Pass path: Learn number base conversions and 2’s complement subtraction in Part 1 and Part 2. Top path: Master binary codes (Gray code vs Excess-3) and fractional base conversions in Part 3 and Part 4.
Part 1: Core Concepts (2 Marks)
- ★ Base (Radix) of a Number System: The total number of distinct symbols or digits utilized in that system (Binary:
, Octal: , Decimal: , Hexadecimal: ). A number is evaluated by polynomial expansion: . - ★ 2’s Complement of a Binary Number: Obtained by taking the 1’s complement (inverting all bits:
) and adding 1 to the least significant bit (LSB): - ★ Gray Code (Unit-Distance Code): An unweighted non-arithmetic binary code where consecutive numerical values differ by only a single bit, eliminating multi-bit switching glitches in rotary optical encoders.
Part 2: Structural Frameworks (10 Marks)
1. Binary Subtraction Using 2’s Complement ( )
When performing subtraction
- Express both
and with the same number of bits ( ). - Compute the 2’s complement of the subtrahend (
). - Add the 2’s complement of
to the minuend ( ): - Evaluate the End-Carry Bit:
- Case 1 (Carry Occurs): If an end-carry of 1 is generated, discard the carry. The result is positive and represented directly in standard binary (
). - Case 2 (No Carry): If no end-carry occurs, the result is negative (
). The true magnitude is obtained by taking the 2’s complement of the resulting sum and appending a negative sign.
- Case 1 (Carry Occurs): If an end-carry of 1 is generated, discard the carry. The result is positive and represented directly in standard binary (
Part 3: Distinction Tables
Binary Codes Comparison: BCD (8421) vs. Excess-3 vs. Gray Code
| Parameter | BCD (8421 Code) | Excess-3 Code | Gray Code |
|---|---|---|---|
| Code Category | Weighted positional arithmetic code | Non-weighted arithmetic code | Non-weighted unit-distance code |
| Mathematical Derivation | Direct 4-bit binary representation of decimal digits ( |
0011 to each decimal digit) |
Derived via XOR shifts ( |
| Self-Complementing | No (9’s complement not obtained by inversion) | Yes (1’s complement yields 9’s complement) | No |
| Consecutive Bit Change | Up to 3 or 4 bits change simultaneously | Up to 3 bits change simultaneously | Strictly 1 bit changes between adjacent values |
Part 4: Worked Problems & Exam Traps
Solved Ladder: 2’s Complement Subtraction
Problem: Subtract
Step-by-step Solution:
- Convert to 8-bit binary:
- Minuend
- Subtrahend
- Minuend
- Find 2’s complement of
: - 1’s complement of
- 2’s complement
- 1’s complement of
- Add
and 2’s complement of : \begin{array}{r@{\quad}l} & 00001110 \\ + & 11101001 \\ \hline & 11110111 \end{array} - End-Carry Evaluation:
- There is no end-carry
The result is negative. - Take 2’s complement of
: 1’s complement 2’s complement
- There is no end-carry
- Append negative sign: Result is
(Verifies: ).
Students lose marks here because when no end-carry occurs, they write down the raw sum as positive instead of taking its 2’s complement to find the negative magnitude.
Binary Complements and Overflow Arithmetic
In
- 1’s Complement: Invert every bit (
). - 2’s Complement: Take 1’s complement and add
. - Signed Range: For
bits, the range is . - Arithmetic Overflow: Occurs when adding two numbers of the same sign produces a result of opposite sign. In hardware, overflow is flagged by
at the most significant bit (MSB).