HexadecimalOctalNumber Systems
On this page

Activity 2.3.1 — Hexadecimal and Octal Number Systems


Learning Objectives

By the end of this lesson, students will be able to:

  1. Explain why hexadecimal and octal number systems are used in digital electronics.
  2. Count in decimal, binary, octal, and hexadecimal.
  3. Convert between decimal ↔ octal using Successive Division and Weighted Multiplication.
  4. Convert between decimal ↔ hexadecimal using Successive Division and Weighted Multiplication.
  5. Convert directly between binary, octal, and hexadecimal using the grouping shortcut.

Vocabulary

Vocabulary (click to expand)
TermDefinition
Base / RadixThe number of unique symbols a number system uses (e.g., Base 10 = decimal)
OctalBase-8 number system; digits 0–7
HexadecimalBase-16 number system; digits 0–9 and A–F
LSDLeast Significant Digit — the rightmost digit (lowest place value)
MSDMost Significant Digit — the leftmost digit (highest place value)
Data BusA group of parallel wires that transfer data within a computer
Successive DivisionMethod for converting decimal → another base by repeated division
Weighted MultiplicationMethod for converting any base → decimal by multiplying by place values
Bit-Weighting FactorThe positional value of a digit (e.g., 2⁰=1, 2¹=2, 8⁰=1, 16¹=16)

Part 1: Why Do We Need More Number Systems?

The Problem with Binary

Humans think in decimal (base 10). Computers operate in binary (base 2). The mismatch gets worse as data buses get wider.

A value on a 32-bit data bus looks like this in binary:

0110 1001 0111 0001 0011 0100 1100 1010

That’s 32 characters — hard to read, easy to mistype.

The Solution: Compact Notation

SystemBaseDigitsCompact?
Binary20, 1❌ Very long
Octal80–7✅ Shorter
Hexadecimal160–9, A–F✅✅ Most compact

The same 32-bit value above in hex is just: 697134CA — 8 characters!

Why powers of 2? Binary, octal (2³=8), and hexadecimal (2⁴=16) are all powers of 2, which means they have a clean, direct relationship to binary. This is why they are used in computing.

Number System Relationship

graph LR
    DEC["Decimal<br/>Base 10"]
    BIN["Binary<br/>Base 2"]
    OCT["Octal<br/>Base 8"]
    HEX["Hexadecimal<br/>Base 16"]

    DEC -- "Successive Division<br/>Weighted Mult." --> BIN
    BIN -- "Weighted Mult.<br/>Successive Division" --> DEC
    DEC -- "Successive Division<br/>Weighted Mult." --> OCT
    OCT -- "Weighted Mult.<br/>Successive Division" --> DEC
    DEC -- "Successive Division<br/>Weighted Mult." --> HEX
    HEX -- "Weighted Mult.<br/>Successive Division" --> DEC
    BIN -- "Group in 3s" --> OCT
    OCT -- "Expand to 3s" --> BIN
    BIN -- "Group in 4s" --> HEX
    HEX -- "Expand to 4s" --> BIN

    style DEC fill:#f9f,stroke:#333,stroke-width:2px
    style BIN fill:#bbf,stroke:#333,stroke-width:2px
    style OCT fill:#bfb,stroke:#333,stroke-width:2px
    style HEX fill:#fbf,stroke:#333,stroke-width:2px

Place-Value Comparison

          ┌─── Binary (Base 2) ───┐
          │  2⁷  2⁶  2⁵  2⁴  2³  2²  2¹  2⁰
          │ 128  64  32  16   8   4   2   1

          ┌─── Octal (Base 8) ────┐
          │  8³   8²   8¹   8⁰
          │ 512   64    8    1

          ┌── Hexadecimal (Base 16) ┐
          │  16³   16²   16¹   16⁰
          │ 4096   256    16     1

          ┌── Decimal (Base 10) ──┐
          │  10³   10²   10¹   10⁰
          │ 1000   100    10     1

Part 2: Counting in All Four Systems

The table below shows the numbers 0–20 in all four number systems. Study the patterns — especially where the hexadecimal system uses letters instead of multi-digit numbers.

DecimalBinaryOctalHexadecimal
00000000
10000111
20001022
30001133
40010044
50010155
60011066
70011177
801000108
901001119
100101012A
110101113B
120110014C
130110115D
140111016E
150111117F
16100002010
17100012111
18100102212
19100112313
20101002414

Key insight: In hexadecimal, A represents 10, B = 11, C = 12, D = 13, E = 14, and F = 15. A number system needs unique symbols — “10” is already two symbols, so letters A–F fill the gap.

Subscript notation: Always subscript the base to avoid confusion.
Examples: 94₁₀ = decimal 94, 134₈ = octal 134, 5E₁₆ = hex 5E
An “H” suffix is also acceptable: 5EH


Part 3: The Two Conversion Methods (Universal)

These two processes work for any base conversion, not just binary.

Method 1: Successive Division (Decimal → Any Base)

Used to convert FROM decimal TO any other base.

Steps:

  1. Divide the decimal number by the target base.
  2. Record the remainder — this becomes the LSD (rightmost digit).
  3. If the quotient is 0, stop. Otherwise, use the quotient as the new number and repeat from Step 1.
  4. Read remainders from bottom to top → this is your converted number.

Method 2: Weighted Multiplication (Any Base → Decimal)

Used to convert FROM any base TO decimal.

Steps:

  1. Assign each digit its bit-weighting factor based on its position:
    • Position 0 (rightmost) = Base⁰
    • Position 1 = Base¹
    • Position 2 = Base²
    • And so on…
  2. Multiply each digit by its bit-weighting factor.
  3. Sum all the products to get the decimal result.

Part 4: Decimal ↔ Octal Conversion

Decimal → Octal (Successive Division by 8)

Worked Example: Convert 94₁₀ to octal.

94 ÷ 8 = 11  remainder  6  ← LSD
11 ÷ 8 =  1  remainder  3
 1 ÷ 8 =  0  remainder  1  ← MSD (stop, quotient = 0)

Read remainders bottom to top:  1, 3, 6

Result:  94₁₀ = 136₈

Remember: Read remainders from BOTTOM (last) to TOP (first) — that’s MSD to LSD order.


Practice Problem — Decimal → Octal

Convert 189₁₀ into its octal equivalent. Work it out before checking the solution below.

Show Solution
189 ÷ 8 = 23  remainder  5  ← LSD
 23 ÷ 8 =  2  remainder  7
  2 ÷ 8 =  0  remainder  2  ← MSD

Read bottom to top:  2, 7, 5

Result:  189₁₀ = 275₈

Octal → Decimal (Weighted Multiplication by powers of 8)

Bit-weighting factors for octal:

Position3210
Factor8³=5128²=648¹=88⁰=1

Worked Example: Convert 136₈ to decimal.

  1 × 8² = 1 × 64 =  64
  3 × 8¹ = 3 × 8  =  24
  6 × 8⁰ = 6 × 1  =   6
                   ------
  Sum =             94

Result:  136₈ = 94₁₀  ✓

Practice Problem — Octal → Decimal

Convert 134₈ into its decimal equivalent. Work it out before checking the solution below.

Show Solution
  1 × 8² = 1 × 64 =  64
  3 × 8¹ = 3 × 8  =  24
  4 × 8⁰ = 4 × 1  =   4
                   ------
  Sum =             92

Result:  134₈ = 92₁₀

Part 5: Decimal ↔ Hexadecimal Conversion

Decimal → Hexadecimal (Successive Division by 16)

Worked Example: Convert 94₁₀ to hexadecimal.

94 ÷ 16 = 5  remainder  14 → E  ← LSD
 5 ÷ 16 = 0  remainder   5  ← MSD (stop, quotient = 0)

Read bottom to top:  5, E

Result:  94₁₀ = 5E₁₆  (or 5EH)

Reminder: Remainders 10–15 become letters A–F!

RemainderHex Digit
10A
11B
12C
13D
14E
15F

Practice Problem — Decimal → Hexadecimal

Convert 429₁₀ into its hexadecimal equivalent. Work it out before checking the solution.

Show Solution
429 ÷ 16 = 26  remainder  13 → D  ← LSD
 26 ÷ 16 =  1  remainder  10 → A
  1 ÷ 16 =  0  remainder   1  ← MSD

Read bottom to top:  1, A, D

Result:  429₁₀ = 1AD₁₆  (or 1ADH)

Hexadecimal → Decimal (Weighted Multiplication by powers of 16)

Bit-weighting factors for hexadecimal:

Position3210
Factor16³=409616²=25616¹=1616⁰=1

Worked Example: Convert 5E₁₆ to decimal.

  5 × 16¹ = 5 × 16 = 80
  E × 16⁰ = 14 × 1 = 14
                    -----
  Sum =             94

Result:  5E₁₆ = 94₁₀  ✓

Practice Problem — Hexadecimal → Decimal

Convert B2EH into its decimal equivalent. Work it out before checking the solution.

Show Solution
B = 11, 2 = 2, E = 14

  B × 16² = 11 × 256 = 2816
  2 × 16¹ =  2 × 16  =   32
  E × 16⁰ = 14 × 1   =   14
                       -------
  Sum =                 2862

Result:  B2EH = 2862₁₀

Part 6: Cross-Base Conversions (Hex ↔ Octal, Octal ↔ Binary)

When converting between non-decimal bases (hex → octal, octal → binary), there is no direct formula. You must use decimal as a stepping stone:

Hex → Decimal → Octal

Octal → Decimal → Binary

Practice Problem — Hexadecimal → Octal

Convert 5AH into its octal equivalent.

Show Solution

Step 1: Hex → Decimal

  5 × 16¹ = 5 × 16 = 80
  A × 16⁰ = 10 × 1 = 10
                     ----
  Sum =              90

  5AH = 90₁₀

Step 2: Decimal → Octal

90 ÷ 8 = 11  remainder  2  ← LSD
11 ÷ 8 =  1  remainder  3
 1 ÷ 8 =  0  remainder  1  ← MSD

Result:  90₁₀ = 132₈

Final:  5AH = 132₈

Practice Problem — Octal → Binary

Convert 132₈ into its binary equivalent.

Show Solution

Step 1: Octal → Decimal

  1 × 8² = 1 × 64 =  64
  3 × 8¹ = 3 × 8  =  24
  2 × 8⁰ = 2 × 1  =   2
                   ------
  Sum =             90

  132₈ = 90₁₀

Step 2: Decimal → Binary

90 ÷ 2 = 45  remainder  0  ← LSD
45 ÷ 2 = 22  remainder  1
22 ÷ 2 = 11  remainder  0
11 ÷ 2 =  5  remainder  1
 5 ÷ 2 =  2  remainder  1
 2 ÷ 2 =  1  remainder  0
 1 ÷ 2 =  0  remainder  1  ← MSD

Result:  90₁₀ = 1011010₂

Final:  132₈ = 1011010₂

Part 7: The Binary ↔ Octal ↔ Hex Shortcut ⚡

Since binary, octal, and hexadecimal are all powers of 2, there is a direct shortcut that bypasses decimal entirely.

Bit Grouping Visual

Binary:  0  1  0  1  1  0  1  0  (= 90₁₀)

         ├─────┤  ├─────┤  ├─────┤
Octal:      1        3        2       ← groups of 3 bits (pad left with 0)

         ├──────────┤  ├──────────┤
   Hex:       5              A        ← groups of 4 bits (pad left with 0)

Result:  01011010₂ = 132₈ = 5A₁₆ = 90₁₀
ConversionGroup SizeReason
Binary ↔ Octal3 binary bits2³ = 8
Binary ↔ Hexadecimal4 binary bits2⁴ = 16

Binary → Octal

  1. Start from the right, group binary digits into sets of 3.
  2. Add leading zeros to the leftmost group if needed.
  3. Convert each group of 3 bits to its octal digit (0–7).

Binary → Hexadecimal

  1. Start from the right, group binary digits into sets of 4.
  2. Add leading zeros to the leftmost group if needed.
  3. Convert each group of 4 bits to its hex digit (0–F).

Worked Example — Shortcut

Binary:  1 0 1 1 0 1 0₂

Octal grouping (sets of 3, right to left):
  001 | 011 | 010
   1     3     2
Result: 132₈ ✓

Hex grouping (sets of 4, right to left):
  0101 | 1010
    5      A
Result: 5AH ✓

This shortcut only works between number systems whose bases are powers of 2. It does NOT work for decimal conversions.


Practice Problem — Shortcut Technique

Use the shortcut to convert A6₁₆ into binary and octal. Check with a calculator.

Show Solution

Step 1: Hex → Binary (expand each hex digit to 4 binary bits)

A = 1010
6 = 0110

A6₁₆ = 1010 0110₂

Step 2: Binary → Octal (group binary into sets of 3)

Rearrange:  001 | 010 | 011 | 0  → need 8 bits: 10100110
Group right-to-left: 010 | 100 | 110 → Wait, let's be precise:

10100110₂ → split right to left into groups of 3:
  010 | 100 | 110
   2     4     6

Result: A6₁₆ = 10100110₂ = 246₈

Calculator check: A6₁₆ = 166₁₀ = 246₈ ✓


Summary: Conversion Road Map

graph TD
    DEC["DECIMAL<br/>Base 10"]
    BIN["BINARY<br/>Base 2"]
    OCT["OCTAL<br/>Base 8"]
    HEX["HEXADECIMAL<br/>Base 16"]

    DEC -- "Successive Division" --> BIN
    DEC -- "Successive Division" --> OCT
    DEC -- "Successive Division" --> HEX
    BIN -- "Weighted Multiplication" --> DEC
    OCT -- "Weighted Multiplication" --> DEC
    HEX -- "Weighted Multiplication" --> DEC
    BIN <--> |"Group/Expand<br/>in 3s"| OCT
    BIN <--> |"Group/Expand<br/>in 4s"| HEX
    OCT -. "Go through<br/>Decimal" .-> HEX
    HEX -. "Go through<br/>Decimal" .-> OCT

    style DEC fill:#f9f,stroke:#333,stroke-width:2px
    style BIN fill:#bbf,stroke:#333,stroke-width:2px
    style OCT fill:#bfb,stroke:#333,stroke-width:2px
    style HEX fill:#fbf,stroke:#333,stroke-width:2px
Conversion DirectionMethod
Decimal → Any BaseSuccessive Division (divide by base, collect remainders bottom→top)
Any Base → DecimalWeighted Multiplication (multiply each digit × base^position, sum all)
Binary ↔ OctalGroup binary into 3s
Binary ↔ HexGroup binary into 4s
Hex ↔ OctalGo through decimal (Hex→Dec→Oct or Oct→Dec→Hex)

Key Reminders for the Activity

  • Always subscript your bases to avoid confusion (e.g., 94₁₀, 136₈, 5EH).
  • When using successive division, read remainders bottom to top (LSD → MSD).
  • When converting hex → decimal, replace letters with their numeric values first (A=10, B=11, C=12, D=13, E=14, F=15).
  • The binary ↔ octal/hex shortcut requires adding leading zeros to fill out groups on the left side.
  • Cross-base conversions (like hex → octal) require a decimal step in the middle.

📝 Quick Reference: Hex Digit Values

HexDecBinary
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
A101010
B111011
C121100
D131101
E141110
F151111

Derived from PLTW Digital Electronics — Activity 2.3.1 (Copyright 2021, PLTW)