The first numbering system was base 60.
The decimal system, or base 10, is in mathematics and everyday life, but computers and other electronics need to have simpler (sometimes more complex) systems. Enter, binary.
Remove these ads by
Signing UpStep 1: Hex decimal
the numbers 1-20 using hex decimal:
1
2
3
4
5
6
7
8
9
a
b
c
d
e
f
10
11
12
13
as you can see it uses the letters a-f to repesent real numbers.
so every time you get to nine you go to a and so on. so 100 in hexdecimal is 64.
hex decimal is usely used in video games becauses you can fit big numbers in small space.






































Visit Our Store »
Go Pro Today »




The formula for converting bases is very simple. For conversion from base N to base 10 you simply do this:
take each digit in the Base N number(Convert it to it's representative base 10 number) and multiply it by N (to the power of) the digit place. the digit place starts at 0 at the far right of the number, and goes up by 1 for each digit. Then add the totals of all the digits.
EX.
10011010 (154)
working from right to left
0 * (2 ^ 0) = 0
1 * (2 ^ 1) = 2
0 * (2 ^ 2) = 0
1 * (2 ^ 3) = 8
1 * (2 ^ 4) = 16
0 * (2 ^ 5) = 0
0 * (2 ^ 6) = 0
1 * (2 ^ 7) = 128
=(add up all the totals)
154
And a Hexadecimal word(Two bytes):
1A3F(6719)
16 * (16 ^ 0) = 16
3 * (16 ^ 1) = 48
10 * (16 ^ 2) = 2560
1 * (16 ^ 3) = 4096
=(add up the totals)
6719
(both examples were checked with the windows calculator)
To convert from base 10 to base N, you use a little division, and Modulus math. You MOD by your Base to get your Base digit(you convert the base 10 number into your digit like you would 10 into "A") and then divide your current number by the base until your current number is less then your base. You take the remainder and convert it into your last digit. And then take these digits and put them from right to left to make your number.
EX. 1264 to a Hex word
1264 mod 16 = 0 (Your right most digit will be 0). 1264 \ 16 (decimals are ignored) = 79
79 mod 16 = 15(F). 79 \ 16 = 4
4 is less then 16, so we make 4 our first digit. so 1264 in a Hex word is :
4F0 (Since this is a Hex word though, it would be 04F0 with a leading 0 so it represents two bytes)
or convert 1264 into a binary word(though it would be simpler to convert the above hex word into binary then preform all these steps again)
1264 mod 2 = 0. 1264 \ 2 = 632
632 mod 2 = 0. 632 \ 2 = 316
316 mod 2 = 0. 316 \ 2 = 158
158 mod 2 = 0. 158 \ 2 = 79
79 mod 2 = 1. 79 \ 2 = 39
39 mod 2 = 1. 39 \ 2 = 19
19 mod 2 = 1. 19 \ 2 = 9
9 mod 2 = 1. 9 \ 2 = 4
4 mod 2 = 0. 4 \ 2 = 2
2 mod 2 = 0. 2 \ 2 = 1
1 < 2. first digit is 1. so:
10011110000. or 000000100 11110000 in two bytes.
I hope this cleared up some stuff for you :)
00001 = 1
00010 = 2
00011 = 3
00100 = 4
00101 = 5
00110 = 6
00111 = 7
Think of the columns as powers of 2, the first being 2^0 That means from right to left, the columns would be 1, 2, 4, 8, 16, and so on. Place a 1 in the column were you need the number. If I were doing 15, I would place it in the largest column that fits. It is smaller than 16, but larger than 8, so I place it in 8.
01111 = 15
All binary odd numbers HAVE to have a 1 in the 2^0 column. The opposite goes for even numbers.
think of it this way, each column of numbers has a value(and the values go up by powers of 2). you can turn this value on and off depending on what number is on the column(1 = on and 0 = off)
so if there is a 1 in the "4" column then you add 4 of the value of the number.
if you want to get a number like 5 you need to have some "0's"in the middle of your number(IE. 101 = 5 because the 1 column is on and the 4 column is on, adding up to 5)
you just kept adding another "one" to your number in the next column which gives you the wrong numbers.
1
01
11
001
101
011
111
0001
1001
0101
1101
0011
1011
0111
1111
00001
10001
01001
11001
00101
thats what you have it is really
00001=1
00010=2
00011=3
00100=4
00101=5
00110=6
00111=7
01000=8
01001=9
01010=10
01011=11
01100=12
01101=13
01110=14
01111=15
10000=16
10001=17
10010=18
10011=19
10100=20
10101=21
10110=22
10111=23
11000=24
11001=25
MSB is the Most Significant Bit, that is, the bit with the highest value. in decimal the "MSB" is always to the left. in the number 643, 6 is the most significent digit. in the binary form of 2, 10 the MSB is on the left. but 2 can also be written with MSB on the right, 01.