1796
the MSD is the 1 and the 6 is the LSD.
So, it we look at a decimal number, the LSD represents the number of 1's, the next digit represents the number of 10's, the next the number of 100's, the next the number of 1,000's, and so on in powers of 10! This is true of any number base, for binary it is the number of 1's, 2's, 4's, etc. (powers of 2); for hexadecimal, it is powers of 16 (1's, 16's, 256's, 4096's, etc.
Number | Base | |
---|---|---|
Binary | 2 | values = 1 or 0 per digit. |
Decimal | 10 | values = 0 thru 9 per digit. |
Hexidecimal | 16 | values = 0 thru F per digit. |
Octal | 8 | values = 0 thru 7 per digit. |
Base5 | 5 | values = 0 thru 4 per digit. |
NOTE: In base 16, the largest number before a carry is 15 (F). In hexadecimal when you reach decimal values greater than 9, the representation for 10 is A, 11 is B, 12 is C, 13 is D, 14 is E, and 15 is F. A 16 value is a carry and is 10. This is 1x16 + 0x1.
Nr.Base | Powers of Base X | |||||||
---|---|---|---|---|---|---|---|---|
Decimal (10) | 10-7 | 10-6 | 10-5 | 10-4 | 10-3 | 10-2 | 10-1 | 10-0 |
Value | 10,000,000 | 1,000,000 | 100,000 | 10,000 | 1,000 | 100 | 10 | 0-9 |
Binary(2) | 2-7 | 2-6 | 2-5 | 2-4 | 2-3 | 2-2 | 2-1 | 2-0 |
Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 0 or 1 |
Hexadecimal (16) | 16-7 | 16-6 | 16-5 | 16-4 | 16-3 | 16-2 | 16-1 | 16-0 |
Value | 268,435,456 | 16,777,216 | 1,048,576 | 65,536 | 4096 | 256 | 16 | 0-F |
Octal(8) | 8-7 | 8-6 | 8-5 | 8-4 | 8-3 | 8-2 | 8-1 | 8-0 |
Value | 2,097,152 | 262,144 | 32,768 | 4096 | 512 | 64 | 8 | 0-7 |
You can create your own tables past the 7th power of number bases.
To convert a number: 11001011 base 2, to base 10,you simply go to the table and add the corresponding numbers for the powers of 2, from the LSB: Going from the right of the binary number, we have: "11001011" - one one, 1 two, 0 fours, 1 eight, 0 16s, 0 32s, 1 64, and 1 128.
SO: lets add them: 1 + 2 + 0 + 8 + 0 + 0 + 64 + 128 = 203 base 10. Lets convert the same number to hexadecimal:
"11001011" - one one, 1 two, 0 fours, 1 eight, 0 16s, 0 32s, 1 64, and 1 128.
This time it is easier to convert first to decimal (base 10) and convert the base 10 number to hexadecimal:
SO: 203 in decimal can be converted by dividing the largest power of 16 that will go into 203 (if you look in the chart above, you can see that 16 squared = 256 and 256 will not divide into 203, so we go to the next lower power - 16): 203/16 = 12 with a Remainder of 11. Since we cannot divide the base (16) any more, we know that the remainder of 11 will be in the LSD position. We convert the 11 to hex, and the 12 to hex. Remember 12 decimal = C in hex, and 11 decimal = B in hex. Then the answer is "CB" in hex. To check this out, we convert this way:
We have B (or 11) ones + C (or 12) 16's. 12 x 16 = 192. Then 11 + 192 = 203 base 10. So, "CB" hexadecimal is correct.
Another illustration is converting 1765 decimal to hexadecimal. From the chart the largest power of 16 that will divide into 1765 is 16 squared or 256. 1765/256 = 6 remainder = 229, so 6 will be our high order digit. Now, divide the next power of 16 into 229. 229/16 = 14 (or E in hex) with remainder 5. So, 5 is our digits, 14 (E) is our next number, and 6 is the high order digit. It looks like this in hex: "6E5".
To prove it: (256 x 6) + (14 x 16) + 5 = 1536 + 224 + 5 = 1765