Computer Architecture
Computer Architecture
Computer Architecture
• 1. 0-0=0
• 2. 1-0=1
• 3. 1-1=0
• 4. 0-1=1 with a borrow of 1 from the next column of the
minuend or 10-1=1.
Binary Subtraction
• Example 1: Subtract 01012 from 11102
• Solution:
Complement of a number
• In digital work, two types of complements of a binary number
are used for complemental subtraction:
1’s complement
• The 1’s complement of a binary number is obtained by changing
its each 0 into a 1 and each 1 into a 0.
Example: Find the 1’s complement of 1002 and 11102
Solution: The 1’s complement of 1002 is 0112 and of 11102 is
00012.
Complement of a number
• 2’s complement
• The 2’s complement of a binary number is obtained by adding 1 to
its 1’s complement.
2’s complement = 1’s complement + 1
• Note: There are 4 table entries for the two-input truth tables, 8
entries for a three-input truth table and 16 entries for the four-
input truth table.
• The number of input combinations will equal 2N for an N-input
truth table.
The OR gate
• The truth table for a two-input OR gate is shown in Fig. 6.5 (a)
and its equivalent symbol in Fig. 6.5 (b).
• The two inputs have been marked as A and B and the output as
A+B.
• The table shows that A+B is logic 1 for every combination of
input levels where one or more inputs are 1. The only case
where A+B is a 0 is when both inputs are 0.
The OR gate
• The truth table for a two-input AND gate is shown in Fig. 6.6
(a) and its equivalent symbol in Fig. 6.6 (b).
• The two inputs have been marked as A and B and the output as
A●B.
• The table shows that A●B is a logic 1 only when both A and B
are at the logic 1 state. For any case where one of the inputs is 0, the
output is 0.
The AND gate
• The truth table in Fig. 6.7 (a) clarifies this for the two cases
and, that is
• because 0 is not 1
• because 1 is not 0
NOR Gates and NAND Gates
• Two other types of logic gates, NOR gates and NAND gates are widely
used in digital circuits.
• These gates actually combine the basic AND, OR, and NOT
operations, so it is a relatively very simple to write their Boolean
expressions.
The NOR Gate
• Combinational logic circuits are the ones in which the logic level
at the output depends on the combination of logic levels present at
the inputs.
• A combinational circuit has no memory characteristic, so its
output depends only on the current value of its inputs.
• To simplify the combinational logic circuits, two methods will be
used; one uses Boolean algebra theorems; the other uses a mapping
technique.
Assignment