Chapter 3 Combinational Design Digital Logic Design III وزارة التعليم العالي والبحث العلمي جامعة الكوفة - كلية التربية – قسم علوم الحاسوب Digital Logic Design III Chapter 3 Combinational Design Dr. Wissam Hasan Mahdi Alagele e-mail:wisam.alageeli@uokufa.edu.iq http://edu-clg.kufauniv.com/staff/Mr.Wesam
Combinational Circuits Princess Sumaya University Combinational Circuits 4241 - Digital Logic Design Output is function of input only i.e. no feedback When input changes, output may change (after a delay) Combinational Circuits • n inputs m outputs Dr. Bassam Kahhaleh
Combinational Circuits Princess Sumaya University 4241 - Digital Logic Design Combinational Circuits Analysis Given a circuit, find out its function Function may be expressed as: Boolean function Truth table Design Given a desired function, determine its circuit ? ? Dr. Bassam Kahhaleh
Princess Sumaya University 4241 - Digital Logic Design Analysis Procedure Boolean Expression Approach T2=ABC T1=A+B+C F2=AB+AC+BC F’2=(A’+B’)(A’+C’)(B’+C’) T3=AB'C'+A'BC'+A'B'C F1=AB'C'+A'BC'+A'B'C+ABC F2=AB+AC+BC Dr. Bassam Kahhaleh
Princess Sumaya University Analysis Procedure 4241 - Digital Logic Design Truth Table Approach A B C F1 F2 0 0 0 = 0 0 0 1 Dr. Bassam Kahhaleh
Princess Sumaya University 4241 - Digital Logic Design Analysis Procedure Truth Table Approach A B C F1 F2 0 0 0 0 0 1 = 0 = 1 1 1 1 0 1 1 Dr. Bassam Kahhaleh
Princess Sumaya University 4241 - Digital Logic Design Analysis Procedure Truth Table Approach A B C F1 F2 0 0 0 0 0 1 1 0 1 0 = 0 = 1 1 1 1 1 0 1 Dr. Bassam Kahhaleh
Princess Sumaya University 4241 - Digital Logic Design Analysis Procedure Truth Table Approach A B C F1 F2 0 0 0 0 0 1 1 0 1 0 0 1 1 = 0 = 1 1 0 1 1 Dr. Bassam Kahhaleh
Princess Sumaya University Analysis Procedure 4241 - Digital Logic Design Truth Table Approach A B C F1 F2 0 0 0 0 0 1 1 0 1 0 0 1 1 1 0 0 = 1 = 0 1 1 1 1 1 0 Dr. Bassam Kahhaleh
Princess Sumaya University 4241 - Digital Logic Design Analysis Procedure Truth Table Approach A B C F1 F2 0 0 0 0 0 1 1 0 1 0 0 1 1 1 0 0 1 0 1 = 1 = 0 1 0 1 1 Dr. Bassam Kahhaleh
Princess Sumaya University Analysis Procedure 4241 - Digital Logic Design Truth Table Approach = 1 = 0 A B C F1 F2 0 0 0 0 0 1 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 0 1 Dr. Bassam Kahhaleh
Princess Sumaya University 4241 - Digital Logic Design Analysis Procedure Truth Table Approach A B C F1 F2 0 0 0 0 0 1 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 = 1 1 1 1 1 1 B 1 A C B 1 A C F1=AB'C'+A'BC'+A'B'C+ABC F2=AB+AC+BC Dr. Bassam Kahhaleh
Princess Sumaya University 4241 - Digital Logic Design Design Procedure Given a problem statement: Determine the number of inputs and outputs Derive the truth table Simplify the Boolean expression for each output Produce the required circuit Example: Design a circuit to convert a “BCD” code to “Excess 3” code 4-bits 0-9 values Value+3 ? Dr. Bassam Kahhaleh
Princess Sumaya University 4241 - Digital Logic Design Design Procedure BCD-to-Excess 3 Converter C 1 B A x D C 1 B A x D A B C D w x y z 0 0 0 0 0 0 1 1 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 x x x x 1 1 0 1 1 1 1 0 1 1 1 1 w = A+BC+BD x = B’C+B’D+BC’D’ C 1 B A x D C 1 B A x D y = C’D’+CD z = D’ Dr. Bassam Kahhaleh
Princess Sumaya University 4241 - Digital Logic Design Design Procedure BCD-to-Excess 3 Converter A B C D w x y z 0 0 0 0 0 0 1 1 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 x x x x 1 1 0 1 1 1 1 0 1 1 1 1 w = A + B(C+D) y = (C+D)’ + CD x = B’(C+D) + B(C+D)’ z = D’ Dr. Bassam Kahhaleh
Seven-Segment Decoder Princess Sumaya University Seven-Segment Decoder 4241 - Digital Logic Design f e g d a b c ? w x y z a b c d e f g BCD code w x y z a b c d e f g 0 0 0 0 1 1 1 1 1 1 0 0 0 0 1 0 1 1 0 0 0 0 0 0 1 0 1 1 0 1 1 0 1 0 0 1 1 1 1 1 1 0 0 1 0 1 0 0 0 1 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 1 0 0 0 0 1 0 0 0 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 0 1 0 x x x x x x x 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1 x a = w + y + xz + x’z’ e = x’z’+yz’ b = x’+yz+y’z’ c = x+y’+z f = w+x+y’z’ d = x’z’+yz’+x’y+xy’z g = w+x’y+xy’+x’y+xz’ Dr. Bassam Kahhaleh
Problem Design a circuit which displays the letters A through J on a seven-segment indicator. The circuit has four inputs W, X, Y, Z which represent the last 4 bits of the ASCII code for the letter to be displayed. For example, if WXYZ = 0001, “A” will be displayed. The letters should be displayed in the following form: Design your circuit using only two-, three-, and four-input NOR gates and inverters. Any solution with 22 or fewer gates and inverters (not counting the four inverters for the inputs) is acceptable.
Princess Sumaya University Binary Adder 4241 - Digital Logic Design Half Adder Adds 1-bit plus 1-bit Produces Sum and Carry HA x y S C x + y ─── C S x y C S 0 0 0 0 0 1 0 1 1 0 1 1 1 0 x y S C Dr. Bassam Kahhaleh
Princess Sumaya University 4241 - Digital Logic Design Binary Adder Full Adder Adds 1-bit plus 1-bit plus 1-bit Produces Sum and Carry FA x y z S C x + y + z ─── C S y 1 x z x y z C S 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 1 1 0 1 0 0 1 0 1 1 1 0 1 1 1 1 1 S = xy'z'+x'yz'+x'y'z+xyz = z’(xy’+x’y)+z(x’y’+xy) =z’(x y) + z(x y)’ = x y z y 1 x z C = xy + xz + yz Dr. Bassam Kahhaleh
Princess Sumaya University 4241 - Digital Logic Design Binary Adder Full Adder S = xy'z'+x'yz'+x'y'z+xyz=x y z C = xy + xz + yz x y z S C x y z S C Dr. Bassam Kahhaleh
Princess Sumaya University Binary Adder 4241 - Digital Logic Design Full Adder HA x y z S C x y z S C Dr. Bassam Kahhaleh
QUIZ ? Q#1- This combinational logic circuit is described as a(n) ___. Q#2- What are the sum and carry out outputs of this full-adder circuit? Q#3- What are the sum and carry out outputs of this full-adder circuit? Q#4- What are the sum and carry out outputs of this full-adder circuit? Q#5- What are the sum and carry out outputs of this full-adder circuit? Q#6- What are the sum and carry out outputs of this full-adder circuit? ANS: full-adder ANS: Sum=0, Carry out=0 ANS: Sum=1, Carry out=0 ANS: Sum=0, Carry out=1 ANS: Sum=1, Carry out=1 ANS: Sum=0, Carry out=1 Cin = 0 A = 0 B = 0 Cin = 0 A = 0 B = 1 Cin = 1 A = 0 B = 1 Cin = 1 A = 1 B = 1 ? Cin = 0 A = 1 B = 1
Princess Sumaya University 4241 - Digital Logic Design Binary Adder c3 c2 c1 . + x3 x2 x1 x0 + y3 y2 y1 y0 ──────── Cy S3 S2 S1 S0 FA x3 x2 x1 x0 y3 y2 y1 y0 S3 S2 S1 S0 C4 C3 C2 C1 Binary Adder x3x2x1x0 y3y2y1y0 S3S2S1S0 C0 Cy Carry Propagate Addition Dr. Bassam Kahhaleh
74x283 4-bit adder Uses carry look-ahead internally
Princess Sumaya University Binary Adder 4241 - Digital Logic Design Carry Propagate Adder c3 c2 c1 . x3 x2 x1 x0 y3 y2 y1 y0 ──────── Cy S3 S2 S1 S0 c7 c6 c5 Cy . + x7 x6 x5 x4 + y7 y6 y5 y4 Cy S7 S6 S5 S4 CPA A3 A2 A1 A0 B3 B2 B1 B0 S3 S2 S1 S0 C0 Cy x3 x2 x1 x0 y3 y2 y1 y0 x7 x6 x5 x4 y7 y6 y5 y4 S3 S2 S1 S0 S7 S6 S5 S4 Dr. Bassam Kahhaleh
Subtractors Half Subtractor Full Subtractor Adder/Subtractor - 1
Half Subtractor Input Output Logic Symbol: Logic Diagram: A Di B Bo Bo Di (difference) B0 (borrow out) B Bo A B Di 0 0 0 0 0 1 1 1 1 0 1 0 1 1 0 0 A B Di Bo -1 1 2 Logic Diagram:
QUIZ ? Q#1- What is the difference and borrow outputs from This half-subtractor circuit? Q#2- What is the difference and borrow outputs from this half-subtractor circuit? Q#3- What is the difference and borrow outputs from this half-subtractor circuit? Q#4- What is the difference and borrow outputs from this half-subtractor circuit? ANS: Di= 0, Bo= 0 ANS: Di= 1, Bo= 0 ANS: Di= 0, Bo= 0 ANS: Di= 1, Bo= 1 (A – B) A = 0 B = 0 (A – B) A = 1 B = 0 (A – B) A = 1 B = 1 (A – B) A = 0 B = 1 ?
Full Subtractor Input Output Logic Symbol: Logic Diagram: Full Di (difference) B0 (borrow out) Full Subtractor Input Output Bin A B Di B0 H. S. Bin Logic Diagram: half subtractor Bo
Full Subtractor Di Di Same as S in full adder Bo 1 1 Ci A B 00 01 11 10 Di 0 0 0 0 0 0 0 1 1 1 0 1 0 1 0 0 1 1 0 0 1 0 0 1 1 1 0 1 0 1 1 1 0 0 0 1 1 1 1 1 Ci A B Di Bo Di Same as S in full adder Bo 00 01 11 10 1 1
HINT: truth table from textbook (Fig. 10-10) is helpful QUIZ Q#1- What are the Difference and Borrow out output from this full-subtractor circuit? Q#2- What are the Difference and Borrow out output from this full-subtractor circuit? Q#3- What are the Difference and Borrow out output from this full-subtractor circuit? Q#4- What are the Difference and Borrow out output from this full-subtractor circuit? Q#5- What are the Difference and Borrow out output from this full-subtractor circuit? Q#6- What are the Difference and Borrow out output from this full-subtractor circuit? HINT: truth table from textbook (Fig. 10-10) is helpful ANSWER: Di = 0, Bo = 0 ANSWER: Di = 1, Bo = 1 ANSWER: Di = 1, Bo = 1 ANSWER: Di = 0, Bo = 1 ANSWER: Di = 1, Bo = 0 ANSWER: Di = 0, Bo = 0 (A – B - Bin) Bin = 0 A = 0 B = 0 (A – B - Bin) Bin = 1 A = 0 B = 0 ? (A – B - Bin) Bin = 1 A = 1 B = 1 (A – B - Bin) Bin = 1 A = 0 B = 1 (A – B - Bin) Bin = 0 A = 1 B = 0 (A – B - Bin) Bin = 0 A = 1 B = 1
Adder/Subtractor - 1 E = 0: Half adder E = 1: Half subtractor Di Bo A B S C Half adder Half subtractor i E = 0: Half adder E = 1: Half subtractor o
Adder/Subtractor-1 E = 0: Full adder E = 1: Full subtractor C A B Bo E Di C Bo i E E = 0: Full adder E = 1: Full subtractor
Adder/Subtractor-2 E = 0: 4-bit adder E = 1: 4-bit subtractor