# Data Representation

Positive Integers, Negative Integers and Real Numbers.

A computer represents positive integers using The Binary Number System. It uses the numbers 1 and 0 to represent numbers in the computer. It is simple in which it only has to generate and detect 2 voltage levels, it also means that calculations are kept simple. There are only 4 rules for addition/subtraction/division/multiplication. Example: the number 200 can be represented as 11001000. There is a simple way of representing a negative number in binary. The first bit of the number to represent whether the number is positive or negative. This is called Signed Bit representation. Example: 011 = 3 111 = -3. This is a problem as it means there are 2 values for zero (000 = 0 and 100 = -0) However, we can use Two’s Complement to represent negative numbers. We do this by changing all the 1’s to 0 and all the 0’s to 1, we then add 1. Example: 5 = 00000101, change all the 1’s to 0 and 0’s to 1 = 11111010 and then add 1 = 11111011. The range of integers which can be stored in two bytes is -32768 to 32767. This is still a problem due to the increased memory needed to store the large number of bits needed.. And so we use Floating Point Notation. The real number is stored as 2 separate bits of data. The mantissa holds the number without the point and the exponent holds the number of places that the point must be moved in the original number to place it at the left hand side. If the size of the mantissa is increased then the accuracy of the number held is increased and if the size of the exponent is increased then the range of the numbers which can be stored is increased.

Text

A list of all characters a computer can process and control is called the character set and each character is represented by a unique binary code. The internationally agreed code used to represent American English is the American Standard Code for Information Interchange (ASCII). It used 7 bits to represent each character from 0000000 to 1111111. This can be used to store 128 characters. Extended ASCII was then created and uses 8 bits to represent each character from 00000000 to 11111111. This can be used to store 256 characters. This is a problem as it was based on European alphabets and don’t contain other characters such as Arabic or Japanese characters. The solution to this is Unicode. It uses 16 bits to represent each character which can be used to store 65,536 characters.

ASCII Table:

Bitmapped Graphics

An image is made up of pixels, which are tiny dots. The resolution determines the quality of the picture. A high resolution image will have more pixels than a low resolution image. The image is saved in a two dimensional array using binary numbers to represent the colours in the pixels. An image with 2 colours means each pixel is represented using one bit. An image with 4 colours means each pixel is represented using 2 bits. The number of bits used to represent the colour of the pixels is called the bit depth. To store an image which is 5×7 inches at 600 dpi using 65,536 colours, 24.03 mb of memory would be required. This is because we times the size of the image by the dpi.. (5×600)x(7×600) = 12600000. We then times this by 2 bytes.. 12600000 x 2 = 25200000 bytes. We then have to divide this by 1024 to get it into Kilobytes.. 25200000/1024 and then by 1024 again to get it into megabytes.. = 24.03 mb. In a bitmapped graphic the file area is fixed. The graphic can also be edited to pixel level. However, enlarging the image causes a loss in quality, the file size is very large and the file is printed at the same resolution as it is shown on the screen.

Bitmapped Graphic: