DS Lectures..............
DS Lectures..............
• Equivalent Circuits
• Reductions of circuits
Applications of Logic
3
Lectures outline
• Boolean Algebra
• Adders
• Reductions of circuits
Basic Logic Gates
x
• Not x where x = ¬x
x xy
• And y where xy = x y
x x+y
• Or y where x+y = x y
Constructing Circuits
Here is the circuit of the statement
(p q) (~p q) (p ~q)
Cont...
Following is the circuit output of the following
statement
(x + y) ¬ y
x
y
Designing a circuitt for a given input/output
• Half Adders
a. ∼P ≡ P ↓ P
b. P ∨ Q ≡ (P ↓ Q) ↓ (P ↓ Q)
c. P ∧ Q ≡ (P ↓ P) ↓ (Q ↓ Q)
b. (P ↓ Q) ↓ (P ↓ Q)
More generally, decimal notation is based on the fact that any positive
integer can be written uniquely as a sum of products of the form
d ·10n
where each n is a nonnegative integer and each d is one of the decimal
digits 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9. The word decimal comes from the Latin
root deci, meaning “ten.”
Boolean Algebra
Converting decimal to binary representations
27 = 16 + 8 + 2 + 1
= 1·24 + 1·23 + 0·22 + 1·21 + 1·20.
Boolean Algebra
Any integer can be represented uniquely as a sum of products of the form
d ·2n
where each n is an integer and each d is one of the binary digits (or bits) 0
or 1.
Converting binary to decimal
Represent 110101 in decimal notation.
Addition in Binary Notation
Add 11012 and 1112 using binary notation.
Solution: Because 210 = 102 and 110 = 12, the translation of 110 +
110 = 210 to binary notation is
• Carry is x AND y
• Sum is x XOR y
• The circuit to compute this is called a half-adder.
Circuit of Half Adder
• Sum = x XOR y
• Carry = x AND y
x
y Sum
Carry
Using Half adders
1 0 0
1 1 0 0
+1 1 1 0
? 0 1 0
How to fix that
• We need to create an adder that can take a carry bit as an
additional input
Inputs: x, y, carry in
Outputs: sum, carry out
• This is called a full adder
Will add x and y with a half-adder
Will add the sum of that to the
carry in
• What about the carry out?
It’s 1 if either (or both):
x+y = 10
x+y = 01 and carry in = 1
The Full adder
Parallel Adder Circuits
Two full-adders and one half-adder can be used together to build a
circuit that will add two three-digit binary numbers PQR and STU to
obtain the sum WXYZ. Such a circuit is called a parallel adder.
Parallel adders can be constructed to add binary numbers of any
finite length.
The Full adder
The full circuitry of the full adder
c
s
x
y
c
Lecture summary
• Boolean Algebra