Number Representations What all the numbers can mean.
General Idea In a computer, all information is binary numbers Those numbers have to be interpreted to become the information we want In other words, numbers can represent other things. Another way to think of Digital is “representable by numbers”
ASCII American Standard Code for Information Interchange cipher(code) to convert numbers to symbols 1 byte = letter of the alphabet or a symbol when you type, the keyboard sends an ASCII byte to the PC There are 256 possible characters (the number of numbers that can be represented by 1 byte)
ASCII examples ! = 51(33h) A to Z = 65(41h) to 90(5Ah) a to z = 97(61h) to 122(7Ah)
ASCII Exercise Hello! LetterHello! Hex48h65h6Bh 6Fh33h Bin
ASCII Weaknesses? Think about other languages – you can’t fit ALL those symbols into 256 characters
Unicode Unicode (Also called UTF-8) allows up to 4 byes to represent a single character How many different characters possible? 4,294,967,296 (2 32 ) in theory 2,147,483,648 (2 31 ) in real life still enough for every language on earth (including fictional ones like Klingon and Elvish)
Other ways computers use numbers This means nothing to us:
cont. But what about this? or this?
Bitmaps a computer interprets an image as a bitmap: a series of bits that represent pixels (picture elements) What about colors?
Colors normally, one pixel is 3 bytes (24-bits) 1 byte for each primary color (RGB) FF is bright red 00 FF FF is bright cyan (G & B) is dark grey FF 00 FF is bright magenta (R & B) So how many different colors are there?
Understanding A megapixel is a million pixels. If the color is 24-bit, how many bytes is a megapixel? How many megabytes? Cameras are now commonly 5 megapixel (or more)
Cameras: Megapixel Myth 1 MP(megapixel) = a million pixels An image 1000 pixels wide and 1000 pixels tall is a megapixel (1000x1000) So how wide and tall is a 2 MP image? 1414x1414 (the SQUARE ROOT of 2 mil.) You’d need 4MP to double the image quality (math: exponential relationship) So the quality difference between 7 and 8 MP is actually pretty small. DON’T pay the extra $100 for the extra megapixel.
Final Point A computer sees a bunch of numbers and does math to them. What those numbers mean depend on the instructions given to the computer Are those 1s and 0s a picture? a document? music? It all depends on what we tell the computer to do with those bits.