Sunteți pe pagina 1din 2

Converting Binary to Decimal

=======================
64 32 16 8 4 2 1
etc 2x2x2x2x2 2x2x2x2 2x2x2 2x2 2 1

To work out 0101101 in binary, place it below the table:


64 32 16 8 4 2 1
0 1 0 1 1 0 1

Then multiply by the number above:


64x0 32x1 16x0 8x1 4x1 2x0 1x1

Then add them (remember something times 0 is nothing):


64x0 + 32x1 + 16x0 + 8x1 + 4x1 + 2x0 + 1x1
= 0 + 32 + 0 + 8 + 4 + 0 + 1 = 45

So 0101101 in binary is 45 in decimal_

Converting Decimal to Binary


Repeatedly divide by the base you want to convert to - namely 2
To convert 45 to binary:
Number to convert Divide by base we are converting to Remainder
----------------------------------------------------------------------------------------------------------------
---
47 47 divided by 2 1
23 23 divided by 2 1
11 11 divided by 2 1
5 5 divided by 2 1
2 2 divided by 2 0
1 1 divided by 2 1
0
Reading the binary digits from the bottom up:
So 47 in decimal is 101111 in binary_

Converting Decimal to Hexadecimal


============================
Repeatedly divide by the base we are converting to - namely 16

Number to convert Divide by base we are converting to Remainder


-------------------------------------------------------------------------------------------------------
2334 2320 divided by 16 14 = E in hex
145 145 divided by 16 1
9 9 divided by 16 9
0
Reading from the bottom uo that's 91E

So 2334 in decimal is 91E in hexadecimal_

Converting Decimal to Hexadecimal


============================
Repeatedly divide by the base we are converting to - namely 16

Number to convert Divide by base we are converting to Remainder


-------------------------------------------------------------------------------------------------------
2334 2320 divided by 16 14 = E in hex
145 145 divided by 16 1
9 9 divided by 16 9
0
Reading from the bottom uo that's 91E

So 2334 in decimal is 91E in hexadecimal_