Number Bases JSS2
Number Base System — Complete JSS2 Guide
Introduction
A number base (or radix) is the number of different digit symbols a number system uses. Each base defines its own digits and place values. The system you use every day is decimal (base 10). Computers use binary (base 2), and programmers often use hexadecimal (base 16).
Definition
A number base system is a method of representing quantities using digits where the weight of each digit depends on its position (place value) and the base. The base tells you how many symbols exist before you carry to the next place.
Common Number Bases
| Base | Name | Digits | Sample number |
|---|---|---|---|
| 2 | Binary | 0, 1 | 1011₂ |
| 8 | Octal | 0–7 | 725₈ |
| 10 | Decimal | 0–9 | 458₁₀ |
| 16 | Hexadecimal | 0–9, A–F | 3AF₁₆ |
Place Value Explained
Every digit has a place value determined by the base and its position (indexing from right, starting at 0). The value of a whole number is the sum of each digit multiplied by the base raised to its position power.
Decimal example
345₁₀ = 3×10² + 4×10¹ + 5×10⁰ = 300 + 40 + 5
Binary example
1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11₁₀
How to Convert Between Bases
A. Convert from other base → Decimal (place-value expansion)
Multiply each digit by the base to the power of its position, then add the results.
Example: Convert 3B₁₆ to decimal.
3×16¹ + B×16⁰ = 3×16 + 11×1 = 48 + 11 = 59₁₀
B. Convert Decimal → Other base (division & remainders)
Divide the decimal number by the target base, record the remainder, then divide the quotient again until the quotient is 0. Read remainders from bottom to top.
Example: Convert 29₁₀ → binary
29 ÷ 2 = 14 remainder 1
14 ÷ 2 = 7 remainder 0
7 ÷ 2 = 3 remainder 1
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
Read bottom → top: 11101₂
C. Convert between non-decimal bases
General method: Convert the source number to decimal, then convert that decimal to the target base. This always works.
- Binary ↔ Octal: group bits in sets of 3 (right to left).
- Binary ↔ Hex: group bits in sets of 4 (right to left).
Binary → Hex example (shortcut)
Convert 11011100₂ to hex.
Group: (1101)(1100) → D and C → DC₁₆
Binary → Octal example
Convert 101101₂ to octal.
Group: (101)(101) → 5 and 5 → 55₈
Addition & Subtraction in Number Bases (Focus on Binary & Hex)
Binary addition rules
| Operation | Binary result | Notes |
|---|---|---|
| 0 + 0 | 0 | no carry |
| 0 + 1 | 1 | no carry |
| 1 + 0 | 1 | no carry |
| 1 + 1 | 10 | write 0, carry 1 |
| 1 + 1 + 1 | 11 | write 1, carry 1 |
Worked example (binary addition)
1011
+ 1101
------
11000
Step: add column by column from right. 1+1=10 (write 0 carry 1), continue with carry.
Hexadecimal addition tip
Remember hex digits A–F are 10–15. If the sum is ≥ 16, subtract 16 and carry 1 to the next column.
Binary subtraction rules
| Operation | Binary result |
|---|---|
| 0 − 0 | 0 |
| 1 − 0 | 1 |
| 1 − 1 | 0 |
| 0 − 1 | 1 (borrow 1) |
Worked example (binary subtraction)
10110
- 01101
-------
01001 (which equals 9 in decimal)
Borrow when needed; align digits and subtract bit by bit.
Additional Worked Examples (Detailed)
1. Octal → Decimal
Convert 127₈ to decimal:
1×8² + 2×8¹ + 7×8⁰ = 64 + 16 + 7 = 87₁₀
2. Hexadecimal → Decimal
Convert 3B₁₆ to decimal:
3×16¹ + B×16⁰ = 3×16 + 11 = 48 + 11 = 59₁₀
3. Decimal → Binary (step-by-step)
Convert 36₁₀ to binary:
36 ÷ 2 = 18 rem 0
18 ÷ 2 = 9 rem 0
9 ÷ 2 = 4 rem 1
4 ÷ 2 = 2 rem 0
2 ÷ 2 = 1 rem 0
1 ÷ 2 = 0 rem 1
Read bottom→top: 100100₂
4. Decimal → Hex
Convert 254₁₀ to hex:
254 ÷ 16 = 15 remainder 14 → remainder 14 = E
15 ÷ 16 = 0 remainder 15 → remainder 15 = F
Read bottom→top: FE₁₆
Why Number Bases Matter (Real-life Uses)
- Binary: The language of computers. Every on/off state (transistor) corresponds to 1 or 0.
- Hexadecimal: Shorter way to show binary data — used in memory addresses, debugging and web colors (e.g.,
#FF5733). - Octal: Historically used in some computing systems for compact binary grouping (3 bits).
- Decimal: For everyday counting, money, and measurements.
Practice Questions (with answers hidden — click to reveal)
1010₂ to decimal.
10₁₀ — because 1×2³ + 0×2² + 1×2¹ + 0×2⁰ = 8 + 0 + 2 + 0.111₈ to decimal.
73₁₀ — calculation: 1×8² + 1×8¹ + 1×8⁰ = 64 + 8 + 1 = 73.1A₁₆ to decimal.
26₁₀ — because 1×16 + 10 = 26.36₁₀ to binary.
100100₂ (see worked example above).FF₁₆ in decimal?
255₁₀ — since F=15, 15×16 + 15 = 240 + 15 = 255.1011₂ + 1101₂.
11000₂ (which is 24₁₀).100101₂ to hexadecimal.
25₁₆. Group: (0010)(0101) → 2 5.77₈ to decimal.
63₁₀ (7×8 + 7 = 56 + 7).
I learnt a lot
ReplyDeleteThank you ma
DeleteYes I agree I also learnt a lot
ReplyDelete