Skip to content

Number Systems

  • Binary (Base 2): Uses digits 0, 1
  • Octal (Base 8): Uses digits 0-7
  • Decimal (Base 10): Uses digits 0-9
  • Hexadecimal (Base 16): Uses digits 0-9, A-F
  • Positional Number System: Each digit’s value depends on its position
  • Multiple Representations: Same binary pattern can represent different values depending on the number system used
    • Example: could be 10, -2, -5, or -6

Use positional notation:

Group binary digits in sets of 3 (from right):

Group binary digits in sets of 4 (from right):

  1. Sign-and-Magnitude
  2. Ones’-Complement
  3. Two’s-Complement
  • MSB (Most Significant Bit) is the sign bit:
    • 0 = Positive
    • 1 = Negative
  • Advantages:
    • Widely used in modern systems
    • Simplifies arithmetic operations
    • Only one representation for zero
  • Process: To get negative of a number:
    1. Invert all bits (ones’-complement)
    2. Add 1 to the result
  • Uses negative powers of 2 for digits after the binary point
  • Example:

Method: Multiply by 2, take integer part, repeat with fractional part

  • Example: Convert to binary
    • → 0
    • → 1
    • → 1
    • Result:
  • Some decimal fractions cannot be exactly represented in binary
  • Example: (repeating)
  • This leads to precision issues in computer calculations

The most common floating point representation:

SignExponentMantissa/Significand
1823
SignExponentMantissa/Significand
11152
  1. Sign Bit: 0 for positive, 1 for negative
  2. Exponent: Biased representation (actual exponent + bias)
    • Single: bias = 127
    • Double: bias = 1023
  3. Mantissa: Fractional part (normalized, implicit leading 1)

  • Zero: Exponent = 0, Mantissa = 0
  • Infinity: Exponent = all 1s, Mantissa = 0
  • NaN (Not a Number): Exponent = all 1s, Mantissa ≠ 0
  • Denormalized: Exponent = 0, Mantissa ≠ 0

Single precision representation of :

  1. Convert to binary:
  2. Normalize:
  3. Sign: 0 (positive)
  4. Exponent:
  5. Mantissa:
  • Real-world signals: Continuous/analog form
  • Digital systems: Model these as 0s and 1s
  • Conversion needed: Between analog and digital representations