Data Representation

Digital and Analog Signals

  • Analog data: continuous representation of information.
    • Example: Mercury thermometer.
  • Digital data: discrete representation, breaking information into separate elements.
    • Computers use digital data, requiring analog information to be digitized.

Digital Signals

  • Digital signals can degrade but are recoverable; analog signals lose information upon degradation.
  • Digital signals are reclocked to regain their original shape, preventing information loss.

Binary System

  • Early computers used decimal systems; John von Neumann proposed binary data processing in 1945.
  • Binary system simplifies computer design and uses Boolean logic.
  • On/off switches relate to Boolean logic (1/0, True/False, Yes/No).

Number Bases

  • Decimal (base 10): 10 digits (0-9).
  • Binary (base 2): 2 digits (0 and 1), also known as bits.
  • Octal (base 8): 8 digits (0-7).
  • Hexadecimal (base 16): 16 digits (0-9, A-F).

Bits and Bytes

  • 8 bits = 1 byte.
  • 4 bytes = 1 word (in many systems).
  • Number of bits affects accuracy and limits the size of numbers.

Number Systems

  • Positional notation: place value determines the value of a digit.
    • Decimal system: powers of 10.
    • Binary system: powers of 2.
    • Octal system: powers of 8.
    • Hexadecimal system: powers of 16.

Positional Notation Examples

  • Base 10: 527 = 5 \times 10^2 + 2 \times 10^1 + 7 \times 10^0
  • Octal: 6248 = 6 \times 8^2 + 2 \times 8^1 + 4 \times 8^0 = 404{10}
  • Hexadecimal: 6704{16} = 6 \times 16^3 + 7 \times 16^2 + 0 \times 16^1 + 4 \times 16^0 = 26372{10}
  • Binary: 110101102 = 1 \times 2^7 + 1 \times 2^6 + 0 \times 2^5 + 1 \times 2^4 + 0 \times 2^3 + 1 \times 2^2 + 1 \times 2^1 + 0 \times 2^0 = 214{10}

Range of Possible Numbers

  • Formula: R = B^K
    • R = range, B = base, K = number of digits.
    • Example: Base 10, 2 digits: R = 10^2 = 100 (0…99).
    • Example: Base 2, 16 digits: R = 2^{16} = 65,536.

Decimal Range for Bit Widths

  • 1 bit: 2 values (0 and 1).
  • 4 bits: 16 values (0 to 15).
  • 8 bits: 256 values.
  • 16 bits: 65,536 values (64K).
  • 32 bits: 4,294,967,296 values (4G).

Base/Radix

  • The number of different symbols needed to represent a number.
    • Base 10: 0-9.
    • Base 2: 0,1.
    • Base 8: 0-7.
    • Base 16: 0-9, A-F.

Number of Symbols vs. Number of Digits

  • Larger base requires more symbols but fewer digits for a given number.

Counting in Base 2

  • Binary numbers and their decimal equivalents.

Addition Tables

  • Base 10, Base 8 addition tables.

Multiplication Tables

  • Base 10, Base 8 multiplication tables.

Addition Examples

  • Decimal: 6 + 3 = 9
  • Octal: 6 + 1 = 7
  • Hexadecimal: 6 + 9 = F
  • Binary: 1 + 0 = 1

Addition with Carry

  • Decimal: 6 + 4 = 10 (carry the 10).
  • Octal: 6 + 2 = 10 (carry the 8).
  • Hexadecimal: 6 + A = 10 (carry the 16).
  • Binary: 1 + 1 = 10 (carry the 2).

Binary Arithmetic

  • Includes addition, multiplication, and division using Boolean logic.

Boolean Logic

  • EXCLUSIVE-OR: Output is “1” if either input, but not both, is “1”.
  • AND (carry bit): Output is “1” only if both inputs are “1”.

Converting from Base 10

  • Using powers table to convert base 10 numbers to other bases.

Converting from Base 10 to Base 2

  • Example: Converting 42 from base 10 to base 2.

Converting from Base 10 to Base 16

  • Example: Converting 5,735 from base 10 to base 16.

Converting from Base 8 to Base 10

  • Example: Converting 7263 from base 8 to base 10.

Converting from Base 16 to Base 2

  • Using the nibble approach for easier conversion.
  • Example: Converting 1F67 from base 16 to base 2.