GATE Computer ScienceHardGATE CS (PYQ pattern)
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 both are read as unsigned numbers?
- A. 32640
- B. 8128
- C. 32768
- D. 16384
Correct answer: D. 16384
The two orderings disagree only when the sign bits differ. With a non-negative and b negative, signed a > b but unsigned a < b: 128 × 128 = 16384 pairs. The opposite case (a negative, b non-negative) gives signed a < b.
More Digital Logic questions
- 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…
- What is the minimum number of 2:1 multiplexers needed to realise the three-input majority function MAJ(a, b, c) = ab + bc + ca if the…
- What is the minimum number of 2:1 multiplexers needed to realise a ⊕ b ⊕ c if the constants 0, 1 and the inputs a, b, c are available but…
- Segment g of a BCD-to-seven-segment decoder (inputs A B C D, A the MSB) is on for the digits 2, 3, 4, 5, 6, 8, 9. A designer forgets that…