GATE 2010 CS (CS1) – Question 18
Signed 16-bit P has two’s-complement hexadecimal representation F87B. Find the representation of 8P.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) C3D8
Explanation
P=0xF87B−0x10000=−1925. Thus 8P=−15400, which fits signed sixteen bits. Its encoding is 65536−15400=50136=0xC3D8, A. Equivalently left-shift the word three bits and retain sixteen bits.