GATE Computer ScienceEasyGATE CS (PYQ pattern)
A stack grows downwards in 4-byte units and SP = 0x8000 initially. The instructions PUSH, PUSH, CALL (pushes a 4-byte return address), POP, RET (pops the return address) and PUSH are executed in order. What is SP at the end?
- A. 0x7FF4
- B. 0x800C
- C. 0x7FF8
- D. 0x7FF0
Correct answer: C. 0x7FF8
Net change in words: −1 −1 −1 +1 +1 −1 = −2 words = −8 bytes, so SP = 0x8000 − 8 = 0x7FF8.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A Wallace-tree multiplier of 16 × 16 bits must add 16 partial products using layers of 3:2 carry-save adders (each group of 3 rows becomes…
- Instruction frequencies are 0.5, 0.25, 0.125, 0.0625 and 0.0625. What is the minimum average opcode length with a prefix code, and how…
- A cache line holds 8 words. Memory returns the first word 20 cycles after the request and then one word per cycle. Without…
- A physically indexed, physically tagged cache needs the TLB first: a TLB hit takes 1 ns and the cache hit then takes 2 ns. A VIPT cache…
- A physically tagged L1 data cache is 32 KB, 8-way set-associative with 64-byte blocks. Physical addresses are 40 bits and pages are 4 KB…
- A pipeline (ideal CPI 1) can predict branches not-taken (a taken branch costs 3 cycles, a not-taken one 0) or predict taken (a taken…