GATE Computer ScienceVery hardGATE CS (PYQ pattern)
An 8-bit CPU adds the 16-bit two's-complement numbers 0x7F9C and 0x00A7 with ADD on the low bytes followed by ADC (add with carry) on the high bytes. The flags after ADC are set from the high-byte operation alone (N = sign, Z = zero, C = carry out, V = signed overflow). What is the 16-bit result, and what are the flags after ADC?
- A. 0x8043; N=1 Z=0 C=0 V=1
- B. 0x7F43; N=0 Z=0 C=1 V=0
- C. 0x8043; N=1 Z=0 C=1 V=0
- D. 0x8043; N=1 Z=0 C=0 V=0
Correct answer: A. 0x8043; N=1 Z=0 C=0 V=1
Low: 0x9C + 0xA7 = 0x143 → 0x43 with carry 1. High: 0x7F + 0x00 + 1 = 0x80, no carry out (C = 0), result negative (N = 1), and two non-negative operands gave a negative result, so V = 1: the 16-bit signed sum 32668 + 167 = 32835 overflows. Dropping the carry gives 0x7F43.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A disk spins at 7200 rpm with 400 sectors of 512 B per track, an average seek of 9 ms and a 0.2 ms controller overhead. A 64 KB block (1…
- A DMA controller uses cycle stealing and may take at most 20% of the bus cycles. Bus 1 is 32 bits wide with a 50 ns cycle; bus 2 is 64…
- Ideal CPI is 1. Every instruction fetch misses the L1 I-cache 2% of the time; 30% of instructions are loads/stores and miss the L1 D-cache…
- Three enhancements with speed-ups 30, 20 and 15 apply to disjoint parts of a program's original run time. The first two each apply to 25%…
- A processor compares A = 0xF0 with B = 0x10 using an 8-bit subtraction A − B and sets flags like a normal ALU. Which statement describes…
- Which statements about 8-bit number representations are correct? I. In one's complement, 0xFE + 0x02 with end-around carry gives 0x01. II…