Professional Documents
Culture Documents
Instruction Format
Instruction Format
Instruction Format
• An instruction format defines the layout of the bits of an
instruction, in terms of its constituents parts.
• An instruction format must include an opcode and, implicitly
or explicitly, zero or more operands.
• Each explicit operand is referenced using one of the addressing
mode that is available for that machine.
• The format must, implicitly or explictly, indicate the addressing
mode of each operand.
• For most instruction sets, more than one instruction format is
used.
• Four common instruction format are shown in the Figure 1.
Instruction Formats
• Evaluate X=(a/b+c*d)/(d*e-f+c/a)+g
• Evaluate Y=(A-B)/[C+(D/E)]
Problem
Assumptions
24-bit memory address (3 bytes)
128 instructions (7 bits rounded to 1 byte)
Memory
24 Bits / 3 Bytes
4- Address
8
Instruction
24 24 24 24
Op
Op Code
Code ResAddr
ResAddr Op1Addr
Op1Addr Op2Addr
Op2Addr NextiAddr
NextiAddr
CPU
PC 24
Calculation of Memory Accesses:
To fetch Instruction itself To Execute an Instruction
Opcode=1
Op1Addr=1 Op1=1
Op2Addr=1 Op2=1
ResAddr=1 Res=1
Total=4 Total=3
PC 24
Calculation of Memory Accesses:
To fetch Instruction itself To Execute an Instruction
Opcode=1
Op1Addr=1 Op1=1
Op2Addr=1 Op2=1
Res=1
Total=3
Total=3
PC 24
Calculation of Memory Accesses:
To fetch Instruction itself To Execute an Instruction
Opcode=1
Op1Addr=1 Op1=1
Total=2 Total=1