Professional Documents
Culture Documents
Instruction Format
What is an Instruction Format?
An instruction consists of bits, which are grouped up to make fields. Some
fields in instruction format are as follows
1. Opcode, which tells about the operation to be performed.
2. Address field designating a memory address or a processor register.
3. Mode field specifying how the operand or effective address is determined.
Bits 8 24 24 24
BITS 8 24 24
OP CODE
ADD
BITS
8
e.g. ADD
Top of stack Top of stack + Second top of the stack
2) With flow chart explain the restoring and non-restoring
division operations on two decimal Numbers P and Q.
M A D D[0]
ADDER/SUBSTRACTOR
Register Q in this case holds the quotient, while register A holds the
remainder. Here, the divisor is loaded in M and the n-bit dividend is loaded
in D. The register whose value is restored after iteration and for which it is
named Restoring is initially held at 0.
A0
MQ
D P
COUNT n
Shift A,D
D[0] 1 D[0] 0
A A+M
Step 4: Examine the most significant bit of A. If it’s 0, set the least
significant bit of D to 1. Conversely, if the most significant bit is 1,
set the least significant bit of D to 0. Additionally, restore the value
of register A to its state before the subtraction with M.
Step 5: Reduce the value of the counter n by one.
Step 3: Should this bit within register A be 1, we shift the A,D value
to the left and execute A = A + M. In contrast, if the bit is 0, we
again shift the A,D value leftward but perform A = A – M. In the
latter case, the 2’s complement of M is added to register A, and
the outcome replaces A.
A <- 0
M <- Q
D <- P
Count <- n
Shift A,D
CONCLUSION
In conclusion, this report has provided a comprehensive overview of
addressing modes and instruction formats, showcasing how they vary
based on the number of address fields used in the instruction format.
Various examples were presented to illustrate each addressing mode's
characteristics and usage within computer architecture.
Furthermore, the report also delved into the division operations, specifically
restoring and non-restoring division, demonstrating the process through
flowcharts. These division methods were applied to two decimal numbers,
P and Q, offering a clear visual representation of the steps involved in
performing these arithmetic operations.