Enjoy an ad free experience by logging in. Not a member yet? Register.

Results 1 to 15 of 18

07062004, 06:43 AM #1
 Join Date
 Dec 2003
 Location
 America
 Posts
 544
 Thanks
 0
 Thanked 0 Times in 0 Posts
How does the hexadecimal system work?
I have been thinking for a while as to how the 6 digit system for the hexidecimal works. I dont get how it is that one can get 256 colors from merely 6 digits. If i take a calculator, and i multiply 6 times 16, i get only 96 different potential variations, so how can that be the same as 256? I know theres 0 through 9, and from there, its like A through F for anything higher than 9. Thus, i know that #000000 is like pure for pure black. For white, its #ffffff. But i do not get from this, how it is that it can be 256 colors.
Can anyone lend a hand, or an explanation?LovesWar

07062004, 06:48 AM #2
 Join Date
 Sep 2003
 Posts
 3,620
 Thanks
 0
 Thanked 0 Times in 0 Posts
Your not very good at math are you?

07062004, 06:54 AM #3
 Join Date
 Dec 2003
 Location
 America
 Posts
 544
 Thanks
 0
 Thanked 0 Times in 0 Posts
LOL............never been my greatest skill. I am a visual person, so i try to visualise concepts so that i may understand them. If i however multiply 16 times 16, then i get 256. Is that how its supposed to be?
LovesWar

07062004, 07:19 AM #4
 Join Date
 Jun 2004
 Location
 underground
 Posts
 186
 Thanks
 0
 Thanked 0 Times in 0 Posts
an exercise:

07072004, 04:49 AM #5
 Join Date
 Dec 2003
 Location
 America
 Posts
 544
 Thanks
 0
 Thanked 0 Times in 0 Posts
So is anyone gonna answer my question? Is it 16 times 16?
LovesWar

07072004, 06:49 AM #6
 Join Date
 Jun 2002
 Location
 The Planet Earth Code Poet: True
 Posts
 282
 Thanks
 0
 Thanked 1 Time in 1 Post
They all ready did. The link that neofibril supplied more than adequately explained how The Hexadecimal Number System works.
And yes 16*16=256

07072004, 07:06 AM #7
 Join Date
 Dec 2003
 Location
 America
 Posts
 544
 Thanks
 0
 Thanked 0 Times in 0 Posts
I didnt really understand the excercises. I get the idea of how the letters represent higher digits than 9, but over, and beyond that, i didnt get a friggin thing. I need things broken down before i get things.
LovesWar

07072004, 08:15 AM #8
 Join Date
 Jul 2002
 Posts
 698
 Thanks
 0
 Thanked 0 Times in 0 Posts
the hexadecimal system works just like the normal 10 base system.
the first hex on the left of a number is 1's so a number with only 1 digit can be between 0 and 15(f):0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f
the next digits is then increased for every time you have 16 or more of the digit before it so 16 would be :16=#10,17=#11,18=#12.
a color code hex number is infact not 1 number but 3hex numbers.
2 digits for red
2 digits for green
2 digits for blue
each number can be between 0255. this can be calculated by saying that you can store 16 sixteen times with to digits 16x16=256 but since 1 number i zero the range is 0255.
each of the 3 numbers(red,green,blue) indicates how much of that color to put in the final color. And as standard it was decided in the way way past that a 0 of all three(#00{red}00{green}00{blue} should black and a full of all 3(#ff{red}ff{green}ff{blue}should be white.
And contrary to what you said this system allows for 256^3 different colors not just 256 colors.
Hope that helped.

07072004, 12:53 PM #9
 Join Date
 Dec 2003
 Location
 America
 Posts
 544
 Thanks
 0
 Thanked 0 Times in 0 Posts
See what kills me is the idea of a set. I know that 10 is really 16, since f is 15. In this sense, the one is for a single set, while, the zero is for nothing left over.
This is ok up until i get to something like 26. If i say, its 2 sets, plus a 6, then i would be inclined to think, ok, thats 30 plus 6, which is 36, but that isnt correct either. Hence, from my perspective, there isnt an easy way of using a formula in my head by which to easily figure out how to go from regular math notation to hexadecimal notation.
For something like FF, i know the answer is 240 plus 15, since the first letter means 15 times 16, which gives us 240. The second F means 15, so when you add 240 plus 15, you get 255. But i dont see how to apply a consistant formula all accross the board. This is why i dont fully get it.
How do i break something like, 24 for red, 26 for green, and 24 for blue. How do i break down into their hexadecimal equivalents? In other words, how do i do it automatically in my head without having to like count with my toes. If i write everything down, then yea, i could figure out. But i dont always want to have to write things down.
At any rate, if in human terms the number is 24, i add 6 to get 30, which would be the hexadecimal equivalent. But if the hexadecimal is like lets 56, then i subtract 6, and i get 50, for the human notation version of the number.
Somehow, anything after F, you have to add a 6 to get an idea of the hexadecimal equivalency. 14 then is like 20 since i have added a 6. But how do i figure out something like 35 in hexadecimal notation? I subtract, right? and i subtract 6 since, the differences between regular sets, and hexadecimal sets is 6. If you go from human notation to hexadecimal, you add a 6, but if you go from hexadecimal to human, you subtract a 6.
But how do i do an easy translation of something like BB? Or ED? What B= 11, but how then do i understand the 11? If i had to just do math, i would probably be inclined to just ad 6, but that isnt correct since the 11 here means 11 sets of something, which is 16. This being the case, i know then that i multiply 11 sets times 16 to get 176; and from here, we add another 11 for the second b to get the final answer of 187?
I am not sure i am phrasing my problem. i know that the second digit generally presents a set, hence, 10 means a whole set of 15if the 10 here in the hex system, and not in the human system. In the human system, 10 is anything over 9, but in hex, its anything after F, which is 16. But supposing i was already in the hex system: how would i do 255? Do i simply subtract 6 to get 249? Is this correct? 249 is the human version of the hex system of 255?Last edited by SpiritualStorms; 07072004 at 01:54 PM.
LovesWar

07072004, 02:21 PM #10
 Join Date
 Jun 2002
 Posts
 338
 Thanks
 0
 Thanked 0 Times in 0 Posts
It's all about place values. But just to preface, it doesn't make sense to call the decimal system the "human" system. Hexadecimal is just as much a human base as decimal.
When you have a number in decimal, say, 456, each digit represents a place value. Here, "6" is the "units" digit (1), so you multiply 6*1. Then, "5" is the "tens" digit (10), so you multiply 5*10. Then, "4" is the hundreds digit (100), so you multiply 4*100. The sum of these products is equal to the number itself.
The reason we do this is because each digit is "mapped" to a power of ten, starting from 0. The "6" is in the place value 10^0, or 1. The "5" is in the place value 10^1, or 10. The "4" is in the place value 10^2, or 100.
What does this mean in terms of hexadecimal, though?
When you use a different base system, it's very simple to convert to decimal. All you do is switch the base in the above example to the base you are using (in your case, 16). So, for instance, if we have the number 255 in hexadecimal, the conversion process to decimal would be this:
5 * 16^0 = 5*1 = 5
5 * 16^1 = 5*16 = 80
2 * 16^2 = 2*256 = 512
Then, we take the sum (5 + 80 + 512) and we get 597. That is the decimal value of the hex. number 255.
Hope that helps!
Happy coding!

07072004, 02:38 PM #11
 Join Date
 Jun 2004
 Posts
 565
 Thanks
 0
 Thanked 18 Times in 18 Posts
Originally Posted by SpiritualStorms
How do i break something like, 24 for red, 26 for green, and 24 for blue. How do i break down into their hexadecimal equivalents? In other words, how do i do it automatically in my head without having to like count with my toes. If i write everything down, then yea, i could figure out. But i dont always want to have to write things down.
But if the hexadecimal is like lets 56, then i subtract 6, and i get 50, for the human notation version of the number.
(dec) 86 => FLOOR(86 / 16) full sets + 86 % 16 left over => (hex) 5 * 10 + 6 = 56
But how do i do an easy translation of something like BB? Or ED? What B= 11, but how then do i understand the 11? If i had to just do math, i would probably be inclined to just ad 6, but that isnt correct since the 11 here means 11 sets of something, which is 16. This being the case, i know then that i multiply 11 sets times 16 to get 176; and from here, we add another 11 for the second b to get the final answer of 187?
ED => 14 full sets + 13 left over => 14 * 16 + 13 = 237
But supposing i was already in the hex system: how would i do 255? Do i simply subtract 6 to get 249? Is this correct? 249 is the human version of the hex system of 255?
dumpfiLast edited by dumpfi; 07072004 at 02:56 PM.

07072004, 03:16 PM #12
 Join Date
 Feb 2004
 Location
 Cornwall, UK
 Posts
 535
 Thanks
 0
 Thanked 0 Times in 0 Posts
Originally Posted by SpiritualStorms

07072004, 03:21 PM #13
 Join Date
 Jun 2004
 Posts
 565
 Thanks
 0
 Thanked 18 Times in 18 Posts
Originally Posted by trib4lmaniac
Next time he should try 16^6.
dumpfi

07072004, 03:46 PM #14
 Join Date
 Feb 2004
 Location
 Cornwall, UK
 Posts
 535
 Thanks
 0
 Thanked 0 Times in 0 Posts
You know what I mean

07082004, 01:35 AM #15
 Join Date
 Dec 2003
 Location
 America
 Posts
 544
 Thanks
 0
 Thanked 0 Times in 0 Posts
I realise that. All languages are human made, hence human based. However, because some times one needs to create distinctions for effective communication, i chose a set of terms that would contrast the 2 for easier references.
from: nolachrymose,
It's all about place values. But just to preface, it doesn't make sense to call the decimal system the "human" system. Hexadecimal is just as much a human base as decimal.LovesWar