Chapter 2: Introduction To Logic Circuits: 2009 Spring CS211 Digital Systems & Lab
Chapter 2: Introduction To Logic Circuits: 2009 Spring CS211 Digital Systems & Lab
Logic functions and circuits Boolean Algebra g Logic gates and Synthesis CAD t tools l and d VHDL
Read
Terminology
3
Di it l circuits Digital i it
Signal values restricted to a few discrete values Binary logic circuit two values, values 0 and 1
Analog circuits
2009 Spring CS211 Digital Systems & Lab
Binary switch
open open closed closed
x = 0
Input variable
Application of a switch
5
S Battery x Light
Output
State S
of f the h light li h : L =1 1 if the h light li h i is on, L=0 L 0 (off) ( ff) The state of the light can be described as a function of the h input variable bl x L(x) = x : logic function
2009 Spring CS211 Digital Systems & Lab
S Power supply l x1
S x2 Light
(a) The logical AND function (series connection) S x1 Power supply S x2 (b) The logical OR function (parallel connection)
2009 Spring CS211 Digital Systems & Lab
Light
S
X1
S
X3
Power supply
S
X2
Light
Logic function ?
2009 Spring CS211 Digital Systems & Lab
Inversion
8
R Power supply
Light
Inverse of a value
Several commonly used notations x = x = !x = NOT x = ~x The complement operation can be applied to more complex operations f(x1,x x2) = x1+x2
2009 Spring CS211 Digital Systems & Lab
Useful aid for depicting information involving logic functions Grow exponentially p y in size with the number of variables
2009 Spring CS211 Digital Systems & Lab
X Y
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1 1 X nand Y
X or Y
X=Y
not X not Y
X xor Y
X nor Y
Complete Set : a set of function is complete iff every Boolean function can be generated by a combination of the functions
Basic Gates
12
x1 x2
x1 x2 xn
x1 x2
x1+ x2+ + xn
S
X1
S
X3
Power supply
S
X2
Light
x 1 x 2 x 3
x x x 1 2 3 1
f = (x + x ) x 1 2 3
f = ( x + x ) x3 1 1 2
x2
f (x , x )
1 2
A 1 1 0 0
B 0 0 0 1
0 0 1 1
0 1 0 1
1 1 0 1
(b) ( ) Truth table 2009 Spring CS211 Digital Systems & Lab
Timing Diagram
15
Ti i Di Timing Diagram
Changes in signals at various points are presented in graphical form Also useful method for indicating the functional behavior
x1 0 0 1 1 0 1 0 1 1 1 0 0 A 0 0 01 B 1 1 0 1 f
x x1 1 0 x2 1 0 1 A 0 B 1 0 1 f 0
waveform
Time (c) Timing diagram 2009 Spring CS211 Digital Systems & Lab
x1 + x1 x2 = x1 + x2
x1 0 0 1 1 1 1 0 0 A 0 0 01 B f = x1 + x1x2 1 1 0 1 f
x2
0 1 0 1
1 1 0 1
g = x +x 1 2
with a variety of different networks, probably having different costs How do we find the best implementation for a given function?
Logic functions and circuits Boolean Algebra g Logic gates and Synthesis CAD t tools l and d VHDL
Read
Boolean Algebra
19
A scheme for the algebraic description of processes involved in logical thought and reasoning Boolean algebra provides an effective means of describing circuits built with switches A set of element B = {0, 1} Binary operation { +(OR), (AND) } And a unary operation { (NOT)} Such that the following axioms hold :
A dual of a Boolean expression is derived by replacing by +, + by , 0 by 1, 1 and 1 by 0, 0 and leaving variables unchanged Dual of any true statement is also true X+Y+XY XY=X+Y X+Y=XY
DeMorgans theorem
OR and AND operations Say simply sum and product Product terms and Sum terms
xy
Precedence
In
NOT AND OR
gate t
truth t th table t bl
XNOR X = Y ( (XY+XY) )
2009 Spring CS211 Digital Systems & Lab
Logic functions and circuits Boolean Algebra g Logic gates and Synthesis CAD t tools l and d VHDL
Read
Any logic function that can be expressed as a truth table written as an expression in Boolean algebra Implementing an arbitrary logic function
Derive
Logical
Example
26
Logic function
x1 x2
Af function ti to t be b synthesized. th i d
Tools to g generate different solutions Logic minimization: reduce number of gates and complexity Logic optimization: reduction of complexity while trading off against delay (or power consumption)
Static and dynamic behavior Number of gate levels and structure D l Delays are diff different t Glitches (hazards) may arise Cost
2009 Spring CS211 Digital Systems & Lab
29
Technology independent
Canonical
Canonical forms
30
Truth table
A
unique signature of a Boolean function Many alternative gate realizations Many alternative Boolean expressions drawback?
Canonical forms
Standard
forms for a Boolean expression p A unique algebraic signature Using g Truth table
2009 Spring CS211 Digital Systems & Lab
Mi t Minterm
ANDed product of literals Product term in which each of input variables or its complement appears once ORed sum of literals Sum term in which each of input variables or its complement appears once
Maxterm
Canonical sum-of-products
Logic function
x1 x2
A function to be synthesized.
Example
34
SOP
Conjunctive C j ti normal l form f (M (Maxterm t expansion) i ) f(x1,x2) = m2 = x1x2 f(x1,x x2) = f = x1x2 = x1+x2 = M2 In the previous example
f(x1,x2,x3) = M0 M2 M3 M7 = (x1+x3)(x2+x3)
x1 x2 x1 x2 xn
x1 x1 x2 x2 x1 + x2 xn
(b) NOR gates
x1 + x2 + + xn
x1 x2
x1x2 = x1 + x2
x1 x2
x1 x2 (b)
x1 x2
x1 + x2 = x1x2
x1 x2 x3 x4 x5
x1 x2 x3 x4 x5
x1 x2 x3 x4 x5
2009 Spring CS211 Digital Systems & Lab
x1 x2 x3 x4 x5
x1 x2 x3 x4 x5
x1 x2 x3 x4 x5
40
Assume that A th t a large l room has h three th doors d and d that th t a switch it h near the th door controls a light in the room
Turn the light on or off by changing the state of any one Turn this word statement into a formal specification using a truth table
Design
Let x1, x2, and x3 be the input p variables that denote the state of each switch The light is off if all switches are open The light is on if any one of the switches is closed The light is off if two (or no) switches are closed The light is on if all switches are closed
x1 x2 x3
(a) Sum-of-products realization
x3 x2 x1
f
M lti l Multiplexer
A circuit that generates an output that exactly reflects the state of one of a number of data inputs, based on the value of one or more selection control inputs Two sources of data(x1 , x2)and one output(f) A selection control signal s Assume
Suppose
These requirements can be specified in the form of a truth table in the next slide
2009 Spring CS211 Digital Systems & Lab
(a)Truth table
Logic functions and circuits Boolean Algebra g Logic gates and Synthesis CAD t tools l and d VHDL
Read
TA will teach you these topics next week Experiment p on several circuits using g CAD tools and VHDL