CMPE1550: Number Systems

📚 Lesson: Understanding Number Systems

🎯 Learning Objectives

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

  • Identify and describe the characteristics of decimal, binary, octal, and hexadecimal number systems.
  • Convert numbers between these systems and decimal.
  • Apply the Division-Remainder Method for base conversions.
  • Understand binary groupings for conversions between binary, octal, and hexadecimal.

1️⃣ Introduction to Number Systems

Key Concepts:

  • Positional Number Systems: Each digit has a weighted value based on its position.
  • Radix/Base: The number of unique digits, including zero, used to represent numbers.
System Base Digits Used Weighting (Powers of…)
Decimal 10 0–9 Powers of 10
Binary 2 0, 1 Powers of 2
Octal 8 0–7 Powers of 8
Hexadecimal 16 0–9, A–F (A=10 to F=15) Powers of 16

2️⃣ Converting to Decimal

Method: Weighted Sum of Powers

  • Expand each digit using its base and position.
  • Example (Binary):

$1101.01_2 = 1×2^3 + 1×2^2 + 0×2^1 + 1×2^0 + 0×2^{-1} + 1×2^{-2}$

Practice:

  • Convert the following to decimal:

  • $2306.71_{10}$
  • $7206.351_8$
  • $A31C.04_{16}$

3️⃣ Converting from Decimal

Method: Division-Remainder (for integers)

  • Divide the number by the target base.
  • Record the remainder.
  • Repeat until the quotient is 0.
  • Read remainders in reverse.

Example:

Convert $2458_{10}$ to Octal:

  • 2458 ÷ 8 = 307, R=2
  • 307 ÷ 8 = 38, R=3
  • 38 ÷ 8 = 4, R=6
  • 4 ÷ 8 = 0, R=4
  • Result: $4632_8$

4️⃣ Conversions Between Binary, Octal, and Hexadecimal

Binary ↔ Octal:

  • Group binary digits in sets of 3 (right to left).
  • Example:

$101100010110_2$ → $101\ 100\ 010\ 110$ → $5426_8$

Binary ↔ Hexadecimal:

  • Group binary digits in sets of 4.
  • Example:

$01100010110_2$ → $1011\ 0001\ 0110$ →

$B16_{16}$

5️⃣ Exercises & Activities

In-Class Practice:

  • Convert $145_{10}$ to Binary, Octal, and Hexadecimal using Division-Remainder.
  • Use calculators to verify results. Group Challenge:
  • Each group gets a number in one base and must convert it to the other three. Discussion Prompt:
  • Why do computers use binary, and how do hexadecimal and octal help simplify binary representation?

6️⃣ Wrap-Up & Homework

Summary:

  • Number systems are foundational to digital logic and computing.
  • Understanding conversions helps in programming, electronics, and data representation. Homework:
  • Memorize hexadecimal digit-to-decimal mappings.
  • Convert five random decimal numbers to binary, octal, and hexadecimal.