Exam-style question
Try this first
A simple processor model uses 8-bit instructions. The first 4 bits are allocated to the opcode and the final 4 bits are allocated to the operand. Explain the structure of one instruction and calculate how many different opcode patterns are possible.
Model answer
What a good answer should say
- The instruction is made up of an opcode followed by an operand.
- The opcode occupies the first 4 bits and identifies both the basic machine operation and the addressing mode in this model.
- The operand occupies the final 4 bits and can represent a value, a memory address or a register.
- The number of possible opcode patterns is 2^4 = 16.
Explanation
Why this works
The total instruction length is 4 + 4 = 8 bits. Since four bits are allocated to the opcode, each bit can be 0 or 1, giving 2^4 = 16 possible opcode patterns.
The addressing mode is included within the opcode bits rather than being represented separately.
Common mistake
No common mistake is linked to this question yet.
