Title: ECE U322 Digital Logic Design
1ECE U322Digital Logic Design
Sept 15, 2005
- Lecture 5
- Boolean Algebra
- NOTs, NANDs, and NORs
- Reading Marcovitz 2.2, 2.3, 2.4
2N 4
Number Represented
Unsigned 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Binary 0000 0001 0010 0011 0100 0101 0110 0111 1
000 1001 1010 1011 1100 1101 1110 1111
Signed Mag 0 1 2 3 4 5 6 7 -0 -1 -2 -3 -4 -5 -6 -
7
One's Comp 0 1 2 3 4 5 6 7 -7 -6 -5 -4 -3 -2 -1 -
0
Two's Comp 0 1 2 3 4 5 6 7 -8 -7 -6 -5 -4 -3 -2 -
1
Twos complement Most important
3- Ex 537 using 16-bit unsigned integers is
- 16-bit unsigned integers can represent a range of
integers from - 0 to ________
- or 0 to 65,535
- 16-bit unsigned fraction with binary point to the
left of the most significant digit can represent
fractions from - 0 to_________
- What is the range for signed numbers? 8-bit
4Boolean Algebra
- Operators
- AND ?
- OR v
- NOT A ?A
- Values
- 1 (true) 0 false
5Associative and Distributive
- Associative rules
- a (b c) (a b) c
- a ? (b ? c)
- Distributive rules
- a (b ? c) (a b) ? (a c)
- a ? (b c)
- Note these rules look like algebra !
6Complement (NOT)
- a
- a a 1
- a 0
- Additional rules
- a a a
- a ? a a
7Properties of 0 and 1
8Basic Identities of Boolean Algebra
9Venn Diagram
- You can think of Boolean equations as sets 1 is
everything, and 0 is nothing.
10Absorption Theorem
- a ab a
- a ( a b) a
- Venn Diagram
11An expression is true
- A valid expression is true
- true true
- false false
- x x
- false true
12Absorption Theorem
- a ab a
- Proof
- a ab apply distributive law (14)
- a ab a (1b) apply 3 1 b 1
- a ab a ? 1 apply 2
- a ab
13Boolean Algebra
14Laws of Boolean Algebra
Any law that is true for an expression is also
true for its dual. Operations with 0 and 1 1.
x 0 x x 1 x 2. x 1 1 x 0
0 Idempotent Law 3. x x x x x
x Involution Law 4. (x) x Laws of
Complementarity 5. x x 1 x x
0 Commutative Law 6. x y y x x y y x
15Laws of Boolean Algebra (cont.)
- Associative Laws
- (x y) z x (y z) x y z x (y
z) - Distributive Laws
- x (y z) (x y) (x z) x (y z)
- (x y)(x z)
- Simplification Theorems
- x y x y x (x y) (x y) x
- x x y x x (x y) x
- (x y) y x y (x y) y x y
- DeMorgans Law
- (x y z ) (x y z )
- x y z x y z
- Theorems for Multiplying and Factoring
- (x y) (x z) x y x z
- x z x y (x z) (x y)
- Consensus Theorem
- x y y z x z (x y) (y z)
(x z) - x y x z (x y) (x z)
16Dual
- The dual of an algebraic expression is obtained
by interchanging OR and AND operations, and
replacing 1s by 0s and 0s by 1s. - Replace
-
- 1
- 0
17Duality Principle
- A Boolean equation remains valid (true) if we
take the dual of the equation. - If an expression is true, its dual is true
- To take the dual
- Replace
-
- ?
- 1
- 0
18DeMorgans Laws
- (a ? b) a b
- (a b) a ? b
- Replace AND with OR and OR with AND.
- Remove complement from the entire expression and
place over each variable instead. - These laws are duals of one another.
- NOTE The LHS of each equation is NOT the dual
of the RHS.
19DeMorgans Laws in Pictures
A
A
B
B
A
A
B
B
A
A
B
B
20- Truth tables can be used to verify expressions.
- Example, verify DeMorgans Theorem
21Algebraic Manipulation
- Ex F XYZ XYZ XZ
- Boolean algebra is a useful tool for simplifying
digital circuits. - Literal single variable within a term that may
or may not be complemented.
22 23- Truth Table
- Truth table for both expressions are equivalent.
- By reducing the number of terms and number of
literals, it is possible to obtain a simpler
circuit.
24Consensus Theorem
- XY XZ YZ XY XZ
- Note Y and Z are associated with X and X, and
appear together in the term that is eliminated. - The dual of the consensus theorem is
redundant
25Proof
26Complement of a Function
- F can be obtained by interchanging 1s to 0s and
0s to 1s for values of F in the truth table. - Can apply DeMorgans theorem as many times as
necessary to find F. - F1 XYZ XYZ
- Obtain F1
- F1 XYZ XYZ
27Example
28Negative Logic
- Positive Logic
- true 1
- false 0
- Negative Logic
- true 0
- false 1
- I can think of negated inputs as negative logic.
29Inverted Values
- Bubbles represent inverted values on inputs or
outputs - Two bubbles cancel
- X
30NOR and NAND gates
NOR gates
NAND gates
31OR and AND gates
32Circuit Analysis
F
F
33All you need is NAND gates
- Can build AND, OR, NOT from NAND gates
- NAND(X,X) NOT (X)
34All you need is NAND gates
- AND from NAND gates
- AND(X,Y) NAND followed by NOT (X)
35All you need is NAND gates
- OR from NAND gates
- Use Demorgans
- NAND(X,Y) X ? Y
- How to invert inputs?
36Why Do Everything With NANDs
- Because you can
- can only use NORs too.
- The technology of most digital circuits (CMOS) is
naturally inverting. - To build non-inverting logic, build
- AND NAND NOT
- OR
- Dont do that too many NOT gates.
37LAB 1 XOR gate
Truth Table
- XOR
- Exclusive-OR gate
- Symbol to designate its operation.
- Similar to the OR gate, but excludes (has the
value 0 for) the combination with both X and Y
equal to 1. - 1 if _______________ variable is equal to 1.
38Lab1 XOR from NAND gates