Computer Organization and Architecture questions

Q34

GATE CS 2015 CS-3Memory HierarchyMCQ1 mark−1/3 if wrong
Consider a machine with a byte addressable main memory of 2202^{20} bytes, block size of 16 bytes and a direct mapped cache having 2122^{12} cache lines. Let the addresses of two consecutive bytes in main memory be (E201F)16(\text{E201F})_{16} and (E2020)16(\text{E2020})_{16}. What are the tag and cache line address (in hex) for main memory address (E201F)16(\text{E201F})_{16}?
Show answer without attempting

Answer: A

Q48

GATE CS 2015 CS-3Instruction PipeliningNAT2 marks
Consider the following reservation table for a pipeline having three stages S1S_1, S2S_2 and S3S_3.
Time →\to12345
S1S_1XX
S2S_2XX
S3S_3X
The minimum average latency (MAL) is ____________.
Show answer without attempting

Answer: 3

Q49

GATE CS 2015 CS-3Instruction PipeliningMCQ2 marks−2/3 if wrong
Consider the following code sequence having five instructions I1I_1 to I5I_5. Each of these instructions has the following format.

OP Ri, Rj, Rk

where operation OP is performed on contents of registers Rj and Rk and the result is stored in register Ri.

I1I_1: ADD R1, R2, R3
I2I_2: MUL R7, R1, R3
I3I_3: SUB R4, R1, R5
I4I_4: ADD R3, R2, R4
I5I_5: MUL R7, R8, R9

Consider the following three statements.

S1: There is an anti-dependence between instructions I2I_2 and I5I_5
S2: There is an anti-dependence between instructions I2I_2 and I4I_4
S3: Within an instruction pipeline an anti-dependence always creates one or more stalls

Which one of above statements is/are correct?
Show answer without attempting

Answer: B

Q50

GATE CS 2015 CS-3Memory HierarchyMCQ2 marks−2/3 if wrong
Consider the following two C code segments. YY and XX are one and two dimensional arrays of size nn and n×nn \times n respectively, where 2≤n≤102 \le n \le 10. Assume that in both code segments, elements of YY are initialized to 0 and each element X[i][j]X[i][j] of array XX is initialized to i+ji+j. Further assume that when stored in main memory all elements of XX are in same main memory page frame.

Code segment 1:
//initialize elements of Y to 0
//initialize elements X[i][j] of X to i+j

for(i = 0; i < n; i++)
    Y[i] += X[0][i];
Code Segment 2:
//initialize elements of Y to 0
//initialize elements X[i][j] of X to i+j

for(i = 0; i < n; i++)
    Y[i] += X[i][0];
Which of the following statements is/are correct?

S1: Final contents of array YY will be same in both code segments
S2: Elements of array XX accessed inside the for loop shown in code segment 1 are contiguous in main memory
S3: Elements of array XX accessed inside the for loop shown in code segment 2 are contiguous in main memory
Show answer without attempting

Answer: C

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

Q55

GATE CS 2015 CS-1Instruction PipeliningNAT2 marks
Consider a non-pipelined processor with a clock rate of 2.5 gigahertz and average cycles per instruction of four. The same processor is upgraded to a pipelined processor with five stages; but due to the internal pipeline delay, the clock speed is reduced to 2 gigahertz. Assume that there are no stalls in the pipeline. The speed up achieved in this pipelined processor is ________.
Show answer without attempting

Answer: 3.2

Q18

GATE CS 2015 CS-2Memory HierarchyNAT1 mark
Assume that for a certain processor, a read request takes 50 nanoseconds on a cache miss and 5 nanoseconds on a cache hit. Suppose while running a program, it was observed that 80% of the processor's read requests result in a cache hit. The average read access time in nanoseconds is ___________.
Show answer without attempting

Answer: 14

Q53

GATE CS 2015 CS-2Instruction PipeliningNAT2 marks
Consider the sequence of machine instructions given below:
MUL  R5, R0, R1
DIV  R6, R2, R3
ADD  R7, R5, R6
SUB  R8, R7, R4
In the above sequence, R0 to R8 are general purpose registers. In the instructions shown, the first register stores the result of the operation performed on the second and the third registers. This sequence of instructions is to be executed in a pipelined instruction processor with the following 4 stages: (1) Instruction Fetch and Decode (IF), (2) Operand Fetch (OF), (3) Perform Operation (PO) and (4) Write back the result (WB). The IF, OF and WB stages take 1 clock cycle each for any instruction. The PO stage takes 1 clock cycle for ADD or SUB instruction, 3 clock cycles for MUL instruction and 5 clock cycles for DIV instruction. The pipelined processor uses operand forwarding from the PO stage to the OF stage. The number of clock cycles taken for the execution of the above sequence of instructions is ____________.
Show answer without attempting

Answer: 13

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

0/90 correct0 marks

Related topics in GATE CS