33
Chapter 4 Boolean Algebra and Logic Simplification ETEC 2301 Programmable Logic Devices Shawnee State University Department of Industrial and Engineering Technologies Copyright © 2007 by Janna B. Gallaher

Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Embed Size (px)

Citation preview

Page 1: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Chapter 4Boolean Algebra andLogic Simplification

ETEC 2301 Programmable Logic Devices

Shawnee State UniversityDepartment of Industrial and Engineering Technologies

Copyright copy 2007 by Janna B Gallaher

Boolean Operations and Expressions Boolean Addition

minus The OR Operation

Boolean Multiplicationminus The AND Operation

Laws and Rules of Boolean Algebra Laws of Boolean Algebra

minus Commutative Law Commutative Law of Addition A + B = B + A Commutative Law of Multiplication AB = BA

minus Associative Law Associative Law of Addition A + (B + C) = (A + B) + C Associative Law of Multiplication A(BC) = (AB)C

minus Distributive Law A(B + C) = AB + AC

Laws and Rules of Boolean Algebra (continued) Laws of Boolean Algebra (Continued)

minus The 12 Rules of Boolean Algebra A + 0 = A A + 1 = 1 A 0 = 0 A 1 = A A + A = A A + A = 1 A A = A A A = 0 A = A A + AB = A A + AB = A + B (A + B)(A + C) = A + BC

Demorgans Theorems

XY = X + Y

X + Y = XY

Boolean Analysis of Logic Circuits

Boolean Expression for a Logic Circuitminus Boolean expressions are written by starting at the left-most gate working

toward the final output and writing the expression for each gate

Boolean Analysis of Logic Circuits (continued) Constructing a Truth Table for a Logic Circuit A(B + CD) INPUTS OUTPUT

A B C D A(B + CD)

0 0 0 0 0

0 0 0 1 0

0 0 1 0 0

0 0 1 1 0

0 1 0 0 0

0 1 0 1 0

0 1 1 0 0

0 1 1 1 0

1 0 0 0 0

1 0 0 1 0

1 0 1 0 0

1 0 1 1 1

1 1 0 0 1

1 1 0 1 1

1 1 1 0 1

1 1 1 1 1

Simplification Using Boolean Algebra Simplify

minus Use the 12 rules and DeMorgans theorems

Apply Rule 10Apply Rule 10

Simplify AB + A(B + C) + B(B + C)

AABABCAABC

A

ABABACBBBCABACBBCABBACBAC

AABABC

Standard Forms of Boolean Expressions Sum-of-Products(SOP) Form

minus eg AB + ABC ABC + CDE + BCDminus Domain of a Boolean Expression = the set of variables contained in the

expression eg For AB + ABC the domain is A B and Cminus ANDOR implementation of an SOP expression

ORing the output of two or more AND gates

ANDOR Implementation of SOP NANDNAND Implementation of SOP

Standard Forms of Boolean Expressions Conversion of a General Expression to SOP Form

minus eg Convert AB + B(CD + EF) to SOP AB + BCD + BEF

The Standard SOP Formminus All of the variables in the domain appear in each product term

eg ABCD + ABCD + ABCD is in standard formminus If a variable is missing from any term it and its negative must be added to that

termbull eg Convert to standard SOP form

A BC=A BC DD=A BC DA BC DA B=A BCC =A BCA B CA B=A BCA B C=A BC DDA B C DD=A BC DA BC DA B C DA B C DA BCA BAB C D=A BC DA BC DA BC DA BC DA B C DA B C DAB C D

A BCA BAB C D

Product-of-Sums (POS) Formminus eg minus Implementation of a POS expression

(A + B)(B + C + D)(A + C)

The Standard POS Formminus Must contain all of the terms in the domain of the expressionminus eg (A + B + C)(A + B + D)(A + B + C + D) is missing D in the first term

and C in the second term These need to be added in to get the expression into standard form

Standard Forms of Boolean Expressions (continued)

AB ABC

Converting a sum term to standard POSminus Add each nonstandard product term a term made up of the product of the

missing variable and its complementminus Apply rule 12 =gt A + BC = (A + B)(A + C)minus Apply to all terms missing variablesminus eg Convert

First lets just reduce it

Standard Forms of Boolean Expressions (continued)

A AC AB

AAA C ABAA C ABA AB AAABAABA

Converting a sum term to standard POS (continued)minus Now lets put it into standard form

Standard Forms of Boolean Expressions (continued)

A AC AB

AB B=ABABABC C =ABC ABC ABC C=ABC ABC

ACB B=ABC ABC

ABC C=ABC ABC

ABC ABC ABC ABC ABC ABC ABC ABcABC ABC ABC ABC

First term A

Second Term (A + C)

Third Term (A + B)

Inputs Output A B C X Product Term

0 0 0 00 0 1 00 1 0 1 A BC

0 1 1 01 0 0 01 0 1 1 A B C

1 1 0 01 1 1 0

Boolean Expressions and Truth Tables Converting SOP Expressions to Truth Table Format

minus For a sum term we need to determine where the term = 1minus eg Develop the truth table for A B CA BC

An SOP = 1 only if one or more of the product terms = 1

01 0=111=1

101=111=1

Inputs Output A B C X Sum Term

0 0 0 10 0 1 0 ABC 0 1 0 0 ABC 0 1 1 11 0 0 11 0 1 11 1 0 11 1 1 0 ABC

Converting POS Expressions to Truth Table Formatminus For a product term we need to determine where the term = 0minus eg Develop the truth table for

Boolean Expressions and Truth Tables (continued)

ABC ABC ABC

ABC =001=0ABC =010=0

ABC =111=0

Determining Standard Expressions from a Truth Tableminus Given a truth table the SOP expression is developed from where the

output is 1 and the POS expression is developed from where the output is 0

minus eg Develop the SOP and POS expressions from the following

Boolean Expressions and Truth Tables (continued)

Inputs Output A B C X0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1

For the SOP expression Look or an output of 1 Then write the terms

011 A BC100 A BC110 A BC111 A BCX=A BCABCA BCABC

For the POS expression Look for an output of 0 Then write the terms

000 ABC001 ABC010 ABC101 ABCX=ABC ABC ABC ABC

The Karnaugh Map Provides a method for simplifying Boolean expressions It will produce the simplest SOP and POS expressions Works best for less than 6 variables Similar to a truth table =gt it maps all possibilities A Karnaugh map is an array of cells arranged in a special manner The number of cells is 2n where n = number of variables A 3-Variable Karnaugh Map

Note the order of these values they are reverse of the usual order They are arranged this way so that only one variable changes at a time

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 2: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Boolean Operations and Expressions Boolean Addition

minus The OR Operation

Boolean Multiplicationminus The AND Operation

Laws and Rules of Boolean Algebra Laws of Boolean Algebra

minus Commutative Law Commutative Law of Addition A + B = B + A Commutative Law of Multiplication AB = BA

minus Associative Law Associative Law of Addition A + (B + C) = (A + B) + C Associative Law of Multiplication A(BC) = (AB)C

minus Distributive Law A(B + C) = AB + AC

Laws and Rules of Boolean Algebra (continued) Laws of Boolean Algebra (Continued)

minus The 12 Rules of Boolean Algebra A + 0 = A A + 1 = 1 A 0 = 0 A 1 = A A + A = A A + A = 1 A A = A A A = 0 A = A A + AB = A A + AB = A + B (A + B)(A + C) = A + BC

Demorgans Theorems

XY = X + Y

X + Y = XY

Boolean Analysis of Logic Circuits

Boolean Expression for a Logic Circuitminus Boolean expressions are written by starting at the left-most gate working

toward the final output and writing the expression for each gate

Boolean Analysis of Logic Circuits (continued) Constructing a Truth Table for a Logic Circuit A(B + CD) INPUTS OUTPUT

A B C D A(B + CD)

0 0 0 0 0

0 0 0 1 0

0 0 1 0 0

0 0 1 1 0

0 1 0 0 0

0 1 0 1 0

0 1 1 0 0

0 1 1 1 0

1 0 0 0 0

1 0 0 1 0

1 0 1 0 0

1 0 1 1 1

1 1 0 0 1

1 1 0 1 1

1 1 1 0 1

1 1 1 1 1

Simplification Using Boolean Algebra Simplify

minus Use the 12 rules and DeMorgans theorems

Apply Rule 10Apply Rule 10

Simplify AB + A(B + C) + B(B + C)

AABABCAABC

A

ABABACBBBCABACBBCABBACBAC

AABABC

Standard Forms of Boolean Expressions Sum-of-Products(SOP) Form

minus eg AB + ABC ABC + CDE + BCDminus Domain of a Boolean Expression = the set of variables contained in the

expression eg For AB + ABC the domain is A B and Cminus ANDOR implementation of an SOP expression

ORing the output of two or more AND gates

ANDOR Implementation of SOP NANDNAND Implementation of SOP

Standard Forms of Boolean Expressions Conversion of a General Expression to SOP Form

minus eg Convert AB + B(CD + EF) to SOP AB + BCD + BEF

The Standard SOP Formminus All of the variables in the domain appear in each product term

eg ABCD + ABCD + ABCD is in standard formminus If a variable is missing from any term it and its negative must be added to that

termbull eg Convert to standard SOP form

A BC=A BC DD=A BC DA BC DA B=A BCC =A BCA B CA B=A BCA B C=A BC DDA B C DD=A BC DA BC DA B C DA B C DA BCA BAB C D=A BC DA BC DA BC DA BC DA B C DA B C DAB C D

A BCA BAB C D

Product-of-Sums (POS) Formminus eg minus Implementation of a POS expression

(A + B)(B + C + D)(A + C)

The Standard POS Formminus Must contain all of the terms in the domain of the expressionminus eg (A + B + C)(A + B + D)(A + B + C + D) is missing D in the first term

and C in the second term These need to be added in to get the expression into standard form

Standard Forms of Boolean Expressions (continued)

AB ABC

Converting a sum term to standard POSminus Add each nonstandard product term a term made up of the product of the

missing variable and its complementminus Apply rule 12 =gt A + BC = (A + B)(A + C)minus Apply to all terms missing variablesminus eg Convert

First lets just reduce it

Standard Forms of Boolean Expressions (continued)

A AC AB

AAA C ABAA C ABA AB AAABAABA

Converting a sum term to standard POS (continued)minus Now lets put it into standard form

Standard Forms of Boolean Expressions (continued)

A AC AB

AB B=ABABABC C =ABC ABC ABC C=ABC ABC

ACB B=ABC ABC

ABC C=ABC ABC

ABC ABC ABC ABC ABC ABC ABC ABcABC ABC ABC ABC

First term A

Second Term (A + C)

Third Term (A + B)

Inputs Output A B C X Product Term

0 0 0 00 0 1 00 1 0 1 A BC

0 1 1 01 0 0 01 0 1 1 A B C

1 1 0 01 1 1 0

Boolean Expressions and Truth Tables Converting SOP Expressions to Truth Table Format

minus For a sum term we need to determine where the term = 1minus eg Develop the truth table for A B CA BC

An SOP = 1 only if one or more of the product terms = 1

01 0=111=1

101=111=1

Inputs Output A B C X Sum Term

0 0 0 10 0 1 0 ABC 0 1 0 0 ABC 0 1 1 11 0 0 11 0 1 11 1 0 11 1 1 0 ABC

Converting POS Expressions to Truth Table Formatminus For a product term we need to determine where the term = 0minus eg Develop the truth table for

Boolean Expressions and Truth Tables (continued)

ABC ABC ABC

ABC =001=0ABC =010=0

ABC =111=0

Determining Standard Expressions from a Truth Tableminus Given a truth table the SOP expression is developed from where the

output is 1 and the POS expression is developed from where the output is 0

minus eg Develop the SOP and POS expressions from the following

Boolean Expressions and Truth Tables (continued)

Inputs Output A B C X0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1

For the SOP expression Look or an output of 1 Then write the terms

011 A BC100 A BC110 A BC111 A BCX=A BCABCA BCABC

For the POS expression Look for an output of 0 Then write the terms

000 ABC001 ABC010 ABC101 ABCX=ABC ABC ABC ABC

The Karnaugh Map Provides a method for simplifying Boolean expressions It will produce the simplest SOP and POS expressions Works best for less than 6 variables Similar to a truth table =gt it maps all possibilities A Karnaugh map is an array of cells arranged in a special manner The number of cells is 2n where n = number of variables A 3-Variable Karnaugh Map

Note the order of these values they are reverse of the usual order They are arranged this way so that only one variable changes at a time

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 3: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Laws and Rules of Boolean Algebra Laws of Boolean Algebra

minus Commutative Law Commutative Law of Addition A + B = B + A Commutative Law of Multiplication AB = BA

minus Associative Law Associative Law of Addition A + (B + C) = (A + B) + C Associative Law of Multiplication A(BC) = (AB)C

minus Distributive Law A(B + C) = AB + AC

Laws and Rules of Boolean Algebra (continued) Laws of Boolean Algebra (Continued)

minus The 12 Rules of Boolean Algebra A + 0 = A A + 1 = 1 A 0 = 0 A 1 = A A + A = A A + A = 1 A A = A A A = 0 A = A A + AB = A A + AB = A + B (A + B)(A + C) = A + BC

Demorgans Theorems

XY = X + Y

X + Y = XY

Boolean Analysis of Logic Circuits

Boolean Expression for a Logic Circuitminus Boolean expressions are written by starting at the left-most gate working

toward the final output and writing the expression for each gate

Boolean Analysis of Logic Circuits (continued) Constructing a Truth Table for a Logic Circuit A(B + CD) INPUTS OUTPUT

A B C D A(B + CD)

0 0 0 0 0

0 0 0 1 0

0 0 1 0 0

0 0 1 1 0

0 1 0 0 0

0 1 0 1 0

0 1 1 0 0

0 1 1 1 0

1 0 0 0 0

1 0 0 1 0

1 0 1 0 0

1 0 1 1 1

1 1 0 0 1

1 1 0 1 1

1 1 1 0 1

1 1 1 1 1

Simplification Using Boolean Algebra Simplify

minus Use the 12 rules and DeMorgans theorems

Apply Rule 10Apply Rule 10

Simplify AB + A(B + C) + B(B + C)

AABABCAABC

A

ABABACBBBCABACBBCABBACBAC

AABABC

Standard Forms of Boolean Expressions Sum-of-Products(SOP) Form

minus eg AB + ABC ABC + CDE + BCDminus Domain of a Boolean Expression = the set of variables contained in the

expression eg For AB + ABC the domain is A B and Cminus ANDOR implementation of an SOP expression

ORing the output of two or more AND gates

ANDOR Implementation of SOP NANDNAND Implementation of SOP

Standard Forms of Boolean Expressions Conversion of a General Expression to SOP Form

minus eg Convert AB + B(CD + EF) to SOP AB + BCD + BEF

The Standard SOP Formminus All of the variables in the domain appear in each product term

eg ABCD + ABCD + ABCD is in standard formminus If a variable is missing from any term it and its negative must be added to that

termbull eg Convert to standard SOP form

A BC=A BC DD=A BC DA BC DA B=A BCC =A BCA B CA B=A BCA B C=A BC DDA B C DD=A BC DA BC DA B C DA B C DA BCA BAB C D=A BC DA BC DA BC DA BC DA B C DA B C DAB C D

A BCA BAB C D

Product-of-Sums (POS) Formminus eg minus Implementation of a POS expression

(A + B)(B + C + D)(A + C)

The Standard POS Formminus Must contain all of the terms in the domain of the expressionminus eg (A + B + C)(A + B + D)(A + B + C + D) is missing D in the first term

and C in the second term These need to be added in to get the expression into standard form

Standard Forms of Boolean Expressions (continued)

AB ABC

Converting a sum term to standard POSminus Add each nonstandard product term a term made up of the product of the

missing variable and its complementminus Apply rule 12 =gt A + BC = (A + B)(A + C)minus Apply to all terms missing variablesminus eg Convert

First lets just reduce it

Standard Forms of Boolean Expressions (continued)

A AC AB

AAA C ABAA C ABA AB AAABAABA

Converting a sum term to standard POS (continued)minus Now lets put it into standard form

Standard Forms of Boolean Expressions (continued)

A AC AB

AB B=ABABABC C =ABC ABC ABC C=ABC ABC

ACB B=ABC ABC

ABC C=ABC ABC

ABC ABC ABC ABC ABC ABC ABC ABcABC ABC ABC ABC

First term A

Second Term (A + C)

Third Term (A + B)

Inputs Output A B C X Product Term

0 0 0 00 0 1 00 1 0 1 A BC

0 1 1 01 0 0 01 0 1 1 A B C

1 1 0 01 1 1 0

Boolean Expressions and Truth Tables Converting SOP Expressions to Truth Table Format

minus For a sum term we need to determine where the term = 1minus eg Develop the truth table for A B CA BC

An SOP = 1 only if one or more of the product terms = 1

01 0=111=1

101=111=1

Inputs Output A B C X Sum Term

0 0 0 10 0 1 0 ABC 0 1 0 0 ABC 0 1 1 11 0 0 11 0 1 11 1 0 11 1 1 0 ABC

Converting POS Expressions to Truth Table Formatminus For a product term we need to determine where the term = 0minus eg Develop the truth table for

Boolean Expressions and Truth Tables (continued)

ABC ABC ABC

ABC =001=0ABC =010=0

ABC =111=0

Determining Standard Expressions from a Truth Tableminus Given a truth table the SOP expression is developed from where the

output is 1 and the POS expression is developed from where the output is 0

minus eg Develop the SOP and POS expressions from the following

Boolean Expressions and Truth Tables (continued)

Inputs Output A B C X0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1

For the SOP expression Look or an output of 1 Then write the terms

011 A BC100 A BC110 A BC111 A BCX=A BCABCA BCABC

For the POS expression Look for an output of 0 Then write the terms

000 ABC001 ABC010 ABC101 ABCX=ABC ABC ABC ABC

The Karnaugh Map Provides a method for simplifying Boolean expressions It will produce the simplest SOP and POS expressions Works best for less than 6 variables Similar to a truth table =gt it maps all possibilities A Karnaugh map is an array of cells arranged in a special manner The number of cells is 2n where n = number of variables A 3-Variable Karnaugh Map

Note the order of these values they are reverse of the usual order They are arranged this way so that only one variable changes at a time

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 4: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Laws and Rules of Boolean Algebra (continued) Laws of Boolean Algebra (Continued)

minus The 12 Rules of Boolean Algebra A + 0 = A A + 1 = 1 A 0 = 0 A 1 = A A + A = A A + A = 1 A A = A A A = 0 A = A A + AB = A A + AB = A + B (A + B)(A + C) = A + BC

Demorgans Theorems

XY = X + Y

X + Y = XY

Boolean Analysis of Logic Circuits

Boolean Expression for a Logic Circuitminus Boolean expressions are written by starting at the left-most gate working

toward the final output and writing the expression for each gate

Boolean Analysis of Logic Circuits (continued) Constructing a Truth Table for a Logic Circuit A(B + CD) INPUTS OUTPUT

A B C D A(B + CD)

0 0 0 0 0

0 0 0 1 0

0 0 1 0 0

0 0 1 1 0

0 1 0 0 0

0 1 0 1 0

0 1 1 0 0

0 1 1 1 0

1 0 0 0 0

1 0 0 1 0

1 0 1 0 0

1 0 1 1 1

1 1 0 0 1

1 1 0 1 1

1 1 1 0 1

1 1 1 1 1

Simplification Using Boolean Algebra Simplify

minus Use the 12 rules and DeMorgans theorems

Apply Rule 10Apply Rule 10

Simplify AB + A(B + C) + B(B + C)

AABABCAABC

A

ABABACBBBCABACBBCABBACBAC

AABABC

Standard Forms of Boolean Expressions Sum-of-Products(SOP) Form

minus eg AB + ABC ABC + CDE + BCDminus Domain of a Boolean Expression = the set of variables contained in the

expression eg For AB + ABC the domain is A B and Cminus ANDOR implementation of an SOP expression

ORing the output of two or more AND gates

ANDOR Implementation of SOP NANDNAND Implementation of SOP

Standard Forms of Boolean Expressions Conversion of a General Expression to SOP Form

minus eg Convert AB + B(CD + EF) to SOP AB + BCD + BEF

The Standard SOP Formminus All of the variables in the domain appear in each product term

eg ABCD + ABCD + ABCD is in standard formminus If a variable is missing from any term it and its negative must be added to that

termbull eg Convert to standard SOP form

A BC=A BC DD=A BC DA BC DA B=A BCC =A BCA B CA B=A BCA B C=A BC DDA B C DD=A BC DA BC DA B C DA B C DA BCA BAB C D=A BC DA BC DA BC DA BC DA B C DA B C DAB C D

A BCA BAB C D

Product-of-Sums (POS) Formminus eg minus Implementation of a POS expression

(A + B)(B + C + D)(A + C)

The Standard POS Formminus Must contain all of the terms in the domain of the expressionminus eg (A + B + C)(A + B + D)(A + B + C + D) is missing D in the first term

and C in the second term These need to be added in to get the expression into standard form

Standard Forms of Boolean Expressions (continued)

AB ABC

Converting a sum term to standard POSminus Add each nonstandard product term a term made up of the product of the

missing variable and its complementminus Apply rule 12 =gt A + BC = (A + B)(A + C)minus Apply to all terms missing variablesminus eg Convert

First lets just reduce it

Standard Forms of Boolean Expressions (continued)

A AC AB

AAA C ABAA C ABA AB AAABAABA

Converting a sum term to standard POS (continued)minus Now lets put it into standard form

Standard Forms of Boolean Expressions (continued)

A AC AB

AB B=ABABABC C =ABC ABC ABC C=ABC ABC

ACB B=ABC ABC

ABC C=ABC ABC

ABC ABC ABC ABC ABC ABC ABC ABcABC ABC ABC ABC

First term A

Second Term (A + C)

Third Term (A + B)

Inputs Output A B C X Product Term

0 0 0 00 0 1 00 1 0 1 A BC

0 1 1 01 0 0 01 0 1 1 A B C

1 1 0 01 1 1 0

Boolean Expressions and Truth Tables Converting SOP Expressions to Truth Table Format

minus For a sum term we need to determine where the term = 1minus eg Develop the truth table for A B CA BC

An SOP = 1 only if one or more of the product terms = 1

01 0=111=1

101=111=1

Inputs Output A B C X Sum Term

0 0 0 10 0 1 0 ABC 0 1 0 0 ABC 0 1 1 11 0 0 11 0 1 11 1 0 11 1 1 0 ABC

Converting POS Expressions to Truth Table Formatminus For a product term we need to determine where the term = 0minus eg Develop the truth table for

Boolean Expressions and Truth Tables (continued)

ABC ABC ABC

ABC =001=0ABC =010=0

ABC =111=0

Determining Standard Expressions from a Truth Tableminus Given a truth table the SOP expression is developed from where the

output is 1 and the POS expression is developed from where the output is 0

minus eg Develop the SOP and POS expressions from the following

Boolean Expressions and Truth Tables (continued)

Inputs Output A B C X0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1

For the SOP expression Look or an output of 1 Then write the terms

011 A BC100 A BC110 A BC111 A BCX=A BCABCA BCABC

For the POS expression Look for an output of 0 Then write the terms

000 ABC001 ABC010 ABC101 ABCX=ABC ABC ABC ABC

The Karnaugh Map Provides a method for simplifying Boolean expressions It will produce the simplest SOP and POS expressions Works best for less than 6 variables Similar to a truth table =gt it maps all possibilities A Karnaugh map is an array of cells arranged in a special manner The number of cells is 2n where n = number of variables A 3-Variable Karnaugh Map

Note the order of these values they are reverse of the usual order They are arranged this way so that only one variable changes at a time

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 5: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Demorgans Theorems

XY = X + Y

X + Y = XY

Boolean Analysis of Logic Circuits

Boolean Expression for a Logic Circuitminus Boolean expressions are written by starting at the left-most gate working

toward the final output and writing the expression for each gate

Boolean Analysis of Logic Circuits (continued) Constructing a Truth Table for a Logic Circuit A(B + CD) INPUTS OUTPUT

A B C D A(B + CD)

0 0 0 0 0

0 0 0 1 0

0 0 1 0 0

0 0 1 1 0

0 1 0 0 0

0 1 0 1 0

0 1 1 0 0

0 1 1 1 0

1 0 0 0 0

1 0 0 1 0

1 0 1 0 0

1 0 1 1 1

1 1 0 0 1

1 1 0 1 1

1 1 1 0 1

1 1 1 1 1

Simplification Using Boolean Algebra Simplify

minus Use the 12 rules and DeMorgans theorems

Apply Rule 10Apply Rule 10

Simplify AB + A(B + C) + B(B + C)

AABABCAABC

A

ABABACBBBCABACBBCABBACBAC

AABABC

Standard Forms of Boolean Expressions Sum-of-Products(SOP) Form

minus eg AB + ABC ABC + CDE + BCDminus Domain of a Boolean Expression = the set of variables contained in the

expression eg For AB + ABC the domain is A B and Cminus ANDOR implementation of an SOP expression

ORing the output of two or more AND gates

ANDOR Implementation of SOP NANDNAND Implementation of SOP

Standard Forms of Boolean Expressions Conversion of a General Expression to SOP Form

minus eg Convert AB + B(CD + EF) to SOP AB + BCD + BEF

The Standard SOP Formminus All of the variables in the domain appear in each product term

eg ABCD + ABCD + ABCD is in standard formminus If a variable is missing from any term it and its negative must be added to that

termbull eg Convert to standard SOP form

A BC=A BC DD=A BC DA BC DA B=A BCC =A BCA B CA B=A BCA B C=A BC DDA B C DD=A BC DA BC DA B C DA B C DA BCA BAB C D=A BC DA BC DA BC DA BC DA B C DA B C DAB C D

A BCA BAB C D

Product-of-Sums (POS) Formminus eg minus Implementation of a POS expression

(A + B)(B + C + D)(A + C)

The Standard POS Formminus Must contain all of the terms in the domain of the expressionminus eg (A + B + C)(A + B + D)(A + B + C + D) is missing D in the first term

and C in the second term These need to be added in to get the expression into standard form

Standard Forms of Boolean Expressions (continued)

AB ABC

Converting a sum term to standard POSminus Add each nonstandard product term a term made up of the product of the

missing variable and its complementminus Apply rule 12 =gt A + BC = (A + B)(A + C)minus Apply to all terms missing variablesminus eg Convert

First lets just reduce it

Standard Forms of Boolean Expressions (continued)

A AC AB

AAA C ABAA C ABA AB AAABAABA

Converting a sum term to standard POS (continued)minus Now lets put it into standard form

Standard Forms of Boolean Expressions (continued)

A AC AB

AB B=ABABABC C =ABC ABC ABC C=ABC ABC

ACB B=ABC ABC

ABC C=ABC ABC

ABC ABC ABC ABC ABC ABC ABC ABcABC ABC ABC ABC

First term A

Second Term (A + C)

Third Term (A + B)

Inputs Output A B C X Product Term

0 0 0 00 0 1 00 1 0 1 A BC

0 1 1 01 0 0 01 0 1 1 A B C

1 1 0 01 1 1 0

Boolean Expressions and Truth Tables Converting SOP Expressions to Truth Table Format

minus For a sum term we need to determine where the term = 1minus eg Develop the truth table for A B CA BC

An SOP = 1 only if one or more of the product terms = 1

01 0=111=1

101=111=1

Inputs Output A B C X Sum Term

0 0 0 10 0 1 0 ABC 0 1 0 0 ABC 0 1 1 11 0 0 11 0 1 11 1 0 11 1 1 0 ABC

Converting POS Expressions to Truth Table Formatminus For a product term we need to determine where the term = 0minus eg Develop the truth table for

Boolean Expressions and Truth Tables (continued)

ABC ABC ABC

ABC =001=0ABC =010=0

ABC =111=0

Determining Standard Expressions from a Truth Tableminus Given a truth table the SOP expression is developed from where the

output is 1 and the POS expression is developed from where the output is 0

minus eg Develop the SOP and POS expressions from the following

Boolean Expressions and Truth Tables (continued)

Inputs Output A B C X0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1

For the SOP expression Look or an output of 1 Then write the terms

011 A BC100 A BC110 A BC111 A BCX=A BCABCA BCABC

For the POS expression Look for an output of 0 Then write the terms

000 ABC001 ABC010 ABC101 ABCX=ABC ABC ABC ABC

The Karnaugh Map Provides a method for simplifying Boolean expressions It will produce the simplest SOP and POS expressions Works best for less than 6 variables Similar to a truth table =gt it maps all possibilities A Karnaugh map is an array of cells arranged in a special manner The number of cells is 2n where n = number of variables A 3-Variable Karnaugh Map

Note the order of these values they are reverse of the usual order They are arranged this way so that only one variable changes at a time

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 6: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Boolean Analysis of Logic Circuits

Boolean Expression for a Logic Circuitminus Boolean expressions are written by starting at the left-most gate working

toward the final output and writing the expression for each gate

Boolean Analysis of Logic Circuits (continued) Constructing a Truth Table for a Logic Circuit A(B + CD) INPUTS OUTPUT

A B C D A(B + CD)

0 0 0 0 0

0 0 0 1 0

0 0 1 0 0

0 0 1 1 0

0 1 0 0 0

0 1 0 1 0

0 1 1 0 0

0 1 1 1 0

1 0 0 0 0

1 0 0 1 0

1 0 1 0 0

1 0 1 1 1

1 1 0 0 1

1 1 0 1 1

1 1 1 0 1

1 1 1 1 1

Simplification Using Boolean Algebra Simplify

minus Use the 12 rules and DeMorgans theorems

Apply Rule 10Apply Rule 10

Simplify AB + A(B + C) + B(B + C)

AABABCAABC

A

ABABACBBBCABACBBCABBACBAC

AABABC

Standard Forms of Boolean Expressions Sum-of-Products(SOP) Form

minus eg AB + ABC ABC + CDE + BCDminus Domain of a Boolean Expression = the set of variables contained in the

expression eg For AB + ABC the domain is A B and Cminus ANDOR implementation of an SOP expression

ORing the output of two or more AND gates

ANDOR Implementation of SOP NANDNAND Implementation of SOP

Standard Forms of Boolean Expressions Conversion of a General Expression to SOP Form

minus eg Convert AB + B(CD + EF) to SOP AB + BCD + BEF

The Standard SOP Formminus All of the variables in the domain appear in each product term

eg ABCD + ABCD + ABCD is in standard formminus If a variable is missing from any term it and its negative must be added to that

termbull eg Convert to standard SOP form

A BC=A BC DD=A BC DA BC DA B=A BCC =A BCA B CA B=A BCA B C=A BC DDA B C DD=A BC DA BC DA B C DA B C DA BCA BAB C D=A BC DA BC DA BC DA BC DA B C DA B C DAB C D

A BCA BAB C D

Product-of-Sums (POS) Formminus eg minus Implementation of a POS expression

(A + B)(B + C + D)(A + C)

The Standard POS Formminus Must contain all of the terms in the domain of the expressionminus eg (A + B + C)(A + B + D)(A + B + C + D) is missing D in the first term

and C in the second term These need to be added in to get the expression into standard form

Standard Forms of Boolean Expressions (continued)

AB ABC

Converting a sum term to standard POSminus Add each nonstandard product term a term made up of the product of the

missing variable and its complementminus Apply rule 12 =gt A + BC = (A + B)(A + C)minus Apply to all terms missing variablesminus eg Convert

First lets just reduce it

Standard Forms of Boolean Expressions (continued)

A AC AB

AAA C ABAA C ABA AB AAABAABA

Converting a sum term to standard POS (continued)minus Now lets put it into standard form

Standard Forms of Boolean Expressions (continued)

A AC AB

AB B=ABABABC C =ABC ABC ABC C=ABC ABC

ACB B=ABC ABC

ABC C=ABC ABC

ABC ABC ABC ABC ABC ABC ABC ABcABC ABC ABC ABC

First term A

Second Term (A + C)

Third Term (A + B)

Inputs Output A B C X Product Term

0 0 0 00 0 1 00 1 0 1 A BC

0 1 1 01 0 0 01 0 1 1 A B C

1 1 0 01 1 1 0

Boolean Expressions and Truth Tables Converting SOP Expressions to Truth Table Format

minus For a sum term we need to determine where the term = 1minus eg Develop the truth table for A B CA BC

An SOP = 1 only if one or more of the product terms = 1

01 0=111=1

101=111=1

Inputs Output A B C X Sum Term

0 0 0 10 0 1 0 ABC 0 1 0 0 ABC 0 1 1 11 0 0 11 0 1 11 1 0 11 1 1 0 ABC

Converting POS Expressions to Truth Table Formatminus For a product term we need to determine where the term = 0minus eg Develop the truth table for

Boolean Expressions and Truth Tables (continued)

ABC ABC ABC

ABC =001=0ABC =010=0

ABC =111=0

Determining Standard Expressions from a Truth Tableminus Given a truth table the SOP expression is developed from where the

output is 1 and the POS expression is developed from where the output is 0

minus eg Develop the SOP and POS expressions from the following

Boolean Expressions and Truth Tables (continued)

Inputs Output A B C X0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1

For the SOP expression Look or an output of 1 Then write the terms

011 A BC100 A BC110 A BC111 A BCX=A BCABCA BCABC

For the POS expression Look for an output of 0 Then write the terms

000 ABC001 ABC010 ABC101 ABCX=ABC ABC ABC ABC

The Karnaugh Map Provides a method for simplifying Boolean expressions It will produce the simplest SOP and POS expressions Works best for less than 6 variables Similar to a truth table =gt it maps all possibilities A Karnaugh map is an array of cells arranged in a special manner The number of cells is 2n where n = number of variables A 3-Variable Karnaugh Map

Note the order of these values they are reverse of the usual order They are arranged this way so that only one variable changes at a time

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 7: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Boolean Analysis of Logic Circuits (continued) Constructing a Truth Table for a Logic Circuit A(B + CD) INPUTS OUTPUT

A B C D A(B + CD)

0 0 0 0 0

0 0 0 1 0

0 0 1 0 0

0 0 1 1 0

0 1 0 0 0

0 1 0 1 0

0 1 1 0 0

0 1 1 1 0

1 0 0 0 0

1 0 0 1 0

1 0 1 0 0

1 0 1 1 1

1 1 0 0 1

1 1 0 1 1

1 1 1 0 1

1 1 1 1 1

Simplification Using Boolean Algebra Simplify

minus Use the 12 rules and DeMorgans theorems

Apply Rule 10Apply Rule 10

Simplify AB + A(B + C) + B(B + C)

AABABCAABC

A

ABABACBBBCABACBBCABBACBAC

AABABC

Standard Forms of Boolean Expressions Sum-of-Products(SOP) Form

minus eg AB + ABC ABC + CDE + BCDminus Domain of a Boolean Expression = the set of variables contained in the

expression eg For AB + ABC the domain is A B and Cminus ANDOR implementation of an SOP expression

ORing the output of two or more AND gates

ANDOR Implementation of SOP NANDNAND Implementation of SOP

Standard Forms of Boolean Expressions Conversion of a General Expression to SOP Form

minus eg Convert AB + B(CD + EF) to SOP AB + BCD + BEF

The Standard SOP Formminus All of the variables in the domain appear in each product term

eg ABCD + ABCD + ABCD is in standard formminus If a variable is missing from any term it and its negative must be added to that

termbull eg Convert to standard SOP form

A BC=A BC DD=A BC DA BC DA B=A BCC =A BCA B CA B=A BCA B C=A BC DDA B C DD=A BC DA BC DA B C DA B C DA BCA BAB C D=A BC DA BC DA BC DA BC DA B C DA B C DAB C D

A BCA BAB C D

Product-of-Sums (POS) Formminus eg minus Implementation of a POS expression

(A + B)(B + C + D)(A + C)

The Standard POS Formminus Must contain all of the terms in the domain of the expressionminus eg (A + B + C)(A + B + D)(A + B + C + D) is missing D in the first term

and C in the second term These need to be added in to get the expression into standard form

Standard Forms of Boolean Expressions (continued)

AB ABC

Converting a sum term to standard POSminus Add each nonstandard product term a term made up of the product of the

missing variable and its complementminus Apply rule 12 =gt A + BC = (A + B)(A + C)minus Apply to all terms missing variablesminus eg Convert

First lets just reduce it

Standard Forms of Boolean Expressions (continued)

A AC AB

AAA C ABAA C ABA AB AAABAABA

Converting a sum term to standard POS (continued)minus Now lets put it into standard form

Standard Forms of Boolean Expressions (continued)

A AC AB

AB B=ABABABC C =ABC ABC ABC C=ABC ABC

ACB B=ABC ABC

ABC C=ABC ABC

ABC ABC ABC ABC ABC ABC ABC ABcABC ABC ABC ABC

First term A

Second Term (A + C)

Third Term (A + B)

Inputs Output A B C X Product Term

0 0 0 00 0 1 00 1 0 1 A BC

0 1 1 01 0 0 01 0 1 1 A B C

1 1 0 01 1 1 0

Boolean Expressions and Truth Tables Converting SOP Expressions to Truth Table Format

minus For a sum term we need to determine where the term = 1minus eg Develop the truth table for A B CA BC

An SOP = 1 only if one or more of the product terms = 1

01 0=111=1

101=111=1

Inputs Output A B C X Sum Term

0 0 0 10 0 1 0 ABC 0 1 0 0 ABC 0 1 1 11 0 0 11 0 1 11 1 0 11 1 1 0 ABC

Converting POS Expressions to Truth Table Formatminus For a product term we need to determine where the term = 0minus eg Develop the truth table for

Boolean Expressions and Truth Tables (continued)

ABC ABC ABC

ABC =001=0ABC =010=0

ABC =111=0

Determining Standard Expressions from a Truth Tableminus Given a truth table the SOP expression is developed from where the

output is 1 and the POS expression is developed from where the output is 0

minus eg Develop the SOP and POS expressions from the following

Boolean Expressions and Truth Tables (continued)

Inputs Output A B C X0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1

For the SOP expression Look or an output of 1 Then write the terms

011 A BC100 A BC110 A BC111 A BCX=A BCABCA BCABC

For the POS expression Look for an output of 0 Then write the terms

000 ABC001 ABC010 ABC101 ABCX=ABC ABC ABC ABC

The Karnaugh Map Provides a method for simplifying Boolean expressions It will produce the simplest SOP and POS expressions Works best for less than 6 variables Similar to a truth table =gt it maps all possibilities A Karnaugh map is an array of cells arranged in a special manner The number of cells is 2n where n = number of variables A 3-Variable Karnaugh Map

Note the order of these values they are reverse of the usual order They are arranged this way so that only one variable changes at a time

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 8: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Simplification Using Boolean Algebra Simplify

minus Use the 12 rules and DeMorgans theorems

Apply Rule 10Apply Rule 10

Simplify AB + A(B + C) + B(B + C)

AABABCAABC

A

ABABACBBBCABACBBCABBACBAC

AABABC

Standard Forms of Boolean Expressions Sum-of-Products(SOP) Form

minus eg AB + ABC ABC + CDE + BCDminus Domain of a Boolean Expression = the set of variables contained in the

expression eg For AB + ABC the domain is A B and Cminus ANDOR implementation of an SOP expression

ORing the output of two or more AND gates

ANDOR Implementation of SOP NANDNAND Implementation of SOP

Standard Forms of Boolean Expressions Conversion of a General Expression to SOP Form

minus eg Convert AB + B(CD + EF) to SOP AB + BCD + BEF

The Standard SOP Formminus All of the variables in the domain appear in each product term

eg ABCD + ABCD + ABCD is in standard formminus If a variable is missing from any term it and its negative must be added to that

termbull eg Convert to standard SOP form

A BC=A BC DD=A BC DA BC DA B=A BCC =A BCA B CA B=A BCA B C=A BC DDA B C DD=A BC DA BC DA B C DA B C DA BCA BAB C D=A BC DA BC DA BC DA BC DA B C DA B C DAB C D

A BCA BAB C D

Product-of-Sums (POS) Formminus eg minus Implementation of a POS expression

(A + B)(B + C + D)(A + C)

The Standard POS Formminus Must contain all of the terms in the domain of the expressionminus eg (A + B + C)(A + B + D)(A + B + C + D) is missing D in the first term

and C in the second term These need to be added in to get the expression into standard form

Standard Forms of Boolean Expressions (continued)

AB ABC

Converting a sum term to standard POSminus Add each nonstandard product term a term made up of the product of the

missing variable and its complementminus Apply rule 12 =gt A + BC = (A + B)(A + C)minus Apply to all terms missing variablesminus eg Convert

First lets just reduce it

Standard Forms of Boolean Expressions (continued)

A AC AB

AAA C ABAA C ABA AB AAABAABA

Converting a sum term to standard POS (continued)minus Now lets put it into standard form

Standard Forms of Boolean Expressions (continued)

A AC AB

AB B=ABABABC C =ABC ABC ABC C=ABC ABC

ACB B=ABC ABC

ABC C=ABC ABC

ABC ABC ABC ABC ABC ABC ABC ABcABC ABC ABC ABC

First term A

Second Term (A + C)

Third Term (A + B)

Inputs Output A B C X Product Term

0 0 0 00 0 1 00 1 0 1 A BC

0 1 1 01 0 0 01 0 1 1 A B C

1 1 0 01 1 1 0

Boolean Expressions and Truth Tables Converting SOP Expressions to Truth Table Format

minus For a sum term we need to determine where the term = 1minus eg Develop the truth table for A B CA BC

An SOP = 1 only if one or more of the product terms = 1

01 0=111=1

101=111=1

Inputs Output A B C X Sum Term

0 0 0 10 0 1 0 ABC 0 1 0 0 ABC 0 1 1 11 0 0 11 0 1 11 1 0 11 1 1 0 ABC

Converting POS Expressions to Truth Table Formatminus For a product term we need to determine where the term = 0minus eg Develop the truth table for

Boolean Expressions and Truth Tables (continued)

ABC ABC ABC

ABC =001=0ABC =010=0

ABC =111=0

Determining Standard Expressions from a Truth Tableminus Given a truth table the SOP expression is developed from where the

output is 1 and the POS expression is developed from where the output is 0

minus eg Develop the SOP and POS expressions from the following

Boolean Expressions and Truth Tables (continued)

Inputs Output A B C X0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1

For the SOP expression Look or an output of 1 Then write the terms

011 A BC100 A BC110 A BC111 A BCX=A BCABCA BCABC

For the POS expression Look for an output of 0 Then write the terms

000 ABC001 ABC010 ABC101 ABCX=ABC ABC ABC ABC

The Karnaugh Map Provides a method for simplifying Boolean expressions It will produce the simplest SOP and POS expressions Works best for less than 6 variables Similar to a truth table =gt it maps all possibilities A Karnaugh map is an array of cells arranged in a special manner The number of cells is 2n where n = number of variables A 3-Variable Karnaugh Map

Note the order of these values they are reverse of the usual order They are arranged this way so that only one variable changes at a time

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 9: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Standard Forms of Boolean Expressions Sum-of-Products(SOP) Form

minus eg AB + ABC ABC + CDE + BCDminus Domain of a Boolean Expression = the set of variables contained in the

expression eg For AB + ABC the domain is A B and Cminus ANDOR implementation of an SOP expression

ORing the output of two or more AND gates

ANDOR Implementation of SOP NANDNAND Implementation of SOP

Standard Forms of Boolean Expressions Conversion of a General Expression to SOP Form

minus eg Convert AB + B(CD + EF) to SOP AB + BCD + BEF

The Standard SOP Formminus All of the variables in the domain appear in each product term

eg ABCD + ABCD + ABCD is in standard formminus If a variable is missing from any term it and its negative must be added to that

termbull eg Convert to standard SOP form

A BC=A BC DD=A BC DA BC DA B=A BCC =A BCA B CA B=A BCA B C=A BC DDA B C DD=A BC DA BC DA B C DA B C DA BCA BAB C D=A BC DA BC DA BC DA BC DA B C DA B C DAB C D

A BCA BAB C D

Product-of-Sums (POS) Formminus eg minus Implementation of a POS expression

(A + B)(B + C + D)(A + C)

The Standard POS Formminus Must contain all of the terms in the domain of the expressionminus eg (A + B + C)(A + B + D)(A + B + C + D) is missing D in the first term

and C in the second term These need to be added in to get the expression into standard form

Standard Forms of Boolean Expressions (continued)

AB ABC

Converting a sum term to standard POSminus Add each nonstandard product term a term made up of the product of the

missing variable and its complementminus Apply rule 12 =gt A + BC = (A + B)(A + C)minus Apply to all terms missing variablesminus eg Convert

First lets just reduce it

Standard Forms of Boolean Expressions (continued)

A AC AB

AAA C ABAA C ABA AB AAABAABA

Converting a sum term to standard POS (continued)minus Now lets put it into standard form

Standard Forms of Boolean Expressions (continued)

A AC AB

AB B=ABABABC C =ABC ABC ABC C=ABC ABC

ACB B=ABC ABC

ABC C=ABC ABC

ABC ABC ABC ABC ABC ABC ABC ABcABC ABC ABC ABC

First term A

Second Term (A + C)

Third Term (A + B)

Inputs Output A B C X Product Term

0 0 0 00 0 1 00 1 0 1 A BC

0 1 1 01 0 0 01 0 1 1 A B C

1 1 0 01 1 1 0

Boolean Expressions and Truth Tables Converting SOP Expressions to Truth Table Format

minus For a sum term we need to determine where the term = 1minus eg Develop the truth table for A B CA BC

An SOP = 1 only if one or more of the product terms = 1

01 0=111=1

101=111=1

Inputs Output A B C X Sum Term

0 0 0 10 0 1 0 ABC 0 1 0 0 ABC 0 1 1 11 0 0 11 0 1 11 1 0 11 1 1 0 ABC

Converting POS Expressions to Truth Table Formatminus For a product term we need to determine where the term = 0minus eg Develop the truth table for

Boolean Expressions and Truth Tables (continued)

ABC ABC ABC

ABC =001=0ABC =010=0

ABC =111=0

Determining Standard Expressions from a Truth Tableminus Given a truth table the SOP expression is developed from where the

output is 1 and the POS expression is developed from where the output is 0

minus eg Develop the SOP and POS expressions from the following

Boolean Expressions and Truth Tables (continued)

Inputs Output A B C X0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1

For the SOP expression Look or an output of 1 Then write the terms

011 A BC100 A BC110 A BC111 A BCX=A BCABCA BCABC

For the POS expression Look for an output of 0 Then write the terms

000 ABC001 ABC010 ABC101 ABCX=ABC ABC ABC ABC

The Karnaugh Map Provides a method for simplifying Boolean expressions It will produce the simplest SOP and POS expressions Works best for less than 6 variables Similar to a truth table =gt it maps all possibilities A Karnaugh map is an array of cells arranged in a special manner The number of cells is 2n where n = number of variables A 3-Variable Karnaugh Map

Note the order of these values they are reverse of the usual order They are arranged this way so that only one variable changes at a time

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 10: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Standard Forms of Boolean Expressions Conversion of a General Expression to SOP Form

minus eg Convert AB + B(CD + EF) to SOP AB + BCD + BEF

The Standard SOP Formminus All of the variables in the domain appear in each product term

eg ABCD + ABCD + ABCD is in standard formminus If a variable is missing from any term it and its negative must be added to that

termbull eg Convert to standard SOP form

A BC=A BC DD=A BC DA BC DA B=A BCC =A BCA B CA B=A BCA B C=A BC DDA B C DD=A BC DA BC DA B C DA B C DA BCA BAB C D=A BC DA BC DA BC DA BC DA B C DA B C DAB C D

A BCA BAB C D

Product-of-Sums (POS) Formminus eg minus Implementation of a POS expression

(A + B)(B + C + D)(A + C)

The Standard POS Formminus Must contain all of the terms in the domain of the expressionminus eg (A + B + C)(A + B + D)(A + B + C + D) is missing D in the first term

and C in the second term These need to be added in to get the expression into standard form

Standard Forms of Boolean Expressions (continued)

AB ABC

Converting a sum term to standard POSminus Add each nonstandard product term a term made up of the product of the

missing variable and its complementminus Apply rule 12 =gt A + BC = (A + B)(A + C)minus Apply to all terms missing variablesminus eg Convert

First lets just reduce it

Standard Forms of Boolean Expressions (continued)

A AC AB

AAA C ABAA C ABA AB AAABAABA

Converting a sum term to standard POS (continued)minus Now lets put it into standard form

Standard Forms of Boolean Expressions (continued)

A AC AB

AB B=ABABABC C =ABC ABC ABC C=ABC ABC

ACB B=ABC ABC

ABC C=ABC ABC

ABC ABC ABC ABC ABC ABC ABC ABcABC ABC ABC ABC

First term A

Second Term (A + C)

Third Term (A + B)

Inputs Output A B C X Product Term

0 0 0 00 0 1 00 1 0 1 A BC

0 1 1 01 0 0 01 0 1 1 A B C

1 1 0 01 1 1 0

Boolean Expressions and Truth Tables Converting SOP Expressions to Truth Table Format

minus For a sum term we need to determine where the term = 1minus eg Develop the truth table for A B CA BC

An SOP = 1 only if one or more of the product terms = 1

01 0=111=1

101=111=1

Inputs Output A B C X Sum Term

0 0 0 10 0 1 0 ABC 0 1 0 0 ABC 0 1 1 11 0 0 11 0 1 11 1 0 11 1 1 0 ABC

Converting POS Expressions to Truth Table Formatminus For a product term we need to determine where the term = 0minus eg Develop the truth table for

Boolean Expressions and Truth Tables (continued)

ABC ABC ABC

ABC =001=0ABC =010=0

ABC =111=0

Determining Standard Expressions from a Truth Tableminus Given a truth table the SOP expression is developed from where the

output is 1 and the POS expression is developed from where the output is 0

minus eg Develop the SOP and POS expressions from the following

Boolean Expressions and Truth Tables (continued)

Inputs Output A B C X0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1

For the SOP expression Look or an output of 1 Then write the terms

011 A BC100 A BC110 A BC111 A BCX=A BCABCA BCABC

For the POS expression Look for an output of 0 Then write the terms

000 ABC001 ABC010 ABC101 ABCX=ABC ABC ABC ABC

The Karnaugh Map Provides a method for simplifying Boolean expressions It will produce the simplest SOP and POS expressions Works best for less than 6 variables Similar to a truth table =gt it maps all possibilities A Karnaugh map is an array of cells arranged in a special manner The number of cells is 2n where n = number of variables A 3-Variable Karnaugh Map

Note the order of these values they are reverse of the usual order They are arranged this way so that only one variable changes at a time

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 11: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Product-of-Sums (POS) Formminus eg minus Implementation of a POS expression

(A + B)(B + C + D)(A + C)

The Standard POS Formminus Must contain all of the terms in the domain of the expressionminus eg (A + B + C)(A + B + D)(A + B + C + D) is missing D in the first term

and C in the second term These need to be added in to get the expression into standard form

Standard Forms of Boolean Expressions (continued)

AB ABC

Converting a sum term to standard POSminus Add each nonstandard product term a term made up of the product of the

missing variable and its complementminus Apply rule 12 =gt A + BC = (A + B)(A + C)minus Apply to all terms missing variablesminus eg Convert

First lets just reduce it

Standard Forms of Boolean Expressions (continued)

A AC AB

AAA C ABAA C ABA AB AAABAABA

Converting a sum term to standard POS (continued)minus Now lets put it into standard form

Standard Forms of Boolean Expressions (continued)

A AC AB

AB B=ABABABC C =ABC ABC ABC C=ABC ABC

ACB B=ABC ABC

ABC C=ABC ABC

ABC ABC ABC ABC ABC ABC ABC ABcABC ABC ABC ABC

First term A

Second Term (A + C)

Third Term (A + B)

Inputs Output A B C X Product Term

0 0 0 00 0 1 00 1 0 1 A BC

0 1 1 01 0 0 01 0 1 1 A B C

1 1 0 01 1 1 0

Boolean Expressions and Truth Tables Converting SOP Expressions to Truth Table Format

minus For a sum term we need to determine where the term = 1minus eg Develop the truth table for A B CA BC

An SOP = 1 only if one or more of the product terms = 1

01 0=111=1

101=111=1

Inputs Output A B C X Sum Term

0 0 0 10 0 1 0 ABC 0 1 0 0 ABC 0 1 1 11 0 0 11 0 1 11 1 0 11 1 1 0 ABC

Converting POS Expressions to Truth Table Formatminus For a product term we need to determine where the term = 0minus eg Develop the truth table for

Boolean Expressions and Truth Tables (continued)

ABC ABC ABC

ABC =001=0ABC =010=0

ABC =111=0

Determining Standard Expressions from a Truth Tableminus Given a truth table the SOP expression is developed from where the

output is 1 and the POS expression is developed from where the output is 0

minus eg Develop the SOP and POS expressions from the following

Boolean Expressions and Truth Tables (continued)

Inputs Output A B C X0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1

For the SOP expression Look or an output of 1 Then write the terms

011 A BC100 A BC110 A BC111 A BCX=A BCABCA BCABC

For the POS expression Look for an output of 0 Then write the terms

000 ABC001 ABC010 ABC101 ABCX=ABC ABC ABC ABC

The Karnaugh Map Provides a method for simplifying Boolean expressions It will produce the simplest SOP and POS expressions Works best for less than 6 variables Similar to a truth table =gt it maps all possibilities A Karnaugh map is an array of cells arranged in a special manner The number of cells is 2n where n = number of variables A 3-Variable Karnaugh Map

Note the order of these values they are reverse of the usual order They are arranged this way so that only one variable changes at a time

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 12: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Converting a sum term to standard POSminus Add each nonstandard product term a term made up of the product of the

missing variable and its complementminus Apply rule 12 =gt A + BC = (A + B)(A + C)minus Apply to all terms missing variablesminus eg Convert

First lets just reduce it

Standard Forms of Boolean Expressions (continued)

A AC AB

AAA C ABAA C ABA AB AAABAABA

Converting a sum term to standard POS (continued)minus Now lets put it into standard form

Standard Forms of Boolean Expressions (continued)

A AC AB

AB B=ABABABC C =ABC ABC ABC C=ABC ABC

ACB B=ABC ABC

ABC C=ABC ABC

ABC ABC ABC ABC ABC ABC ABC ABcABC ABC ABC ABC

First term A

Second Term (A + C)

Third Term (A + B)

Inputs Output A B C X Product Term

0 0 0 00 0 1 00 1 0 1 A BC

0 1 1 01 0 0 01 0 1 1 A B C

1 1 0 01 1 1 0

Boolean Expressions and Truth Tables Converting SOP Expressions to Truth Table Format

minus For a sum term we need to determine where the term = 1minus eg Develop the truth table for A B CA BC

An SOP = 1 only if one or more of the product terms = 1

01 0=111=1

101=111=1

Inputs Output A B C X Sum Term

0 0 0 10 0 1 0 ABC 0 1 0 0 ABC 0 1 1 11 0 0 11 0 1 11 1 0 11 1 1 0 ABC

Converting POS Expressions to Truth Table Formatminus For a product term we need to determine where the term = 0minus eg Develop the truth table for

Boolean Expressions and Truth Tables (continued)

ABC ABC ABC

ABC =001=0ABC =010=0

ABC =111=0

Determining Standard Expressions from a Truth Tableminus Given a truth table the SOP expression is developed from where the

output is 1 and the POS expression is developed from where the output is 0

minus eg Develop the SOP and POS expressions from the following

Boolean Expressions and Truth Tables (continued)

Inputs Output A B C X0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1

For the SOP expression Look or an output of 1 Then write the terms

011 A BC100 A BC110 A BC111 A BCX=A BCABCA BCABC

For the POS expression Look for an output of 0 Then write the terms

000 ABC001 ABC010 ABC101 ABCX=ABC ABC ABC ABC

The Karnaugh Map Provides a method for simplifying Boolean expressions It will produce the simplest SOP and POS expressions Works best for less than 6 variables Similar to a truth table =gt it maps all possibilities A Karnaugh map is an array of cells arranged in a special manner The number of cells is 2n where n = number of variables A 3-Variable Karnaugh Map

Note the order of these values they are reverse of the usual order They are arranged this way so that only one variable changes at a time

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 13: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Converting a sum term to standard POS (continued)minus Now lets put it into standard form

Standard Forms of Boolean Expressions (continued)

A AC AB

AB B=ABABABC C =ABC ABC ABC C=ABC ABC

ACB B=ABC ABC

ABC C=ABC ABC

ABC ABC ABC ABC ABC ABC ABC ABcABC ABC ABC ABC

First term A

Second Term (A + C)

Third Term (A + B)

Inputs Output A B C X Product Term

0 0 0 00 0 1 00 1 0 1 A BC

0 1 1 01 0 0 01 0 1 1 A B C

1 1 0 01 1 1 0

Boolean Expressions and Truth Tables Converting SOP Expressions to Truth Table Format

minus For a sum term we need to determine where the term = 1minus eg Develop the truth table for A B CA BC

An SOP = 1 only if one or more of the product terms = 1

01 0=111=1

101=111=1

Inputs Output A B C X Sum Term

0 0 0 10 0 1 0 ABC 0 1 0 0 ABC 0 1 1 11 0 0 11 0 1 11 1 0 11 1 1 0 ABC

Converting POS Expressions to Truth Table Formatminus For a product term we need to determine where the term = 0minus eg Develop the truth table for

Boolean Expressions and Truth Tables (continued)

ABC ABC ABC

ABC =001=0ABC =010=0

ABC =111=0

Determining Standard Expressions from a Truth Tableminus Given a truth table the SOP expression is developed from where the

output is 1 and the POS expression is developed from where the output is 0

minus eg Develop the SOP and POS expressions from the following

Boolean Expressions and Truth Tables (continued)

Inputs Output A B C X0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1

For the SOP expression Look or an output of 1 Then write the terms

011 A BC100 A BC110 A BC111 A BCX=A BCABCA BCABC

For the POS expression Look for an output of 0 Then write the terms

000 ABC001 ABC010 ABC101 ABCX=ABC ABC ABC ABC

The Karnaugh Map Provides a method for simplifying Boolean expressions It will produce the simplest SOP and POS expressions Works best for less than 6 variables Similar to a truth table =gt it maps all possibilities A Karnaugh map is an array of cells arranged in a special manner The number of cells is 2n where n = number of variables A 3-Variable Karnaugh Map

Note the order of these values they are reverse of the usual order They are arranged this way so that only one variable changes at a time

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 14: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Inputs Output A B C X Product Term

0 0 0 00 0 1 00 1 0 1 A BC

0 1 1 01 0 0 01 0 1 1 A B C

1 1 0 01 1 1 0

Boolean Expressions and Truth Tables Converting SOP Expressions to Truth Table Format

minus For a sum term we need to determine where the term = 1minus eg Develop the truth table for A B CA BC

An SOP = 1 only if one or more of the product terms = 1

01 0=111=1

101=111=1

Inputs Output A B C X Sum Term

0 0 0 10 0 1 0 ABC 0 1 0 0 ABC 0 1 1 11 0 0 11 0 1 11 1 0 11 1 1 0 ABC

Converting POS Expressions to Truth Table Formatminus For a product term we need to determine where the term = 0minus eg Develop the truth table for

Boolean Expressions and Truth Tables (continued)

ABC ABC ABC

ABC =001=0ABC =010=0

ABC =111=0

Determining Standard Expressions from a Truth Tableminus Given a truth table the SOP expression is developed from where the

output is 1 and the POS expression is developed from where the output is 0

minus eg Develop the SOP and POS expressions from the following

Boolean Expressions and Truth Tables (continued)

Inputs Output A B C X0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1

For the SOP expression Look or an output of 1 Then write the terms

011 A BC100 A BC110 A BC111 A BCX=A BCABCA BCABC

For the POS expression Look for an output of 0 Then write the terms

000 ABC001 ABC010 ABC101 ABCX=ABC ABC ABC ABC

The Karnaugh Map Provides a method for simplifying Boolean expressions It will produce the simplest SOP and POS expressions Works best for less than 6 variables Similar to a truth table =gt it maps all possibilities A Karnaugh map is an array of cells arranged in a special manner The number of cells is 2n where n = number of variables A 3-Variable Karnaugh Map

Note the order of these values they are reverse of the usual order They are arranged this way so that only one variable changes at a time

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 15: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Inputs Output A B C X Sum Term

0 0 0 10 0 1 0 ABC 0 1 0 0 ABC 0 1 1 11 0 0 11 0 1 11 1 0 11 1 1 0 ABC

Converting POS Expressions to Truth Table Formatminus For a product term we need to determine where the term = 0minus eg Develop the truth table for

Boolean Expressions and Truth Tables (continued)

ABC ABC ABC

ABC =001=0ABC =010=0

ABC =111=0

Determining Standard Expressions from a Truth Tableminus Given a truth table the SOP expression is developed from where the

output is 1 and the POS expression is developed from where the output is 0

minus eg Develop the SOP and POS expressions from the following

Boolean Expressions and Truth Tables (continued)

Inputs Output A B C X0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1

For the SOP expression Look or an output of 1 Then write the terms

011 A BC100 A BC110 A BC111 A BCX=A BCABCA BCABC

For the POS expression Look for an output of 0 Then write the terms

000 ABC001 ABC010 ABC101 ABCX=ABC ABC ABC ABC

The Karnaugh Map Provides a method for simplifying Boolean expressions It will produce the simplest SOP and POS expressions Works best for less than 6 variables Similar to a truth table =gt it maps all possibilities A Karnaugh map is an array of cells arranged in a special manner The number of cells is 2n where n = number of variables A 3-Variable Karnaugh Map

Note the order of these values they are reverse of the usual order They are arranged this way so that only one variable changes at a time

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 16: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Determining Standard Expressions from a Truth Tableminus Given a truth table the SOP expression is developed from where the

output is 1 and the POS expression is developed from where the output is 0

minus eg Develop the SOP and POS expressions from the following

Boolean Expressions and Truth Tables (continued)

Inputs Output A B C X0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1

For the SOP expression Look or an output of 1 Then write the terms

011 A BC100 A BC110 A BC111 A BCX=A BCABCA BCABC

For the POS expression Look for an output of 0 Then write the terms

000 ABC001 ABC010 ABC101 ABCX=ABC ABC ABC ABC

The Karnaugh Map Provides a method for simplifying Boolean expressions It will produce the simplest SOP and POS expressions Works best for less than 6 variables Similar to a truth table =gt it maps all possibilities A Karnaugh map is an array of cells arranged in a special manner The number of cells is 2n where n = number of variables A 3-Variable Karnaugh Map

Note the order of these values they are reverse of the usual order They are arranged this way so that only one variable changes at a time

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 17: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

The Karnaugh Map Provides a method for simplifying Boolean expressions It will produce the simplest SOP and POS expressions Works best for less than 6 variables Similar to a truth table =gt it maps all possibilities A Karnaugh map is an array of cells arranged in a special manner The number of cells is 2n where n = number of variables A 3-Variable Karnaugh Map

Note the order of these values they are reverse of the usual order They are arranged this way so that only one variable changes at a time

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 18: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Cell Adjacency

The Karnaugh Map (continued)

Note the wrap-around from side to side and top to bottom

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 19: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Karnaugh Map SOP Minimization Mapping a Standard SOP expression

minus Place a 1 in the Karnaugh map where each product term = 1minus eg Map the following

A BC DA BC DA BC DABCDABC DA BC DA BC D

Note that this expression is in standard SOP form

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 20: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Mapping a Nonstandard SOP expressionminus Each nonstandard part of the expression must be expandedminus eg Map the SOP expression

Karnaugh Map SOP Minimization

AA BA BC

AA BC=011A BC=010A BC=001A BC=000

A BA BC=101A BC=100

A BC=110

Place 1s in the Karnaugh map that correspond with each of the above terms

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 21: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Karnaugh Map Simplification of SOP Expressionsminus Finding the minimum SOP expression after an SOP expression has been

mappedminus Process is to group the 1s in adjacent cells

A group must contain either 1 2 4 8 or 16 cells (a power of 2) Each cell in a group must be adjacent to 1 or more cells Always include the largest possible number of 1s in a group but it

must be 1 2 4 8 or 16 cells (a power of 2) Each 1 on the map must be included in at least one group Groups

may overlapminus Be sure to remember the adjacency from side to side and top to bottom

when grouping the 1sminus In some cases there may be more than one way to group the 1s

Karnaugh Map SOP Minimization (continued)

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 22: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Simplification example

Karnaugh Map SOP Minimization (continued)

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 23: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Determining the Minimum SOP Expression from the Mapminus After grouping the 1s look for the variables that dont change in each

group These will remain in our product term The variables that do change drop out

minus eg Develop the SOP for the following Karnaugh Map

Karnaugh Map SOP Minimization (continued)

Note that B takes on both 0 and 1 values

Here A and C assume both 0 and 1 values so they drop out

The resulting SOP is the sum of each groupBACAC D

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 24: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Mapping Directly from a Truth Tableminus eg

Karnaugh Map SOP Minimization (continued)

Dont Care Conditionsminus Sometimes certain variable combinations are not allowed In that case

we represent them with an ldquoXrdquo in the truth table and Karnaugh map

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 25: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Karnaugh Map POS Minimization Mapping a Standard POS Expression

minus A 0 is placed on the Karnaugh map for each sum term in the expressionminus The values are mapped

Determine the binary value of each sum term in the standard expression Place a 0 on the Karnaugh map in the corresponding cell

minus eg Map the expressionABCDABCDABCDAB=CDABCD

ABCD=1100ABCD=1011ABCD=0010ABCD=1111ABCD=0011

Binary value of each Sum term

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 26: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Karnaugh Map Simplification of POS Expressionsminus Basically the same as for the POS expression except that we will group

0s to produce the minimum sum terms instead of grouping 1sminus eg Use a Karnaugh Map to minimize

Karnaugh Map POS Minimization (continued)

ABC ABC ABC ABC ABC

ABC =000 =0ABC =001=0ABC =010=0ABC =011=0ABC =110=0

Binary value of each Product term

X=ABC

We can also derive the SOP expression by looking at the 1s X=ACA B=ABC

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 27: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Converting Between POS and SOP using the Karnaugh Mapminus Once an expression or truth table has been mapped each cell contains a

1 or a 0 (or x)minus By grouping the 0s we can derive the minimum POS expressionminus By grouping the 1s we can derive the minimum SOP expression

Karnaugh Map POS Minimization (continued)

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 28: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Five Variable Karnaugh Maps We can simplify 5 variable expressions by using two 4 variable 32-

cell Karnaugh Maps Each of the maps is a value of the 5th variable and adjacencies exist

between cells in the same location on each map

Note that we still look for variables that remain the same in each group Those will appear in our final expression

The term for the yellow group isThe term for the orange group isThe term for the light red group isThe term for the gray cell grouped with the red cellis

D EBC EAB D

BC D E

x=D EBC EAB DBC D E

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 29: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

We use HDL to program some of the functions of the Xilinx CPLD chips on the PLDT-3 board

HDLs are a quick and versitile method of describing logic designs for downloading into the programmable logic devices

Like any other programming language there is a syntax and reserved words that are used in describing the logic functions

Hardware Description Languages (HDLs)

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 30: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Hardware Description Languages (HDLs) VHDL

minus Abbreviation for Very High Speed Integrated Circuit Hardware Description Language

minus Using VHDS we can describe the circuit in one of three ways behavior data flow or structure

minus We use the keywords and or not nand nor xor and xnor to describe the parts of the logic circuits

minus Also we need to describe the inputs outputs and the internal operation of the logic function (architecture)

minus An entity is described by at least 3 statements Name Port list (inputs and outputs) and the end statement

minus The architectural component is other component

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 31: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Writing Boolean Expressions in VHDLminus Using the keywords we can describe the logic functionminus eg Write a VHDL program to describe

Hardware Description Languages (HDLs) (continued)

X=ABCDentity AND_OR is port( A B C D in bit X out bit )end entity AND_OR

architecture LogicFunction of AND_OR isbegin X lt=(A and B)or(C and D)end architecture LogicFunction

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 32: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

Verilogminus Similar to VHDL it is an IEE standard in designminus It uses different syntax but basically does the same thing ndash defines the

inputs outputs and the logic associated with the moduleminus Uses symbols for the logical operators (not) ampamp (and) || (or)minus Uses symbols for the bitwise operators ~ (not) amp (and) ~amp (nand) | (or)

~| (nor) ^ (xor) ~^(xnor)minus eg Same as for VHDL to see how they compare

Hardware Description Languages (HDLs) (continued)

X=ABCDmodule AndOR(X A B C D)input A B C Doutput X

assign X = (A amp B) || (C amp D)endmodule

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)

Page 33: Chapter 4 Boolean Algebra and Logic Simplificationjgallaher/download/ETEC2301-Programmable... · Laws and Rules of Boolean Algebra Laws of Boolean Algebra −Commutative Law Commutative

ABELminus Nonstandard proprietary HDL that stands for Advanced Boolean

Expressionminus Can use either equations truth tables or state diagrams to describe the

logic functionminus It also uses symbols for the logic operations (not) amp (and) (or) $

(xor) AHDL

minus Also a nonstandard proprietary HDL that stands for Altera Hardware Description Language

minus Can use either text or schematic entry for logic functionsminus It alos uses symbols for the logic operations (not) amp (and) amp (nand)

(or) (nor) $ (xor) $ (xnor)

Hardware Description Languages (HDLs) (continued)