BIT151 · 2079 · 5 marks
What is Instruction Format of basic computer architecture? A computer uses a memory unit with 256K words of 32 bits each. Draw the instruction word format and indicate the number of bits in each part.
What is Instruction Format of basic computer architecture? A computer uses a memory unit with 256K words of 32 bits each. Draw the instruction word format and indicate the number of bits in each part. [5]
Instruction Format of Basic Computer Architecture
Definition
An instruction format specifies the layout of bits within an instruction word. It defines how the total bits of the word are partitioned into fields, typically:
- Mode field (I): indicates the addressing mode (direct or indirect).
- Operation code (opcode): specifies the operation to be performed.
- Address field: specifies the memory address of the operand.
In the basic computer (Mano's model), each instruction occupies one memory word, and the format is determined by the memory word size and the number of addressable locations.
Given Data
- Memory size = 256K words
- Word size = 32 bits (so each instruction is 32 bits)
Step 1: Number of Bits for the Address Field
The address field must be large enough to address every word in memory.
$$256K = 256 \times 1024 = 2^8 \times 2^{10} = 2^{18}$$
$$\text{Address bits} = \log_2(2^{18}) = 18 \text{ bits}$$
So 18 bits are required for the address field.
Step 2: Allocate the Remaining Bits
Total word size = 32 bits. Reserve 1 bit for the addressing mode (I), the rest goes to the opcode.
$$\text{Opcode bits} = 32 - 1 - 18 = 13 \text{ bits}$$
Check:
$$1 + 13 + 18 = 32 \text{ bits} \checkmark$$
Instruction Word Format (32 bits)
31 30 18 17 0
+----+----------------+--------------------------+
| I | Opcode | Address |
|1bit| 13 bits | 18 bits |
+----+----------------+--------------------------+
Explanation of Each Field
| Field | Bits | Description |
|---|---|---|
| I (Mode) | 1 | Addressing mode: 0 = direct, 1 = indirect |
| Opcode | 13 | Operation code; supports up to $2^{13} = 8192$ operations |
| Address | 18 | Operand address; addresses up to $2^{18} = 256K$ words |
Key Points
- Address field size ($18$ bits) is fixed by the memory size ($256K = 2^{18}$).
- One bit is used as the mode bit to select direct/indirect addressing.
- The remaining $13$ bits form the opcode.
Final answer: Mode = 1 bit, Opcode = 13 bits, Address = 18 bits, totaling 32 bits.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.