Number Systems - Week 2

Course Overview and Learning Outcomes
  • Academic Context: Week 2 instruction on Number Systems by Marko N. Kostic, Ph.D., P.Eng.

  • Core Objectives:

    • Understand number systems and perform base conversions (CLO2\text{CLO2}).

    • Analyze analog/digital signals and switch-circuit timing (CLO1\text{CLO1}).

    • Construct truth tables, Boolean expressions, and logic circuits (CLO3\text{CLO3}, CLO6\text{CLO6}).

    • Introduce microcontrollers and FPGAs (CLO10\text{CLO10}).

Core Number Systems
  • Decimal (Base 10):

    • Symbols: Ten digits (00 through 99).

    • Positional Weights: Whole numbers scale by positive powers of ten (100,101,102,…10^0, 10^1, 10^2, \dots); fractional components scale by negative powers (10−1,10−2,…10^{-1}, 10^{-2}, \dots).

    • Role: General counting, financial calculation, and physical measurement.

  • Binary (Base 2):

    • Symbols: Two digits (00 and 11).

    • Hardware Mapping: Directly represents physical two-state electronic logic (high/low voltage, on/off).

    • Positional Weights: Powers of two (…,22=4,21=2,20=1\dots, 2^2=4, 2^1=2, 2^0=1; fractions: 2−1=0.5,2−2=0.25,…2^{-1}=0.5, 2^{-2}=0.25, \dots).

    • Key Terms:

    • Least Significant Bit (LSB): Rightmost bit with lowest positional weight (202^0).

    • Most Significant Bit (MSB): Leftmost bit with highest positional weight.

  • Octal (Base 8):

    • Symbols: Eight digits (00 through 77).

    • Positional Weights: Powers of eight (80=1,81=8,82=64,83=512,…8^0=1, 8^1=8, 8^2=64, 8^3=512, \dots).

    • Role: Shorthand for binary sequences (11 octal digit = 33 binary bits); commonly used in Unix file permissions.

  • Hexadecimal (Base 16):

    • Symbols: Sixteen characters: 00 through 99 and letters AA through FF (A=10,B=11,C=12,D=13,E=14,F=15A=10, B=11, C=12, D=13, E=14, F=15).

    • Positional Weights: Powers of sixteen (160=1,161=16,162=256,163=4096,…16^0=1, 16^1=16, 16^2=256, 16^3=4096, \dots).

    • Role: Compact binary representation (11 hex digit = 44 binary bits); used in memory addressing, debugging, and color codes.

Conversion Procedures
  • Base NN to Decimal:

    • Multiply each digit by its positional weight (NnN^n) and sum all evaluated products.

    • Example: FE16=(15×161)+(14×160)=240+14=25410FE_{16} = (15 \times 16^1) + (14 \times 16^0) = 240 + 14 = 254_{10}.

  • Decimal to Base NN:

    • Successively divide the decimal integer by NN, recording the remainder at each step.

    • Continue until quotient is 00.

    • Read remainders in reverse order (bottom-up: first remainder is LSB, last remainder is MSB).

    • Example: 1310÷2→1101213_{10} \div 2 \rightarrow 1101_2.

  • Binary to Hexadecimal:

    • Partition bits into 4-bit nibbles starting from right to left (pad with leading zeros if needed).

    • Map each nibble to its hex value using 8−4−2−18-4-2-1 weighting.

    • Example: 111111102→1111 11102=FE1611111110_2 \rightarrow 1111\,1110_2 = FE_{16}.

  • Hexadecimal to Binary:

    • Replace each hex symbol with its equivalent 4-bit binary group.

    • Example: 9A16→1001 101029A_{16} \rightarrow 1001\,1010_2.

Character and Numeric Encodings
  • ASCII (American Standard Code for Information Interchange):

    • Standard 7-bit character encoding yielding 27=1282^7 = 128 unique codes (00 to 127127).

    • Ranges:

    • Control Characters: Decimal 00 to 3131 and 127127.

    • Digits (0–9): Decimal 4848 to 5757 (301630_{16} to 391639_{16}).

    • Uppercase (A–Z): Decimal 6565 to 9090 (411641_{16} to 5A165A_{16}).

    • Lowercase (a–z): Decimal 9797 to 122122 (611661_{16} to 7A167A_{16}).

  • Binary Coded Decimal (BCD):

    • Encodes each individual decimal digit (00 to 99) into a distinct 4-bit binary nibble (00000000 to 10011001).

    • Nibbles 10101010 through 11111111 are invalid in standard BCD.

    • Contrast: Decimal 451045_{10} is 0100 0101 in BCD, but 1011012101101_2 in pure binary.

    • Role: Directly drives decimal displays (seven-segment displays, digital clocks, calculators) without conversion overhead.

Next Topics
  • Fundamental digital logic gates (AND, OR, NOT, NAND, NOR).

  • Assigned reading: Chapter 3, Sections 3-1 through 3-5.

  • Practical breadboard wiring and datasheet interpretation.