E21 Digital Logic Design Lecture #2
Numbers & Encodings
-
Review gray codes, hex, 2's complement
Adding and subtracting numbers (review quickly)
-
With 2's complement for addition you just add, for subtraction you invert one number and then add
-
If the two addends have the same sign and their result has a different sign, then there is an overflow
-
Examples with 4-bit numbers: -4 + 4, 5 + 6, -7 + 5
Designing boolean functions using logic gates
Representing combinational logic
-
Boolean logic (switching algebra)
-
Variables: X, Y, ALARM (also called signals)
-
Expressions: 'X, X+Y, X*Y (also functions of variables)
-
Logical OR represented as + (also seen as inverted v in mathematics)
-
Logical AND represented as * (also seen as v in mathematics)
-
Logical NOT represented as ' or overstrike
-
Only two values in Boolian logic (0/1)
-
We can think relate Boolean logic to voltage values either way we want (positive or negative logic)
-
Boolean Axioms
-
Two-value logic (X = 0 iff X != 1; X=1 iff X != 0)
-
Inverse (if X=0 then X' = 1; if X=1 then X' = 0)
-
Definition of product (0*0 = 0; 1*1 = 1; 0*1 = 1*0 = 0)
-
Definition of sum (1+1 = 1; 0+0 = 0; 1+0 = 0+1 = 1)
-
Boolean theorems
-
Sum axioms (X + 0 = X, X + 1 = 1, X + X = X, X + X' = 1)
-
Product axioms (X*1 = X, X*0 = 0, X*X = X, X * X' = 0)
-
DeMorgan's theorem ( (X1 * X2 ... Xn)' = X1' * X2' .... Xn'
-
Boolean expressions
-
Realization of some function we want to create
-
Alarm system example
-
Signals: panic button, window, door, enabled, exiting
-
-
Write an expression for when the alarm should go off
-
alarm = panic button + enabled * 'exiting * (window + door)
-
Truth tables: useful up to about 6 variables (at most)
- Do truth table for the alarm example (5 variables)
-
Diagrams: physical representation of the truth table
-
Do a physical diagram based on the logic expression
More on Boolean Expressions
-
Sum of Products (counting the ones)
-
Product of Sums (counting the zeros)
-
Use deMorgan's theorem !(XYZ) = !X + !Y + !Z
- This gives you sums inside the parentheses and products between them
-
Design a full-adder for 1 bit binary numbers (sum and carry bit outputs)
-
Do traffic light example for NS red (show how different encodings result in different circuits)
-
Minimization using Boolean logic (has to be a better way!)
Karnaugh Maps for function minimization
-
Graphical representation of a truth table (show 2, 3, 4, 5 variable formulations)
-
You want to find groups of 1's that form 2n-sized blocks.
-
Pick a cell that contains unique 1's and put that expression in the equation. Remove those one's from consideration.
-
Pick the next cell, and so on, until all of the 1's are covered
-
Always pick the largest cells you can, since those are the simplest expressions (even if they overlap other cells)
-
Sometimes you don't care about some variables in some situations: replace those with a "d" (don't care)
-
Don't care positions can take on either a 1 or 0 value (but not both)
-
Do Z4 (middle horizontal bar) from the BCD to 7 segment display output