Base 10 (Decimal System), Base 16 (Hexadecimal System),

and Base 2 (Binary System)

 

First, understand the format of numbers in bases 10, 16, and 2. See Figure 1.

 

 

 

Figure 1.

 

What else can we say about column 0? We know this is the ones column, but how does that follow from the powers of 10, or 16, or 2 (or whatever) concept? What would it mean for example to multiply 10, 16, or 2 by itself zero times? (Heck, multiplying it by itself only once is weird enough, what with multiplication being a binary operation and no actual multiplication taking place.)

 

Let's start with 104 and start dividing by 10. You get 103=1000, 102=100, 101=10, 1, 1/10, 1/100, ...

So mathematically it seems to make sense to define 100 as 1, and 10-1 as 1/10=1/101, and 10-2 as 1/100=1/102, etc.

So that's how it's done. Conclusion: the rightmost column is the 1's column.

 

But why do we call it base 10?

Because there are 10 numeral symbols that stand for the numbers one, two, three, four, five, six, seven, eight, nine - counting them, we're only up to 9 of them, so what about the 10th? The symbol 0 hasn't been counted yet and will do as our 10th symbol.

 

What about hexadecimal numbers (base 16 - "hex" means 6, "decimal" means 10, so "hexadecimal" means 16)?

Now we need 16 numeral symbols. Here they are.

 

1 (meaning: one)

2 (meaning: two)

<write them all out>

f (meaning: fifteen)

And the 16th symbol: 0.

 

Notice that we can give meanings to the columns in base 16 analogously to how we did it for columns in base 10. 

We will let the 3rd from the right column represent 162=256s, the 4th represent 163=4098s, the 2nd column from the right represent 161=16s, and the rightmost column represent 160=1s. Thus the number sixteen is expressed with a 1 in the 16s (2nd) column and a 0 in the 1s column, giving "10" as the base 16 way to write the number sixteen. 

 

Next, what about binary (base 2)?

For binary we are required to have 2 numeral symbols. Let us call them 0 (meaning zero) and 1 (meaning one). 

 

Like decimal and hexadecimal numbers, binary numbers have different digits in different columns. We will let the 3rd from the right column represent 22=4s, the 4th represent 23=8s, the 5th represent 24=16s, the 2nd column from the right represent 21=2s, and the rightmost column represent 20=1s. The size of the quantities expressed in a given column is certainly considerably less than in base 16! The number two is expressed in binary with a 1 in the 2s (2nd) column and a 0 in the 1s column, giving "10" as the base 2 way to write the number two. 

 

What does a number written in base 16 (for example) mean?

 

In other words, we would like to convert a base 16 number, like 3b7, into a more familiar decimal form. To do this, observe that the rightmost column contains seven 160=1s, the next column contains b (that is, eleven) 161=16s, and the 3rd column contains 3 162=256s. So we add those up: 7+11*16+3*256=951. So 3b7 in base 16 is 951 in base 10 (we can write this as 3b716=95110).

 

The situation is similar in base 2. For example, suppose we want to convert the binary number 111111 into decimal. The rightmost column contains 1 20=1, the next column contains 1 21=2, the next contains 1 22=4. The next contains 1 23=8, the next contains 1 24=16, and the leftmost column contains 1 25=32. So, adding up all those components that 111111 in base 2 contains, we get 1+2+4+8+16+32, or 63 (in decimal notation).

https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif

 

But how do you go the other way, from base 10 to base 16 or 2 (or 3 or 47)?

 

This is a matter of figuring out what numeral symbol goes in the 1s (160) place, the 16s (161) place, the 256s (162) place, ... for conversion to hexadecimal, or the 1s (20) place, the 2s (21) place, the 4s (22) place, the 8s (23) place, the 16s (24) place, ... for conversion to binary. 

 

Let's suppose the number we want to convert to hex is 100 (one hundred). What if we put the full 100 into the 1s place? Problem solved? Well, yes and no. Yes in the sense that the number one hundred is properly accounted for, but no in the sense that we're only supposed to put numbers up to fifteen in the 1s place (remember, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, or f). Anything greater than fifteen thus needs to be expressed using other column(s) besides the 1s column. But what, then, belongs in the 1s column? That's hard to know until we've filled out the higher columns, so let's start high and then, column by column, work downward to the 1s column.

 

Since the rightmost column is 1s, the 2nd-to-the-right column is the 16s column. The 3rd column is the 162=256s column. 256 is more than 100, so 100 is not high enough to use the 3rd column. To need 3rd column the number would have to be at least 256. What about the 2nd (16s) column? 16 goes into 100 six times, with a little left over. So we should put 6 in the 16s column. The left over is 4, which being less than 16 cannot go in the 16s column which, recall, counts in increments of 16. So the remaining 4 goes in the 1s column.The answer then is that 100 in base 10 is 64 in base 16. To check that, 6*16+4*1=100, so it checks.

 

The process is analogous if we wanted to convert 100 into base 2. 27=128 which does not fit into 100, so we don't put anything in the 128s column. 26=64 fits into 100 once, which is a good thing since in base 2 we're only allowed to use the digits 0 or 1 in each column. So we put as 1 in the 64s column, removing 1*64=64 from further consideration, leaving 100-64=36. 25=32 which fits into the remaining 36 once, putting a 1 in the 32s column, removing 1*32 from the 36 and leaving 4 left to account for. 24=16 which does not fit into the remaining 4, so a 0 goes in the 16s column. Likewise for the 23=8s column. 22=4 does fit into the 4 that is left to account for so we put a 1 in the 4s column and remove 1*4 from the remaining 4, leaving 0 left to account for. Therefore the 21=2s column gets a 0, as does the 20=1s column. Thus, 100 in base 10 is 1100100 in base 2.