Question
The representation of the value of a 16-bit unsigned integer in hexadecimal number system is . The representation of the value of in octal number system is
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 into its 4-bit binary equivalent:
Concatenating these gives the 16-bit binary string:
Group the binary string into 3-bit groups starting from the least significant bit (right to left), padding with leading zeros on the left:
Reading the octal digits from left to right yields .
D
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.