Decimal To Binary Conversion: 1. Sum - of - Weights Method
Decimal To Binary Conversion: 1. Sum - of - Weights Method
Two methods
For example: The decimal number 12, for example , can be expressed as the sum of
binary weights as follows.
9=8 + 4
23 + 22
23 22 21 20
1 1 0 0
12 => 1 1 0 0
12 / 2 = 6 0
6/2 = 3 0
3 /2 = 1 1
1 /2 = 0 1
number quotient is 0
For example:
= 2-1 + 2-3
0. 1 0 1
2. Repeated multiplication by 2 method
Decimal fractions can be converted to binary by repeated multiplication by 2 method .
For example , to convert the decimal fraction 0.3125 to binary, begin by multiplying 0.3125 by 2
and then multiplying each resulting fractional part of the product by 2 until the fractional product
is 0 or until the desired number of decimal places is reached. The carried digits or carries,
generated by the multiplications produce the binary number. The first carry produced in MSB
and last carry is LSB.
MSB
= .0101 LSB
Carry
0.3125 * 2 = 0.625 0
0.625 * 2 = 1.25 1
0.25 * 2 = 0.50 0
0.50 * 2 = 1.00 1