290 likes | 487 Views
CS 325: CS Hardware and Software Organization and Architecture. Gates and Boolean Algebra Part 2. Outline. Sum of Products (SOP) Fan-in, Fan-out Cascading to Reduce Inputs Boolean Algebra Laws Gate Reduction using Boolean Algebra. Circuits from SOP Functions. Why simplify circuits?
E N D
CS 325: CS Hardware and SoftwareOrganization and Architecture Gates and Boolean Algebra Part 2
Outline • Sum of Products (SOP) • Fan-in, Fan-out • Cascading to Reduce Inputs • Boolean Algebra Laws • Gate Reduction using Boolean Algebra
Circuits from SOP Functions • Why simplify circuits? • NAND and NOR gates are simpler (faster, smaller) than NOT AND and NOT OR. • Reduction in complexity when using a small number of gate types. • Goal: To implement circuit using a small complete set of operators. • NAND and NOR are both complete since any Boolean function can be implemented with either. • Faster to use small number of inputs to a gate (fan-in), and small number of gate inputs from a gate output (fan-out) • Typically, fan-in and fan-out < 10.
Gate Cascading to Reduce Inputs Implementing 3-input AND and OR functions with 2-input gates ABC = (AB)C A+B+C = (A+B)+C Implementing a 3-input NAND function with 2-input gates. NO! Correct
Basic Laws of Boolean Algebra • Boolean Algebra follows many algebra rules which can be used to make simpler circuits.
Basic Laws of Boolean Algebra • Boolean Algebra follows many algebra rules which can be used to make simpler circuits.
Basic Laws of Boolean Algebra • Boolean Algebra follows many algebra rules which can be used to make simpler circuits.
Basic Laws of Boolean Algebra • Boolean Algebra follows many algebra rules which can be used to make simpler circuits.
Basic Laws of Boolean Algebra • Boolean Algebra follows many algebra rules which can be used to make simpler circuits.
Basic Laws of Boolean Algebra • Boolean Algebra follows many algebra rules which can be used to make simpler circuits.
Basic Laws of Boolean Algebra • Boolean Algebra follows many algebra rules which can be used to make simpler circuits.
Basic Laws of Boolean Algebra • Boolean Algebra follows many algebra rules which can be used to make simpler circuits.
Basic Laws of Boolean Algebra • Boolean Algebra follows many algebra rules which can be used to make simpler circuits.
Basic Laws of Boolean Algebra • Boolean Algebra follows many algebra rules which can be used to make simpler circuits. • Example: AB + AC Three gates • = A(B + C), Distributive Law Two gates
Gate Reduction • AB + AC Three gates • = A(B + C), Distributive Law Two gates
Equivalent Gates/Symbols • Using Boolean Laws (identities), alternative symbols for some gates can be derived:
Functionally Complete Sets of Gates • Not all gate types are typically implemented in circuit design. • Simpler if only 1 or 2 types of gates are used. • A functionally complete set of gates means that any Boolean function can be implemented using only the gates in that set. • Examples of functionally complete sets: • AND, OR, NOT • AND, NOT • OR, NOT • NAND • NOR
Implement XOR with NANDs • Exclusive-OR (XOR) example: • Step 1: build truth table • Step 2: find SOP and build circuit using AND and OR.
Implement XOR with NANDs • Apply Boolean Algebra rules: so, De Morgan’s Law: so, • The last formula is 3 NAND gates.
Implement XOR with NANDs • Logic circuits implementing XOR:
Simplification • Boolean functions, and therefore circuits, can usually be manipulated using Boolean laws into simpler functions. Distributive Law Inverse Law Distributive Law Inverse Law Idempotent Law Identity Law • How to check for correctness?
Checking Logic for Correctness • We can check our solution using a truth table • Checking
Checking Logic for Correctness • We can check our solution using a truth table • Checking Correct
Another Example • Draw the logic gate diagram for the following Boolean function: • Circuit Reduction: Distributive Law Idempotent Law Idempotent Law Distributive Law • Check with Truth table for correctness.
Checking Logic for Correctness • We can check our solution using a truth table • Checking
Checking Logic for Correctness • We can check our solution using a truth table • Checking Correct
Another Example • Draw the logic gate diagram for the following Boolean function: • Circuit Reduction: Distributive Law Idempotent Law Absorption Law Distributive Law Idempotent Law Absorption Law Absorption Law • Check with Truth table for correctness.