Lecture 4

Cards (20)

  • Octal Number System
    Number system with base value 8, uses digits 0-7
  • Converting Octal to Decimal
    1. Multiply each digit with place value
    2. Add results
  • Octal numbers are useful for representation of UTF8 numbers
  • Converting Decimal to Octal
    1. Divide decimal by 8
    2. Remainder becomes least significant digit
    3. Quotient becomes next dividend
    4. Repeat
  • Octal-Decimal Conversion
    Changing representation of a number from one base to another
  • Octal Numbers
    • Use digits 0 to 7
    • Have a base of 8
  • Converting Octal to Decimal (Steps)
    1. Multiply each digit with place value
    2. Add results
  • Converting Binary to Octal
    1. Divide binary into groups of 3 digits
    2. Convert groups to equivalent octal digits
  • Hexadecimal Number System

    Number system with base value 16, uses digits 0-9 and A-F
  • Hexadecimal numbers are useful for handling memory address locations
  • Decimal to Hexadecimal Conversion

    • Divide decimal by 16
    • Remainder becomes least significant digit
    • Quotient becomes next dividend
    • Repeat
  • Converting Binary to Hexadecimal
    1. Divide binary into groups of 4 digits
    2. Convert groups to equivalent hex digits
  • Binary Addition
    Carry over occurs when result equals 2
  • Binary Subtraction
    1. Borrow 1 when subtracting 1 from 0
    2. Reduce 1 in borrowing column by 1
  • 1's Complement
    Toggle all bits, 0 to 1 and 1 to 0
  • 2's Complement

    1 added to 1's complement
  • In 2's complement, MSB represents sign, 0 for positive, 1 for negative
  • Finding 2's Complement
    Start from LSB, find first 1, then flip all bits to the left of that 1
  • If all bits are 1 in 1's complement, add 1 to get 2's complement
  • Minus numbers are represented in 2's complement