Presentation is loading. Please wait.

Presentation is loading. Please wait.

Shawlands Academy Higher Computing Data Representation.

Similar presentations


Presentation on theme: "Shawlands Academy Higher Computing Data Representation."— Presentation transcript:

1 Shawlands Academy Higher Computing Data Representation

2 1 Data Representation 1.2 Numbers Numbers are converted to binary – number base 2 Example of 154 represented as a binary number 1286432168421 10011010 128+0 +16+8+0+2+0 =154

3 1 Data Representation 1.2 Numbers 269 234R1 217R0 28R1 24R0 22 21 20R1 How to convert decimal to binary e.g. 69 Giving 1000101 Keep dividing by 2 Note the remainders Read the remainders from the bottom up

4 Range of Numbers Using 1 byte for storage gives 256 (2 8 ) possible numbers in the range 0 - 255 2 bytes gives 65536(2 16 ), 0 - 65535 Increasing the size of the storage for numeric data increases the range of numbers which can be stored.

5 Data Representation 1.3 Integers Positive numbers  Converted directly to binary  2 bytes = 16 bits gives 0 to 2 16 -1 or 0 to 65535

6 Negative Numbers - more difficult One of the 16 bits available has to be used to store the sign (- or +) – this reduces the range of numbers to –32768 to 32767 This is called Signed Bit representation

7 Problems with Signed Bit Representation Does not always work because: Addition does not work properly (-5+- 10 gives 15) Two values for 0 (00000000 and 10000000)

8 To overcome problems Twos Complement –Addition works and there is only one zero –All 0’s are converted to 1’s and 1’s to 0’s then 1 is added. –To convert 5 to –5 00000101 11111010 +1 11111011 OR 5 OR -5

9 Data Representation 1.4 Real Numbers Real numbers are stored as floating point. E.g 34008.6 is.340086*10 5 In binary 1101.1001 is.11011001*2 100 (the 4is 100 in binary) The mantissa is 11011001 and the exponent is 100 Usually 4 bytes used for mantissa and 2 for exponent Increasing the size of the mantissa increases accuracy Increasing the size of the exponent increases the range of numbers which can be stored

10 1 Data Representation 1.1 Text  Each character is stored as an 8 bit binary code  This is called the ASCII system.  E.g. A is stored as 65 (01000001 in Binary).  1 byte can store 256 (2 8) different characters – enough for all the keys on the keyboard and several foreign symbols (for currency etc )

11 Data Representation 1.5 Bit-mapped Graphics For a graphic drawn in a painting package the computer stores the data as a 2 dimensional array of pixels. Each pixel in a black and white image is 1 bit in memory. 2 bits can store 4 colours or shades of grey.(2 2 ) 8 bits can store 256 colours.(2 8) 2 bytes can store 65,536 colours.(2 16 ) Bit mapped images are often generated from scanned pictures and can create huge files. Editing can be performed at pixel level. When images are enlarged they can become “lumpy” and lose definition.

12 Data Representation 1.6 Vector Graphics Sometimes called object-orientated graphics. Used in CAD, drawing and publishing packages. Describes an object by its attributes (start & end positions, thickness & colour of lines etc.) Editing at pixel level not possible. Can be resized without losing original sharpness. Can be placed over another graphic without rubbing it out as happens with bit-mapped.


Download ppt "Shawlands Academy Higher Computing Data Representation."

Similar presentations


Ads by Google