Bits

Cards (40)

  • Computers comprise billions of switches to turn voltage on and off
  • How an electrical circuit works
    1. Battery
    2. Switch
    3. Lamp
  • A computer is an electrical device that works in the same way as a light bulb connected to a battery
  • Data is stored and processed using combinations of ON and OFF voltages

    ON = 1, OFF = 0
  • Voltages are 'transferred' around the parts of the computer using wires
  • Binary value 21
    Represented as 10101 in binary
  • Bit
    Individual digit in a binary value
  • For n bits a computer can produce 2^n different combinations of values
  • Byte
    Collection of 8 bits
  • Computers process and store large amounts of bytes, often in the order millions or billions
  • Number prefixes used to summarise large quantities of bytes
    • kilo (kB) - 10^3
    • mega (MB) - 10^6
    • giga (GB) - 10^9
    • tera (TB) - 10^12
  • Traditionally computer scientists used the same number prefixes to refer to groups of bytes, but used base 2 instead of base 10
  • New prefixes established in 1998 to represent multiples of base-2

    • kibi (KiB) - 2^10
    • mebi (MiB) - 2^20
    • gibi (GiB) - 2^30
    • tebi (TiB) - 2^40
  • When the 'M' key is pressed on the keyboard, the computer understands the binary pattern 0100 1101
  • ASCII

    American Standard Code for Information Interchange, established in 1963 to encode symbols in the English alphabet using a 7-bit character set
  • Limitations of using a 7-bit character set: only 128 possible binary codes
  • Every character on the keyboard is represented by a binary value, with uppercase and lowercase having different values
  • A standard keyboard has many characters, requiring more than 7 bits to represent them all
  • Character '9' in ASCII
    Represented by the binary byte 00001001
  • The character form of the decimal digit '9' is different from its pure binary representation
  • The first 32 ASCII codes are control characters, e.g. Backspace, Carriage Return, Escape
  • An eighth bit was later introduced in ASCII for extra characters like © and ®
  • The Unicode system was introduced to standardise the encoding of characters from all languages, using 16-bit or 32-bit encodings
  • Disadvantage of using up to 4 bytes per character in Unicode: increased storage and transmission requirements
  • Transmission errors can cause bits to flip from 1s to 0s and 0s to 1s
  • Techniques for error detection
    • Parity bits
    • Majority voting
    • Check digits
    • Checksums
  • When an error is detected, the data cannot be corrected, only a request to resend the data is invoked
  • Parity bits
    Used to make the total number of 1s or 0s in a byte (including the parity bit) odd or even
  • Parity bit values using even parity
    • 1 0 0 1 0 1 0 Parity bit
    • 0 1 0 1 1 0 1 Parity bit
  • An erroneous byte could escape detection despite using a parity check bit
  • Majority voting
    • Each bit of a message is sent three times, and the recipient uses the majority rule to assume the correct bits
  • Drawbacks of majority voting: increased transmission time and storage requirements
  • Check digit
    An additional digit at the end of a string of numbers, designed to check for mistakes in input or transmission
  • Calculating the check digit using the Modulo 10 system
    1. Multiply digits by weights
    2. Add all the numbers
    3. Find the remainder when divided by 10
    4. Subtract the result from 10
  • Checksum
    A total sum of all bytes in a transmission of data, calculated using an algorithm and sent with the data
  • Flaws or weaknesses in a simple checksum example: easy to calculate and detect
  • Electrical signals operated by switches 'create' a binary pattern
  • ASCII and Unicode are used to represent characters
  • An ASCII digit is not the same as its direct binary translation
  • Transmission errors can be detected using a range of methods