Principles Of Digital Design Chapter 3 Boolean Algebra and Logic Design Boolean Algebra Logic Gates Digital Design Implementation Technology ASICs Gate Arrays
Basic Algebraic Properties A set is a collection of objects with a common property If S is a set and is a member of the set S,, then S A = {, 2, 3, 4} denotes the set A,, whose elements are, 2, 3, 4 A binary operator on a set S is a rule that assigns to each pair of elements in S another element that is in S Aioms are assumption that are valid without proof Copyright 24-25 by Daniel D. Gajski 2
Eamples of Aioms Closure for all, y S, ( y) S Z + = {, 2, 3, } is closed to addition, because positive numbers are in Z + A set S is closed with respect to a binary operator iff for all Associativity A binary operator defined on a set S is associative iff for all, y, z S Identity Element ( y) z = (y z) A set S has an identity element e for every e = e = + = + = for every S Copyright 24-25 by Daniel D. Gajski 3
Eamples of Aioms Commutativity A binary operator is commutative iff for all, y S Inverse Element y = y A set S has an inverse iff for every such that y S such that Distributivity for every S, there eists an element y = e If and are two binary operators on a set S, is said to be distributive over if, for all, y, z S if, for all, y, z (y z) = ( y) ( z) Copyright 24-25 by Daniel D. Gajski 4
Aiomatic Definition of Boolean Algebra Boolean algebra is a set of elements B with two binary operators, + and,, which satisfies the following si aioms: Aiom (Closure Property): (a) B is closed with respect to the operator +; (b) B is also closed with respect to the operator Aiom 2 (Identity Element): (a) B has an identity element with respect to +, designated by ; (b) B also has an identity element with respect, designated by Aiom 3 (Commutativity Property): (a) B is commutative with respect to +; (b) B is also commutative with respect to Aiom 4 (Distributivity Property): (a) The operator is distributive over +; (b) similarly, the operator + is distributive over Aiom 5 (Complement Element): or every B, there eists an element B such that (a) + = and (b) = This second element, is called the complement of Aiom 6 (Lower Cardinality Bound): There are at least two elements, y B such that y Copyright 24-25 by Daniel D. Gajski 5
Aiomatic Definition of Boolean Algebra Differences between Boolean algebra and ordinary algebra In ordinary algebra, + is not distributive Boolean algebra does not have inverses with respect to + and ; therefore, there are no subtraction or division operations in Boolean algebra Complements are available in Boolean algebra, but not in ordinary algebra Boolean algebra applies to a finite set of elements, whereas ordinary algebra would apply to the infinite sets of real numbers The definition above for Boolean algebra does not include associativity, since it can be derived from the other aioms Copyright 24-25 by Daniel D. Gajski 6
Two-valued Boolean Algebra Set B has two elements: and Algebra has two operators: AND and OR y y AND Operator y + y OR Operator Copyright 24-25 by Daniel D. Gajski 7
Two-valued Boolean Algebra Two-valued Boolean algebra satisfies Huntington aioms Aiom (Closure Property): Closure is evident in the AND/OR tables, since the result of each operation is an element of B. Aiom 2 (Identity Element): The identity elements in this algebra are for the operator + and for the operator. rom theand/or tables, we see that: + =, and + = + = =, and = = Aiom 3 (Commutativity Property): The commutativity laws follow from the symmetry of the operator tables. Copyright 24-25 by Daniel D. Gajski 8
9 Copyright 24-25 by Daniel D. Gajski Two Two-valued Boolean Algebra valued Boolean Algebra Aiom 4 (Distributivity): The distributivity of this algebra can be demonstrated by checking both sides of the equation. y (y + z) z y + z y (y) + (z) z Proof of distributivity of + y + (yz) + z yz y ( + y)(+ z) z Proof of distributivity of + (y + z) = ( y) + ( z) + (y z) = ( + y)( + z).
Two-valued Boolean Algebra Aiom 5 (Complement): and are complements of each other, since + = + = and + = + = ; furthermore, = = and = =. NOT Operator Aiom 6 (Cardinality): The cardinality aiom is satisfied, since this two-valued Boolean algebra has two distinct elements, and, and. Copyright 24-25 by Daniel D. Gajski
Boolean Operator Procedure Boolean operators are applied in the following order. Parentheses ( ) NOT AND OR + Eample: Evaluate epression ( + y) for = and y = : ( + ) ) = ( + ) = () = Copyright 24-25 by Daniel D. Gajski
Duality Principle Any algebraic epression derived from aioms stays valid when are interchanged. OR and AND and Eample: If X + = then X = by the duality principle Copyright 24-25 by Daniel D. Gajski 2
Theorem of Boolean Algebra Theorem (Idempotency) Theorem 2 Theorem 3 (Absorption) Theorem 4 (Involution) Theorem 5 (Associativity) Theorem 6 (De Morgan s Law) (a) (b) (a) (b) (a) (b) (a) (b) (a) (b) + = = + = = y + = (y + ) = ( ) = ( + y) + z = (yz) = ( + y) = (y) = Basic Theorems of Boolean Algebra + (y + z) (y)z y + y Copyright 24-25 by Daniel D. Gajski 3
Theorem Proofs in Boolean Algebra Theorems can be proved by transformations based on aioms and theorems Eample: Theorem (a) Idempotency: + =. Proof: + = ( + ) bdentity (A. 2b) = ( + ) (( + ) by complement (A. 5a) = + by distributivity (A. 4b) = + by complement (A. 5b) = bdentity (A. 2a) Duality Eample: Theorem (b) Idempotency: =. Proof: + = by Theorem (a) = by Duality principle Copyright 24-25 by Daniel D. Gajski 4
Theorem Proofs in Boolean Algebra Checking theorems for every combinations of variable value Eample: Theorem 6(a) DeMorgan s Law: s Law: ( + y) = y y + y ( + y) y y Proof of Demorgan s irst Theorem Copyright 24-25 by Daniel D. Gajski 5
Boolean unctions Algebraic epression, which are formed from binary variables and Boolean operators AND, OR and NOT. Eample: This function would be equal to if if if otherwise, =. = y + y z + yz if = and y =,, or if = and y = and z =,, or if = and y = and z = ; Note : When we evaluate Boolean epressions, we must follow a specific order of operations, namely, () parentheses, (2) NOT, (3) AND, (4) OR. Note 2: A primed or unprimed variable is usually called a literal. l. Copyright 24-25 by Daniel D. Gajski 6
Boolean unctions Truth tables which list the functional value for all combinations of variable values. Eample: = y + y z + yz Row Numbers Variable Values y z unction Values 2 3 4 5 6 7 Copyright 24-25 by Daniel D. Gajski 7
Complement of a unction Complement of function is function, where can be obtained by: Interchanging and in the truth table. Eample: = y + y z + yz Row Numbers 2 3 4 5 6 7 Variable Values y z unction Values Copyright 24-25 by Daniel D. Gajski 8
Complement of a unction Complement of function is function, where can be obtained by: Repeatedly applying DeMorgan s s theorems. Eample: Duality Principle = (y + y z z + yz yz) by definition of = (y) (y z) ( yz) by DeMorgan s s Th. = ( + y )( + y + z )( + y y + z ) z by DeMorgan s s Th. Eample: = ( y) + ( y z) + ( y z) = ( + y ) y ( + y + z ) z ( + y y + z ) z Copyright 24-25 by Daniel D. Gajski 9
Graphic Representation of Boolean unctions y z y z + + + + + + + Copyright 24-25 by Daniel D. Gajski AND-OR Epression size = 5 ANDs 2 ORs 2 NOTs 2 OR-AND Epression size = 2 ANDs 5 ORs 4 NOTs Two different epressions have different sizes
Epression Equivalence We can prove epression equivalence by algebraic manipulation in which each transformation uses an aiom or a theorem of Boolean algebra. Eample: = y + y z z + yz = y + z + yz Proof: y + y z z + yz = y + yz + y z z + yz by absorption = y + (y + y )z + yz by distributivity = y + z z + yz by complement = y + z + yz bdentity = y + yz + z + yz by absorption = y + z + ( + )yz by distributivity = y + z + yz by complement = y + z + yz bdentity y + y z + yz requires 5 ANDs 2 ORs 2 NOTs y + z + yz requires 3 ANDs 2 ORs Difference: 2 ANDs and 2 NOTs Copyright 24-25 by Daniel D. Gajski 2
Minterms Minterm definition If i = b n b is a binary number between and 2 n,, then a minterm of n variables, could be represented as: variables n, n 2, m i ( n, n 2, ) = y n y where for all k such that k n, y k ={ k if Copyright 24-25 by Daniel D. Gajski k if b k = if b k = y z Minterms Designation y z y z yz yz y z y z yz yz Minterms for Three Binary Variables 22 m m m 2 m 3 m 4 m 5 m 6 m 7
Sum-of of-minterms Any Boolean function can be epressed as a sum (OR) of its -minterms: (list of variables) = Σ(list of -minterm indices) Eample: Row Numbers 2 3 4 5 6 7 Copyright 24-25 by Daniel D. Gajski Variable Values y z unction Values Equation Table = y + y z + yz = ( + y )( + y + z )( + y + z ) (, y, z) z = Σ(3, 5, 6, 7) = m 3 + m 5 + m 6 + m 7 = yz + y z z + yz + yz (, y, z) z = Σ(,,, 2, 4) = m + m + m 2 + m 4 = y z + y z + yz yz + y z 23
Epansion to Sum-of of-minterms Any Boolean function can be epanded into a sum-ofminterms form be epanding each term with ( + ) for each missing variable. Eample: = + yz = (y + y )( )(z + z ) z + ( + )yz = yz + y z z + yz + y z + yz + yz After removing duplicates and rearranging the minterms in ascending order: = yz + y z + y z z + yz + yz = m 3 + m 4 + m 5 + m 6 + m 7 = Σ(3, 4, 5, 6, 7) Copyright 24-25 by Daniel D. Gajski 24
Conversion to Sum-of of-minterms Each Boolean function can be converted into a sum-ofminterms form by generating the truth table and identifying -minterms. Eample: = + yz y z = m 3 + m 4 + m 5 + m 6 + m 7 Copyright 24-25 by Daniel D. Gajski 25
Materms Materms can be defined as the complement of minterms: M i = m i and M i = m i y z Materms Designation + y + z M + y + z M + y + z M 2 + y + z M 3 + y + z M 4 + y + z M 5 + y + z M 6 + y + z M 7 Materms for Three Binary Variables Copyright 24-25 by Daniel D. Gajski 26
Product-of of-materms Any Boolean function can be epressed as a product (AND) of its -materms: (list of variables) = Π(list of -materm indices) Eample: Row Numbers 2 3 4 5 6 7 Copyright 24-25 by Daniel D. Gajski Variable Values y z unction Values Equation Table = y + y z + yz = ( + y )( + y + z )( + y + z ) (, y, z) z = Π(,,, 2, 4) = M M M 2 M 4 = ( + y + z)( + y + z )( + y y + z)( + y y + z) z (, y, z) z = Π(3, 5, 6, 7) = M 3 M 5 M 6 M 7 = ( + y y + z )( + y + z )( + y y + z)( + y y + z ) z Product-of of-materms can also be obtained by complementing the sum-of of-minterms 27 ( ) = ( yz + y z z + yz + yz) = ( + y y + z )( + y + z )( + y y + z)( + y y + z ) z = M 3 M 5 M 6 M 7 = ( ) = ( y z + y z + yz yz + yz ) = ( + y + z)( + y + z )( + y y + z)( + y y + z) z = M M M 2 M 4
Epansion to Product-of of-materms Any Boolean function can be epanded into a product-of-materms form be epanding each term with for each missing variable. Eample: Convert = y + z = ( y + )( )( y + z) z = ( + )( )(y + )( )( + z)( )(y + z) z = ( + y )( )( + z)( )(y + z) z missing i missing missing Epand + y = + y y + zz = ( + y y + z)( )( + y y + z ) + z = + z + yy = ( + y + z)( )( + y y + z) y + z = y + z + = ( + y y + z)( )( + y y + z) Combine = ( + y y + z)( )( + y y + z )( )( + y + z)( )( + y y + z) = M 2 M 3 M 4 M 6 = (2, 3, 4, 6) Copyright 24-25 by Daniel D. Gajski 28
Conversion to Product-of of-materms Any Boolean epression can be converted into a sum-ofmaterms by generating the truth table and listing all the - materms. Eample: = y + z y z Copyright 24-25 by Daniel D. Gajski (,, y, z) z = Σ(,, 5, 7) (,, y, z) z = Π(2, 3, 4, 6) 29
Canonical orms Two canonical forms: Sum-of of-minterms Product-of-materms Canonical forms are unique. Conversion between canonical forms is achieved by: Echanging Σ and Π Listing all the missing indices Copyright 24-25 by Daniel D. Gajski 3
Standard orms Two standard forms Sum-of of-products Product-of of-sums Standard forms are not unique. Sum-of-products is an OR epression with product terms that may have less literals than minterms Eample: = y + yz + y z Copyright 24-25 by Daniel D. Gajski 3
Standard orms Product-of-sums is an AND epression with sum terms that may have less literals than materms Eample: = ( + y )( + y y + z )( + y + z ) z Standard forms have fewer operators (literals) than canonical forms Standard forms can be derived from canonical forms by combining terms that differ in one variable (this is, terms at distance ) Eample: = yz + yz + y z z + yz = yz + yz + yz + y z z + yz + yz = y(z + z ) z + (y + y )z + ( + )yz = y + z + yz Copyright 24-25 by Daniel D. Gajski 32
Non-standard orms Non-standard forms have fewer operators (literals) than standard forms. They are obtained by factoring variables. Eample: y + y z z + y w = (y + y z + y w) = (y + y (z + w)) w Copyright 24-25 by Daniel D. Gajski 33
Strategy for Operator (Literal) Reduction in Boolean Epressions Algebraic Epression Epand into truth table Truth table Generate canonical form Canonical form ind functional subcubes Standard form actor sub-epressions Non-standard form Copyright 24-25 by Daniel D. Gajski 34
Binary Logic Operations There are 2 2n Boolean functions for n binary variables Therefore, 6 Boolean functions for n = 2. They are Zero AND Name Inhibition Transfer Inhibition Transfer XOR OR NOR Equivalence Complement Implication Complement Implication NAND One Operator Symbol y / y y / y + y y y y y y y Copyright 24-25 by Daniel D. Gajski unctional Values for,y = Algebraic Epression = = y 2 = y 3 = 4 = y 5 = y 6 = y + y 7 = + y 8 = ( + y) 9 = y + y = y = + y 2 = 3 = + y 4 = (y) 5 = 35 Comment Binary constant and y but not y y but not y or y but not both or y Not-OR equals y Not y If y, then Not If, then y Not-AND Binary constant There are two functions that generate constants: Zero and One. or every combination of variable values, the Zero function will return to, whereas the One function will return to. There are four functions of one variable, which indicate Complement and Transfer operations. Specifically, the Complement function will produce the complement of one of the binary variables. The Transfer functions by contrast will reproduce one of the binary variables at the output. There are ten functions that define eight specific binary operations: AND, Inhibition, XOR, OR, NOR, Equivalence, Implication, and NAND.
Digital Logic Gates Name Graphic Symbol unctional Epression Number of transistors Delay in ns Inverter = 2 Driver = 4 2 AND y = y 6 2.4 OR y = + y 6 2.4 NAND y = (y) 4.4 NOR y = ( + y) 4.4 XOR y = y 4 4.2 XNOR y = y 2 3.2 Copyright 24-25 by Daniel D. Gajski Basic Logic Library (CMOS Technology Implementations) 36
Multiple-Input Gates Name Graphic Symbol unctional Epression Number of transistors Delay in ns 3 input AND yz = yz 8 2.8 4 input AND w yz = yzw 3.2 3 input OR yz = + y + z 8 2.8 4 input OR w yz = + y + z + w 3.2 3 input NAND yz = (yz) 6.8 4 input NAND w yz = (yzw) 8 2.2 3 input NOR yz = ( + y + z) 6.8 4 input NOR w yz = ( + y + z + w) 8 2.2 Copyright 24-25 by Daniel D. Gajski Multiple-Input Standard Logic Gates 37
Multiple-Operator (Comple) Gates 2 wide, 2 input AOI 3 wide, 2 input AOI 2 wide, 3 input AOI 2 wide, 2 input OAI 3 wide, 2 input OAI 2 wide, 3 input OAI Name Copyright 24-25 by Daniel D. Gajski w y z u v w y z u v w yz w y z u v w y z u v w yz Graphic Symbol = (w + yz) unctional Epression = (uv + w + yz) = (uvw + yz) = ((w + )(y+ z)) = ((u + v)(w+ )(y + z)) = ((u + v + w)( +y + z)) Multiple-Operator Standard Logic Gates 38 Number of transistors 8 2 2 8 2 2 Delay in ns 2. 2.4 2.2 2. 2.2 2.4
ull-adder Design Using XOR Gates i + 2.4 2.4 4.2 2.4 4.2 i + s i Truth table s i Logic Schematic (46 Transistors) Input/Output Path to + to s i i, to + i, to s i ull adder delays Delay (ns) 4.8 ns 4.2 ns 9. ns 8.4 ns s i = i + i + i + i = ( i + i ) + (( i + i ) = ( i ) + (( i ) = ( i ) + (( i ) = ( i ) + = i + i + i + i = i ( + ) + ( i + i ) = i + ( i ) ull adder equation Copyright 24-25 by Daniel D. Gajski 39
ull-adder Design Using ast Gates 2.4.4.4.4.4.4 2.4.4 i i + s i Truth table s i + Logic Schematic (36 Transistors) Input/Output Path to + to s i i, to + i, to s i ull adder delays Delay (ns) 2.8 ns 3.8 ns 5.2 ns 7.6 ns i = i + i = (( i ) ( i ) ) = (( i ) ( i + )) s i = ( i ) + (( i ) = ( i ) + (( i ) = ( i ) + + = i + ( i + ) = (( i ) ( ( i + )) ) ull adder equation Copyright 24-25 by Daniel D. Gajski 4
ull-adder Design with Multiple-input input Gates i i + s i.4.4.4.8.8.8.8.8 2.2 Truth table + Logic Schematic (56 Transistors) s i Input/Output Path to + to s i i, to + i, to s i Delay (ns) 3.2 ns 5. ns 4.2 ns 5. ns s i = i + i + i + i = (( i ) ( i ) ( i ) ( i )) + = i + i + = (( i ) ( i ) ( ) ) ull adder equation ull adder delays Copyright 24-25 by Daniel D. Gajski 4
ull-adder Design with Comple Gates i 2.4 2. 2. i + s i.4 Truth table + s i Logic Schematic (46 Transistors) Input/Output Path to + to s i i, to + i, to s i ull adder delays Delay (ns) 3.4 ns 4.4 ns 3.4 ns 4.4 ns s i = i + i + i + i = (( i + i ) ( i + i ) ) + = i + i + = (( i ) ( i ) ( ) ) = (( i + )( + i )( + )) = ( i + i + ) ull adder equation Copyright 24-25 by Daniel D. Gajski 42
VLSI Technology Small-scale integration (SSI) gates/package Medium-scale integration (MSI) gates/package (2 4 bit slices) Large-scale integration (LSI) gates/package (controllers, datapaths, bit slices) Very-large-scale integration (VLSI) + gates/package (systems on a chip) Custom designs (Standard cells) Gate arrays (GAs) ield-programmable (PGAs) Copyright 24-25 by Daniel D. Gajski 43
Custom Design Standard Cells Routing Channel Each designed by hand Standard cells Same height, different widths Routing in channels and over the cells Two or more metal layers Standard Cell Approach Copyright 24-25 by Daniel D. Gajski 44
Eample of Custom Design i i + i + i i s i i i i ull-adder Implementation with Standard Cells s i Copyright 24-25 by Daniel D. Gajski 45
Semi-Custom Approach with Gate Arrays Gate arrays are prefabricated arrays of interconnected gates All gates are the same type (3 input NAND, for eample) Two or more metal layers used to connect gates ( i ) ( i ) ( i ) i i ( i ) ( ) + ( i ) ( i ) s i Copyright 24-25 by Daniel D. Gajski ull-adder Implementation in a Gate Array 46
ield Programmable Approach with PGA PGAs are programmed by loading data into internal memory Ecellent for rapid prototyping Low density and low speed SM SM SM PLB PLB g g 2 g 3 g 4 4- variable Boolean function GQ G SM SM SM PLB PLB h h 2 h 3 h 4 4- variable Boolean function HQ H Interconnect Point (IP) SM SM SM Array Structure Programmable Logic Blocks (PLB) Copyright 24-25 by Daniel D. Gajski 47
ull-adder Implemented with PGA programmable logic block for each full-adder 3 out of 4 inputs are used for each Boolean function i Unused g g 2 g 3 g 4 g X X X X X X X X g 2 g 3 g 4 G GQ + G Unused h h 2 h 3 h 4 h h 2 h 3 h 4 X X X X X X X X H HQ H s i Copyright 24-25 by Daniel D. Gajski 48
Chapter Summary Boolean Algebra Aioms Basic theorems Boolean unctions Specification of Boolean unctions Truth tables Algebraic epressions Canonical forms Standard forms Non-standard forms Algebraic Manipulation of Boolean Epressions Logic Gates Simple gates Multiple-input input gates Comple gates Implementation Technology SSI (Small-scale integration) MSI (Medium-scale integration) LSI (Large-scale integration) VLSI (Very-large large-scale integration) Custom designs Semi-custom designs ield-programmable Copyright 24-25 by Daniel D. Gajski 49