LEARNING OBJECTIVES:
The specification states - you should be able to:
Bits & Bytes:
explain the terms bit, byte, kilobyte, megabyte, gigabyte and terabyte;
demonstrate that 2n different values can be represented with n bits (maximum n = 8);
Binary & Decimal:
perform conversions from decimal to binary and from binary to decimal for a maximum of 8 bits;
demonstrate how the two’s complement system can represent positive and negative numbers in binary using 8 bits;
demonstrate how American Standard Code for Information Interchange (ASCII) and Unicode are used to represent characters;
Units of Storage
Computers use a variety of memory techniques to store data. All data is stored in digital format using a number system known as binary. A Binary digIT (known as a BIT) is either a 0 or a 1. It is the smallest unit of storage. When bits are grouped together, typically eight, it is referred to as a byte. A single character (such as a letter or digit) is typically represented by a byte. The capacity of storage in a typical computer or peripheral is measured in bytes. Multiples of bytes are referred to as:
Remember 2 to the power of 10 is 2x2x2x2x2x2x2x2x2x2=1024
These terms are usually used to describe disk capacity, or data storage capacity, and system memory. Today, Terabyte is the common term being used to describe the capacity of a hard drive.
Question: Calculate the number of bytes in a 2 Gigabyte USB memory pen?
2 x 1073741824 bytes (2 power 30) = 2147483648
The range of values that can be represented using n bits
The number of bits used will determine the number of different values that can be represented. The greater the number of bits the greater the number of values. For example if we use 3 bits, this will allow eight different values as shown below (ie 23= 8 combinations). 2x2x2=8
Exam tip: They could ask you the highest and lowest value e.g. 5 bits. Lowest value = 0 and the Highest value =31. Remember range is 0-31. Therefore, highest value is not 32.
If we consider 8 bits (2 power 8) (2x2x2x2x2x2x2x2=256) therefore, range 0-255
the lowest value will be 0 and the highest value will be 255 as shown below.
The bit position on the right hand side is referred to as the least significant bit (LSB) whereas the bit position on the left hand side is referred to as the most significant bit (MSB)
MSB LSB
Therefore in general terms 2n different values can be represented with n bits. Although 28 has a value of 256, the highest value is 255 because we include zero in the range of combinations of an 8 bit pattern. To calculate the range of values for n bits we can apply the following rule 0 – (2n-1).
Question: Calculate the range of values using 7 bits?
27 = 128 – 1 = 127
Range is 0-127
(You take away 1 because you start at zero)
Conversions from decimal to binary for a maximum of 8 bits
In the decimal (sometimes referred to as denary) numbering system, each integer number column has values of units, tens, hundreds, thousands, etc. Mathematically these values are written as index numbers starting 100, 101, 102, 103 etc. Then each position to the left of the decimal point indicates an increased positive power of 10.
103 102 101 100
1000 100 10 1
The Binary Numbering System is used in all digital and computer based systems. Binary numbers follow the same set of rules as the decimal numbering system. The main difference is the decimal system uses powers of ten whereas the binary numbering system works on powers of two. Each binary place value can be converted to an equivalent decimal number.
To covert from decimal to binary we can use the “Repeated Division by 2” method. You write down the decimal number and continually divide-by-2 to give a result and a remainder of either a “1” or a “0” until the final result equals zero.
For example covert the decimal value 41 to binary.
41 divided by 2 = 20 remainder 1 ( Least significant BIT)
20 divided by 2 = 10 remainder 0
10 divided by 2 = 5 remainder 0
5 divided by 2 = 2 remainder 1
2 divided by 2 = 1 remainder 0
1 divided by 2 = 0 remainder 1 ( Most significant BIT)
Therefore 41 = 101001 in binary. Remember the LSB is the rightmost value and the MSB is the leftmost value.
Tip: An alternative way is to break the decimal number into binary place values.
Therefore 41 = 32+8+1 =1010012