GateAI
Instruction Set and Addressing Modes

GATE CSE 2021 Set 2 · Q44

MSQ2 marksMedium

Time

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?

Select all that applyOne or more correct

Pick every correct option

Solution

Step-by-step verified solution

Official answer: A) 0x6665; D) 0x0100

Instruction Set and Addressing Modes

Let the two consecutive memory bytes be B0B_0 (at the lower memory address) and B1B_1 (at the higher memory address).

  • In a big-endian system, the most significant byte (MSB) is stored at the lower memory address, so the numerical value is:

    VBE=256⋅B0+B1V_{\text{BE}} = 256 \cdot B_0 + B_1
  • In a little-endian system, the least significant byte (LSB) is stored at the lower memory address (and MSB at the higher address), so the numerical value is:

    VLE=256⋅B1+B0V_{\text{LE}} = 256 \cdot B_1 + B_0

Given that VLE−VBE=255V_{\text{LE}} - V_{\text{BE}} = 255:

(256⋅B1+B0)−(256⋅B0+B1)=255(256 \cdot B_1 + B_0) - (256 \cdot B_0 + B_1) = 255
255(B1−B0)=255  ⟹  B1−B0=1255(B_1 - B_0) = 255 \implies B_1 - B_0 = 1

Thus, B1=B0+1B_1 = B_0 + 1.

The representation of the unsigned integer value on the little-endian computer is written with MSB followed by LSB, i.e., byte B1B_1 followed by byte B0B_0.

Let us evaluate each option (B1B0)16(B_1B_0)_{16}:

  • (A) 0x6665: B1=0x66B_1 = 0\text{x}66, B0=0x65  ⟹  B1−B0=0x66−0x65=1B_0 = 0\text{x}65 \implies B_1 - B_0 = 0\text{x}66 - 0\text{x}65 = 1. (Correct)

  • (B) 0x0001: B1=0x00B_1 = 0\text{x}00, B0=0x01  ⟹  B1−B0=−1≠1B_0 = 0\text{x}01 \implies B_1 - B_0 = -1 \neq 1. (Incorrect)

  • (C) 0x4243: B1=0x42B_1 = 0\text{x}42, B0=0x43  ⟹  B1−B0=−1≠1B_0 = 0\text{x}43 \implies B_1 - B_0 = -1 \neq 1. (Incorrect)

  • (D) 0x0100: B1=0x01B_1 = 0\text{x}01, B0=0x00  ⟹  B1−B0=0x01−0x00=1B_0 = 0\text{x}00 \implies B_1 - B_0 = 0\text{x}01 - 0\text{x}00 = 1. (Correct)

Hence, the correct choices are (A) and (D).

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Instruction Set and Addressing Modes previous year question is Q44 of the GATE CSE 2021 Set 2 paper. Find more GATE CSE PYQs on Instruction Set and Addressing Modes in Computer Organization and Architecture, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Instruction Set and Addressing Modes PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Instruction Set and Addressing Modes in GATE CSE

Instruction Set and Addressing Modes has 19 GATE CSE PYQs across 15 papers from 2011 to 2026. This is the only 2-mark MSQ among them, and it is the only one in GATE CSE 2021 Set 2.

How GATE tests Instruction Set and Addressing Modes

More from GATE CSE 2021 Set 2

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2021 Set 2 · Q44 · MSQ

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?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.