Computer Organization & Architecture
Memory Hierarchy & Floating Point
GATE 2016
Medium
Let X be the number of distinct 16-bit integers in 2's complement representation. Let Y be the number of distinct 16-bit integers in sign magnitude representation. Then X−Y is ____.
1
Explanation
2's complement represents 2¹⁶ distinct VALUES (one representation each, no duplicate zero). Sign-magnitude has two representations for zero (+0 and −0), so it represents only 2¹⁶−1 distinct VALUES. X−Y = 2¹⁶ − (2¹⁶−1) = 1.
Source: GATE CS 2016 (Session 2 / Set B) (2016)
This question is part of a 15-day revision cycle — sign in and Project Forge will bring it back the day before you'd forget it.