Characters

Cards (19)

  • Binary can be used to represent characters
  • Alphanumeric characters are used to make words and strings. They include uppercase and lowercase letters, the digits 0-9 and symbols like ^ + and £
  • Computers are unable to process these characters directly as they only process binary code. So they need a way of converting these characters to binary code and vice versa. They can do this using character sets
  • Don't mistake a character set for a font. A character set is what determines the letter - the font you use just displays that letter in a certain way
  • Charater sets are collections of characters that a computer recognises from their binary representation
  • Character sets also contain special characters which do certain commands (e.g. enter and delete)
  • Pressing a button on your keyboard sends a binary signal to the computer telling it which key you pressed. The computer then uses the character set to translate the binary code into a particular character
  • The number of bits you'll need is based on the character set
  • Different character sets can have different amounts of characters. The number of characters in a character set determines how many bits you'll need
  • ASCII is a commonly used character set in the English-speaking world. Each ASCII character is given a 7-bit binary code - this means it can represent a total of 128 different characters, including all the letters in the English alphabet, numbers, symbols and commands
  • An extra bit (0) is added to the start of the binary code for each ASCII character. This means each ASCII character fits nicely into 1 byte
  • The codes for numbers, uppercase and lowercase letters are ordered with symbols and commands scattered around
  • Character - Binary - Hex - Decimal
    Backspace - 0000 1000 - 8 - 8
    0 - 0011 0000 - 30 - 48
    1 - 0011 0001 - 31 - 49
    = - 0011 1101 - 3D - 61
    A - 0100 0001 - 41 - 65
    B - 0100 0010 - 42 - 66
    ] - 0101 1101 - 5D - 93
    a - 00110 0001 - 61 - 97
    b - 0110 0010 - 62 - 98
  • Unicode comes in several different forms and tries to cover every possible letter or symbol that might be written
  • Unlike ASCII, Unicode uses multiple bytes for each character
  • The best thing about Unicode is that it covers all major languages, even those that use a completely different alphabet like Korean
  • The first 128 codes in Unicode are the same as ASCII
  • You can work out the size of a text file using the formula:
    File size (in bits) = number of bits per character x number of characters)
  • A text file that uses 8 bits per character (like ASCII) and contains 200 characters will have a file size of 8 x 200 = 1600 bits