You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Number Systems: Binary and Denary
Number Systems: Binary and Denary
Understanding number systems is the foundation of data representation in Computer Science. Computers operate using binary (base-2), while humans typically use denary (base-10, also called decimal). This lesson explains both systems and how to convert between them.
The Denary (Decimal) System
The denary system is the number system you use every day. It is a base-10 system, meaning it uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
Each column in a denary number represents a power of 10:
| Thousands (10³) | Hundreds (10²) | Tens (10¹) | Units (10⁰) |
|---|---|---|---|
| 1000 | 100 | 10 | 1 |
For example, the number 3742 means:
- 3 × 1000 = 3000
- 7 × 100 = 700
- 4 × 10 = 40
- 2 × 1 = 2
- Total = 3742
This is called positional notation — the value of a digit depends on its position in the number.
The Binary System
The binary system is a base-2 system. It uses only two digits: 0 and 1. Each digit in a binary number is called a bit (short for binary digit).
Each column in a binary number represents a power of 2:
| 128 (2⁷) | 64 (2⁶) | 32 (2⁵) | 16 (2⁴) | 8 (2³) | 4 (2²) | 2 (2¹) | 1 (2⁰) |
|---|---|---|---|---|---|---|---|
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Why Do Computers Use Binary?
Computers are built from billions of tiny electronic switches called transistors. Each transistor can be in one of two states:
- On (represented by 1)
- Off (represented by 0)
Because there are only two states, binary is the natural number system for computers. Everything a computer processes — numbers, text, images, sound — is ultimately stored as sequences of 0s and 1s.
Converting Binary to Denary
To convert a binary number to denary, write out the place values and add up the columns that contain a 1.
Worked Example 1: Convert 10110101 to denary
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 1 | 0 | 1 | 1 | 0 | 1 | 0 | 1 |
Add the place values where the bit is 1:
- 128 + 32 + 16 + 4 + 1 = 181
Worked Example 2: Convert 01001100 to denary
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 |
- 64 + 8 + 4 = 76
Converting Denary to Binary
To convert a denary number to binary, use the successive division by 2 method or the place value method.
Method 1: Place Value Method
- Write out the column headings: 128, 64, 32, 16, 8, 4, 2, 1.
- Starting from the largest value, ask: "Does this value fit into the remaining number?"
- If yes, write a 1 and subtract that value. If no, write a 0.
- Repeat for each column.
Worked Example: Convert 200 to binary
- 200 ≥ 128? Yes → 1, remainder = 72
- 72 ≥ 64? Yes → 1, remainder = 8
- 8 ≥ 32? No → 0
- 8 ≥ 16? No → 0
- 8 ≥ 8? Yes → 1, remainder = 0
- 0 ≥ 4? No → 0
- 0 ≥ 2? No → 0
- 0 ≥ 1? No → 0
200 in binary = 11001000
Method 2: Successive Division by 2
- Divide the number by 2 and note the remainder.
- Keep dividing the quotient by 2, noting each remainder.
- Read the remainders from bottom to top to get the binary number.
Worked Example: Convert 53 to binary
| Division | Quotient | Remainder |
|---|---|---|
| 53 ÷ 2 | 26 | 1 |
| 26 ÷ 2 | 13 | 0 |
| 13 ÷ 2 | 6 | 1 |
| 6 ÷ 2 | 3 | 0 |
| 3 ÷ 2 | 1 | 1 |
| 1 ÷ 2 | 0 | 1 |
Reading remainders bottom to top: 53 in binary = 110101
(As an 8-bit binary number with leading zeros: 00110101)
Key Terminology
- Bit: A single binary digit (0 or 1). The smallest unit of data.
- Nibble: 4 bits (e.g. 1010).
- Byte: 8 bits (e.g. 10110101). A byte can represent values from 0 to 255 in unsigned binary.
- Most Significant Bit (MSB): The leftmost bit, with the highest place value.
- Least Significant Bit (LSB): The rightmost bit, with the lowest place value (1).
Exam Tip: Always double-check your binary-to-denary conversions by adding up the place values. A common mistake is misaligning the place values. An 8-bit number has a maximum unsigned value of 255 (11111111 in binary = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1).
Summary
- Denary (base-10) uses digits 0–9 and powers of 10 for place values.
- Binary (base-2) uses digits 0 and 1 and powers of 2 for place values.
- Computers use binary because transistors have two states: on (1) and off (0).
- To convert binary to denary, add together the place values of all the 1-bits.
- To convert denary to binary, use the place value method or successive division by 2.
- An 8-bit binary number can represent unsigned values from 0 to 255.