Digital Logic Design
Week 4
Boolean algebra
Boolean algebra
• Boolean algebra• Laws and rules• De Morgan’s theorem• Analysis of logic circuits• Standard forms• Project 1 preparation
Boolean algebra
George BooleBritish mathematician and philosopher.An Investigation of the Laws of Thought on Which are Founded the Mathematical Theories of Logic and Probabilities (1854)
Claude ShannonAmerican electrical engineer.First to apply Boole’s work to design of logic circuits (1937)
Boolean algebra is the mathematics of digital systems deals with values 0 and 1, and just three operations: addition,
multiplication, and complement
Boolean operations
Boolean addition differs from binary addition! There is no carry in Boolean addition
0 + 0 = 00 + 1 = 11 + 0 = 11 + 1 = 1
0 · 0 = 00 · 1 = 01 · 0 = 01 · 1 = 1
0’ = 11’ = 0
Booleanaddition
Booleanmultiplication Complement
Boolean operations
0 + 0 = 00 + 1 = 11 + 0 = 11 + 1 = 1
0 · 0 = 00 · 1 = 01 · 0 = 01 · 1 = 1
0’ = 11’ = 0
Booleanaddition
Booleanmultiplication Complement
ANDOR NOT
Sums and products
Sum terms are generated by OR gates
Examples of sum terms:A+B A+B’ A+B+C’
Variables are symbols representing Boolean values 0,1 A, B and C are variables
Literals are variables or complement of variables A, B’ and C’ are literals
Sums and products
• Boolean addition is the same as the OR function, so…– sum term is 1 if one or more of the literals are 1– sum term is 0 only if each literal is 0
Example: Determine the values of the variablesA,B,C,D that make the sum term A+B’+C+D’ = 0Literals A, B’, C and D’ must all equal zero if sum=0A = B’ = C = D’ = 0 A=0, B=1, C=0, D=1
Sums and products
Product terms are generated by AND gates
Examples of product terms:AB AB’ ABC’
Example: Determine the values of the variablesA,B,C,D that make the product term AB’CD’ = 1Literals A, B’, C and D’ must all equal 1 if product=1A = B’ = C = D’ = 1 A=1, B=0, C=1, D=0
A
BX
Remember: A·B often written simply as AB
Boolean algebra
• Boolean algebra• Laws and rules• De Morgan’s theorem• Analysis of logic circuits• Standard forms• Project 1 preparation
Commutative laws
For addition: A + B = B + AThe order in which variables are ORed makes no difference
For multiplication: A · B = B · AThe order in which variables are ANDed makes no difference
Associative laws
For addition: A + (B + C) = (A + B) + C
For multiplication: A(BC) = (AB)C
Distributive law
Expresses the process of factoring
A(B + C) = AB + AC
Rules of Boolean algebra Rules 1–9 from definitions of AND, OR and NOT Rules 10–12 derived from simpler rules and three laws
12. (A + B)(A + C) = A + BC
1. A + 0 = A2. A + 1 = 1
3. A · 0 = 0
4. A · 1 = A
5. A + A = A
7. A · A = A
6. A + A = 1
8. A · A = 0
9. A = A=
10. A + AB = A
11. A + AB = A + B
A couple of the simpler rulesA + 0 = A– A variable ORed with 0 is always equal to the variable
A · 1 = A A variable ANDed with 1 is always equal to the variable
Proving rules 10–12• Rule 10: A + AB = A
A + AB = A·1 + AB Rule 4: A·1 = A= A(1 + B) Factoring (Distributive
Law)= A·1 Rule 2: 1+B = 1= A Rule 4: A·1 = A
Complete the following truth table, and hence prove A+AB=A
A B AB A+AB-------------------------------------0 00 11 01 1
Proving rules 10–12• Rule 11: A + A’B = A+B
A + A’B = (A + AB) + A’B Rule 10: A = A+AB= (AA + AB) + A’B Rule 7: A = AA= AA + AB + AA’ + A’B Rule 8: adding
AA’=0= (A+A’)(A+B) Factoring= 1·(A+B) Rule 6: A+A’=1= A+B Rule 4: drop the 1
Proving rules 10–12• Rule 12: (A+B)(A+C) = A + BC
Complete the following truth table & prove (A+B)(A+C) = A+BC
A B C A+B A+C (A+B)(A+C) BCA+BC
--------------------------------------------------------------------------------------0 0 00 0 10 1 00 1 11 0 01 0 11 1 01 1 1
Duality Principle
• Any Boolean equality remains valid if we exchange:
1 ↔ 0AND ↔ OR
– This explains why rules 1–8 appear in pairs
Example: Apply the duality principle to Rule 1: A+0 = A
A + 0 = A → A · 1 = A (Rule 4)
Boolean algebra
• Boolean algebra• Laws and rules• De Morgan’s theorem• Analysis of logic circuits• Standard forms• Project 1 preparation
De Morgan’s Theorem
A · B = A + B
A + BA
BAB
A
B
NAND Negative-OR
A + B = A · B
ABA
BA + B
A
B
NOR Negative-AND
Extends to more than two variables Example:
Each variable can also represent a combination of other variables Example:
DCBAABCD
BCACABBCACAB
Applying De Morgan’s Theorem
BCACABBCACAB
BCACAB
CBACBA
CABACBCA
BACBCA
Applying De Morgan’s Theorem
Use De Morgan’s theorem to simplify the expression
FEDCBA
Boolean algebra
• Boolean algebra• Laws and rules• De Morgan’s theorem• Analysis of logic circuits• Standard forms• Project 1 preparation
Boolean expression for a logic circuit
• Begin at the circuit inputs and work towards final output
• Write expression for each gate output
Constructing a truth table for a logic circuit
00
0
0
0
0
0
Truth tableA B C D A(B+CD)---------------------------------------------0 0 0 0 00 0 0 1 ......1 1 1 1 ...
I do NOT recommend using this method to
construct the truth table!It’s far too slow
Constructing a truth table for a logic circuit
A·(B+C·D)=1 Equals 1 only if A=1 and B+C·D=1 So expression equals 0 for top half of truth table,
where A=0 B+C·D=1
Equals 1 when B=1 or C·D=1 or both B=1 and C·D=0 → B C D=100,101,110 B=0 and C·D=1 → B C D=011 B=1 and C·D=1 → B C D=111
We can now fill in the truth table quickly
Use of “standard forms” will simplify
the creation of a truth table from logic expression
A B C D A·(B+C·D)-------------------------------------------------------------0 0 0 0 00 0 0 1 00 0 1 0 00 0 1 1 00 1 0 0 00 1 0 1 00 1 1 0 00 1 1 1 01 0 0 0 01 0 0 1 01 0 1 0 01 0 1 1 11 1 0 0 11 1 0 1 11 1 1 0 11 1 1 1 1
A=0
B=0 and C·D=1
B=1 and C·D=0
B=1 and C·D=1
Boolean algebra
• Boolean algebra• Laws and rules• De Morgan’s theorem• Analysis of logic circuits• Standard forms• Project 1 preparation
Standard forms
All Boolean expressions can be converted into either of two standard forms:
Sum-of-products (SOP) form Product-of-sums (POS) form
Makes the following much easier and systematic: Evaluation Simplification Implementation
Truth table from Boolean expression
Fewer gates for same function
Logic gates to implement expression
SOP this week; POS in week 5
Sum-of-products (SOP)Sum-of-products (SOP) expressions are product terms summed by Boolean addition
Examples:
The following expressions are not in SOP form:
ABCAB DCBCDEABC
ACCBABA
ABCAB CDBA
Remember: “summed” by Boolean addition means OR-ed together
AND/OR implementation of SOPSOP expressions simply require ORing outputs of AND gates
Domain of a Boolean expression is the set of variables in the expressionExample: domain of the expression for X in the
figure above is A, B, C, D
Conversion to SOP form
Convert the following expression to SOP form:
CBA
Any logic expression can be changed to SOP form simply by applying Boolean algebra
CBCACBACBA
Standard SOP formStandard SOP expressionAll variables in the domain appear in each product term in the expression
Example:
The following expression is not in standard SOP form:
Why not? Missing or in first term, and missing or in second term
DCABDCBACDBA
DCBADBACBA D DC C
Product terms involving all
variables in the domain are called
minterms
Conversion to standard SOP formProduct terms missing variables can always be expanded to standard form using Boolean algebra rules and
Example:ABCBAX
1XX X1X
First term is missing the variable C
ABCCCBA ABCCBACBA
Truth tables from standard SOP expressions Truth table: list of all
possible input combinations and corresponding output (0 or 1)
Place a 1 in output column for each input combination that makes the standard SOP expression a 1 0 in remaining
rows
A B C X product term
----------------------------------0 0 0 10 0 1 10 1 0 00 1 1 01 0 0 01 0 1 01 1 0 01 1 1 1
CBACBA
ABC
ABCCBACBAX
Boolean algebra
• Boolean algebra• Laws and rules• De Morgan’s theorem• Analysis of logic circuits• Standard forms• Project 1 preparation
Project 1 preparation• On Sunday (16 Nov) , the class will be given a
Boolean expression involving 4 variables (A,B,C,D) • Project 1
Marked by demonstration to me in week 5 theory section 5 parts, each of equal value:a) Expand given expression to sum-of-products (SOP) formb) Create truth table for expressionc) Expand SOP into standard SOP formd) Implement original expression in Logisim using gatese) Enter SOP expression into Logisim, and confirm that the
resulting truth table produced by Logisim matches your truth table in part b)
Project 1— sample question
a) Expand to SOP:b) Truth table: Z=1 only for ABCD=0101,0111,1101c) Standard SOP: d) Logisim circuit:
e) In Logisim: Project > Analyze Circuitenter expression at Expression tabview truth table at Table tab
BDABCZ DCBBDAZ
Week04_projectdemo.circ
DCBADCABDCBABCDAZ
Top Related