Learning Outcomes
Students should be able to:
• describe how a number is converted to a binary pattern for storage in a computer;
• demonstrate understanding of the following units of data; – Bit; – Nibble; – Byte; – Kilobyte; – Megabyte: – Gigabyte; and – Terabyte;
• demonstrate understanding of the following types of character representation: – ASCII (7-bit and 8-bit); and – Unicode;
• demonstrate understanding of and use number representation and convert between denary, binary and hexadecimal;
• perform the addition of two bytes and explain the meaning of overflow.
• demonstrate understanding of and use Boolean operators (AND, OR and NOT) and truth tables;
Converting to a Binary Pattern In all modern computers memory can either be ON or OFF. On is indicated by 1 and off is indicated by 0. The code will consist of a string of 1’s and 0’s. Each 1 or 0 is called a bit – Binary digit.
To understand the binary system it is important to think about how the decimal (denary) system works. For example the number 134 represents one hundred, three tens and four ones
100 10 1
1 3 4
Moving from left to left each digit is worth ten times the previous one, this is a base ten number system.
However the binary system uses a base two system, therefore as we move from right to left each digit is worth twice as much as the previous one.
Again use the example of 134:
128 64 32 16 8 4 2 1
1 0 0 0 0 1 1 0
Digital data can be classified using the following units of storage.
Bit A single 1 or 0
Nibble 4 bits
Byte 8 bits
Kilobyte 1024 bytes
Megabyte 1024 kilobytes
Gigabyte 1024 Megabytes
Terabyte 1024 Gigabytes
Standard ASCII
ASCII stands for American Standard Code for Information Interchange. It’s a 7-bit character code where every single bit represents a unique character. The first 32 characters in ASCII are unprintable and used for controlling peripheral devices such as printers. Characters 32 to 127 represent upper and lower case letters, numbers, punctuation marks and symbols. The first bit is a parity bit, meaning it is just there to ensure each byte has 8 bits bit it holds no value.
Extended ASCII
Extended ASCII uses 8 bits so it can represent 256 characters. The 8-Bit ASCII codes only cover the unaccented characters of the English language. Below is a partial table for the ASCII codes for common symbols and letters of the alphabet:
Unicode
Unicode Unicode is a world-wide character encoding standard. Compared to older encoding systems, Unicode simplifies character and string manipulation. Unicode enables universal data exchange by using a single binary file for every possible character code. Remember other langauges have a further variety of characters they use and Unicode takes this into account. Unicode is 16 bit meaning it can hold over 60,000 characters.
Hexadecimal This system is a base 16 number system. To account for all 16 possibilities it uses the digits 0 – 9 and characters A–F. The advantage of this system is that it is easy to convert from binary to hexadecimal and it is easy to read and write down the hexadecimal equivalent of each number.
To convert between Hexadecimal and Binary, we use the first 4 bits to represent the first value in the Hex code and the last 4 bits to represent the second number in the HEX code. To convert between Hex and binary we simply reverse the process.
Binary addition is an easy calculation to perform and very similar to how decimal numbers are added together. Two numbers are lined up; one under the other, then starting from the right add each column, recording the result and carry as you go along. There are 4 possibilities when adding:
0+0 = 0
0+1 = 1
1+1 = 2 which is 10 in binary,
1+1+1 (carried over) = 3 which is 11 in binary, which is 1 with a carry of 1
When performing binary addition if the answer of the addition is greater than 255, then we cannot represent that number using 8 bits. This is caused an overflow error and we will need 9 bits to represent the answer accurately.
Possible Exam Questions
Convert the following denary numbers to binary (4 Marks)
100
50
249
7
Convert the following binary numbers to decimal (4 Marks)
00100101
11111111
11001010
10010011
Convert 3 TB into KB (2 Marks)
If a typical song is 6 MB how many songs can be stored in a 4 GB Hard drive (4 Marks)
Explain why 8 bit ASCII can hold more characters than 7 bit ASCII. (2 Marks)
Most modern computer systems now use Unicode to represent characters, why is this? (2 Marks)
Convert the following denary numbers to HEX (3 Marks)
48
100
180
8.Convert the following Hex numbers to binary (3 Marks)
4B
11
A9
9.Convert the following binary numbers to Hex (3 Marks)
00101100
11010011
11001001
10. Complete the following binary additions: (3 Marks)
01100111 00110101 11001000
+ 10001000 +11000111 +01111111
11. Explain what is meant by an overflow error. (2 Marks)