If the numerical value of a 2-byte unsigned integer on a little endian computer is 255 more than that on a big endian computer, which of the following choices represent(s) the unsigned integer on a little endian computer?
GATE CSE 2021Digital Logic › Number Systems & RepresentationVerified
GATE CSE 2021 PYQ: If the numerical value of a 2 2 2 -byte unsigned integer on a little endian computer is 255 255 255 more…
- ACorrect answer
- B
- C
- DCorrect answer
Answer
(A, D) 0 x 6665 0\text{x}6665 0 x 6665; 0 x 0100 0\text{x} 0100 0 x 0100
Approach
Let the two memory bytes be X (lower address) and Y (higher address). Little-endian value = X + 256Y; big-endian value = 256X + Y. Given LE = BE + 255, the problem reduces to finding candidates for which the LE value exceeds the BE value by exactly 255.
Only options A and D satisfy LE - BE = 255. A community answer claiming B and C likely misinterprets the option as a memory byte sequence rather than as the little-endian numerical value.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.