The GATE Grind

GATE 2021 CS (CS2) – Question 54

Computer Organization and Architecture · Instruction Set and Addressing Modes · 2 marks · Multiple select

The same two bytes interpreted as an unsigned integer have a little-endian numerical value 255 greater than their big-endian value. Which hexadecimal values could represent the integer on the little-endian computer?

  1. 0x6665
  2. 0x0001
  3. 0x4243
  4. 0x0100

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (A) 0x6665; (D) 0x0100

Explanation

If bytes at increasing addresses are a,b, little-endian value is a+256b and big-endian is 256a+b. Their difference is 255(b−a), so b=a+1. In the little-endian numerical hexadecimal value, the high byte must exceed the low byte by one. Both 0x6665 and 0x0100 satisfy this, A,D.

More Instruction Set and Addressing Modes questions

All Instruction Set and Addressing Modes questions →