← 2023 Paper 2
UPSC 2023 Maths Optional Paper 2 Q5c-ii — Step-by-Step Solution
5 marks · Section B
Algebra of Binary Numbers · Numerical Analysis · asked 2× in 13 yrs · Read the full method →
Question
Evaluate, using the binary arithmetic, the following numbers in their given system:
(ii) (7AB.432)16−(5CA.D61)16
Technique
4-bit-per-hex-digit conversion; binary subtraction with borrow propagation; regroup.
Solution
The procedure:
- Convert each operand to binary (4 bits per hex digit).
- Subtract in binary using the rule ”ai−bi−bini; borrow if negative”.
- Re-group the binary result into hex.
Step 1 — Convert to binary (4 bits per hex digit):
| Hex | Binary | Hex | Binary | Hex | Binary |
|---|
| 7 | 0111 | A | 1010 | B | 1011 |
| 5 | 0101 | C | 1100 | A | 1010 |
| 4 | 0100 | 3 | 0011 | 2 | 0010 |
| D | 1101 | 6 | 0110 | 1 | 0001 |
(7AB.432)16=011110101011.0100001100102,
(5CA.D61)16=010111001010.1101011000012.
Step 2 — Binary subtraction.
Fractional part (positions 2−1 to 2−12, MSB→LSB):
| Position | 2−1 | 2−2 | 2−3 | 2−4 | 2−5 | 2−6 | 2−7 | 2−8 | 2−9 | 2−10 | 2−11 | 2−12 |
|---|
| minuend | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 |
| subtrahend | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 |
| difference | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1 |
(Borrow propagates from 2−12 up. The final borrow out into the integer part is 1.)
Integer part (positions 20 to 211, LSB→MSB), with borrow-in =1 from the fraction:
| Position | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 210 | 211 |
|---|
| minuend | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 0 |
| subtrahend | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 |
| difference | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |
Integer bits from 211 down: 000111100000=0001111000002.
Fractional bits from 2−1 down: 011011010001=0110110100012.
Step 3 — Regroup in fours back to hex.
Integer: 0001=1,1110=E,0000=0⇒1E0.
Fractional: 0110=6,1101=D,0001=1⇒.6D1.
Answer
(7AB.432)16−(5CA.D61)16=(1E0.6D1)16.