Machine Instructions questions

Q15

GATE CS 2026 CS-1Instruction Set and AddressingMCQ1 mark−1/3 if wrong
Consider a processor P 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 Z = X + Y ?

Note: X, Y, and Z are memory operands. R0, R1, and R2 are registers.
Show answer without attempting

Answer: D

Q44

GATE CS 2026 CS-2Instruction Set and AddressingMCQ2 marks−2/3 if wrong
Consider a processor that has 16 general purpose registers and it uses 2-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 2 register operands and a 6-bit immediate operand. Each R-type instruction has 3 register operands. Each C-type instruction has a register operand and a 6-bit offset value. If there are 2 unique M-type opcodes and 7 unique R-type opcodes, which one of the following options gives the maximum number of unique opcodes possible for C-type instructions?
Show answer without attempting

Answer: B

Q27

GATE CS 2025 CS-1Instruction Set and AddressingMSQ1 mark
A partial data path of a processor is given in the figure, where RA, RB, and RZ are 32-bit registers. Which option(s) is/are CORRECT related to arithmetic operations using the data path as shown?
Question figure
More than one option can be correct.
Show answer without attempting

Answer: A, B, C

Q37

GATE CS 2025 CS-1Instruction Set and AddressingMCQ2 marks−2/3 if wrong
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
Show answer without attempting

Answer: B

Q28

GATE CS 2025 CS-2Instruction Set and AddressingMSQ1 mark
Which of the following is/are part of an Instruction Set Architecture of a processor?
More than one option can be correct.
Show answer without attempting

Answer: D

Q33

GATE CS 2024 CS-1Instruction Set and AddressingNAT1 mark
Consider the operator precedence and associativity rules for the integer arithmetic operators given in the table below.

The value of the expression 3+1+5∗2/7+2−4−7−6/23 + 1 + 5 * 2 / 7 + 2 - 4 - 7 - 6 / 2 as per the above rules is __________
OperatorPrecedenceAssociativity
+ HighestLeft
- HighRight
* MediumRight
/ LowRight
Show answer without attempting

Answer: 6

Q61

GATE CS 2024 CS-2Instruction Set and AddressingNAT2 marks
A processor uses a 32-bit instruction format and supports byte-addressable memory access. The ISA of the processor has 150 distinct instructions. The instructions are equally divided into two types, namely R-type and I-type, whose formats are shown below.

R-type Instruction Format:
OPCODEUNUSEDDST RegisterSRC Register 1SRC Register 2
I-type Instruction Format:
OPCODEDST RegisterSRC Register# Immediate value/address
In the OPCODE, 1 bit is used to distinguish between I-type and R-type instructions and the remaining bits indicate the operation. The processor has 50 architectural registers, and all register fields in the instructions are of equal size.

Let XX be the number of bits used to encode the UNUSED field, YY be the number of bits used to encode the OPCODE field, and ZZ be the number of bits used to encode the immediate value/address field. The value of X+2Y+ZX + 2Y + Z is ________
Show answer without attempting

Answer: 34

Q41

GATE CS 2023 CSInstruction Set and AddressingMCQ2 marks−2/3 if wrong
Consider the given C-code and its corresponding assembly code, with a few operands U1–U4 being unknown. Some useful information as well as the semantics of each unique assembly instruction is annotated as inline comments in the code. The memory is byte-addressable.
//C-code
int a[10], b[10], i;
// int is 32-bit
for (i=0; i<10;i++)
a[i] = b[i] * 8;
;assembly-code (; indicates comments)
;r1-r5 are 32-bit integer registers
;initialize r1=0, r2=10
;initialize r3, r4 with base address of a, b
L01: jeq r1, r2, end ;if(r1==r2) goto end
L02: lw r5, 0(r4) ;r5 <- Memory[r4+0]
L03: shl r5, r5, U1 ;r5 <- r5 << U1
L04: sw r5, 0(r3) ;Memory[r3+0] <- r5
L05: add r3, r3, U2 ;r3 <- r3+U2
L06: add r4, r4, U3
L07: add r1, r1, 1
L08: jmp U4 ;goto U4
L09: end
Which one of the following options is a CORRECT replacement for operands in the position (U1, U2, U3, U4) in the above assembly code?
Show answer without attempting

Answer: B

Q55

GATE CS 2021 CS-1Instruction Set and AddressingNAT2 marks
Consider the following instruction sequence where registers R1, R2 and R3 are general purpose and MEMORY[X] denotes the content at the memory location X.
InstructionSemanticsInstruction Size (bytes)
MOV R1, (5000)R1 ← MEMORY[5000]4
MOV R2, (R3)R2 ← MEMORY[R3]4
ADD R2, R1R2 ← R1+R22
MOV (R3), R2MEMORY[R3] ← R24
INC R3R3 ← R3+12
DEC R1R1 ← R1-12
BNZ 1004Branch if not zero to the given absolute address2
HALTStop1
Assume that the content of the memory location 5000 is 10, and the content of the register R3 is 3000. The content of each of the memory locations from 3000 to 3010 is 50. The instruction sequence starts from the memory location 1000. All the numbers are in decimal format. Assume that the memory is byte addressable.
After the execution of the program, the content of memory location 3010 is ______.
Show answer without attempting

Answer: 50

Q44

GATE CS 2020 CSInstruction Set and AddressingNAT2 marks
A processor has 64 registers and uses 16-bit instruction format. It has two types of instructions: I-type and R-type. Each I-type instruction contains an opcode, a register name, and a 4-bit immediate value. Each R-type instruction contains an opcode and two register names. If there are 8 distinct I-type opcodes, then the maximum number of distinct R-type opcodes is __________.
Show answer without attempting

Answer: 14

Q51

GATE CS 2018 CSInstruction Set and AddressingNAT2 marks
A processor has 16 integer registers (R0, R1, .., R15) and 64 floating point registers (F0, F1,…, F63). It uses a 2-byte instruction format. There are four categories of instructions: Type-1, Type-2, Type-3, and Type-4. Type-1 category consists of four instructions, each with 3 integer register operands (3Rs). Type-2 category consists of eight instructions, each with 2 floating point register operands (2Fs). Type-3 category consists of fourteen instructions, each with one integer register operand and one floating point register operand (1R+1F). Type-4 category consists of N instructions, each with a floating point register operand (1F).

The maximum value of N is __________.
Show answer without attempting

Answer: 32

Q52

GATE CS 2017 CS-1Instruction Set and AddressingNAT2 marks
Consider the expression (a−1)∗(((b+c)/3)+d)(a-1)*(((b+c)/3)+d). Let X be the minimum number of registers required by an optimal code generation (without any register spill) algorithm for a load/store architecture, in which (i) only load and store instructions can have memory operands and (ii) arithmetic instructions can have only register or immediate operands. The value of X is ____________.
Show answer without attempting

Answer: 2.0

Q9

GATE CS 2016 CS-1Instruction Set and AddressingNAT1 mark
A processor can support a maximum memory of 4 GB, where the memory is word-addressable (a word consists of two bytes). The size of the address bus of the processor is at least ________ bits.
Show answer without attempting

Answer: 31.0

Q10

GATE CS 2016 CS-2Instruction Set and AddressingNAT1 mark
A processor has 40 distinct instructions and 24 general purpose registers. A 32-bit instruction word has an opcode, two register operands and an immediate operand. The number of bits available for the immediate operand field is _________.
Show answer without attempting

Answer: 16.0

Q31

GATE CS 2016 CS-2Instruction Set and AddressingNAT2 marks
Consider a processor with 64 registers and an instruction set of size twelve. Each instruction has five distinct fields, namely, opcode, two source register identifiers, one destination register identifier, and a twelve-bit immediate value. Each instruction must be stored in memory in a byte-aligned fashion. If a program has 100 instructions, the amount of memory (in bytes) consumed by the program text is _________.
Show answer without attempting

Answer: 500.0

Q22

GATE CS 2015 CS-1Instruction Set and AddressingMCQ1 mark−1/3 if wrong
For computers based on three-address instruction formats, each address field can be used to specify which of the following:

(S1) A memory operand
(S2) A processor register
(S3) An implied accumulator register
Show answer without attempting

Answer: A

Q54

GATE CS 2015 CS-2Instruction Set and AddressingMCQ2 marks−2/3 if wrong
Consider a processor with byte-addressable memory. Assume that all registers, including Program Counter (PC) and Program Status Word (PSW), are of size 2 bytes. A stack in the main memory is implemented from memory location (0100)16(0100)_{16} and it grows upward. The stack pointer (SP) points to the top element of the stack. The current value of SP is (016E)16(016E)_{16}. The CALL instruction is of two words, the first word is the op-code and the second word is the starting address of the subroutine (one word = 2 bytes). The CALL instruction is implemented as follows:

• Store the current value of PC in the stack
• Store the value of PSW register in the stack
• Load the starting address of the subroutine in PC

The content of PC just before the fetch of a CALL instruction is (5FA0)16(5FA0)_{16}. After execution of the CALL instruction, the value of the stack pointer is
Show answer without attempting

Answer: D

Q9

GATE CS 2014 CS-1Instruction Set and AddressingNAT1 mark
A machine has a 32-bit architecture, with 1-word long instructions. It has 64 registers, each of which is 32 bits long. It needs to support 45 instructions, which have an immediate operand in addition to two register operands. Assuming that the immediate operand is an unsigned integer, the maximum value of the immediate operand is ____________.
Show answer without attempting

Answer: 16383

0/180 correct0 marks

Related topics in Instruction Set and Addressing