Introduction to Microprocessor & Digital Logic

ME262 Introduction to Microprocessor & Digital Logic (Boolean Algebra and Logic Equations) Summer 2010 Introduction to Microprocessor and Digital Lo...
Author: Drusilla Scott
10 downloads 1 Views 235KB Size
ME262

Introduction to Microprocessor & Digital Logic (Boolean Algebra and Logic Equations) Summer 2010

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

1

Boolean Algebra Comparison between governing laws in real number algebra and Boolean algebra Law Associative law

Commutativelaw

Identity Elements

Inverse

Distributive law

Indempotence law

Complementelement

Real Number Algebra ( x  y )  z  x ( y  z ) (x  y)  z  x ( y  z ) x y  y x x y  y x x x

1  x 0  x

Boolean Algebra ( XY ) Z  X (YZ ) ( X  Y )  Z  X  (Y  Z ) XY  YX X  Y Y  X X .1  X X 0  X

1 1 x x  ( x )  0 x

x ( y  z )  xy  xz

X (Y  Z )  ( XY )  ( XZ ) X  (YZ )  ( X Y )( X  Z ) X X  X XX  X X  X 1 XX  0

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

2

Boolean Algebra Theorems Unity Theorem ( XY )  ( XY )  Y ( X  Y )( X  Y )  Y Absorption Theorem X  ( XY )  X

X (X Y)  X

X  ( XY )  X  Y

X ( X  Y )  XY

Consensus Theorem

XY  XZ  YZ  XY  XZ Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

3

Venn Diagrams A graphical way to represent a logic equation. In order to do this, we use: 1- A square to show the binary space 22- A circle to show a binary variable 3- The area inside the circle to represent a true value “1” and the area outside the circle to represent a false value “0”.

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

4

For example, the following figures show AB and AB

AB

AB AB

There was some struggle as to how to generalize too many sets. You can use as far as four sets by using ellipses:

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

5

Example 1: What is the Venn Diagram of Boolean expression of XYZ  XY Z  XYZ

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

6

Example 2: What is the Boolean expression of the shown Venn diagram?

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

7

Karnaugh Mapping A

A

A

A

A

A

A

A

A

A

A

A B

B

A

A

B

B Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

8

A

A

B

B

A

B 0

The above figure represents a Two-variable K-maps.

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

9

Now, we would like to mark a cell corresponding to the desired Boolean expression. As an example, we would like to mark a cell associated with Z=AB

A

B 0

A

0

B 0 1

1

0

1

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

10

Rules for construction of Two-variable K-maps : 1- Circle adjacent 1’s, horizontally or vertically but not diagonally. 2- The sum of minterms inside each circle is the common variable among the minterms 3- The logic equation is obtained by OR’ing the results of step 2 and the minterms which are not included in any of the circles.

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

11

Example 3: Use a K-map to simplify the following truth tables X

Y

0 0 1 1

0 1 0 1 Truth Table

X

Y

0 0 1 1

0 1 0 1 Truth Table

Z 1 0 0 1

Z 1 1 0 0

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

12

Three-variable K-maps C

C

C

A

A

B

B

C

C

C

A A B

B

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

13

BC

B C B C BC

A

x

A x  ABC

C

C

A

C

0

1

3

4

5

7

B

2

A

6

B

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

14

Now, we would like to mark a cell corresponding to the desired Boolean expression. As an example, we would like to mark cells corresponding to the following logic equation:

F ( X , Y , Z )  m2  m3  m6   m(2,3,6) The equation can be obtained using minterms expansion as:

F ( X , Y , Z )  XYZ  XYZ  XYZ The equation can be simplified to

F ( X , Y , Z )  XY  YZ We can obtain the same expression using kk-map map method. method

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

15

Z

Z

X YZ X  YZ X  YZ

Y

YXZ  YXZ  YX

F ( X , Y , Z )  XY  YZ

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

16

Rules for construction of Three-variable K-maps : 1 Circle 1Ci l as many adjacent dj 1’s 1’ as possible ibl in i groups off (2,4,8), (2 4 8) horizontally h i ll or vertically but not diagonally. 2- The sum of minterms inside each circle is the common variable among the minterms 3- The logic equation is obtained by OR’ing the results of step 2 and the minterms which are not included in any of the circles. Hints: 1’ Hi 1’s iin the h same row iin the h first fi andd last l columns l are adjacent. dj For F example, l consider the following K-map

1

1

F ( X , Y , Z )  XZ Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

17

Four-variable K-maps D

D 0

A A

1

D 3

2

4

5

7

6

12

13

15

14

8

9

C

11

10

B B B

C

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

18

Rules for construction of Four-variable K-maps : 1- Circle as many adjacent 1’s as possible in groups of (2,4,8,16), horizontally or vertically but not diagonally. 2- The sum of minterms inside each circle is the common variable among the minterms 3- The logic equation is obtained by OR’ing the results of step 2 and the minterms which are not included in any of the circles. Hints: 1’s in in the top and bottom row in the same column are adjacent, as leftmost and rightmost columns. For example, consider the following K-map

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

19

F (W , X , Y , Z )  W XY Z  W XYZ  WXY Z  WXYZ  W XZ  WXZ  XZ A h example: Another l

F (W , X , Y , Z )  W XZ  WXZ  XZ Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

20

Tabular Method (Q i M Cl k M (Quine-McCluskey Method) th d) In order to apply tabular method, the function must be given as a sum of minterms. Consider the following two minterms minterms, which differ in exactly one variable. variable They can be combined as

AB CD  AB CD  AB C 1010  1011  101 

the dash indicates a missing variable

Now, consider the two following minterms:

A BC D  A BCD

will not combine

0101  0110

will not combine

This concept p can be expanded p to sum of minterms by y sortingg the minterms into groups g p according to the number of 1’s in each term. For example: Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

21

F (W , X , Y , Z )   m(0,1,2,5,6,7,8,9,10,14) Column 1 Group 0

Group 1

Group 2

Group 3

0

0000

Column 2

Column 3

0,1 000-  0,1,8,9 0 2 00 0,2 00-0 0  0,2,8,10 0 2 8 10 1 0001 0,8 -000  0,8,1,9 2 0010 1,5 0-01 0 8 2 10 0,8,2,10  1,9 -001 8 1000 2,6 0-10  2,6,10,14 5 0101 2,10 -010 010  2,10,6,14 2 10 6 14 6 0110 8,9 100-  8,10 10-0  9 1001 5,7 01-1 10 1010 6,7 0117 0111 6 14 -110 6,14 110  14 1110 10,14 1-10  Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

-00-0-0 00 -00-0-0 00 --10 --10

22

F (W , X , Y , Z )  W Y Z  W XZ  W XY  XY  XZ  YZ Note that this equation has 6 implicants. We can use the following table to simplify the equation further. Minterms Implicant

0-01 01-1 01 1 011-00-0-0 --10

Covered Minterms

1,5 57 5,7 6,7 0,1,8,9 0,2,8,10 2,6,10,14

0 1 2 5 6 7 8 9 10 14 

 

  

  

   

 

 



Three implicants can be ignored since the minterms used in them are also used in other implicants. This can be proven using Consensus theorem, which eliminates the redundant terms.

F (W , X , Y , Z )  W XZ  XY  YZ

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

23

Example 4:

(P3.13) For the following function, find all the essential implicants using the

tabular method:

F (W , X , Y , Z )   m(0,4,5,9,11,13)  W YZ

Introduction to Microprocessor and Digital Logic, ME262, University of Waterloo, S'10

24