← 2024 Paper 2
UPSC 2024 Maths Optional Paper 2 Q5c-i — Step-by-Step Solution
5 marks · Section B
Representation of Integers, Signed Integers, and Reals (incl. Double Precision) · Numerical Analysis · Read the full method →
Question
Determine the decimal equivalent in sign-magnitude form of (8D)16 and (FF)16.
Technique
Convert hex to 8-bit binary; the MSB is the sign bit; the remaining 7 bits give the magnitude.
Solution
(8D)16:
8=10002, D=11012 → (8D)16=100011012.
MSB =1 → negative. Magnitude bits 00011012=8+4+1=13.
(8D)16→−13.
(FF)16:
F=11112 → (FF)16=111111112.
MSB =1 → negative. Magnitude bits 11111112=127.
(FF)16→−127.
Answer
(8D)16=−13,(FF)16=−127(sign-magnitude, 8-bit).