Binary and Hexadecimal Representations
Binary and hexadecimal number systems are the backbone of digital computing. This course explains how these systems work, how to convert between them, and how they are used in common…

Convert the hexadecimal value BD07C to binary. Which binary string is correct?
When adding two 4‑bit two's‑complement numbers, overflow occurs if:
A sound sample is recorded with 8‑bit depth. How many distinct amplitude levels can be represented?
Which hexadecimal notation correctly represents the binary pattern 0011 0101 0111 0011?
A 4‑bit two's‑complement system stores the value –5. What is the binary representation?
During binary subtraction, the subtrahend is transformed before addition. Which step is performed first?
A Unicode character is encoded as U+6211. Which of the following statements is true?
When extending a 4‑bit signed integer to 8 bits, which technique preserves its value?
A binary number 10110101 is interpreted as an unsigned value. What decimal number does it represent?
Understanding Binary and Hexadecimal Representations
Binary and hexadecimal number systems are the backbone of digital computing. This course explains how these systems work, how to convert between them, and how they are used in common programming tasks such as memory addressing, two‑s complement arithmetic, audio sampling, and Unicode encoding.
1. Binary Addresses and Their Limits
When a memory address is stored as an unsigned binary number, the range of values it can represent is determined by the number of bits.
- For n bits, the smallest value is 0.
- The largest value is 2ⁿ − 1.
Example: A 4‑bit unsigned address can hold values from 0 to 2⁴ − 1 = 15. Therefore, the decimal value 16 cannot be represented because it exceeds the maximum.
Think of a four‑slot locker: once all slots are full (0‑15), you cannot fit a fifth item (16).
2. Converting Hexadecimal to Binary
Hexadecimal (base‑16) is a compact way to write binary data. Each hex digit corresponds to exactly four binary bits.
- 0 → 0000, 1 → 0001, …, 9 → 1001
- A → 1010, B → 1011, C → 1100, D → 1101, E → 1110, F → 1111
To convert BD07C:
- B → 1011
- D → 1101
- 0 → 0000
- 7 → 0111
- C → 1100
Putting the groups together gives 1011 1101 0000 0111 1100. Notice that the final group contains only four bits; any trailing zeros are optional when the context is clear.
3. Two’s‑Complement Arithmetic and Overflow
Two’s‑complement is the most common method for representing signed integers. The leftmost bit is the sign bit (0 = positive, 1 = negative). Overflow occurs when the result cannot be represented with the given number of bits.
- If both operands are positive and the sum becomes negative, overflow has occurred.
- Similarly, if both operands are negative and the sum becomes positive, overflow also occurs.
For a 4‑bit two’s‑complement system, adding two positive numbers that produce a negative result signals overflow.
4. Bit Depth in Audio Sampling
Audio samples are stored as binary numbers whose width is called the bit depth. The number of distinct amplitude levels equals 2^(bit‑depth).
With an 8‑bit depth, the calculation is 2⁸ = 256 levels. This is why 8‑bit audio can represent 256 different volume steps.
5. Hexadecimal Notation for Binary Patterns
To write a binary pattern in hex, group the bits into fours starting from the most‑significant bit.
Given the binary pattern 0011 0101 0111 0011:
- 0011 → 3
- 0101 → 5
- 0111 → 7
- 0011 → 3
The correct hexadecimal representation is 0x3573.
6. Representing Negative Numbers in Two’s‑Complement
To encode a negative integer:
- Write the absolute value in binary.
- Invert every bit (one’s complement).
- Add 1 to the inverted result.
For –5 in a 4‑bit system:
- 5 → 0101
- Invert → 1010
- Add 1 → 1010 + 1 = 1101
The leftmost 1 indicates a negative value, confirming that 1101 is the correct encoding.
Which step do you remember best: flipping bits, adding 1, or recognizing the leftmost 1 as a sign?
7. Binary Subtraction Using Two’s‑Complement
Subtraction can be performed by adding the two’s‑complement of the subtrahend to the minuend. The first transformation step is:
- Form the two’s‑complement of the subtrahend.
After this conversion, the addition proceeds exactly like any other binary addition, and any final carry‑out is discarded.
8. Unicode Code Points and Hexadecimal Notation
Unicode assigns a unique code point to every character. These code points are usually written in hexadecimal, prefixed with U+.
The code point U+6211 corresponds to the Chinese character “我” (pronounced “wǒ”, meaning “I/me”). This demonstrates how Unicode uses hexadecimal values to cover a vast range of global scripts.
9. Summary of Key Concepts
- Unsigned binary ranges: 0 to 2ⁿ − 1.
- Hex ↔ binary conversion: each hex digit = 4 bits.
- Two’s‑complement overflow rules.
- Bit depth determines the number of amplitude levels (2^depth).
- Hex notation for grouped binary patterns.
- Encoding negative numbers with two’s‑complement.
- Binary subtraction via two’s‑complement of the subtrahend.
- Unicode code points are expressed in hexadecimal.
Mastering these fundamentals equips you to read, write, and debug low‑level code, work with digital audio, and handle international text correctly. Keep practicing conversions and arithmetic operations; the patterns become intuitive with repetition.
