Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2015-11-14 15:25:23

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Base16 to HEX

I'm trying to figure out Base16 and how to turn a RGB value such as; 145,34,203 into HEX values ?
From what I know after 9 it turns into letters, going to up F, with F=15, correct ? Why doesn't it go higher then F ?

Offline

#2 2015-11-14 15:50:36

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Base16 to HEX

In base 10 there are 0 to 9 numerals, in base 2 there are 0 to 1, in base 8 there are 0 to 7, it is only natural to expect base 16 to go from 0 to 15, 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#3 2015-11-14 17:33:38

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Base16 to HEX

After 0, letters come into effect.  What is Base10, does it include any letters ?

Offline

#4 2015-11-14 19:08:19

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Base16 to HEX

After 9 come the letters.

Base 10 is the system we use for arithmetic. Also, base 16 and hexadecimal (hex) are the same thing.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#5 2015-11-15 02:08:27

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Base16 to HEX

bobbym wrote:

After 9 come the letters.

Base 10 is the system we use for arithmetic. Also, base 16 and hexadecimal (hex) are the same thing.

Sorry, I didn't understand what you meant ?

Offline

#6 2015-11-15 04:37:01

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Base16 to HEX

Hi;

What specifically are you having problems with?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#7 2015-11-15 04:47:12

Bob
Administrator
Registered: 2010-06-20
Posts: 10,059

Re: Base16 to HEX


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#8 2015-11-15 08:55:14

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Base16 to HEX

Thanks for the link Bob. 

Why does with Base16 after 9 it goes into letters, then after F it goes back into numbers ?

How would I convert 145,89,200 into HEX values ?

Offline

#9 2015-11-15 12:07:51

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Base16 to HEX

Are you asking about a carry in base 16?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#10 2015-11-15 15:04:23

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Base16 to HEX

bobbym - yes !

Offline

#11 2015-11-15 15:53:24

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Base16 to HEX

Like in base 10 when you get to 9 you go to 10 as the next one. In base 16 when you get to F you go to 10 next.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#12 2015-11-15 17:07:14

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Base16 to HEX

There is like a delayed space with Base16 between 9 and 16.  What is the purpose of 10 - A though to 15 - F with Base16, in other words, what is the purpose of placing those letters and only those sets of letters in the decimal list, seems odd ? smile

Offline

#13 2015-11-15 18:05:16

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Base16 to HEX

There is no delay. It passes smoothly from 9 to A. Each base requires an equal number of symbols to represent any number. Base 2 has 2 numbers 0 and 1. Base 3 has 3 numbers, 0, 1, 2. Base 10 the one that we use requires 10 and base 16 requires 16.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#14 2015-11-15 18:10:21

SuperLynx
Member
Registered: 2009-06-28
Posts: 335

Re: Base16 to HEX

bobbym wrote:

Each base requires an equal number of symbols to represent any number. Base 2 has 2 numbers 0 and 1. Base 3 has 3 numbers, 0, 1, 2. Base 10 the one that we use requires 10 and base 16 requires 16.

I don't understand ?

Why must there be letters ?

Offline

#15 2015-11-15 19:15:29

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Base16 to HEX

Because there are only 10 digits that we use 0,1,2,3,4,5,6,7,8,9. They needed 6 more so they arbitrarily but not unwisely, chose letters of the alphabet.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#16 2015-11-15 21:02:54

Bob
Administrator
Registered: 2010-06-20
Posts: 10,059

Re: Base16 to HEX

hi SuperLynx

Why do we count in tens ?  Most people think it's because we have ten digits.  Look at how the 'place value' system works.  We have ten symbols, 0,1,2,3,4,5,6,7,8,9 and so we can count up to 9 using those.  Instead of needing another symbol for ten, we just shift the place value of 1 into the tens column and put a zero in the units column.

So we write ten as "one lot of ten and zero units"

In that way we can carry on counting.

eleven is "one lot of ten and one unit"
twelve is "one lot of ten and two units"
and so on.

This allows us to get all the way to nine lots of ten and nine units.  Now we've run out of options using two columns so we have to switch into the hundreds column

One hundred is "one lot of one hundred ands zero tens and zero units"

Three columns is enough to get to nine hundreds nine tens and nine units and then we need the thousands column.

This is the way many humans have chosen to count numbers.  You can count to any value using it.  The column headings are (from right to left) units, tens, hundreds, thousands, ten thousands, etc etc.

Note these are all powers of ten. 

If humans had evolved with, say, 12 digits, we might have adopted a counting system based on powers of 12.  We'd have to invent two new symbols, one a single digit symbol for what we call ten and another for what we call eleven.  Let's use T and E for these.

Counting in base 12 would look like this:

0,1,2,3,4,5,6,7,8,9,T,E,10,11,12,13,14,15,16,17,18,19,1T,1E,20,21,..........EE,100,101,102,.........1EE,200,201.........EEE,1000, etc, etc.

The column headings for base 12 would be units, twelves, twelve^2, twelve^3 and so on.

You can convert like this:

2E7 in base twelve = 2 lots of 144 + E lots of 12 + 7 units = 288 + 132 + 7 = 427 in base ten.

You can make up similar counting systems for any base.  Computers work in base two (binary) but it's hard for humans to work with this because the numbers get so long and it's hard to focus on all those 1s and 0s.  base 16 is a useful halfway house because it looks much more like base ten and there's an easy trick to switch base 16 into base two.

To make up a counting system based on powers of 16 you need six new symbols to cover eleven, twelve, ...fifteen.  Sixteen doesn't need another symbol because it is written 10 in base 16.  In general you need 'n' symbols for base n.

It is conventional to use the first six letters of the alphabet for these symbols.  When base 16 was first used, a different set of symbols could have been chosen, but that choice has become the accepted one.  So counting in base 16 looks like this:

0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,10,11,12,......1F,20,21,........FF,100,101, .....etc etc.

You can switch from base 16 like this:

2FF = 2 lots of 256 + F lots of 16 + F units = 512 + 240 + 15 = 767

The page I linked for you has a converter to save you the trouble of doing it the long way.  smile

Hope this helps,

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#17 2015-11-16 12:10:37

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: Base16 to HEX

Please keep in mind that The three color channels are distinct


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#18 2015-11-16 12:38:18

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Base16 to HEX

Yes, each one has to be converted to hex.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

Board footer

Powered by FluxBB