Presentation is loading. Please wait.

Presentation is loading. Please wait.

Higher Computing Computer Systems S. McCrossan 1 Higher Grade Computing Studies 1. Data Representation Data Representation – Why do we use binary? simplicity,

Similar presentations


Presentation on theme: "Higher Computing Computer Systems S. McCrossan 1 Higher Grade Computing Studies 1. Data Representation Data Representation – Why do we use binary? simplicity,"— Presentation transcript:

1 Higher Computing Computer Systems S. McCrossan 1 Higher Grade Computing Studies 1. Data Representation Data Representation – Why do we use binary? simplicity, in only having to generate and detect two voltage levels. good tolerance, because a degraded 1 is still recognisable as a 1. calculations are kept simple.

2 Higher Computing Computer Systems S. McCrossan 2 Higher Grade Computing Studies 1. Data Representation Data Representation - Numbers Converting binary to decimal Here is an example of how to convert the binary number 10011010 to a decimal: 1286432168421 1 0 0 11010 = 128 + 16 + 8 + 2 = 154.

3 Higher Computing Computer Systems S. McCrossan 3 Higher Grade Computing Studies 1. Data Representation Data Representation - Numbers Converting decimal to binary Here is an example of how to convert the decimal number 69 to a binary: 2222222222222222 69 34 17 8 4 2 1 0 R 1 R 0 R 1 R 0 R 1 giving 1000101

4 Higher Computing Computer Systems S. McCrossan 4 Higher Grade Computing Studies 1. Data Representation Data Representation - Numbers Positive and Negative Integers The leftmost bit is used to store whether a number is positive or negative. Twos complement representation is used to store both positive and negative numbers. Integer -3 -2 0 1 2 3 Binary 11111101 11111110 11111111 00000000 00000001 00000010 00000011

5 Higher Computing Computer Systems S. McCrossan 5 Higher Grade Computing Studies 1. Data Representation Data Representation - Numbers Positive and Negative Integers To convert 5 to –5 you change all 0s to 1s and vice versa and then add 1. So0 0 0 0 0 1 0 1or5 becomes1 1 11 1 01 0 + 1 1 1 11 1 01 1or-5

6 Higher Computing Computer Systems S. McCrossan 6 Higher Grade Computing Studies 1. Data Representation Data Representation - Numbers Positive and Negative Integers The number of integers which could be stored in one byte ( 8 bits ) is 2 8 = 256 The range of integers which could be stored in one byte ( 8 bits ) is -128 to +127

7 Higher Computing Computer Systems S. McCrossan 7 Higher Grade Computing Studies 1. Data Representation Data Representation - Numbers Real Numbers A real number is a number like 134.78954673. Real numbers are stored in a computer as floating point numbers. In decimal base 10, 34006.8 becomes 3.40068 * 10 4 The ‘4’ is because the point has moved 4 places to the left. The ‘3.40068’ is called the mantissa. The ‘4’ is called the exponent.

8 Higher Computing Computer Systems S. McCrossan 8 Higher Grade Computing Studies 1. Data Representation Data Representation - Numbers Real Numbers The binary real number 1101.0011011101 would be written as where the 2 is because we are working in binary and the 4 is the number of places that the point has moved..11010011011101 * 2 4 The full answer is.11010011011101 *2 100 because the 4 is converted into binary as well. The computer would store the mantissa 11010011011101 and exponent 100.

9 Higher Computing Computer Systems S. McCrossan 9 Higher Grade Computing Studies 1. Data Representation Data Representation - Numbers Storage of Numbers Increasing the size of the storage for numeric data increases the range of numbers that can be stored. Increasing the size of the mantissa increases the accuracy with which the real number can be stored. Increasing the size of the exponent increases the range of numbers that can be stored.

10 Higher Computing Computer Systems S. McCrossan 10 Higher Grade Computing Studies 1. Data Representation Data Representation - Text Each character is stored in the computer as a unique binary code. ASCII character set was introduced so that all computers would use the same codes to represent the same characters The list of characters that a computer can handle is called the character set. Control characters are included in the character set that tell the computer to do things, for instance, take a new page or take a newline.

11 Higher Computing Computer Systems S. McCrossan 11 Higher Grade Computing Studies 1. Data Representation Data Representation - Text ASCII can only represent, at most, 256 characters. However, other alphabets need many more characters, e.g. Japanese and Arabic. The solution was Unicode which uses 16 bits to represent each character. This means it can store 65,536 characters.

12 Higher Computing Computer Systems S. McCrossan 12 Higher Grade Computing Studies 1. Data Representation Data Representation - Graphics Bit mapped Graphics For a graphic drawn in a painting package, the computer stores it as a two-dimensional array of pixels The number of pixels that makes up an image is called the resolution.

13 Higher Computing Computer Systems S. McCrossan 13 Higher Grade Computing Studies 1. Data Representation Data Representation - Graphics Bit mapped Graphics In a black and white display, each white pixel is represented by a 0. In a black and white display, each black pixel is represented by a 1. Only two values, 1 and 0, need to be stored as there are only two colours to be used.

14 Higher Computing Computer Systems S. McCrossan 14 Higher Grade Computing Studies 1. Data Representation Data Representation - Graphics Bit mapped Graphics However, when more than two colours are used we need more memory to store the colour value for each pixel. In an 8 colour display, each white pixel is represented by a 000. In an 8 colour display, each black pixel is represented by a 001. In an 8 colour display, each yellow pixel is represented by a 011.

15 Higher Computing Computer Systems S. McCrossan 15 Higher Grade Computing Studies 1. Data Representation Data Representation - Graphics Bit mapped Graphics The number of bits used to represent the colour of the pixels is called the bit depth. Bit depthColours 1 2 3 8 16 24 2 4 8 256 65536 16777216

16 Higher Computing Computer Systems S. McCrossan 16 Higher Grade Computing Studies 1. Data Representation Data Representation - Graphics Bit mapped Storage Requirements An image, 5in by 7in is stored at 600 dpi in 65536 colours. How much memory would be required to store this image? Pixels used to store image = 5 x 7 x 600 x 600 = 12600000 65536 colours = 16 bits = 2 bytes Amount of memory = 12600000 x 2 bytes = 25200000 bytes = 24Mb

17 Higher Computing Computer Systems S. McCrossan 17 Higher Grade Computing Studies 1. Data Representation Data Representation - Graphics Bit mapped Graphics The advantage of using bit mapped graphics is that you have more control over the graphic as you are able to go into detail and edit the graphic pixel by pixel. The disadvantage of using bit mapped graphics is that each picture or graphic takes up a lot of memory as the colour of each pixel has to be stored. Another disadvantage of using bit mapped graphics is that if you enlarge a bitmap image it becomes ‘blocky’.

18 Higher Computing Computer Systems S. McCrossan 18 Higher Grade Computing Studies 1. Data Representation Data Representation - Graphics Vector Graphics In a CAD or drawing package, the computer stores information about an object by its attributes i.e. a description of how it is to be drawn. For a rectangle it might be: start x and y position length, breadth and angle of rotation thickness and colour of the lines colour fill etc.

19 Higher Computing Computer Systems S. McCrossan 19 Higher Grade Computing Studies 1. Data Representation Data Representation - Graphics Vector Graphics The advantage of using vector graphics is that you edit shapes. This allows you to scale the graphic easily. It also means that vector graphics don’t take up a lot of memory. The disadvantage of using vector graphics is that you are limited to using only the shapes that the package offers. This can mean that only simple graphics can be created.


Download ppt "Higher Computing Computer Systems S. McCrossan 1 Higher Grade Computing Studies 1. Data Representation Data Representation – Why do we use binary? simplicity,"

Similar presentations


Ads by Google