Professional Documents
Culture Documents
Solution:
1(64)+1(32)+1(16)+1(8)+1(4)+1(2)+1(1)
64+32+16+8+4+2+1=
2.
Solution: 1()+1()+1()+1()+1()+0()
32 + 16 +8 +4 +2 +0
=
3.
Solution: 32+16+8+0+2+1 =
Exercise
By reading backward, (the first digit of the binary is the 64’s), we obtain:
=
2. Write the Decimal 63 to binary
Division by 2 Quotient Remainder Place of Bits
2)63 31 1 1’s
2)31 15 1 2’s
2)15 7 1 4’s
2)7 3 1 8’s
2)3 1 1 16’s
2)1 0 1 32’s
0
=
Exercise:
1.
Operations of Binary Numbers
Addition
In adding binary numbers, we use the fact that the sum of the
numbers must be one and zero only. Thus, the sum of 0 and 0 is 0; the sum
of 1, and the sum 1 and 1 is 0.
Consider the examples:
1. If we add and , we have the following solution,
carry-> 1
1 0 0 1
1 1 1 0
1 0 1 1 1
To check whether our answers are correct, we convert and to decimal numbers, as well as the
sum
= 1(8)+0(4)+0(2)+1(1)= 9
= 1(8)+1(4)+1(2)+1(0)= 14
We should expect that is 23.
=1(16)+0(8)+1(4)+1(2)+1(1)= 23
2.
3. The sum oftheand
Similarly, sumisof
shown
and below:
is:
Carry -> 1 1 1
1 0 1 1 0 1
1 0 0 1 1 0
1 0 1 0 0 1 1
Carry - 1 1 1 1 1 1
>
1 1 1 1 1 1
1 0 1 1 1 1
1 1 0 1 1 1 0
1 1 1 0 => 1 1 0 1
0
1 0 0 1 1 0 0 1
1 0 1
We are checking whether the difference of 14 and 9 is 5
= 1(8) + 1(4) + 1(2) + 0(1) = 14
= 1(8) + 0(4) + 0(2) + 1(1) = 9
2. Suppose we will subtract and
1 1 1 1 0 1 1 1 0 10
1 0 1 0 1 1 0 1 0 1
1 0 0 1
21
Exercise
Find the sum of the following binary numbers:
1. and
2. and