Data Represenation Notes

Document Sample
Data Represenation Notes Powered By Docstoc
					Hamilton Grammar School Learning Criteria & Self Evaluation
ICT Department Higher Computing

Hamilton Grammar School ICT Department

Learning Criteria & Self Evaluation 2008 - 2009 Higher Computer Systems Student Name: __________________________
Complete the smiley or colour it in - for each bit of information in this book (but only for the pages you are told to read)


I know exactly what this means and can explain it


I know what this means but I find it hard to explain


I don’t know at all what this means Help Me Please!

Page 1

Hamilton Grammar School Learning Criteria & Self Evaluation Unit 1 – Data Representation The Binary System Computers use the binary numbering system because Computers are two state machines, with states on and off. The binary numbering system is a two state counting system using 1’s and 0’s which can easily be used to represent the states in a computer system. Advantages are that if voltage degradation occurs the value is still preserved within a transistor. There are less complex rules of addition to “teach” the processor. It is also easy to represent the states in storage devices. Representing positive numbers in The Binary Numbering System
Decimal number Binary Number 34 128 0 64 0 32 1 16 0 8 0 4 0 2 1 1 0 ICT Department Higher Computing

Decimal number Binary Number

117 128 0 64 1 32 1 16 1 8 0 4 1 2 0 1 1

Page 2

Hamilton Grammar School Learning Criteria & Self Evaluation Representing Negative numbers in Binary Signed Bit Notation Uses the most significant bit (the left hand side bit) to indicate a positive or negative number.  This gives two representations of zero. Positive zero and negative zero  It also sacrifices some range by using 1 bit to indicate positive or negative 1000 0000 – Negative 0 0000 0000 – Positive Zero
ICT Department Higher Computing

Two’s Compliment Notation Only one representation for zero! To Convert: - 71
Decimal number Binary Number Convert to Binary Invert Add 1 -71 in two’s compliment 71 128 0 1 1 64 1 0 0 32 0 1 1 16 0 1 1 8 0 1 1 4 1 0 0 2 1 0 1 1 0 1 0

10111010

Page 3

Hamilton Grammar School Learning Criteria & Self Evaluation
Converting back? Just repeat the process Two’s Compliment Number 1 0 1 0 1 1 1 1 (note that the leading 1 means negative!) 128 1 0 0 64 0 1 1 32 1 0 0 16 0 1 1 8 1 0 0 4 1 0 0 2 1 0 0 1 1 0 1 ICT Department Higher Computing

Invert Add 1

1 0 1 0 1 1 1 1 in Decimal -81

Representing Real Numbers Real Numbers are represented in Binary using Floating Point Representation. This uses a Mantissa to represent the actual number and an exponent which indicates how many places to “float” the decimal point. In this example we will use 16 bits for the mantissa and 8 for the exponent. Converting to Floating Point - 27.75 2048 1024 512 256 128 0 0 0 0 0 mantissa 64 0 32 0 16 1 8 1 4 0 2 1 0.5 0.25 0.125 0.0625 1 1 1 1 0 0

0000000110111100

Looking at our example we need to “float” the point 12 places 12 in binary (using 8 bits) 00001100

27.75 in Floating Point 0 0 0 0 0 0 0 1 1 0 1 1 1 1 0 0 * 2 ^ 0 0 0 0 1 1 0 0

Page 4

Hamilton Grammar School Learning Criteria & Self Evaluation
Accuracy of numbers using Floating Point Floating Point Numbers are difficult to use as when multiplying two of the numbers together the closest we can represent the number will be an approximation. Increasing the number of bits for the Mantissa will increase the precision. Think of it as being given more space to be specific about the length of something. Increasing the number of bits for the Exponent will increase the range of numbers which can be represented. You will be able to move the decimal place more. ICT Department Higher Computing

ASCII Code American Standard Code for Information Interchange is a standard code which we can use to exchange information from computer to computer. Ascii code is a 7 bit code which allows for 128 characters. Extended Ascii can be used in the case where more characters are required. All of the characters which Ascii can represent are known as the Character Set. Included in the Character set are control characters. These control the print head (with instructions like new line, tab etc) they are non printable as they are not seen on the screen!

Page 5

Hamilton Grammar School Learning Criteria & Self Evaluation
Unicode Ascii code only has 7 bits available to represent characters. Unicode is a 16 bit code which allows for 65, 536 characters. This is much more important in today’s society. As Ascii is limited to 7 bits it has problems representing all of the characters in world use today. Unicode has ample space to store them. Storing Graphics The bit map representation of Graphics stores a collection of bits which represent a graphic like so ICT Department Higher Computing

There are two methods of storing graphics Bitmapped Graphics Bit mapped graphics only remember which colour each pixel is. They do not recognise placing shapes on top of another.

Page 6

Hamilton Grammar School Learning Criteria & Self Evaluation
Bitmapped graphics used fixed resolution, this means that no matter how good your printer is, it is always printed at the resolution which you save the graphic. With bitmap graphics you can zoom in and edit individual pixels. A bitmap graphic always uses the same amount of memory. It saves every pixel on the screen – even if there is nothing on there! Vector Graphics Vector Graphics store their images as separate shapes. It saves the attributes of the objects on the image rather than all the pixels. This obviously has less memory requirements. Saving things like the coordinates, the colour etc Increasing the complexity of an image has no effect of the amount of backing storage required with a bitmapped graphic – it is always the same Increasing the complexity of an image which is saved as a vector graphic will increase the backing storage requirements Calculating Backing Storage Requirements What you need to know – Length of image Height of Image Colour Depth in bits Resolution ICT Department Higher Computing

Calculate thus: (length * resolution) * (height * resolution) * bit depth

Page 7

Hamilton Grammar School Learning Criteria & Self Evaluation
This image uses 256 colours and measures 3 inches by 4 inches. It has a resolution of 250 dpi Number of Pixels = (3 * 250 ) * (4 * 250) = 750 000 pixels Colour Depth = 8 bits ( 8 bits can represent 256 different numbers) Bits = 750 000 * 8 = 6 000 000 bits Bytes= 6 000 000 / 8 = 750 000 bytes Kilobytes = 750 000 / 1024 = 732.41 Kb Compression Lossy Compression Lossy Compression loses some of the data in the original image by getting rid of some of the data. To do this it uses complex mathematical coding, it can reduce the file size more than lossless compression. Repeated compression can reduce the file size and make it look “rough”. It may also introduce some things to the image that weren’t there before compression Lossless Compression This means that no data is lost from the original image. One way of doing this is to simply store repeated colours in a row (it does this by storing say the colour blue and how many repeated blue pixels there are) ICT Department Higher Computing

Page 8

Hamilton Grammar School Learning Criteria & Self Evaluation
Compression can save a lot of space in memory. This means it will be quicker to transmit via email, download over internet pages and leave a lot of backing storage memory free for other things Compression can affect the overall image quality, repeated compression can make the image useless. Compression can also introduce random pieces into the image that didn’t exist before compression. ICT Department Higher Computing

Page 9


				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:1789
posted:1/29/2009
language:English
pages:9