Representing numbers

Cards (48)

  • Transistors
    Element of a CPU that acts like a switch
  • Binary system
    Has 2 states (ON or OFF)
  • Bit-depth of operating systems always doubles over time (e.g. 16 bit, 32 bit, 64 bit)
  • Bit
    Single binary digit
  • With four binary digits, 16 different values can be represented
  • 2^2 = 2x2
  • 2^3 = 2x2x2
  • Humans have evolved to use a base-10 counting system
  • The image created has a bit-depth of 1 bit (black and white)
  • Any number to the power of 0 is equal to 1
  • Place values for decimal system
    • 100,000
    • 10,000
    • 1,000
    • 100
    • 10
    • 1
  • Place values for binary system
    • 32
    • 16
    • 8
    • 4
    • 2
    • 1
  • Byte
    8 bits
  • In 8-bit binary, the maximum number of values is 256 (0 through 255)
  • Place values for 8-bit binary
    • 128
    • 64
    • 32
    • 16
    • 8
    • 4
    • 2
    • 1
  • The decimal value represented in the given 8-bit binary is 115
  • Converting 8-bit binary to decimal

    • 11001101 = 205
    • 01000100 = 68
    • 10101010 = 170
    • 11110000 = 240
    • 10111100 = 188
  • You can't count up to 256 in 8-bit binary because it would require 9 bits
  • Method 1 for converting decimal to binary
    1. Start at the left and ask if the number is equal to or greater than the place value
    2. If less, place a 0
    3. If greater, place a 1 and subtract the place value to find the remainder
  • Method 2 for converting decimal to binary

    Divide the number by 2 repeatedly, recording the remainders
  • Number of bits in units
    • Nibble: 4
    • Byte: 8
    • Kilobyte: 8,000
    • Megabyte: 8,000,000
    • Gigabyte: 8,000,000,000
    • Terabyte: 8,000,000,000,000
  • An image file of 213,624,133 bits is 26.7 MB
  • Kibibyte
    Equal to 1024 bytes, used in binary systems instead of kilobyte (1000 bytes)
  • There are 8,000,000,000 bits in a gigabyte
  • 2000 MB is equal to 2 GB
  • 1 terabyte is equal to 1,000,000,000 kilobytes
  • Converting binary to decimal
    • 11010101 = 213
    • 01101110 = 110
    • 10101010 = 170
  • Converting decimal to binary
    • 233 = 11101001
    • 153 = 10011001
  • If there are 8 bits in a byte, one megabyte is equal to 8 megabits
  • Bits are binary digits with values of 0 or 1
  • Bits can be combined into groups like letters into words
  • All computer commands and data consist of groups of bits
  • In any number system, the value of a digit is determined by its place value
  • Binary is a base 2 number system
  • Binary numbers can be converted to decimal and vice versa
  • Binary additions
    • 1001111 + 1011101 = 10101100
    0111111 + 1011101 = 10001100 (overflow)
  • How to multiply in binary
    Shift to the left by the power
  • Binary left shifts
    • 00101101 left shift by 3 = 01010101000
    10001101 left shift by 4 = 10011010000
    10110111 left shift by 2 = 11011100
  • How to divide in binary
    Look at first two digits of dividend, compare to divisor, add 1 to quotient, subtract divisor, repeat until remainder is 0
  • Binary right shifts
    • 00101101 right shift by 3 = 00001010
    10001101 right shift by 4 = 00001000
    10110111 right shift by 2 = 00101101