Beruflich Dokumente
Kultur Dokumente
0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 with a carry of 1
Solution:
1111111 Carries
101101101
+
1110011
____________________
111100000
Check:
( 101101101) 2 = (365) 10
( 1110011) 2 =
(115) 10
Then,
Solution:
11
11
111111 Carries
110110
101001
111000
10101
100010
---------------
1 1 001110
Check:
( 110110) 2 =
(54) 10
( 101001) 2 =
(41) 10
( 111000) 2 =
(56) 10
( 10101) 2 =
(21) 10
( 100010) 2 =
(34) 10
Then,
( 11001110) 2 = (54 + 41 + 56 + 21 + 34) 10
= (206) 10
0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7
1 2 3 4 5 6 7 10
2 3 4 5 6 7 10 11
3 4 5 6 7 10 11 12
4 5 6 7 10 11 12 13
5 6 7 10 11 12 13 14
6 7 10 11 12 13 14 15
7 10 11 12 13 14 15 16
When Table 2.1 above is used for addition, we first locate the least
significant digit of the first number (augend) in the upper row of the
table, and then we locate the least significant digit of the second
number (addend) in the left most column of the table. The
intersection of the augend with the addend gives the sum of these
two numbers. We follow the same procedure for all other digits from
right to left.
Example 2.3
Add the numbers (3527) 8 and(4167) 8
Solution:
011 Carries
3527
+ 4167
______
7716
Starting with the least significant digit column above, we add 7 with 7
and the table gives us 16 i.e.6 with a carry of 1. Next we add 6 and 2,
with a carry of 1 , or 6 and 3, and the table gives 11 us i.e., 1 with a
carry of 1 . Now we add 1, 5 and 1 (carry) and we obtain 7 with no
carry.
Finally, we add 4 and 3 which gives 7 and no carry. As before, we can
check the sum for correctness by converting the numbers to their
equivalent decimal numbers.
When Table 2.1 above is used for subtraction, we first find the least
significant digit of the subtrahend (the smaller number) in the first
row of the table. Then, in the same column, we locate the least
significant digit of the minuend (the larger number). If the least
significant digit of the minuend is less than the least significant digit
of the subtrahend, a borrow occurs and from the numbers 10 through
16 in the table we choose the one whose least significant digit
matches the least significant digit of the minuend. We find the
difference by going across to the left most column. We follow the
same procedure for all other digits from right to left.
Example 2.4
Subtract (415) 8 from ( 614) 8
Solution:
614
- 415
______
177
The least significant digit of the subtrahend is 5 and we locate it in
the first row of Table 2.1.
Going down that column where 5 appears, we choose 14 because the
least significant digit of the minuend is 4. The difference, 7 in this
case with a borrow, appears across to the left most column. Next, we
add the borrow to the next digit of the subtrahend, 1 in this case, so
now we must subtract 2from 1. Continuing we locate 2 in the first
row of the table and going down on the same column we choose 11
because the next digit of the minuend is 1 , and again from the left
most column we find that the difference is 7 with another borrow.
Finally, we add that borrow to 4 and now we subtract from and this
difference of appears in the most significant position
of the result with no borrow.
0 1 2 3 4 5 6 7 8 9 A B
C D E F
1 2 3 4 5 6 7 8 9 A B C
D E F 10
2 3 4 5 6 7 8 9 A B C D
E F 10 11
3 4 5 6 7 8 9 A B C D E F
10 11 12
4 5 6 7 8 9 A B C D E F
10 11 12 13
5 6 7 8 9 A B C D E F 10
11 12 13 14
6 7 8 9 A B C D E F 10 11
12 13 14 15
7 8 9 A B C D E F 10 11 12
13 14 15 16
8 9 A B C D E F 10 11 12 13
14 15 16 17
9 A B C D E F 10 11 12 13 14
15 16 17 18
A B C D E F 10 11 12 13 14 15
16 17 18 19
B C D E F 10 11 12 13 14 15 16
17 18 19 1A
C D E F 10 11 12 13 14 15 16 17
18 19 1A 1B
D E F 10 11 12 13 14 15 16 17 18
19 1A 1B 1C
E F 10 11 12 13 14 15 16 17 18 19
1A 1B 1C 1D
F 10 11 12 13 14 15 16 17 18 19 1A
1B 1C 1D 1E
Example 2.5
Add the numbers (F347) 16 and (E916) 16
Solution: F347
+ E916
1DC5D
Starting with the least significant digit column above, we add with
and the table gives us D with no carry. Next, we add 4 and 1 and we
obtain 5 with no carry. Now, we add 9 and and 3 we C obtain with no
carry. Finally, we add F and E and that gives 1D . As before, we can
check the sum for correctness by converting the numbers to their
equivalent decimal numbers.
Example 2.6
Solution:
D5C7
- A9F8
2BCF
2.4.1Tens − Complement
The tens − complement of a number can be found by subtracting the
first non − zero least significant digit and all zeros to the right of it
from 10; then, we subtract all other digits from 9.
Example 2.7
Solution:
We first subtract 7 (lsd) from 10 and we obtain 3 . This is the lsd of
the tens − complement. For the remainder part of the tens -
complement, we subtract 6,5,3 , and 2 from 9 and we obtain 3, 4,6 ,
and respectively. Therefore, the tens - complement of 23567 is 76433
Example 2.8
Find the tens − complement of 0.8642
Solution:
We first subtract 2 (lsd) from 10 and all other digits from 9. Therefore,
the tens − complement of 0.8642 is 0.1358
Example 2.9
Find the tens _ complement of 37.562
Solution:
We first subtract 2(lsd) from 10 and all other digits from 9. Therefore,
the tens − complement of 37.562 is 62.438.
2.4.2Nines− Complement
The nines− complement of a number can be found by subtracting
every digit (lsd) of that number from 9.
Example 2.10
We subtract every digit of the given number from and we find that the
nines−complement of 23567 is 76432. We observe that this
complement is one less than which, as we found in Example 2.7, is
the tens − complement of 23567. This is always the case, that is, the
nines − complement is always one less than the tens − complement.
Alternately, we can add 1 to the nines − complement to obtain the
tens − complement.
Example 2.11
Solution:
We subtract every digit of the given number from 9 and we find that
the nines − complement of 23567 is 76432 .Therefore, the
nines − complement of 37.562 is 62.437.
2.4.3Twos− Complement
Example 2.12
Starting from the right side of the given number we leave 100
unchanged and then for the remaining digits, i.e, 1101 we replace the
ones with zeros and the zero with one. Therefore, the
twos − complement of 1101100 is 0010100.
Example 2.13
Solution:
We leave the lsd (last 1 ) unchanged and we replace the ones with
zeros and the zero with one.
Therefore, the twos - complement of 0.1011 is 0.0101. The leading 0
to the left of the binary point that separates the integer and fractional
parts remains unchanged.
Example 2.14
Solution:
We leave the lsd (last 1 ) unchanged and we replace the ones with
zeros and the zeros with ones. Therefore, the twos - complement of
1101100.1011 is 0010011.0101
2.4.4Ones−Complement
Example 2.15
Solution:
Replacing all ones with zeros and all zeros with ones we find that the
ones− complement 1101100 of 0010011 is . We observe that this
complement is one less than 0010100 which, as we found in Example
2.12, is the twos − complement of 1101100. This is always the case,
that is, the ones − complement is always one less than the
twos − complement. Alternately, we can add 1to the ones –
complement to obtain the twos- complement.
Example 2.16
Solution:
Replacing all ones with zeros and all zeros with ones we find that the
ones− complement of 0.1011 is 0.100 . The leading 0 to the left of the
binary point that separates the integer and fractional parts remains
unchanged.
Example 2.17
Example 2.18
Solution:
Minuend = 61435 stays unchanged 61435
Subtrahend 02798 take tens - complement 97202
Example 2.19
Solution:
Minuend = 02798 stays unchanged 02798
Subtrahend 61435 take tens – complement 38565
No end
carry 41363
Solution:
Minuend = 1101100 stays unchanged 1101100
Subtrahend = 1011011 take twos - complement 0100101
Therefore,
( 1101100 – 1011011) 2 =
(0010001) 2
Example 2.21
Solution:
Minuend = 1011011 stays unchanged 1011011
Subtrahend 1101100 take twos complement + 0010100
Since there is no end carry, we take the twos− complement of the sum
and we place a
minus (−) sign in front of it resulting in -0010001. Therefore,
We will assume that the numbers for the subtraction operation are
both positive numbers. The subtraction operation using
nines− complement or ones− complements is performed as follows:
1. Take the nines− complement or ones −complement of the
subtrahend and add it to the minuend which remains unchanged.
2. Check the result (sum), and
a. if an end carry occurs, add 1 − referred to as end around carry
− to the lsd of the result (sum).
b. if an end carry does not occur, take the nines− complement or
ones− complement of the result (sum) and place a minus ( − ) sign in
front of it.
Example 2.22
Solution:
Therefore,
( 61435 – 02798) 10 = (58637) 10
Example 2.23
Solution:
Minuend = 02798 stays unchanged 02798
Subtrahend 61435 take nines complement + 38564
No end carry
41362
Solution:
Minuend = 1101100 stays unchanged 1101100
Subtrahend 1011011 take ones complement + 0100100
Therefore,
( 1101100 – 1011011) 2 = (0010001) 2
Example 2.25
Solution:
Minuend = 1011011 stays unchanged 1011011
Subtrahend = 1101100 take ones complement + 0010011
Therefore,
(1011011 – 1101100) 2 = (–0010001) 2.
T his chapter begins with the basic logic operations and continues
with the fundamentals of Boolean algebra and the basic postulates
and theorems as applied to electronic logic circuits. truth tables are
defined and examples are given to illustrate how they can be used to
prove Boolean algebra theorems or equivalent expressions.
The following three logic operations constitute the three basic logic
operations performed by a digital computer.
5.2.1 Postulates
2.0 .0 = 0
3.0.1= 1.0= 0
4.1.1.= 1
5.0+0= 0
6.0+1 = 1 + 0 = 1
7.1+1 = 1
5.2.2 Theorems
1. Commutative laws
a. A . B = B . A
b.A + B = B + A
2. Associative laws
a. ( A . B) . C = A . ( B . C)
b. A + B) + C = A + (B + C)
3. Distributive laws
a. A . ( B + C) = A . B + A . C
b. A . (B + C) = (A + B) . ( A + C)
4. Identity laws
a. A . A = A
b. A + A = A
5. Negation laws
a. A’ = A’
b. (A)’’ = A’’ = A
6. Redundancy laws
a. A . ( A + B) = A
b. A + (A . B) = A
7.
a. 0 . A = 0
b. 1 . A = A
c. 0 + A = A
d. 1 + A = 1
8.
a. A . A’ = 0
b. A + A’ = 1
9.
a. A . ( A + B) = A . B
b. A + (A . B) = A + B
a.( A . B)’ = A’ + B’
b. (A + B)’ = A’ . B’
Example 5.1
Simplify the Boolean expression C = A’ . B + A . B + A’ . B
Solution:
C = B + A’ . B’
C= A’ + B