GATE Computer ScienceHardGATE CS (PYQ pattern)
An 8-bit adder adds two operands a and b (no carry-in), each treated as an 8-bit two's complement number. Over all 2¹⁶ operand pairs, for how many pairs is the signed overflow flag V set?
- A. 16384
- B. 8128
- C. 32640
- D. 16512
Correct answer: A. 16384
Positive overflow needs both operands in 0..127 with sum ≥ 128: 8128 pairs. Negative overflow needs both in −128..−1 with sum < −128: 8256 pairs. Total 16384, which is 2¹⁴. Counting only positive overflow gives 8128 and counting carry-outs gives 32640.
More Digital Logic questions
- An 8-bit adder adds two 8-bit operands a and b with no carry-in, producing the carry-out C8 and the signed (two's complement) overflow…
- A 4-bit ALU computes A − B as A + B' + 1 and sets C (the adder's carry-out) and V (signed two's complement overflow). Over all 256 ordered…
- A 4-bit two's complement adder computes A + B + Cin. Over all 512 combinations of A, B (each −8 to 7) and Cin (0 or 1), for how many is…
- Over one complete cycle of 10 counts (back to the starting state), how many flip-flop toggles in total does (i) a synchronous 4-bit BCD…
- The 8-bit binary-reflected Gray code of x is g(x) = x XOR (x >> 1). For how many of the 256 values of x does g(x) contain exactly two 1…
- For 8-bit patterns a and b, how many ordered pairs satisfy a > b when both are read as signed two's complement numbers, but a < b when…