GATE Computer ScienceVery hardGATE CS (PYQ pattern)
An accumulator machine has memory contents M[100]=300, M[104]=7, M[150]=75, M[200]=150, M[300]=500 and registers R1 = 100, R2 = 4. Starting with ACC = 0 it executes: LOAD #100 (immediate); ADD 100 (direct); ADD @100 (memory indirect); ADD (R1+R2) (indexed, effective address = R1 + R2). What is ACC at the end?
- A. 407
- B. 907
- C. 975
- D. 707
Correct answer: B. 907
LOAD #100 → 100; ADD 100 → +M[100] = 300 → 400; ADD @100 → +M[M[100]] = M[300] = 500 → 900; ADD (R1+R2) → +M[104] = 7 → 907. Reading the indirect operand as M[100] again, or the indexed operand as M[R1] + R2, gives the other values.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A loop branch is taken 9 times and then falls through (T×9, N), and the whole 10-outcome pattern repeats 5 times. A 2-bit saturating…
- A control unit has 48 control signals partitioned into 6 groups of mutually exclusive signals of sizes 12, 10, 9, 8, 5 and 4. In a…
- A branch outcome stream is TTTTTNN repeated 6 times (42 outcomes). With a 2-bit saturating counter (taken predicted in states 2,3)…
- A direct-mapped cache has 2 lines of 4 words each. A program writes (once each) to word addresses 0, 4, 8, 12, 16, 20, 24, 28 and never…
- A processor encodes branch targets as a 16-bit signed offset relative to the incremented PC in 2-byte instruction units (target = PC + 2 ×…
- A synchronous 100 MHz bus has a multiplexed 32-bit address/data path. A block read takes 1 address cycle, 3 wait cycles, then one data…