CDA-4101 Lecture 7 Notes



Digital Logic Level

  • Basic simple digital elements
  • How to combine these elements to do more useful things
  • some mathematucal techniques for analyzing the combinations
  • we start with "gates"

Gates?


Gates?


Gates


Device Level (briefly)


Two Transistors


Gates

A X
0 1
1 0
A B X
0 0 1
0 1 1
1 0 1
1 1 0
A B X
0 0 1
0 1 0
1 0 0
1 1 0

Two More Gates?


Two More Gates

A B X
0 0 0
0 1 0
1 0 0
1 1 1
A B X
0 0 0
0 1 1
1 0 1
1 1 1

Boolean Algebra

  • an algebra is any system of properties and relationshsips
  • algebra, as you probably know it, is actually just the algebra of the real numbers
  • there are many other mathematical systems, each with their own algebra
  • in a digital world with only two values, we will need to study and use boolean algebra
  • technically, we will be using a switching algebra which is very closely related to boolean algebra, but we will not worry about this difference

Boolean Functions

  • with real numbers, functions can have ranges and domains that span an (uncountably) infinite set of numbers.
  • boolean functions are restricted to ranges and domains from the set { 0, 1 }
  • Example: The NOT function 'f':
    	 f(0) = 1
    	 f(1) = 0	 
  • Example: The AND function 'g':
    	 g(0,0) = 0
    	 g(0,1) = 0
    	 g(1,0) = 0
    	 g(1,1) = 1	 

George Boole

Larger Boolean Functions

A B C M
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
  • truth tables can quickly become cumbersome
  • we will use algebraic notation instead and only encode the things that make the function a '1'
  • OR = addition
  • AND = multiplication
  • overbar = negation (other negation notations include apostrophes, tildes)
  • order of precedence: negation, multiplication (AND), adition (OR) (just like you are used to)
  • Example:
    		    _      _      _
    		M = ABC + ABC + ABC + ABC
    		
  • This is a sum of products representation

Implementing Boolean Functions


Complete Gates

  • we've seen that NAND and NOR require less transitors
  • also, it is sometimes more convenient to use only a single type of gate
  • any circuit can be converted into a form that uses only NAND or only NOR gates
  • a single gate type that can implement any boolean function is called a complete gate
  • NAND and NOR are the only complete gates
  • note that the set of NOT, AND and OR gates together can also form any boolean function

"In high school I took a little English, some science, some hubcaps and some wheel covers." - William James "Gates" Brown

NAND Completeness

NOR Completeness

Circuit Equivalence


Boolean Algebra Identities



Circuit Reduction Using Boolean Algebra


Original Circuit

Circuit Reduction I

Reduction:

  F(X,Y,Z) = ((X + Y')Z) + (X'YZ')
           = XZ + Y'Z + X'YZ'         (distribute)

Equivalent Circuit

Circuit Reduction II

  Identity:
    (AB) + (CD) = (A+C)(A+D)(B+C)(B+D)       ("adding out")

  Follows from:
    (AB) + (CD) = (AB + C)(AB + D)           (distributive law)
    (AB) + (CD) = ((A+C)(B+C))((A+D)(B+D))   (distributive law)

  Generalizes to:
    (X1 X2 ... Xn) + (Y1 Y2 ... Yn)
    = (X1+Y1)(X1+Y2)...(X1+Yn)(X2+Y1)(X2+Y2)...(Xn+Y1)...(Xn+Yn)

Another Reduction:

  F(X,Y,Z) = ((X + Y')Z) + (X'YZ')
           = (X + Y' + X')(X + Y' + Y)(X + Y' + Z')(Z + X')(Z + Y)(Z + Z')
           =       1           1      (X + Y' + Z')(Z + X')(Z + Y)   1
           = (X + Y' + Z')(Z + X')(Z + Y)

Another Equivalent Circuit

Karnaugh Maps


Karnaugh Map of 2 Variables

Karnaugh Map of 3 Variables

Karnaugh Map of 4 Variables

Karnaugh Map Example

X Y Z F(X,Y,Z)
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 1
F(X,Y,Z) = X'Y'Z + X'YZ' + XY'Z + XYZ
  • note that each '1' in the box represents one of the product terms in a sum of products representation for the function
  • we can reduce clutter in the map by only writing the 1's and assuming empty cells are zeroes

Karnaugh Map Example (cont.)

  • First look at the last two product terms in the formula: XY'Z (cell 5) and XYZ (cell 7)
  • Algebraically, we can simplify:
    	     XY'Z + XYZ
    	   = (XZ)Y' + (XZ)Y
    	   = (XZ)(Y + Y')
    	   = XZ
    	   
  • effectively, the value of Y has no impact on the truth values for these two rows of the truth table: regardless of Y's value, when X=1 and Z=1 the function is '1'.
  • This is graphically represented in the Karnaugh map by the adjacent 1's in cells 5 and 7

Karnaugh Map Example (cont.)

  • Cell 2 of the Karnaugh map has no adjacent 1's (diagonals do not count), so its corresponding product term X'YZ' cannot be reduced.
  • Cells 1 and 5 are considered adjacent (wrap around) so this indicates that we can simplify its two product terms:
    	      X'Y'Z + XY'Z
    	   = Y'Z
    	   
  • In fact the Karnaugh map will give us a complete equivalent form of the function if we simply take care of all the 1's
  • An equivalent formula from the Karnaugh map is:
    	  F(X,Y,Z) = X'Y'Z + X'YZ' + XY'Z + XYZ
    	           = X'YZ' + XZ + Y'Z 
    	   

Karnaugh Map Procedure


Bigger Karnaugh Map Example

Prime Number Detector

  • Prime numbers from 0 to 15 are: 1, 2, 3, 5, 7, 11, 13
  • F(W,X,Y,Z) = W'X'Y'Z + W'X'YZ' + W'X'YZ + W'XY'Z + W'XYZ + WX'YZ + WXY'Z

Bigger Karnaugh Map Example (cont.)

Prime Number Detector

  • there are 4 groupings
  • F(W,X,Y,Z) = W'Z + XY'Z + X'YZ + W'X'Y

Karnaugh Maps and Duality


What if We "Don't Care"?


"Don't Care" Karnaugh Map Example

BCD Prime Number Detector

  • with a BCD representation, the values 10 through 15 aree not possible, so the primes are: 1, 2, 3, 5, 7
  • we don't care whether the function is 1 or 0 for any values greater than 9
  • F(W,X,Y,Z) = W'X'Y'Z + W'X'YZ' + W'X'YZ + W'XY'Z + W'XYZ

"Don't Care" Karnaugh Map Example (cont.)

BCD Prime Number Detector

  • we have choices about which groupings to take
  • groupings containing only "don't cares" shouldn't be included
  • just ensure that set of groupings selected "cover" all 1's
  • F(W,X,Y,Z) = W'Z + X'Y