GATE Computer ScienceVery hardGATE CS (PYQ pattern)
Which of these 8-bit two's-complement operations overflow as signed arithmetic? I. 0x80 − 0x01. II. 0x00 − 0x80. III. 0x7F + 0x80. IV. 0xC0 + 0xC0.
- A. II only
- B. I and II only
- C. I, II and IV only
- D. II and III only
Correct answer: B. I and II only
I: −128 − 1 = −129 < −128, overflow. II: 0 − (−128) = +128 > 127, overflow (the adder computes 0x00 + 0x80 with carry-in, giving 0x80). III: 127 + (−128) = −1, fine. IV: −64 + −64 = −128, exactly representable (0x80), no overflow even though a carry leaves the MSB.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- An 8-bit x86-style SUB computes 0x01 − 0xFF. In this convention CF = 1 exactly when the unsigned subtraction needs a borrow, OF = signed…
- A two-level memory has a 32 KB cache costing 100 per KB (access 10 ns) and a 4 MB main memory costing 1 per KB (access 100 ns); total…
- A write-back, write-allocate cache has a 2 ns hit time and a 5% miss rate. A miss that evicts a clean block costs 40 ns; a miss that…
- An 8-bit CPU multiplies the two's-complement bytes 0xF6 and 0x0D as signed numbers into a 16-bit product. What is the product, and is the…
- A branch behaves T, T, N, N repeatedly for 32 executions. A 2-bit saturating counter starts at state 0 and predicts taken in states 2 and…
- A 32-bit machine uses a 2-level page table with 4 KB pages and 4-byte entries (10 + 10 + 12 bit split). A process uses exactly 4 MB + 8 KB…