A Computer uses a memory unit with 256K word of 32 bits each. A binary instruction code is stored in one word of memory. The instruction has four parts: an indirect bit, an operation code and a register code part to specify one of 64 registers and an address part. How many bits are there in operation code, the register code part and the address part?
7, 6, 18
The question asks us to determine the number of bits allocated to different parts of a computer instruction: the operation code, the register code part, and the address part. We are given the total size of the memory, the size of each memory word, and the structure of the instruction code.
We are told that a binary instruction code is stored in one word of memory. The memory unit has words of 32 bits each. Therefore, each instruction is 32 bits long.
The instruction is divided into four parts:
The total number of bits for these four parts must sum up to the total instruction length, which is 32 bits.
The question explicitly states there is an indirect bit. This typically occupies 1 bit.
Indirect bit bits = 1
The register code part is used to specify one of 64 registers. To uniquely identify one out of 64 items, we need a certain number of bits. The number of bits required is given by $\text{log}_2(\text{number of items})$.
Number of registers = 64
Register code bits = $\text{log}_2(64)$
Since $2^6 = 64$, $\text{log}_2(64) = 6$.
Register code part bits = 6
The address part is used to address memory locations. The memory unit has 256K words. First, let's convert 256K words into the total number of words.
$1\text{K} = 1024$ words.
$256\text{K} = 256 \times 1024 = 262144$ words.
To address one of the 262144 memory locations, we need a certain number of bits for the address part. Similar to the register code, the number of bits required is $\text{log}_2(\text{total number of memory words})$.
Total memory words = 262144
Address part bits = $\text{log}_2(262144)$
We know that $2^{10} = 1024$ and $2^8 = 256$.
So, $262144 = 256 \times 1024 = 2^8 \times 2^{10} = 2^{(8+10)} = 2^{18}$.
Therefore, $\text{log}_2(262144) = 18$.
Address part bits = 18
The operation code specifies the operation to be performed. The bits for the opcode are the remaining bits after allocating bits for the indirect bit, register code, and address part from the total instruction length.
Total instruction bits = 32
Bits used by other parts = Indirect bit bits + Register code part bits + Address part bits
Bits used by other parts = $1 + 6 + 18 = 25$ bits.
Operation code bits = Total instruction bits - Bits used by other parts
Operation code bits = $32 - 25 = 7$ bits.
Let's summarize the number of bits for each part of the computer instruction:
The question asks for the number of bits in the order: operation code, the register code part, and the address part.
This order corresponds to 7, 6, 18.
Let's compare our calculated values (7, 6, 18) with the given options:
Our calculation confirms that the number of bits are 7 for the operation code, 6 for the register code part, and 18 for the address part.
| Instruction Part | Calculation / Basis | Number of Bits |
|---|---|---|
| Total Instruction Length | Memory word size | 32 |
| Indirect Bit | Given | 1 |
| Register Code Part | To specify 64 registers ($\text{log}_2(64)$) | 6 |
| Address Part | To address 256K words ($\text{log}_2(262144)$) | 18 |
| Operation Code | Remaining bits (32 - 1 - 6 - 18) | 7 |
| Concept | Explanation | Calculation |
|---|---|---|
| Instruction Length | Determined by memory word size where instruction is stored. | 32 bits (given) |
| Register Code Bits | Number of bits needed to uniquely identify one out of 'N' registers. | $\text{log}_2(\text{Number of registers})$ |
| Address Part Bits | Number of bits needed to uniquely identify one out of 'M' memory locations. | $\text{log}_2(\text{Total memory locations})$ |
| Operation Code Bits | Remaining bits after allocating for other parts (control bits, registers, address) in the instruction format. | Total bits - (Sum of bits for other parts) |
A computer instruction is a command that tells the computer's CPU what operation to perform. Instructions are typically stored in memory and fetched by the CPU during program execution. The format of an instruction defines how the bits of the instruction are organized into functional parts.
Different computer architectures have varying instruction formats. The format significantly impacts the CPU design and the efficiency of program execution. Fixed-length instructions, like the 32-bit format described, are common in RISC (Reduced Instruction Set Computer) architectures, while variable-length instructions are found in CISC (Complex Instruction Set Computer) architectures.
The following program is stored in the memory unit of the basic computer. Give the content of accumulator register in hexadecimal after the execution of the program.
Location | Instruction |
010 | CLA |
011 | ADD 016 |
012 | BUN 014 |
013 | HLT |
014 | AND 017 |
015 | BUN 013 |
016 | C1A5 |
017 | 93C6 |
A micro instruction format has micro operation field which is divided into 2 subfields F1 and F2, each having 15 distinct microoperations, condition field CD for four status bits, branch field BR having four options used in conjunction with address field AD. The address space is of 128 memory words. The size of micro instruction is:
A computer uses a memory unit of 512 K words of 32 bits each. A binary instruction code is stored in one word of the memory. The instruction has four parts: an addressing mode field to specify one of the two-addressing mode (direct and indirect), an operation code, a register code part to specify one of the 256 registers and an address part. How many bits are there in addressing mode part, opcode part, register code part and the address part?
Which of the following is not an example of pseudo‐instruction?