Skip to main content

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…

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?

  1. A
    0x66650\text{x}6665
    Correct answer
  2. B
    0x00010\text{x} 0001
  3. C
    0x42430\text{x} 4243
  4. D
    0x01000\text{x} 0100
    Correct 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.