Binary conversion
Binary to Decimal
Binary to Hexadecimal
Binary to Octal
Decimal conversion
Decimal to Binary
Decimal to octal
Octal to binary
Octal to Decimal
Hex conversion
Hex o Binary
2. Introduction
• In last PPT it ended up with 4 types of number
system .
• In this PPT we are going to see in depth with
conversions .
3. Binary conversion
• Binary to Decimal
• 1. Start at the rightmost bit.
• 2. Take that bit and multiply by 2n where n is the
current position beginning at 0 and increasing by 1
each time. This represents a power of two.
• 3. Sum each terms product until all bits have been
used.
4. • Binary number
example : - 1001
convert to decimal
1 * 23 + 0 * 22 + 0 * 21 + 1 * 20 8 + 0 + 0 + 1
8+0+0+1 = (9)10
Ans :- Decimal value = (9) 10
6. • Binary to hex Conversion Example
• Compare the above to table
• For example :-
binary 1100 = C in hex
1011 = B
0001 = 1
for greater then 4 digits in binary
1)example :- 11001011 2)example :- 101010
make group of 4 digits :- make group of 4 digits
:-
1100 1011 Ans :- CB 10 1010 Ans :-2A
C B 2 A
8. • Binary to Octal Conversion Example
• Compare the above to table
• For example :-
binary 100 = 4 in Octal
011 = 3
001 = 1
for greater then 4 digits in binary
1)example :- 11001011 2)example :- 101010
make group of 3 digits :- make group of 3 digits :-
11 001 011 Ans :- 313 101 010 Ans :-52
3 1 3 5 2
9. Decimal conversion
Decimal to Binary
• 1. Divide the decimal number by 2.
• 2. Take the remainder and record it on the side.
• 3. REPEAT UNTIL the decimal number
cannot be divided into anymore.
• 4. With the bits, record them in order from
right to left as that will be the number in base
two.
11. • Decimal to octal
Its similar to Decimal to binary conversion
instead of 2 have to divide it by 8
Example :- (18)10
18 / 8 = 2 2
2 / 8 = 0 2
Answer : - (22)8
12. Octal conversion
• Octal to binary
• Simply separate the number and individually
find the binary digit , for Example
• number (742)8
• 7 | 4 | 2
• 111 | 100 | 010
• Answer: (111100010)2
13. • Octal to Decimal
• Similar to the binary to decimal method,
simply take each digit in the octal base and
multiply by the power of 8
• Example :- (764)8
• 7 * 82 + 6 * 81 + 4 * 80 448 + 48 + 4 = 500
Answer: (500)10
14. Hex conversions
• Hex o Binary
• This conversion is very simple given the hexadecimal
compare the table and find the answer
15. • Example
• hexadecimal number (A2F)16
Convert to binary
A | 2 | F
1010 | 0010 | 1111
Answer: (1010 0010 1111)2