Monday, January 7, 2008

HexaDecimal

Today in class we talked about Hexadecimals. It is like binary but alot more complicated. It has many things in common with Binary but not all. They both use place values but Hexadecimal is base 16 which means it multiplys the previous column but 16. So it goes from 1, 16, 256, 4096 and it contiues to multiply by 16. Like binary to represent a number we place a digit under it, but since you go up by 16 it is imposible to just use 0 and 1 so you cna use any numbers and symbols t replace numbers. To get any number from 1-9 you put 1 in the 1 column to represent 1, 2 in the 1 columnt to represent 2, and so on. Since you cannot have 2 digits in a column how do you get 10 since the second column is when you get 16 you have to use a letter to replace these numbers becuase you do not need 16 to make a 10. In this case you use letters to replace it so:

A=10
B=11
C=12
D=13
E=14
F= 15

But you will stop at 15 becuase you need 1 16 to make a 16 so the hexadecimal will be 10 so:

16 1

1 0

will represent 16 and to make 17 you use the comboes, but the next column is 256 so you have to go through alot of combinations to get to 256 but for every column in HexaDecimal the letters equal the number so it states how much you multiply the number by, so A=10 so if there is a a on the 16 column and a 0 in the 1 column it would be 160.

The second thing we learned in class today is colour on computes. Computers only can read and understand code if we type in blue it will not not what is blue, we need to type a code to find out what is blue and we use hexadecimal. There are 256 levels of colour. In computer the primary colours are Red, Green, Blue (RGB, blue always come last, red always come first and green is always in the middle.) Each one of these colours has 256 levels, but it includes 0 which is a level, if we dont count it there will only be 255 of every level of coulour and we use Hexadecimal to represent coulour. Since it doesn't have 256 levels we will only need to use 2 columns the 1 and the 16 columns. So we use hexadecimal to reperesent what level is each coulour, so different combinations of different coulour levels for different colours. The format looks like this:

Red Green Blue

F F F F F F (White)
0 0 0 0 0 0 (Black)
9 9 9 9 9 9 (Gray)

This is a colour since F and F means 255 1 away from 256 this means that it is a fusion of red green blue all at the 255 level or max and this cuases White, if all the colours are at the 0 level it will be at nothing so it is black, and inbetween them both is gray which is half of all each light so 999999 is gray. For each coulour there are 2 places for the level in hexidecimal becuase the level of each colour will be in hexidecimal and it will only be in 2 spaces and since ther are 3 colours and 2 fore each there are 6 spaces for a coulour. The colours will stay this order no matter what. So if you want only pure blue it will be 0000FF that is the purest blue.

No comments: