GATE CSE · Digital Logic
Generate GATE-level questions covering binary, decimal, octal, hexadecimal conversions, 1's and 2's complement representation, overflow detection, and range of signed numbers. Include both conceptual and numerical problems.
Concept summary for GATE CSE 2027 · 117 practice questions available
A system for representing numeric values. Digital systems use Binary (base-2). Other common bases: Octal (8), Hexadecimal (16), Decimal (10).
r's complement (2's complement for binary):
Subtraction using 2's complement:
A − B = A + (2's complement of B). If carry out = 1 → result positive; no carry → negative result (take 2's complement of result)
| Format | Range (n bits) | Negation |
|---|---|---|
| Sign-Magnitude | −(2ⁿ⁻¹−1) to +(2ⁿ⁻¹−1) | Flip MSB |
| 1's Complement | −(2ⁿ⁻¹−1) to +(2ⁿ⁻¹−1) | Flip all bits |
| 2's Complement | −2ⁿ⁻¹ to +(2ⁿ⁻¹−1) | Flip all + 1 |
2's complement range is asymmetric - one extra negative number. BCD addition: if sum > 9 or carry generated, add 6 (0110) to correct. Gray to binary: MSB same, each subsequent bit = Gray bit XOR previous binary bit.