Overview
This lecture introduces positional number systems in various bases, explains core number systems used in computing, and demonstrates conversion from any base to decimal.
Positional Number Systems
- In positional number systems, a digit's value depends on its position and the base.
- Example: 110 in base 10 expands to (1×10²) + (1×10¹) + (0×10⁰) = 110.
- Any base can be used, with digit values determined by powers of that base.
- Subscripts denote the base (e.g., 110₂ for binary).
Common Number Bases in Computing
- Base 10 (Decimal): Uses digits 0–9; most familiar system.
- Base 2 (Binary): Uses 0 and 1; fundamental in computer systems.
- Base 8 (Octal): Uses 0–7; serves as a shorthand for binary.
- Base 16 (Hexadecimal): Uses 0–9 and A–F (A=10, …, F=15); common for color codes and data representation.
Counting and Representation
- After running out of symbols in any base, add another digit (e.g., after 9 in decimal comes 10).
- In binary, 2 is written as 10₂, and so on for higher bases.
Binary, Bytes, and Data Sizes
- One binary digit is a bit; 8 bits make a byte.
- Larger data sizes: kilobyte (kB) = 1,000 bytes (metric) vs kibibyte (KiB) = 1,024 bytes (binary).
- Metric prefixes (kilo, mega, giga) use powers of ten; binary prefixes (kibi, mebi, gibi) use powers of two.
- Hard drive sizes and network speeds may differ by up to 10% depending on the prefix used.
Converting from Any Base to Decimal
- Expand the number using powers of its base: e.g., 263₈ = (2×8²) + (6×8¹) + (3×8⁰) = 179₁₀.
- For hexadecimal: 2AF₁₆ = (2×16²) + (10×16¹) + (15×16⁰) = 687₁₀.
- For binary with fractions: 101.011₂ = (1×2²) + (0×2¹) + (1×2⁰) + (0×2⁻¹) + (1×2⁻²) + (1×2⁻³) = 5.375₁₀.
- The dot in numbers is called the "radix point" in non-decimal bases.
Key Terms & Definitions
- Positional Number System — A number system where a digit’s value is determined by its position and base.
- Binary (Base 2) — System using two symbols: 0 and 1.
- Octal (Base 8) — System using digits 0 through 7.
- Hexadecimal (Base 16) — System using 0–9 and A–F for 10–15.
- Bit — A single binary digit.
- Byte — Group of 8 bits.
- Radix Point — The general term for the "dot" in any base, not just decimal.
- Kibibyte (KiB) — 1,024 bytes (2¹⁰); binary-prefixed unit.
- Kilobyte (kB) — 1,000 bytes (10³); metric-prefixed unit.
Action Items / Next Steps
- Prepare for the next lecture on converting decimal values to other bases.