GATE Computer ScienceVery hardGATE CS (PYQ pattern)
A byte-addressed machine has auto-increment (R1)+ (use R1 as the address, then add 4) and auto-decrement −(R1) (subtract 4 from R1, then use it as the address). Memory holds M[116] = 5, M[120] = 20, M[124] = 40, M[128] = 60. With R1 = 120 and ACC = 0 it executes ADD (R1)+; ADD (R1)+; ADD −(R1); ADD −(R1); ADD −(R1). What are ACC and R1 at the end?
- A. ACC = 180, R1 = 116
- B. ACC = 125, R1 = 116
- C. ACC = 145, R1 = 116
- D. ACC = 125, R1 = 120
Correct answer: B. ACC = 125, R1 = 116
(R1)+ reads 120 (+20), R1 = 124; reads 124 (+40), R1 = 128. −(R1): R1 = 124, +40; R1 = 120, +20; R1 = 116, +5. ACC = 20 + 40 + 40 + 20 + 5 = 125, R1 = 116. Treating −(R1) as use-then-decrement gives ACC = 180.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A fully associative cache holds 4 blocks. A loop cycles through 5 distinct blocks 0,1,2,3,4,0,1,2,3,4,… for 30 references. How many hits…
- In C99, int x = −37 (32-bit two's complement), and this implementation's >> on negative values is an arithmetic shift. What are x / 4, x…
- A non-pipelined processor takes the sum of its stage delays (90, 150, 110, 170, 80, 130 ps) per instruction. Its pipelined version has the…
- Which hexadecimal pattern is the IEEE 754 single-precision representation of 0.1 (round to nearest)?
- A 4-stage pipeline has stage delays 240, 160, 320 and 200 ps and a 40 ps latch after each stage. The 320 ps stage is split into two 160 ps…
- A memory has B low-order interleaved banks (bank = word address mod B, any positive integer B). A bank stays busy for 6 cycles after an…