Introduction to Number Systems
What is a Number System?
Definition
A number system is a mathematical notation for representing numbers using a consistent set of digits or symbols.
Key Components:
-
Base (Radix): Number of unique digits
-
Digits: Symbols used for representation
-
Positional Value: Weight of each position
-
Place Value: Base raised to position power
General Formula
\(N = d_n \times \text{base}^n + d_{n-1} \times \text{base}^{n-1} + \cdots + d_1 \times \text{base}^1 + d_0 \times \text{base}^0\)
Common Number Systems
The Four Essential Number Systems
Decimal Number System (Base-10)
Characteristics:
-
Base: 10
-
Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
-
Most familiar to humans
-
Natural counting system
Example: \(1234_{10}\)
Binary Number System (Base-2)
Characteristics:
-
Base: 2
-
Digits: 0, 1 only
-
Foundation of digital systems
-
Each bit represents ON/OFF state
Example: \(1011_2\)
Octal Number System (Base-8)
Characteristics:
-
Base: 8
-
Digits: 0, 1, 2, 3, 4, 5, 6, 7
-
Compact binary representation
-
Historical importance in computing
Example: \(175_8\)
Hexadecimal Number System (Base-16)
Characteristics:
-
Base: 16
-
Digits: 0-9, A-F
-
A=10, B=11, C=12, D=13, E=14, F=15
-
Widely used in programming
Example: \(2AF_{16}\)
Number System Conversions
Conversion Methods Overview
Decimal to Binary Conversion
Method: Successive Division by 2
Example: Convert \(25_{10}\) to Binary
Division | Quotient | Remainder |
---|---|---|
\(25 \div 2\) | \(12\) | \(\mathbf{1}\) |
\(12 \div 2\) | \(6\) | \(\mathbf{0}\) |
\(6 \div 2\) | \(3\) | \(\mathbf{0}\) |
\(3 \div 2\) | \(1\) | \(\mathbf{1}\) |
\(1 \div 2\) | \(0\) | \(\mathbf{1}\) |
Result: Read remainders upward: \(11001_2\)
Verification
\(11001_2 = 1 \times 2^4 + 1 \times 2^3 + 0 \times 2^2 + 0 \times 2^1 + 1 \times 2^0 = 16 + 8 + 0 + 0 + 1 = 25_{10}\) \(\checkmark\)
Binary to Decimal Conversion
Method: Weighted Sum (Positional Notation)
Example: Convert \(110101_2\) to Decimal
Pro Tip!
For quick mental conversion, memorize powers of 2 up to \(2^{10}\) = 1024
Quick Binary-Octal-Hex Conversions
Key Insight: Direct grouping method for related bases
Binary \(\leftrightarrow\) Octal (Group by 3)
Binary to Octal: Group binary digits in sets of 3 (from right)
Example: \(110101_2\)
Binary \(\leftrightarrow\) Hex (Group by 4)
Binary to Hex: Group binary digits in sets of 4 (from right)
Example: \(110101_2\)
Binary Arithmetic
Binary Addition Rules
Basic Rules
A | B | Sum | Carry |
---|---|---|---|
0 | 0 | 0 | 0 |
0 | 1 | 1 | 0 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 |
Example 1: Simple Addition
Example 2: With Carry Chain
Binary Subtraction Rules
Basic Rules
A | B | Difference | Borrow |
---|---|---|---|
0 | 0 | 0 | 0 |
1 | 0 | 1 | 0 |
0 | 1 | 1 | 1 |
1 | 1 | 0 | 0 |
Example 1: Simple Subtraction
Example 2: With Borrowing
Applications & Summary
Why Different Number Systems Matter
Binary Applications:
-
Digital circuit design
-
Computer programming
-
Data storage & transmission
-
Logic operations
Octal Applications:
-
Unix/Linux file permissions
-
Compact binary representation
-
Assembly programming
Hexadecimal Applications:
-
Memory addressing
-
Color codes (RGB)
-
Machine code representation
-
Debugging tools
Decimal Applications:
-
Human-readable interface
-
Mathematical calculations
-
Financial computations
-
Scientific measurements
Key Takeaway
Each number system serves specific purposes in electronics and computing!
Quick Reference Table
Decimal | Binary | Octal | Hex | Notes |
---|---|---|---|---|
0 | 0000 | 0 | 0 | - |
1 | 0001 | 1 | 1 | - |
2 | 0010 | 2 | 2 | - |
3 | 0011 | 3 | 3 | - |
4 | 0100 | 4 | 4 | - |
5 | 0101 | 5 | 5 | - |
6 | 0110 | 6 | 6 | - |
7 | 0111 | 7 | 7 | - |
8 | 1000 | 10 | 8 | - |
9 | 1001 | 11 | 9 | - |
10 | 1010 | 12 | A | First hex letter |
11 | 1011 | 13 | B | - |
12 | 1100 | 14 | C | - |
13 | 1101 | 15 | D | - |
14 | 1110 | 16 | E | - |
15 | 1111 | 17 | F | Largest single hex |
16 | 10000 | 20 | 10 | One hex digit overflow |
Summary & Key Points
What We Learned
-
Number Systems: Different bases for representing numbers
-
Conversion Methods: Division method and weighted sum
-
Quick Conversions: Grouping for Binary-Octal-Hex
-
Binary Arithmetic: Addition and subtraction rules
-
Practical Applications: Where each system is used
Practice Problems
-
Convert \(156_{10}\) to binary, octal, and hexadecimal
-
Calculate \(1101_2 + 1011_2\) in binary
-
Convert \(3A7_{16}\) to decimal
-
Perform \(10110_2 - 01011_2\)
Next Lecture Preview
Boolean Algebra & Logic Gates - The foundation of digital circuits!