Machine Instruction · Computer Organization and Architecture
36 questions · asked in 19 of 27 years (2000–2026)
MCQ 27 · MSQ 1 · NAT 81-mark 22 · 2-mark 14
2000Questions per year2026
Questions 1–5 of 36
Consider a processor whose instruction set architecture is the load-store architecture. The instruction format is such that the first operand of any instruction is the destination operand.
Which one of the following sequences of instructions corresponds to the high-level language statement ?
Note: X, Y, and Z are memory operands. R, R, and R are registers.
Which one of the following sequences of instructions corresponds to the high-level language statement ?
Note: X, Y, and Z are memory operands. R, R, and R are registers.
Answer: (D)
A load-store (register-register) machine does arithmetic only on registers. It cannot work directly on memory. So to compute , where are memory locations, we need these steps:
1. LOAD both memory operands into registers: and .
2. Add the registers: (the first operand is the destination, as the question says).
3. STORE the result in memory: .
An option that puts a memory operand straight into an ADD instruction (for example or ) is not valid on a load-store machine. ADD takes only register operands.
Answer: LOAD R0,X; LOAD R1,Y; ADD R2,R0,R1; STORE Z,R2
1. LOAD both memory operands into registers: and .
2. Add the registers: (the first operand is the destination, as the question says).
3. STORE the result in memory: .
An option that puts a memory operand straight into an ADD instruction (for example or ) is not valid on a load-store machine. ADD takes only register operands.
Answer: LOAD R0,X; LOAD R1,Y; ADD R2,R0,R1; STORE Z,R2
Consider a processor that has general purpose registers and it uses -byte instruction format for all its instructions. Variable-sized opcodes are permitted. There are three different types of instructions; M-type, R-type, and C-type. Each M-type instruction has register operands and a -bit immediate operand. Each Rtype instruction has register operands. Each C-type instruction has a register operand and a -bit offset value. If there are unique M-type opcodes and unique R-type opcodes, which one of the following options gives the maximum number of unique opcodes possible for C-type instructions?
Answer: (B)
There are general-purpose registers, so one register operand takes bits. The whole instruction is bytes bits.
- M-type: There are register operands ( bits) an immediate of bits. The operand part bits. The opcode gets the rest: bits. This allows up to M-type codes. Only are used. So prefixes of bits stay free for the other instruction types.
- R-type: There are register operands ( bits). The opcode gets bits. With an expanding opcode scheme, the prefixes of bits left over from M-type each expand into codes of bits. This gives R-type slots in all. Only are used. So prefix of bits is left unused.
- C-type: There is register operand ( bits) an offset of bits, which bits. The opcode gets bits. That one unused prefix of bits expands into C-type codes of bits.
Answer: 4
- M-type: There are register operands ( bits) an immediate of bits. The operand part bits. The opcode gets the rest: bits. This allows up to M-type codes. Only are used. So prefixes of bits stay free for the other instruction types.
- R-type: There are register operands ( bits). The opcode gets bits. With an expanding opcode scheme, the prefixes of bits left over from M-type each expand into codes of bits. This gives R-type slots in all. Only are used. So prefix of bits is left unused.
- C-type: There is register operand ( bits) an offset of bits, which bits. The opcode gets bits. That one unused prefix of bits expands into C-type codes of bits.
Answer: 4
A processor has 64 general-purpose registers and 50 distinct instruction types. An instruction is encoded in 32-bits. What is the maximum number of bits that can be used to store the immediate operand for the given instruction?
ADD R1, #25 // R1 = R1 + 25
ADD R1, #25 // R1 = R1 + 25
Answer: (B)
There are registers, so one register-number field needs bits. There are distinct instruction types, so the opcode field needs bits (because ).
The instruction (it means ) names only one register, which is both source and destination. It also has an immediate value. So the -bit instruction is split like this: opcode ( bits) one register field ( bits) immediate field (the remaining bits).
Immediate field width bits.
Answer: 20
The instruction (it means ) names only one register, which is both source and destination. It also has an immediate value. So the -bit instruction is split like this: opcode ( bits) one register field ( bits) immediate field (the remaining bits).
Immediate field width bits.
Answer: 20
Which of the following is/are part of an Instruction Set Architecture of a processor?
One or more options are correct.
Answer: (D)
The Instruction Set Architecture (ISA) is the part of the processor that software can see. It sits between hardware and software. It covers the available instructions, the addressing modes, and the visible register set. The total number of (architecturally visible) registers belongs to the ISA, because programs and compilers must know how many registers they can use.
Cache size, clock frequency and the number of cache levels are microarchitecture (implementation) details. Two processors can have the very same ISA and still differ in these, and software will still work on both.
Answer: The total number of registers
Cache size, clock frequency and the number of cache levels are microarchitecture (implementation) details. Two processors can have the very same ISA and still differ in these, and software will still work on both.
Answer: The total number of registers
A processor with 16 general purpose registers uses a 32-bit instruction format. The instruction format consists of an opcode field, an addressing mode field, two register operand fields, and a 16-bit scalar field. If 8 addressing modes are to be supported, the maximum number of unique opcodes possible for every addressing mode is _________
Answer: 32
The 32 bits are shared by four fields.
- Register fields: 16 registers need bits each, so two fields use bits.
- Addressing mode field: 8 modes need bits.
- Scalar field: 16 bits.
Bits left for the opcode: . So the number of opcodes is . The addressing mode has its own field, so all 32 opcodes can be used with every addressing mode.
Answer: 32
- Register fields: 16 registers need bits each, so two fields use bits.
- Addressing mode field: 8 modes need bits.
- Scalar field: 16 bits.
Bits left for the opcode: . So the number of opcodes is . The addressing mode has its own field, so all 32 opcodes can be used with every addressing mode.
Answer: 32
Keep practising