Binary Data Types
Binary Data Types
The only types of data used by early computers were text and numbers. One reason for this was that no one had invented a way to display or print anything else - certainly not images on a screen! Monitors were just white or light - green characters appearing on a black background.
Character (character, chr) called text or strings when there is a sequence of them
Integer numbers
Floating - point numbers
Fixed - point numbers
Boolean: logical values that can be only true or false.
Today computers must also handle audio, images, video and animation, which are types of data common in multimedia.
Representing text using binary.
A common method to represent text data is called ASCII (pronounced “as-kee”) and was published in 1963. The letters stand for American Standard Code for Information Interchange.
ASCII uses 7 bits, allowing 128 different possible codes, with the eighth one sometimes used as a check bit to see if the message was received correctly.
This decision was based on early teleprinters, where paper tape could fit only eight holes across. Holes represented a one. Eight bits can represent 28 = 256 different symbols. Everyone at the time thought that this would be more than enough, as in English there are only 26 letters of the alphabet, upper and lower cases, numerals 0-9, punctuation and some other special symbols.
When we type words in at the keyboard, the signals travel from the keys to the CPU. At this stage of the journey the binary codes are called keyboard scan codes. The computer, however, receives these scan codes and translates them into ASCII to represent the character.
Here is a small snippet of binary ASCII code:
This is difficult to read, which is why ASCII tables are often written in decimal form. The binary above in decimal looks like this:
66 73 78 65 82 89
See if you can translate this code into a word using the ASCII table in Table 2.4
Task 8: Building an ASCII translator
In this activity you will use a spreadsheet to create a translator for binary ASCII code. We have formed the beginning of a well-known joke about binary. Your task is to discover the rest of the joke and explain it!
You will need to use Fill down and Look up tables.
What about other languages?
By using bits ASCII can represent 256 different symbols. But computers are not only expected to handle the 26 upper case and 26 lower case Roman or Latin characters used in English.
There are many alphabets in use throughout the world.
What about the Russian or Arabic alphabets and how do we represent the many Chinese characters?
To solve this problem another system called Unicode was invented. To make it easy to switch, ASCII was included as part of Unicode. Thus, the decimal value of 84 represents uppercase “T” in both systems.
Unicode allows as many as 1 1 1 4 1 1 2 possible characters. At present, only about 10% of these have been used.
Task 9: Reading 8-bit ASCII Codes
ASCII is short for American Standard Code for Information Interchange. Most computers use the ASCII (ask-ee) code to represent English characters as numbers. For example, the uppercase letter ‘A’ is represented as 01000001. Using our knowledge of binary codes, we can work out that this is the decimal
number 65.
Complete the following document on Google Classroom. See if you can find the patterns to help complete the code.