Uploaded by Guilmar Terrence Ramirez

conversion

advertisement
Binary Number System
And Conversion
Digital Electronics
TLE ICT
GUILMAR TERRENCE B. RAMIREZ
Bridging the Digital Divide
Decimal-to-Binary
Conversion
Binary-to-Decimal
Conversion
2
Decimal ‒to‒ Binary Conversion
The Process : Successive Division
a) Divide the Decimal Number by 2; the remainder is the LSB of
Binary Number .
b) If the quotation is zero, the conversion is complete; else repeat
step (a) using the quotation as the Decimal Number. The new
remainder is the next most significant bit of the Binary Number.
Example:
Convert the decimal number 610 into its binary equivalent.
3
2 6
1
2 3
0
2 1
r  0  Least Significant Bit
r 1
 610 = 1102
r  1  Most Significant Bit
3
Dec → Binary : Example #1
Example:
Convert the decimal number 2610 into its binary equivalent.
4
Dec → Binary : Example #1
Example:
Convert the decimal number 2610 into its binary equivalent.
Solution:
13
2 26
r  0  LSB
6
2 13
r 1
3
2 6
r 0
1
2 3
r 1
0
2 1
r  1  MSB
 2610 = 110102
5
Dec → Binary : Example #2
Example:
Convert the decimal number 4110 into its binary equivalent.
6
Dec → Binary : Example #2
Example:
Convert the decimal number 4110 into its binary equivalent.
Solution:
20
2 41
r  1  LSB
10
2 20
r 0
5
2 10
r 0
2
2 5
r 1
1
2 2
r 0
0
2 1
r  1  MSB
 4110 = 1010012
7
Dec → Binary : More Examples
1310 = ? (a
2210 = ? (b
4310 = ? (c
15810 = ? (d
8
Dec → Binary : More Examples
1310 = ? (a 1 1 0 1 2
2210 = ? (b 1 0 1 1 0 2
4310 = ? (c 1 0 1 0 1 1 2
15810 = ? (d 1 0 0 1 1 1 1 0 2
9
Binary ‒to‒ Decimal Process
The Process : Weighted Multiplication
a) Multiply each bit of the Binary Number by it corresponding bitweighting factor (i.e. Bit-0→20=1; Bit-1→21=2; Bit-2→22=4; etc).
b) Sum up all the products in step (a) to get the Decimal Number.
Example:
Convert the decimal number 01102 into its decimal equivalent.
0
1
1
0
23
22
21
20
8
4
2
1
0
+
4
+
2
+
0
Bit-Weighting
Factors
=
 0110 2 = 6 10
610
10
Binary → Dec : Example #1
Example:
Convert the binary number 100102 into its decimal equivalent.
11
Binary → Dec : Example #1
Example:
Convert the binary number 100102 into its decimal equivalent.
Solution:
1
0
0
1
0
24
23
22
21
20
16
8
4
2
1
16
+
0
+
0
+
2
+
0
=
1810
100102 = 1810
12
Binary → Dec : Example #2
Example:
Convert the binary number 01101012 into its decimal
equivalent.
13
Binary → Dec : Example #2
Example:
Convert the binary number 01101012 into its decimal
equivalent.
Solution:
0
1
1
0
1
0
1
26
25
24
23
22
21
20
64
32
16
8
4
2
1
0
+
32
+
16
+
0
+
4
+
0
+
1
=
5310
01101012 = 5310
14
Binary → Dec : More Examples
0110 2 = ? (a
11010 2 = ? (b
0110101 2 = ? (c
11010011 2 = ? (d
15
Binary → Dec : More Examples
0110 2 = ? (a 6 10
11010 2 = ? (b 26 10
0110101 2 = ? (c 53 10
11010011 2 = ? (d 211 10
16
Summary & Review
Successive
Division
Divide the Decimal Number by 2; the remainder is the LSB of Binary
Number .
(a
If the Quotient Zero, the conversion is complete; else repeat step (a) using
the Quotient as the Decimal Number. The new remainder is the next most
significant bit of the Binary Number.
(b
Weighted
Multiplication
Multiply each bit of the Binary Number by it corresponding bit-weighting
factor (i.e. Bit-0→20=1; Bit-1→21=2; Bit-2→22=4; etc).
Sum up all the products in step (a) to get the Decimal Number.
(b
(a
17
Image Resources
• Microsoft, Inc. (2008). Clip Art. Retrieved March 15, 2008 from
http://office.microsoft.com/en-us/clipart/default.aspx
18
Compute the equivalent of the following decimal
numbers to binary numbers
1. 34
A.10001
C. 10010
B.100010
D. 1100111
2. 18
A.10001
C. 10010
B.1000010
D. 1100111
3. 51
A.10001
C. 10010
B.1000010
D. 1100111
4. 17
A.10001
C. 10010
B.1000010
D. 1100111
19
Compute the equivalent of the following binary numbers
to decimal numbers
5. 11100
A.23
B.30
6. 10111
C. 25
D. 28
7. 11001
8. 11110
20
Download