Data Representation

Cards (25)

  • Natural Numbers are positive integers
  • Integers are whole numbers
  • rational numbers are numbers that can be expressed with fractions and ratios
  • irrational numbers cannot be expressed with a fraction, such as Pi
  • Real numbers are both rational and irrational
  • binary is base 2
  • decimal is base 10
  • hexadecimal is base 16
  • computers are made up of millions of switches that turn on and off
  • a bit is the smallest unit of data
  • a byte is 8 bits
  • ASCII is made to represent the English alphabet using 7 bits
  • Unicode uses 8 bits, it also represents characters from multiple languages
  • transmission errors: electrical interference, power surges, synchronisation issues, wear and tear in cables
  • some ways to check for errors include: parity bits, majority voting, check digits, and checksums
  • Parity Bits
    1. computers are either odd or even parity
    2. when sending a byte, one bit is the parity bit
    3. they can only check for errors and not correct them
  • Majority Voting
    1. each bit is sent three times
    2. if any bits are flipped, the receiving computer uses majority rule to fix it
    3. errors can sometimes get through if there is a majority
  • Check Digits
    1. a check digit is an additional digit at the end of a long line of numbers
  • Checksums
    1. a total sum of all bytes id calculated
    2. the sum is often sent with the data
  • an overflow error is when the carried bit exceeds the byte
  • negative numbers are represented with twos compliment, where 11111111 is -1
  • to find the compliment of a number you:
    1. flip it
    2. add 1
    e.g. 01001101 =77 > 10110010 = - 76 > 10110011 = -77
  • you can use twos compliment to do subtraction
  • to do fractions you add a point in the middle of the byte. The left is the number and the right is the decimal starting at 2^-1, then 2^-2, and so on
  • floating point uses 16 bits. 1 for the sign, 9 for the number, 6 for the exponent. rounding is necessary