Open In App

GATE | GATE-CS-2016 (Set 2) | Question 41

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 ____________

[Note that this was originally a Fill-in-the-Blanks question]
(A) 100
(B) 200
(C) 400
(D) 500

Answer: (D)
Explanation: One instruction is divided into five parts,



Adding them all we get,

= 4 + 6 + 6 + 6 + 12 
= 34 bit 
= 34/8 byte 
= 4.25 byte 

As given Each instruction must be stored in memory in a byte-aligned fashion,4.25 is not byte alignment, memory address should be 0,1,2,3,4,5,6,7…….. so it should be 5 bytes.



As there are 100 instructions, we have a size of 5*100= 500 bytes.

Hence (D) 500 is the answer.
Quiz of this Question

Article Tags :