GATE 2004
199 questions
MCQ 1991-mark 199
Questions 71–75 of 199
Which of the following addressing modes are suitable for program relocation at run time?
(i) Absolute addressing
(ii) Based addressing
(iii) Relative addressing
(iv) Indirect addressing
(i) Absolute addressing
(ii) Based addressing
(iii) Relative addressing
(iv) Indirect addressing
Answer: (C)
A program can be moved (relocated) at run time only if its instructions do not contain fixed memory addresses.
(i) Absolute: the instruction holds the actual address, so it must be rewritten when the program moves. Not suitable.
(ii) Based: . After a move only the base register is changed; the code stays the same. Suitable.
(iii) Relative: . The target stays at the same distance from the instruction wherever the program is loaded. Suitable.
(iv) Indirect: the instruction points to a memory word that holds the operand's absolute address. That stored address is not changed by the move, so it would have to be fixed. Not suitable.
So only (ii) and (iii) work.
Answer: (C)
(i) Absolute: the instruction holds the actual address, so it must be rewritten when the program moves. Not suitable.
(ii) Based: . After a move only the base register is changed; the code stays the same. Suitable.
(iii) Relative: . The target stays at the same distance from the instruction wherever the program is loaded. Suitable.
(iv) Indirect: the instruction points to a memory word that holds the operand's absolute address. That stored address is not changed by the move, so it would have to be fixed. Not suitable.
So only (ii) and (iii) work.
Answer: (C)
A CPU has only three instructions I1, I2 and I3, which use the following signals in time steps T1-T5:
I1 :
T1 : Ain, Bout, Cin
T2 : PCout, Bin
T3 : Zout, Ain
T4 : Bin, Cout
T5 : End
I2 :
T1 : Cin, Bout, Din
T2 : Aout, Bin
T3 : Zout, Ain
T4 : Bin, Cout
T5 : End
I3 :
T1 : Din, Aout
T2 : Ain, Bout
T3 : Zout, Ain
T4 : Dout, Ain
T5 : End
Which of the following logic functions will generate the hardwired control for the signal Ain ?
I1 :
T1 : Ain, Bout, Cin
T2 : PCout, Bin
T3 : Zout, Ain
T4 : Bin, Cout
T5 : End
I2 :
T1 : Cin, Bout, Din
T2 : Aout, Bin
T3 : Zout, Ain
T4 : Bin, Cout
T5 : End
I3 :
T1 : Din, Aout
T2 : Ain, Bout
T3 : Zout, Ain
T4 : Dout, Ain
T5 : End
Which of the following logic functions will generate the hardwired control for the signal Ain ?
Answer: (A)
We only need to find which option gives every time is , and gives in all other cases.
Ain is active () in of and . It is also active in of , and in and of . So the answer will be
The CPU has only instructions. So can be replaced with (we do not need to check which instruction it is, as is active in time step of all the instructions).
So,
The answer is Option (A).
The microinstructions stored in the control memory of a processor have a width of 26 bits. Each microinstruction is divided into three fields: a micro-operation field of 13 bits, a next address field (X), and a MUX select field (Y). There are 8 status bits in the inputs of the MUX.
How many bits are there in the X and Y fields, and what is the size of the control memory in number of words?
How many bits are there in the X and Y fields, and what is the size of the control memory in number of words?
Answer: (A)
Here is the number of bits that select among the 8 different states of the multiplexer
is the number of bits needed to address the control memory.
We get by using and .
The size of the control memory
Correct Answer:
What is the minimum size of ROM required to store the complete truth table of an 8-bit 8-bit multiplier?
Answer: (B)
The multiplier has two 8-bit inputs, so the ROM address has bits. That gives words, one for each pair of inputs.
The product of two 8-bit numbers is at most , so it needs 16 bits. Each word is therefore 16 bits wide.
Minimum ROM size = bits
Answer: (B)
The product of two 8-bit numbers is at most , so it needs 16 bits. Each word is therefore 16 bits wide.
Minimum ROM size = bits
Answer: (B)
Consider a fully associative cache with 8 cache blocks (numbered 0-7) and the following sequence of memory block requests:
4,3,25,8,19,6,25,8,16,35,45,22,8,3,16,25,7
If LRU replacement policy is used, which cache block will have memory block 7?
4,3,25,8,19,6,25,8,16,35,45,22,8,3,16,25,7
If LRU replacement policy is used, which cache block will have memory block 7?
Answer: (B)
The cache is fully associative, so a block can go anywhere. Empty cache blocks are filled in order 0 to 7.
4, 3, 25, 8, 19, 6 go to cache blocks 0 to 5. Then 25 and 8 are hits. 16 goes to block 6 and 35 goes to block 7. The cache is now full:
blocks 0 to 7 hold .
Below, the order lists blocks from least recently used to most recently used. After 35 it is , because the hits on 25 and 8 made them recent.
45 misses and replaces 4 (cache block 0). Order:
22 misses and replaces 3 (cache block 1). Order:
8 is a hit. Order:
3 misses and replaces 19 (cache block 4). Order:
16 is a hit. Order:
25 is a hit. Order:
7 misses and replaces 6, which is in cache block 5.
Answer: (B)
4, 3, 25, 8, 19, 6 go to cache blocks 0 to 5. Then 25 and 8 are hits. 16 goes to block 6 and 35 goes to block 7. The cache is now full:
blocks 0 to 7 hold .
Below, the order lists blocks from least recently used to most recently used. After 35 it is , because the hits on 25 and 8 made them recent.
45 misses and replaces 4 (cache block 0). Order:
22 misses and replaces 3 (cache block 1). Order:
8 is a hit. Order:
3 misses and replaces 19 (cache block 4). Order:
16 is a hit. Order:
25 is a hit. Order:
7 misses and replaces 6, which is in cache block 5.
Answer: (B)