Question

The representation of the value of a 16-bit unsigned integer YY in hexadecimal number system is BCA9\text{BCA9}. The representation of the value of YY in octal number system is

Choose one option
Official answer and solution
Official answer
D
From
Official GATE 2017 answer key

Solution

Convert the 16-bit hexadecimal number to binary, then group the binary digits into groups of 3 bits from right to left to obtain the octal representation.

Convert each hexadecimal digit of BCA916\text{BCA9}_{16} into its 4-bit binary equivalent:

  • B16=10112\text{B}_{16} = 1011_2
  • C16=11002\text{C}_{16} = 1100_2
  • A16=10102\text{A}_{16} = 1010_2
  • 916=100129_{16} = 1001_2

Concatenating these gives the 16-bit binary string:

Y=1011 1100 1010 10012Y = 1011\ 1100\ 1010\ 1001_2

Group the binary string into 3-bit groups starting from the least significant bit (right to left), padding with leading zeros on the left:

  • 0012=1001_2 = 1
  • 0112=3011_2 = 3
  • 1102=6110_2 = 6
  • 0102=2010_2 = 2
  • 1012=5101_2 = 5
  • 0012=1001_2 = 1

Reading the octal digits from left to right yields 1362518136251_8.

Final answer

D

Common trap

Grouping from left to right instead of right to left leads to incorrect digit boundaries.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2017 Computer Science and Information Technology (CS) Session 2
Question
1 of 65, printed as CS Q.1
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.