Difficulty: Easy
Correct Answer: Correct
Explanation:
Introduction / Context: Hexadecimal (base 16) maps neatly to binary because 16 = 2^4; each hex digit corresponds to exactly four bits. Designers and programmers rely on hex to write and read binary values in a compact, human-friendly form, especially for registers, bitmasks, addresses, and machine code bytes.Given Data / Assumptions:
Concept / Approach: Since each nibble (4 bits) is one hex digit, converting between binary and hex is grouping bits by fours. This one-to-one mapping reduces transcription errors and accelerates debugging. Octal (base 8) similarly maps groups of three bits, but hex dominates due to byte alignment (8 bits = 2 hex digits).Step-by-Step Solution:
Group a binary string into nibbles from the LSB side.Map each group of four to a hex digit (0000→0, …, 1111→F).Write the hex sequence as a compact representation of the same bits.Verification / Alternative check:
Round-trip: Convert hex back to binary by replacing each hex digit with its 4-bit pattern.Why Other Options Are Wrong:
Incorrect: Contradicts standard engineering practice.Only for signed integers: Hex applies to any bit pattern, signed or unsigned.Used only in assembly: Hex pervades firmware, hardware, and high-level tooling alike.Common Pitfalls:
Dropping leading zeros in the most significant nibble and changing byte alignment.Confusing endianness with hex representation; endianness affects byte order, not digit meaning.Final Answer:
Correct
Discussion & Comments