Chapter 2Basic Digital Logic1 Chapter 2
Basic Digital Logic2 Outlines Basic Digital Logic Gates Two types of digital logic circuits Combinational logic circuits Sequential logic circuits Combinational logic circuit design Using sum of product Using product of sum Karnaugh map: Minimization of logic circuits Without don’t care term With don’t care term Construction from smaller components Sequential logic circuit
Chapter 2Basic Digital Logic3 Switches Abstraction of building block of digital computers Basic logic functions AND OR NOT B A A A B
Chapter 2Basic Digital Logic4 Basic Digital Logic Gates NOT gate AND gate OR gate XOR gate NAND gate NOR gate XNOR gate
Chapter 2Basic Digital Logic5 Two types of digital logic circuits Combinational logic circuits Output depends only on its input at that time. Sequential logic circuits Output depends both on its previous output and its input at that time Combinational Logic Circuit Sequential Logic Circuit
Chapter 2Basic Digital Logic6 Combinational Logic Circuit
Chapter 2Basic Digital Logic7 How to design a combinational logic circuit Decide how to encode input and output in 0 and 1 Describe each bit of the output in term of input Truth table Logical function Construct a logic circuit from the logical function
Chapter 2Basic Digital Logic8 Truth table and logical function out = f (in 1, in 2, …) in 1 in 2 …out … ………… 1110
Chapter 2Basic Digital Logic9 Boolean Logic Basic Boolean operations AND: X Y, X & Y, X Y, X Y OR: X Y, X + Y NOT: ~X, X’, X Any Boolean expressions can be described in: Disjunctive normal form (DNF) /sum of product Conjunctive normal form (CNF) / product of sum
Chapter 2Basic Digital Logic10 Example: Exclusive OR (XOR) output = X Y + X Y XYoutput
Chapter 2Basic Digital Logic11 Construct Sum of Products Find out all conditions when the function is true X Y = T(1) when X=0, Y=1 => X Y =1 X=1, Y=0 => X Y = 1 OR the conditions X Y + X Y Sum of products XYoutput minterm
Chapter 2Basic Digital Logic12 Exclusive OR (XOR): Sum of products output = X Y + X Y minternXYoutput XYXY 000 X Y 011 X Y 101 X Y110 X Y output
Chapter 2Basic Digital Logic13 Construct Product of Sums Find out all conditions when the negation of the function is true X Y = F(0) when X=0, Y=0 => X + Y = 0 X=1, Y=1 =>X +Y = 0 AND the conditions ( X + Y )(X +Y) Product of sum XYoutput maxterm
Chapter 2Basic Digital Logic14 Exclusive OR (XOR) output = ( X + Y )( X + Y ) X Y output maxtermXYoutput X + Y000 X + Y X + Y 110
Chapter 2Basic Digital Logic15 Karnaugh Map (K-map)
Chapter 2Basic Digital Logic16 2-variable K-map A B ABX
Chapter 2Basic Digital Logic17 3-variable K-map ABCX AB C
Chapter 2Basic Digital Logic18 4-variable K-map ABCDX AB CD
Chapter 2Basic Digital Logic19 Full Adder Full adder A B Ci S Co ABCiSCo
Chapter 2Basic Digital Logic20 Full Adder ABCSCo AB C AB C S=A’B’C+A’BC’+ABC+AB’C’ Co=AB+BC+AC
Chapter 2Basic Digital Logic21 Encoder A3 A2 A1 X1 A0 X0 A3A2A1A0X1X0 0000XX XX …XX …XX 1111XX
Chapter 2Basic Digital Logic22 Encoder A3A3 A2A2 A1A1 A0A0 X1X1 X0X0 0000XX XX …XX …XX 1111XX A 3 A 2 A 1 A X1X1 010XXX 11XXXX 100XXX X 1 = A 1 A 0
Chapter 2Basic Digital Logic23 Encoder A3A3 A2A2 A1A1 A0A0 X1X1 X0X0 0000XX XX …XX …XX 1111XX A 3 A 2 A 1 A X0X1 010XXX 11XXXX 101XXX X 0 = A 1 +A 3
Chapter 2Basic Digital Logic24 Decoder decoder b3b2b1b0b3b2b1b0 a1a0a1a0 If a 1 a 0 is a binary i, b i is 1 and b j is 0 when j i. a1a1 a0a0 b3b3 b2b2 b1b1 b0b
Chapter 2Basic Digital Logic25 Decoder a1a1 a0a0 b3b3 b2b2 b1b1 b0b b 3 = a 1 a 0 b 2 = a 1 a 0 b 1 = a 1 a 0 b 0 = a 1 a 0 b3b3 b2b2 b0b0 b1b1 a0a0 a1a1
Chapter 2Basic Digital Logic26 Multiplexor 2-1 multiplexor D1D0D1D0 x S X = D s SD1D1 D0D0 x
Chapter 2Basic Digital Logic27 Multiplexor SD1D1 D0D0 x D 1 D 0 S X = S D 0 + S D 1
Chapter 2Basic Digital Logic28 Multiplexor X = S D 0 + S D 1 D 1 D 0 S X
Chapter 2Basic Digital Logic29 Construction from Smaller Components
Chapter 2Basic Digital Logic30 2-bit Full Adder 1 1 A 1 A B 1 B C S 1 S 0 FA 0 FA 1 A 1 B 1 A 0 B 0 Ci=0 C S 1 S 0 A B Ci Co S A B Ci Co S 2-bit full adder
Chapter 2Basic Digital Logic31 4-bit Full Adder A 1 A 0 B 1 B 0 + C S 1 S 0 2FA 0 2FA 1 A 1 B 1 A 0 B 0 Ci=0 C S 1 S 0 A B Ci Co S A B Ci Co S bit full adder
Chapter 2Basic Digital Logic32 Sequential Circuit
Chapter 2Basic Digital Logic33 Clock Signal oscillating between 0 and 1 clock cycle time / clock period Rising edge Falling edge Edge-triggered clocking The state of the sequential circuits changes on the clock edge.
Chapter 2Basic Digital Logic34 Types of sequential circuits Synchronous circuits With clock Use in digital computers Asynchronous circuits Without clock
Chapter 2Basic Digital Logic35 SR Latch R Q’ S Q set R Q’ S Q reset R Q’ S Q 0 0 1/0 0/1 1/0 hold R Q’ S Q 1 1 ? ? ? ? unstable
Chapter 2Basic Digital Logic36 D Latch C D Q QQ 0 0 Q0Q0 0 0 Q0Q0 Q0Q0 C D Q QQ 0 1 Q0Q0 0 0 Q0Q0 Q0Q0 C D Q QQ C D Q QQ Q0Q0 0 CDQCDQ C=0 hold data C=1 load data
Chapter 2Basic Digital Logic37 D Flip-flop D latch DCDC DCDC QQ DCDC Q Q 1010 xDxD QDQD D latch DCDC DCDC QQ DCDC Q Q 0101 xxxxQQQQ D latch DCDC DCDC QQ DCDC Q Q 0000 xxxxxxxx D latch DCDC DCDC QQ DCDC Q Q 1111 xDxDDDDD CDQCDQ C=1 0 load data
Chapter 2Basic Digital Logic38 Registers D flip-flop clk D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 0 O 7 O 6 O 5 O 4 O 3 O 2 O 1 O 0 8-bit REGISTER D in D out clk 8 8 CDQCDQ Set-up time Hold time
Chapter 2Basic Digital Logic39 Register Files n-2 n decoder Register n-1 Register n-2 Register 0... n n-1 n-2 0 Write Register number Data in 8 n-1 MUX Data out 8
Chapter 2Basic Digital Logic40 Finite State Machines Next-state function (Combinational) Current State (registers) Output function (Combinational) Inputs Outputs
Chapter 2Basic Digital Logic41 Counter 0 -> 3 clk abab Current StateNext State abAB A = a b B = b D Q Q D Q Q clk a b
Chapter 2Basic Digital Logic42 Counter with reset R clk abab reset R Current State Next State abAB A = R (a b) B = R b D Q Q D Q Q R clk a b