Instruction Formats: - Memory and Branch Instructions
Instruction Formats: - Memory and Branch Instructions
I OPCODE ADDRESS
0 1 1 1 OPERATION
Input/Output and Interrupt instructions.
– No possibility to provide port number in the
instruction.
– Can use all 16-bits of the instruction to specify the
opcode.
– However, must clearly distinguish these instructions
from memory and register reference.
• Use the combination 1 1 1 for the opcode with a 1 in the
Direct/Indirect field.
15 11 0
1 1 1 1 OPERATION
I OPCODE ` ADDRESS
3 to 8 Decoder
7 6 5 4 3 2 1 0
I Control
Control
Logic
Signals
Decoding the instruction
• In our instruction format design, the instruction is
decoded in the following steps:
– Decode bits 12 – 14 of the instruction.
• If they are equal to 7, the instruction is “non-memory”
– If bit 15 is 0, then register transfer, look at bits 0 – 11 to
determine the operation.
– Else, the input/output operation, look at bits 0 – 11 for the
operation.
• Else, the instruction is “memory”
– If bit 15 is 0, then direct memory reference, bits 0 – 11 contain
the effective address
– Else, indirect memory reference, bits 0 – 11 contain the address
of the memory location containing the effective address
Timing Signals
• Each instruction is made up of several micro-
operations that need to be executed in sequence.
– A mechanism is needed to allow the sequencing of these
operations,this requires timing signals.
– The solution is a “sequence counter”. This along with the
decoder provides the timing signals.
• Similar to the program counter. Except that it sequences at the
micro-operation level within the instruction.
– How large?
• Depends on the complexity of the instructions.
• Needs to generate enough combinations to allow sequencing the
most complex instruction.
Sequencing the execution
IR 15 14 13 12 11 - 0
3 to 8 Decoder
7 6 5 4 3 2 1 0
D0
I
D7
Control
Control
T15 Logic
Signals
T0
15 14 2 1 0
4 to 16 Decoder
4-bit Increment
Sequence
Counter Clear
The Sequence Counter
• In our example we will use a 4-bit sequence counter.
– It will generate 16 different combinations allowing a
maximum of 16 different micro-operations within an
instruction.
– This counter is automatically incremented at the end of
each micro-operation.
– The last micro-operation of the instruction will reset the
counter to 0 to initiate the execution of the next
instruction.
– The counter’s output will be decoded and fed into the
control logic.
The Sequence Counter
• As an example consider the case where SC is
incremented to provide timing signals T0,T1,T2,
T3 and T4 in sequence. At time T4, SC is cleared
to 0 if decoder output D3 is active. This is
expressed as:
D3T4: SC 0