GATE Computer ScienceModerateGATE CS (PYQ pattern)
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 the signed overflow flag V set?
- A. 128
- B. 112
- C. 64
- D. 120
Correct answer: A. 128
Positive overflow: A + B + Cin ≥ 8 with A, B in 0..7: for Cin = 0 there are 28 pairs with A + B ≥ 8, for Cin = 1 there are 36 with A + B ≥ 7. Negative overflow: A + B + Cin ≤ −9: Cin = 0 gives 36 pairs with A + B ≤ −9, Cin = 1 gives 28 with A + B ≤ −10. Total 28 + 36 + 36 + 28 = 128.
More Digital Logic questions
- 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…
- A one-digit BCD adder adds digits a, b (0-9) and a carry-in c (0 or 1). Its 4-bit binary adder gives a carry K and sum Z8Z4Z2Z1, and the…
- Two 8-input priority encoders receive the same inputs I7..I0. Encoder H gives priority to the highest-numbered asserted input, encoder L…
- An 8-input priority encoder (I7 highest priority) outputs the index y (0 to 7) of the highest asserted input. Among the 255 non-zero input…