Digital Electronics Tutorial: Combinational Logic Design Examples

Slides:



Advertisements
Similar presentations
Digital Circuits.
Advertisements

Logical Design.
Chapter 2 Logic Circuits.
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 9 Programmable Configurations Read Only Memory (ROM) – –a fixed array of AND gates.
Boolean Algebra and Combinational Logic
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 6 Dr. Shi Dept. of Electrical and Computer Engineering.
CSE 370 – Winter 2002 – Logic minimization - 1 Overview zLast lecture yExamples of Karnaugh maps, including Don’t cares zToday yDesign Examples yPrime.
Give qualifications of instructors: DAP
ENGIN112 L13: Combinational Design Procedure October 1, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 13 Combinational Design Procedure.
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 4-1 Chapter #2: Two-Level Combinational Logic Section 2.3, Switches and Tools.
CS 151 Digital Systems Design Lecture 13 Combinational Design Procedure.
Chapter 3 Combinational Logic Design
CSCE 211: Digital Logic Design
Propositional Calculus Math Foundations of Computer Science.
Overview Part 2 – Circuit Optimization 2-4 Two-Level Optimization
CS 105 Digital Logic Design
Chapter 2: Boolean Algebra and Logic Functions
Introduction to Digital Logic Design Appendix A of CO&A Dr. Farag
EEE324 Digital Electronics Ian McCrumRoom 5B18, Lecture 4: Boolean Algebra.
Overview of Chapter 3 °K-maps: an alternate approach to representing Boolean functions °K-map representation can be used to minimize Boolean functions.
1 CHAPTER 4: PART I ARITHMETIC FOR COMPUTERS. 2 The MIPS ALU We’ll be working with the MIPS instruction set architecture –similar to other architectures.
Overview of Chapter 4 °Design digital circuit from specification °Digital inputs and outputs known Need to determine logic that can transform data °Start.
Outline Analysis of Combinational Circuits Signed Number Arithmetic
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
1 COMBINATIONAL LOGIC One or more digital signal inputs One or more digital signal outputs Outputs are only functions of current input values (ideal) plus.
Dr. Ahmed El-Bialy, Dr. Sahar Fawzy Combinational Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
Department of Computer Engineering
9/16/04UCB EECS150 D. Culler Fa04 1 EECS Components and Design Techniques for Digital Systems Lec 06 – Minimizing Boolean Logic 9/16-04 David Culler.
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
1 The Chinese University of Hong Kong Faculty of Education Diploma in Education (Part-Time) Winter 1997 Educational Communications and Technology Assignment.
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 7 Transformations Factoring - finding a factored form from SOP or POS expression Decomposition.
Module 9.  Digital logic circuits can be categorized based on the nature of their inputs either: Combinational logic circuit It consists of logic gates.
Optimization Algorithm
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. Circuit Optimization Logic and Computer Design Fundamentals.
Kuliah Rangkaian Digital Kuliah 6: Blok Pembangun Logika Kombinasional Teknik Komputer Universitas Gunadarma.
CHAPTER 4 Combinational Logic
V - Combinational Logic Case Studies © Copyright 2004, Gaetano Borriello and Randy H. Katz 1 Combinational logic design case studies General design procedure.
Computer Engineering (Logic Circuits) (Karnaugh Map)
Ahmad Almulhem, KFUPM 2010 COE 202: Digital Logic Design Combinational Logic Part 3 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
Chap 2. Combinational Logic Circuits
ES 244: Digital Logic Design Chapter 2 Chapter 2: Combinational Systems Adapted from Alan Marcovitz’s Introduction to Logic and Computer Design Uchechukwu.
Lecture 11 Combinational Design Procedure
1 Chapter 4 Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables,
Combinational Circuit Design. Digital Circuits Combinational CircuitsSequential Circuits Output is determined by current values of inputs only. Output.
Module 11.  In Module 9, we have been introduced to the concept of combinational logic circuits through the examples of binary adders.  Meanwhile, in.
Digital Logic (Karnaugh Map). Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row.
Combinational Logic: Other Gate Types
ECE 301 – Digital Electronics Minimizing Boolean Expressions using K-maps, The Minimal Cover, and Incompletely Specified Boolean Functions (Lecture #6)
1 CSE370, Lecture 8 Lecture 8 u Logistics n Midterm 1 week from today in class. Closed book/closed notes n Sample midterm linked in on calendar n Review.
Chapter 3 Simplification of Switching Functions. Simplification Goals Goal -- minimize the cost of realizing a switching function Cost measures and other.
1 CS 352 Introduction to Logic Design Lecture 4 Ahmed Ezzat Multi-level Gate Circuits and Combinational Circuit Design Ch-7 + Ch-8.
1 EENG 2710 Chapter 3 Simplification of Switching Functions.
©2010 Cengage Learning SLIDES FOR CHAPTER 4 APPLICATIONS OF BOOLEAN ALGEBRA MINTERM AND MAXTERM EXPANSIONS Click the mouse to move to the next page. Use.
UNIT 4 APPLICATIONS OF BOOLEAN ALGEBRA MINTERM AND MAXTERM EXPANSIONS Click the mouse to move to the next page. Use the ESC key to exit this chapter. This.
1 Digital Systems Design Lecture 7 Transformations Factoring - finding a factored form from SOP or POS expression Decomposition - expression of a function.
1 CSE370, Lecture 7 Lecture 9 u Logistics n HW3 posted, due on Friday n Lab3 this week u Last lecture n Verilog u Last last lecture n K-maps examples n.
Chapter 2: Boolean Algebra and Logic Functions
DeMorgan’s Theorem DeMorgan’s 2nd Theorem
Boolean Algebra and Combinational Logic
Lecture 9 Logistics Last lecture Today HW3 due Wednesday
ECE 434 Advanced Digital System L03
BASIC & COMBINATIONAL LOGIC CIRCUIT
Digital Logic & Design Dr. Waseem Ikram Lecture 13.
Lecture 8 Logistics Last lecture Last last lecture Today
Optimization Algorithm
Combinational logic design case studies
Lecture 9 Logistics Last lecture Last last lecture Today
Overview Part 2 – Circuit Optimization
Digital System Design Combinational Logic
Presentation transcript:

Digital Electronics Tutorial: Combinational Logic Design Examples Solutions ELEC1041 - Combinational Logic Examples - 1

ELEC1041 - Combinational Logic Examples - 2 Problem #1 Develop a minimized Boolean implementation of a “ones count” circuit that works as follows. The subsystem has four binary inputs A, B, C, D, and generates a 3-bit output, XYZ. XYZ is 000 if none of the inputs are 1, 001 if one input is 1, 010 if two are one, 011 if three inputs are 1, and 100 if all four inputs are 1. (a)    Draw the truth tables for XYZ (A, B, C, D). (b)    Minimize the functions X, Y, Z using 4-variable K-maps. Write down the Boolean expressions for the minimized Sum of Products form of each function. (c)    Repeat the minimization process, this time deriving Product of Sums form. ELEC1041 - Combinational Logic Examples - 2

ELEC1041 - Combinational Logic Examples - 3 Problem #1 Solution (1/6) (a)    Draw the truth tables for XYZ (A, B, C, D). ELEC1041 - Combinational Logic Examples - 3

ELEC1041 - Combinational Logic Examples - 4 Problem #1 Solution (2/6) (b)  Minimize the functions X, Y, Z using 4-variable K-maps. Write down the Boolean expressions for the minimized Sum of Products form of each function. ELEC1041 - Combinational Logic Examples - 4

ELEC1041 - Combinational Logic Examples - 5 Problem #1 Solution (3/6) ELEC1041 - Combinational Logic Examples - 5

ELEC1041 - Combinational Logic Examples - 6 Problem #1 Solution (4/6) (c)    Repeat the minimization process, this time deriving Product of Sums form. ELEC1041 - Combinational Logic Examples - 6

ELEC1041 - Combinational Logic Examples - 7 Problem #1 Solution (5/6) ELEC1041 - Combinational Logic Examples - 7

ELEC1041 - Combinational Logic Examples - 8 Problem #1 Solution (6/6) ELEC1041 - Combinational Logic Examples - 8

ELEC1041 - Combinational Logic Examples - 9 Problem #2 Consider a combinational logic subsystem that performs a two-bit addition function. It has two 2-bit inputs A B and C D, and forms the 3-bit sum X Y Z. (a)    Draw the truth tables for XYZ(A,B,C,D). (b)    Minimize the functions using 4-variable K-maps to derive minimized Sum of Products forms. (c)    In your textbook and in class/lab we have introduced the Full Adder circuit. What is the relative performance to compute the resulting sum bits of the 2-bit adder compared to two full adders connected together? (Hint: which has the worst delay in terms of gates to pass through between the inputs and the final outputs, and how many gates is this?). ELEC1041 - Combinational Logic Examples - 9

ELEC1041 - Combinational Logic Examples - 10 Problem #2 Solution (1/3) (a)    Draw the truth tables for XYZ(A,B,C,D).    0 00 01 10 11 ELEC1041 - Combinational Logic Examples - 10

ELEC1041 - Combinational Logic Examples - 11 Problem #2 Solution (2/3) (b)    Minimize the functions using 4-variable K-maps to derive minimized Sum of Products forms. ELEC1041 - Combinational Logic Examples - 11

ELEC1041 - Combinational Logic Examples - 12 Problem #2 Solution (3/3) (c)    In your textbook and in class/lab we have introduced the Full Adder circuit. What is the relative performance to compute the resulting sum bits of the 2-bit adder compared to two full adders connected together? (Hint: which has the worst delay in terms of gates to pass through between the inputs and the final outputs, and how many gates is this?). The above circuit is better because there are only two gate levels. But the adder circuit can be used to build adder circuit of more bits. I can’t imagine doing a K-map to construct a adder circuit of 64 bits using the method above.   ELEC1041 - Combinational Logic Examples - 12

ELEC1041 - Combinational Logic Examples - 13 Problem #3 Show how to implement the full adder Sum(A, B, Cin) and Carry(A, B, Cin) in terms of: (a)    Two 8:1 multiplexers; (b)    Two 4:1 multiplexers; (c)    If you are limited to 2:1 multiplexers (and inverters) only, how would you use them to implement the full adder and how many 2:1 multiplexers would you need? ELEC1041 - Combinational Logic Examples - 13

ELEC1041 - Combinational Logic Examples - 14 Problem #3 Solution (1/8) Ai Bi Cin Sum Cout 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 ELEC1041 - Combinational Logic Examples - 14

ELEC1041 - Combinational Logic Examples - 15 Problem #3 Solution (2/8) (a)  Two 8:1 multiplexers (Sum); Ai Bi Cin Sum 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1 ELEC1041 - Combinational Logic Examples - 15

ELEC1041 - Combinational Logic Examples - 16 Problem #3 Solution (3/8) (a)    Two 8:1 multiplexers (Carry); Ai Bi Cin Cout 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 ELEC1041 - Combinational Logic Examples - 16

ELEC1041 - Combinational Logic Examples - 17 Problem #3 Solution (4/8) (b)    Two 4:1 multiplexers (Sum); Ai Bi Cin Sum 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1 ELEC1041 - Combinational Logic Examples - 17

ELEC1041 - Combinational Logic Examples - 18 Problem #3 Solution (5/8) (b)    Two 4:1 multiplexers (Carry); Ai Bi Cin Cout 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 ELEC1041 - Combinational Logic Examples - 18

ELEC1041 - Combinational Logic Examples - 19 Problem #3 Solution (6/8) (c)  2:1 multiplexers (sum) Ai Bi Cin Sum 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1 ELEC1041 - Combinational Logic Examples - 19

ELEC1041 - Combinational Logic Examples - 20 Problem #3 Solution (7/8) (c)  2:1 multiplexers (Carry) Ai Bi Cin Cout 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 ELEC1041 - Combinational Logic Examples - 20

ELEC1041 - Combinational Logic Examples - 21 Problem #3 Solution (8/8) (c)  2:1 multiplexers (Sum) Ver 2 - USE the same carry Ai Bi Cin Sum 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1 ELEC1041 - Combinational Logic Examples - 21

ELEC1041 - Combinational Logic Examples - 22 Problem #4 Design a combinational logic subsystem with three inputs, I3, I2, I1, and two outputs, O1, O0, that behaves as follows. The outputs indicate the highest index of the inputs that is driven high. For example, if I3 is 0, I2 is 1, I1 is 1, then O1, O0 would be 10 (i.e., I2 is the highest input set to 1). (a)    Specify the function by filling out a complete truth table. (b)    Develop the minimized gate-level implementation using the K-map method. (c)    Develop an implementation using two 4:1 multiplexers. (d)    Compare your implementation for (b) and (c). Which is better and under what criterion? ELEC1041 - Combinational Logic Examples - 22

ELEC1041 - Combinational Logic Examples - 23 Problem #4 Solution (1/5) (a)    Specify the function by filling out a complete truth table.    I3 I2 I1 O1 O0 0 0 0 0 0 0 0 1 0 1 0 1 x 1 0 1 x x 1 1 ELEC1041 - Combinational Logic Examples - 23

ELEC1041 - Combinational Logic Examples - 24 Problem #4 Solution (2/5) (b)    Develop the minimized gate-level implementation using the K-map method.   I3 I2 I1 O1 O0 0 0 0 0 0 0 0 1 0 1 0 1 x 1 0 1 x x 1 1 ELEC1041 - Combinational Logic Examples - 24

ELEC1041 - Combinational Logic Examples - 25 Problem #4 Solution (3/5) (c)    Develop an implementation using two 4:1 multiplexers.   I3 I2 I1 O1 O0 0 0 0 0 0 0 0 1 0 1 0 1 x 1 0 1 x x 1 1 ELEC1041 - Combinational Logic Examples - 25

ELEC1041 - Combinational Logic Examples - 26 Problem #4 Solution (4/5) (c)    Develop an implementation using two 4:1 multiplexers.   I3 I2 I1 O1 O0 0 0 0 0 0 0 0 1 0 1 0 1 x 1 0 1 x x 1 1 ELEC1041 - Combinational Logic Examples - 26

ELEC1041 - Combinational Logic Examples - 27 Problem #4 Solution (5/5) (d)    Compare your implementation for (b) and (c). Which is better and under what criterion?   ELEC1041 - Combinational Logic Examples - 27

ELEC1041 - Combinational Logic Examples - 28 Problem #5 You are to design a simple combinational subsystem to the following specification. The system has the ability to pass its inputs directly to its outputs when a control input, S, is not asserted. It interchanges its inputs when the control input S is asserted. For example, given four inputs A, B, C, D and four outputs W, X, Y, Z, when S=0, WXYZ=ABCD and when S=1, WXYZ=BCDA.  Show how to implement this functionality using building blocks that are restricted to be 2:1 multiplexers and 2:1 demultiplexers. Draw your solution below, using black boxes for the mux/demux blocks.   A B C D W X Y Z S ELEC1041 - Combinational Logic Examples - 28

ELEC1041 - Combinational Logic Examples - 29 Problem #5 Solution Each output is tied to the output of a 2:1 Multiplexer. S is the select signal. S A W B X C D Y Z ELEC1041 - Combinational Logic Examples - 29

ELEC1041 - Combinational Logic Examples - 30   Problem #6 Your task is to design a combinational logic subsystem to decode a hexadecimal digit in the range of 0 through 9, A through F to drive a seven-segment display. The hexadecimal numerals are as follows:    Design a minimized implementation in PLA form. That is, look for common terms among the seven output functions. ELEC1041 - Combinational Logic Examples - 30

Problem #6 Solution (1/5) c0 c1 c2 c3 c4 c5 c6   Problem #6 Solution (1/5) BCD to 7–segment control signal decoder c0 c1 c2 c3 c4 c5 c6 A B C D c2 c1 c5 c4 c3 c0 c6 ELEC1041 - Combinational Logic Examples - 31

Problem #6 Solution (2/5) c0 c1 c2 c3 c4 c5 c6   Problem #6 Solution (2/5) BCD to 7–segment control signal decoder c0 c1 c2 c3 c4 c5 c6 A B C D c2 c1 c5 c4 c3 c0 c6 ELEC1041 - Combinational Logic Examples - 32

ELEC1041 - Combinational Logic Examples - 33 Problem #6 Solution (3/5) BCD ACD ABD ABC A B C D F0 F1 F2 F3 F4 F5 F6 ELEC1041 - Combinational Logic Examples - 33

ELEC1041 - Combinational Logic Examples - 34 Problem #6 Solution (4/5) BCD ACD ABD ABC A B C D F0 F1 F2 F3 F4 F5 F6 18 terms ELEC1041 - Combinational Logic Examples - 34

ELEC1041 - Combinational Logic Examples - 35 Problem #6 Solution (5/5) ABCD A B C D F0 F1 F2 F3 F4 F5 F6 16 terms ELEC1041 - Combinational Logic Examples - 35

ELEC1041 - Combinational Logic Examples - 36 Problem #7 Calendar subsystem Determine number of days in a month (to control watch display) used in controlling the display of a wrist-watch LCD screen inputs: month, leap year flag outputs: number of days ELEC1041 - Combinational Logic Examples - 36

ELEC1041 - Combinational Logic Examples - 37 Problem #7 Solution (1/3) Calendar subsystem Use software implementation to help understand the problem integer number_of_days ( month, leap_year_flag) { switch (month) { case 1: return (31); case 2: if (leap_year_flag == 1) then return (29) else return (28); case 3: return (31); case 4: return (30); case 5: return (31); case 6: return (30); case 7: return (31); case 8: return (31); case 9: return (30); case 10: return (31); case 11: return (30); case 12: return (31); default: return (0); } ELEC1041 - Combinational Logic Examples - 37

ELEC1041 - Combinational Logic Examples - 38 Problem #7 Solution (2/3) Formalize the problem Encoding: binary number for month: 4 bits 4 wires for 28, 29, 30, and 31 one-hot – only one true at any time Block diagram: month leap 28 29 30 31 0000 – – – – – 0001 – 0 0 0 1 0010 0 1 0 0 0 0010 1 0 1 0 0 0011 – 0 0 0 1 0100 – 0 0 1 0 0101 – 0 0 0 1 0110 – 0 0 1 0 0111 – 0 0 0 1 1000 – 0 0 0 1 1001 – 0 0 1 0 1010 – 0 0 0 1 1011 – 0 0 1 0 1100 – 0 0 0 1 1101 – – – – – 111– – – – – – leap month 28 29 30 31 ELEC1041 - Combinational Logic Examples - 38

ELEC1041 - Combinational Logic Examples - 39 Problem #7 Solution (3/3) month leap 28 29 30 31 0000 – – – – – 0001 – 0 0 0 1 0010 0 1 0 0 0 0010 1 0 1 0 0 0011 – 0 0 0 1 0100 – 0 0 1 0 0101 – 0 0 0 1 0110 – 0 0 1 0 0111 – 0 0 0 1 1000 – 0 0 0 1 1001 – 0 0 1 0 1010 – 0 0 0 1 1011 – 0 0 1 0 1100 – 0 0 0 1 1101 – – – – – 111– – – – – – Choose implementation target and perform mapping Discrete gates 28 = 29 = 30 = 31 = Can translate to S-o-P or P-o-S m8’ m4’ m2 m1’ leap’ m8’ m4’ m2 m1’ leap m8’ m4 m1’ + m8 m1 m8’ m1 + m8 m1’ ELEC1041 - Combinational Logic Examples - 39

ELEC1041 - Combinational Logic Examples - 40 Problem #8 Leap year flag Determine value of leap year flag given the year For years after 1582 (Gregorian calendar reformation), leap years are all the years divisible by 4, except that years divisible by 100 are not leap years, but years divisible by 400 are leap years. ELEC1041 - Combinational Logic Examples - 40

ELEC1041 - Combinational Logic Examples - 41 Problem #8 Solution (1/5) Leap year flag Encoding the year: binary – easy for divisible by 4, but difficult for 100 and 400 (not powers of 2) BCD – easy for 100, but more difficult for 4, what about 400? Parts: construct a circuit that determines if the year is divisible by 4 construct a circuit that determines if the year is divisible by 100 construct a circuit that determines if the year is divisible by 400 combine the results of the previous three steps to yield the leap year flag ELEC1041 - Combinational Logic Examples - 41

ELEC1041 - Combinational Logic Examples - 42 Problem #8 Solution (2/5) Divisible-by-4 circuit BCD coded year YM8 YM4 YM2 YM1 – YH8 YH4 YH2 YH1 – YT8 YT4 YT2 YT1 – YO8 YO4 YO2 YO1 Only need to look at low-order two digits of the year all years ending in 00, 04, 08, 12, 16, 20, etc. are divisible by 4 if tens digit is even, then divisible by 4 if ones digit is 0, 4, or 8 if tens digit is odd, then divisible by 4 if the ones digit is 2 or 6. Translates into the following Boolean expression (where YT1 is the year's tens digit low-order bit, YO8 is the high-order bit of year's ones digit, etc.): YT1’ (YO8’ YO4’ YO2’ YO1’ + YO8’ YO4 YO2’ YO1’ + YO8 YO4’ YO2’ YO1’ ) + YT1 (YO8’ YO4’ YO2 YO1’ + YO8’ YO4 YO2 YO1’ ) Digits with values of 10 to 15 will never occur, simplify further to yield: YT1’ YO2’ YO1’ + YT1 YO2 YO1’ ELEC1041 - Combinational Logic Examples - 42

ELEC1041 - Combinational Logic Examples - 43 Problem #8 Solution (3/5) Divisible-by-100 and divisible-by-400 circuits Divisible-by-100 just requires checking that all bits of two low-order digits are all 0: YT8’ YT4’ YT2’ YT1’ • YO8’ YO4’ YO2’ YO1’ Divisible-by-400 combines the divisible-by-4 (applied to the thousands and hundreds digits) and divisible-by-100 circuits (YM1’ YH2’ YH1’ + YM1 YH2 YH1’) • (YT8’ YT4’ YT2’ YT1’ • YO8’ YO4’ YO2’ YO1’ ) ELEC1041 - Combinational Logic Examples - 43

ELEC1041 - Combinational Logic Examples - 44 Problem #8 Solution (4/5) Combining to determine leap year flag Label results of previous three circuits: D4, D100, and D400 leap_year_flag = D4 (D100 • D400’ ) ’ = D4 • D100’ + D4 • D400 = D4 • D100’ + D400 ELEC1041 - Combinational Logic Examples - 44

ELEC1041 - Combinational Logic Examples - 45 Problem #8 Solution (5/5) Implementation of leap year flag ELEC1041 - Combinational Logic Examples - 45

ELEC1041 - Combinational Logic Examples - 46   Problem #9 Consider the following functions, which are five different functions over the inputs A,B,C,D. (1)    F(A,B,C) = åm(1,2,6,7) (2)    F(A,B,C,D) = åm(0,1,3,9,11,12,14,15) (3)    F’(A,B,C,D) = åm(2,4,5,6,7,8,10,13) (4)    F(A,B,C,D) = (A B C + A’ B’) (C + D) (5)    F(A,B,C,D) = (A + B + C) (A + B + C’ + D) (A + B’ + C + D’) (A’ + B’) a) you were to implement these in a single PLA structure with four inputs, five outputs, and an unlimited number of product terms, how many unique product terms are there in this PLA implementation b) If you are trying to maximize the number of shared product terms across the five functions, rather than minimizing the literal count for each function independently, how many unique terms do you obtain? Draw the new K-maps with your selection of implicants that minimizes the number of unique terms across all five functions ELEC1041 - Combinational Logic Examples - 46

ELEC1041 - Combinational Logic Examples - 47   Problem #9 Solution (1/2) Consider the following functions, which are five different functions over the inputs A,B,C,D. (1)    F(A,B,C) = åm(1,2,6,7) (2)    F(A,B,C,D) = åm(0,1,3,9,11,12,14,15) (3)    F’(A,B,C,D) = åm(2,4,5,6,7,8,10,13) (4)    F(A,B,C,D) = (A B C + A’ B’) (C + D) (5)    F(A,B,C,D) = (A’ + B + C) (A + B + C’ + D) (A + B’ + C + D’) (A’ + B’) a) you were to implement these in a single PLA structure with four inputs, five outputs, and an unlimited number of product terms, how many unique product terms are there in this PLA implementation F(A,B,C)= BC’+AB+A’B’C F(A,B,C,D)=ABD’+ACD+B’D+A’B’C’ F’(A,B,C,D)=A’B+BC’D+AB’D’+B’CD’ F(A,B,C,D)=A’B’D+A’B’C+ABC F(A,B,C,D)=A’C’D’+A’B’D+A’BC+AB’C From Revision Tutorial 17 unique terms ELEC1041 - Combinational Logic Examples - 47

ELEC1041 - Combinational Logic Examples - 48   Problem #9 Solution (2/2) b) If you are trying to maximize the number of shared product terms across the five functions, rather than minimizing the literal count for each function independently, how many unique terms do you obtain? Draw the new K-maps with your selection of implicants that minimizes the number of unique terms across all five functions 1. BC’ + AB + A’B’C => ABD' + ABD + A'BC' + ABC' + A'B'C 2. ABD’ + ACD + B’D + A’B’C’ => ABD' + ACD + AB'D + A'B'D + B'CD + B'C'D + A'B'C'  3. A’B + BC’D + AB’D’ + B’CD’ => A'BC + A'BC' + A'BD + A'BD' + BC'D + AB'D' + B'CD' 4. A’B’D + A’B’C + ABC => A’B’D + A’B’C + ABC 5. A’C’D’+A’B’D+A’BC+AB’C => A’C’D’+A’B’D+A’BC+AB’C   shared terms: A'B'C is shared between 1 and 4. A’BC’ is shared between 1 and 3. ABD' is shared between 1 and 2. A’B’D is shared between 2, 4 and 5. A’BC is shared between 3 and 5.  5 shared terms +[22 – (4  2) – (1  3)] => 11 unique terms across all five functions NOTE: PLA Minimization is always carried out by CAD Tools ELEC1041 - Combinational Logic Examples - 48

ELEC1041 - Combinational Logic Examples - 49   Problem #10 Consider the following Boolean function in Product of Sums form:  F(A,B,C,D) = (A + B’ + D) (A’ + B’ + D) (B’ + C’ + D’) (A’ + C + D) (A’ + C’ + D)  Show how to implement this function with an 8:1 multiplexer, with A,B,C on the control inputs and D, its complement, and the constants 0 and 1 available as data inputs. Show your work:   1 2 3 4 5 6 7 F(A,B,C,D) A B C S2 S1 S0 ELEC1041 - Combinational Logic Examples - 49

ELEC1041 - Combinational Logic Examples - 50   Problem #10 Solution (1/2)  F(A,B,C,D) = (A + B’ + D) (A’ + B’ + D) (B’ + C’ + D’) (A’ + C + D) (A’ + C’ + D)   1 2 3 4 5 6 7 F(A,B,C,D) A B C S2 S1 S0 ELEC1041 - Combinational Logic Examples - 50

ELEC1041 - Combinational Logic Examples - 51   Problem #10 Solution (2/2)  F(A,B,C,D) = (A + B’ + D) (A’ + B’ + D) (B’ + C’ + D’) (A’ + C + D) (A’ + C’ + D)   1 2 3 4 5 6 7 F(A,B,C,D) A B C S2 S1 S0 1 D ) ELEC1041 - Combinational Logic Examples - 51

ELEC1041 - Combinational Logic Examples - 52   Problem #11 Consider a variation on the calendar combinational subsystem that works as follows. Given the inputs MONTH (1-12), DAY (1-31), and LEAP_YEAR flag, the subsystem generates the output DAY_OF_YEAR (1-365 or 366). In this problem, you will design the subsystem to the block diagram level only. (a)    One block maps the month into a day offset into the year. Identify the inputs and outputs and their bit widths. Use any formal specification method you wish (e.g., truth tables, ROM contents, equations, hardware description language, etc.) to describe the function of this block. (b)    You may assume any width binary adder you may require. Indicate how the adder is composed with the block of part (a) and any other blocks or inputs to compute the correct output. Be sure to describe how you deal with the LEAP_YEAR input   ELEC1041 - Combinational Logic Examples - 52

ELEC1041 - Combinational Logic Examples - 53   Problem #11 Solution (1/3) (a)    One block maps the month into a day offset into the year. Identify the inputs and outputs and their bit widths. Use any formal specification method you wish (e.g., truth tables, ROM contents, equations, hardware description language, etc.) to describe the function of this block Day Offset 31 59 60 90 91 l m4 m3 m2 m1 m0 d8 d7 d6 d5 d4 d3 d2 d1 d0 x 1 --- ELEC1041 - Combinational Logic Examples - 53

ELEC1041 - Combinational Logic Examples - 54   Problem #11 Solution (2/3) (a)    One block maps the month into a day offset into the year. Identify the inputs and outputs and their bit widths. Use any formal specification method you wish (e.g., truth tables, ROM contents, equations, hardware description language, etc.) to describe the function of this block ROM 26 x 10 m4 m3 m2 m1 m0 l d8 d7 d6 d5 d4 d3 d2 d1 d0 ELEC1041 - Combinational Logic Examples - 54

ELEC1041 - Combinational Logic Examples - 55   Problem #11 Solution (3/3) (b)    You may assume any width binary adder you may require. Indicate how the adder is composed with the block of part (a) and any other blocks or inputs to compute the correct output. Be sure to describe how you deal with the LEAP_YEAR input  Since leap has been taken care of in part a, you can just add whatever output from that block with day, which will give you the correct day of the year.   ROM 26 x 10 m4 m3 m2 m1 m0 l d8 d7 d6 d5 d4 d3 d2 d1 d0 d8 d7 d6 d5 d4 d3 d2 d1 d0 9-bit Adder d8-d0 day8 – day0 day8 day7 day6 day5 day4 day3 day2 day1 day0 day8 – day5 are always 0 ELEC1041 - Combinational Logic Examples - 55

ELEC1041 - Combinational Logic Examples - 56   Problem #12 Design a two-bit comparator with the following inputs and outputs: Inputs: Numbers N1 and N2 to be compared N1 = A B N2 = C D Outputs: LT, GT, EQ LT = 1 when AB < CD example (A B = 01) < (C D = 10) GT = 1 when AB > CD example (A B = 11) > (C D = 10) EQ = 1 when AB = CD example (A B = 01) = (C D = 01) ELEC1041 - Combinational Logic Examples - 56

ELEC1041 - Combinational Logic Examples - 57 Problem #12 Solution (1/3) A B C D LT EQ GT 0 0 0 0 0 1 0 0 1 1 0 0 1 0 1 0 0 1 1 1 0 0 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 1 0 1 0 0 1 1 0 0 1 0 1 1 0 0 0 0 1 1 0 0 0 1 1 1 0 1 0 LT EQ GT A B < C D A B = C D A B > C D A B C D N1 N2 block diagram and truth table we'll need a 4-variable Karnaugh map for each of the 3 output functions ELEC1041 - Combinational Logic Examples - 57

Problem #12 Solution (2/3) B C' D' + A C' + A B D' 0 0 1 0 D A 1 1 0 1 B C 1 0 0 1 0 0 D A B C 0 1 0 0 1 1 D A 1 0 B C A'B'C'D' + A'BC'D + ABCD + AB'CD’ A' B' D + A' C + B' C D K-map for LT K-map for EQ K-map for GT LT = EQ = GT = = (A xnor C) • (B xnor D) LT and GT are similar (flip A/C and B/D) ELEC1041 - Combinational Logic Examples - 58

Problem #12 Solution (3/3) A B C D two alternative EQ two alternative implementations of EQ with and without XOR XNOR is implemented with at least 3 simple gates ELEC1041 - Combinational Logic Examples - 59

ELEC1041 - Combinational Logic Examples - 60   Problem #13 Design a 2X2 bit multiplier: Inputs: Numbers N1 and N2 to be multiplied N1 = A1 A0 N2 = B1 B0 Outputs: products: P8, P4, P2, P0 P0 = Product with weighting 20 = 1 P2 = Product with weighting 21 = 2 P4 = Product with weighting 22 = 4 P8 = Product with weighting 23 = 8 Example: 11 A1A0 11 B1B0 11 B0(AA0) 11 B1(AA0) 1001 P8 P4 P2 P0 ELEC1041 - Combinational Logic Examples - 60

ELEC1041 - Combinational Logic Examples - 61 Problem #13 Solution (1/2) A2 A1 B2 B1 P8 P4 P2 P1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 1 0 1 1 0 1 1 0 0 0 0 0 0 0 1 0 0 1 1 1 0 0 1 1 0 1 1 1 0 0 1 P1 P2 P4 P8 A1 A2 B1 B2 block diagram and truth table 4-variable K-map for each of the 4 output functions ELEC1041 - Combinational Logic Examples - 61

ELEC1041 - Combinational Logic Examples - 62 Problem #13 Solution (2/2) 0 0 B1 A2 1 0 A1 B2 0 0 B1 A2 0 1 1 1 A1 B2 K-map for P8 K-map for P4 P4 = A2B2B1' + A2A1'B2 P8 = A2A1B2B1 0 0 1 1 B1 A2 0 1 1 0 A1 B2 0 0 0 1 1 0 B1 A2 A1 B2 K-map for P2 K-map for P1 P1 = A1B1 P2 = A2'A1B2 + A1B2B1' + A2B2'B1 + A2A1'B1 ELEC1041 - Combinational Logic Examples - 62

ELEC1041 - Combinational Logic Examples - 63   Problem #14 Design a BCD increment by 1: Inputs: BCD Number N N = I8 I4 I2 I0 Outputs: products: O8, O4, O2, O0 O8 O4 O2 O0 = I8 I4 I2 I0 + 1 Example: 0011 I8 I4 I2 I0 0100 O8 O4 O2 O0 O8 O4 O2 O0 ELEC1041 - Combinational Logic Examples - 63

Problem #14 Solution (1/2) I8 I4 I2 I1 O8 O4 O2 O1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 1 0 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 0 0 1 1 0 0 1 1 1 0 1 1 1 1 0 0 0 1 0 0 0 1 0 0 1 1 0 0 1 0 0 0 0 1 0 1 0 X X X X 1 0 1 1 X X X X 1 1 0 0 X X X X 1 1 0 1 X X X X 1 1 1 0 X X X X 1 1 1 1 X X X X O1 O2 O4 O8 I1 I2 I4 I8 block diagram and truth table 4-variable K-map for each of the 4 output functions ELEC1041 - Combinational Logic Examples - 64

ELEC1041 - Combinational Logic Examples - 65 Problem #14 Solution (2/2) 0 0 X 1 X 0 I1 I8 0 1 X X I4 I2 O8 = I4 I2 I1 + I8 I1' O4 = I4 I2' + I4 I1' + I4’ I2 I1 O2 = I8’ I2’ I1 + I2 I1' O1 = I1' 0 1 X 0 I1 I8 1 0 X X I4 I2 O8 O4 0 0 1 1 X 0 I1 I8 X X I4 I2 1 1 0 0 X 1 X 0 I1 I8 X X I4 I2 O2 O1 ELEC1041 - Combinational Logic Examples - 65

ELEC1041 - Combinational Logic Examples - 66   Problem #15 Analyse the behavior of the Circuit below when Input A changes from one logic state to another. F A B C D ELEC1041 - Combinational Logic Examples - 66

Problem #15 Solutions (1/1) pulse shaping circuit (Momentary Changes in outputs) A' xnor A = 0 delays matter in function d 1 0 1 0 1 0 1 0 1 1 0 d 3d F A B C D D remains low for three gate delays after A changes from high to low D remains high for three gate delays after A changes from low to high F is not always 0 pulse 3 gate-delays wide ELEC1041 - Combinational Logic Examples - 67

ELEC1041 - Combinational Logic Examples - 68   Problem #16 Analyse the circuit below for static hazard A S B S' ELEC1041 - Combinational Logic Examples - 68

ELEC1041 - Combinational Logic Examples - 69 Problem #16 Solution (1/1) Due to a literal and its complement momentarily taking on the same value through different paths with different delays and reconverging we get Static 1 Hazard A 1 d 1 0 A B S 1 0 F S d 0 1 2d 3d 1 0 1 S' 1 B 2d 0 1 F S' Static-1 hazard static-0 hazard static-1 hazard ELEC1041 - Combinational Logic Examples - 69

ELEC1041 - Combinational Logic Examples - 70   Problem #17 Analyse the pulse shaping circuit below + open switch A B C D ELEC1041 - Combinational Logic Examples - 70

ELEC1041 - Combinational Logic Examples - 71 Problem #17 Solution (1/1) An Oscillator + U = Undefined open switch 0 1 A B d U 0 C D U 1 U 0 2d 3d close switch initially undefined open switch ELEC1041 - Combinational Logic Examples - 71

ELEC1041 - Combinational Logic Examples - 72   Problem #18 Which of the components below cab be used to build an inverter? ELEC1041 - Combinational Logic Examples - 72

ELEC1041 - Combinational Logic Examples - 73   Problem #18 Solution (1/1) 1 A’ A A nand 1 = A’ A’ A A nor 0 = A’ 1 A’ A’ A A A xor 1 = A’ A xnor 0 = A’ ELEC1041 - Combinational Logic Examples - 73

ELEC1041 - Combinational Logic Examples - 74 Problem #19 Consider the Equation: Z= A’ B’ C’ D + A’ B’ C D’ + A’ B C’ D’ + A’ B C D + A B C’ D + A B C D’ + A B’ C’ D’ + A B’ C D Use Shanon’s decomposition to implement this using 2-1 multiplexers. ELEC1041 - Combinational Logic Examples - 74

ELEC1041 - Combinational Logic Examples - 75 Problem #19 Solution (1/3) Z= A’ B’ C’ D + A’ B’ C D’ + A’ B C’ D’ + A’ B C D + A B C’ D + A B C D’ + A B’ C’ D’ + A B’ C D Z = A’ [B (C’ D’ + C D) + B’ (C’ D + C D’)] + A [B (C’ D + C D’) + B’ (C’ D’ + C D)] = A’ [B (C xor D)’ + B’ (C xor D)] + A [B (C xor D) + B’ (C xor D)’] = A’ [( B xor C xor D)] + A [( B xor C xor D)’] = A xor B xor C xor D ELEC1041 - Combinational Logic Examples - 75

ELEC1041 - Combinational Logic Examples - 76 Problem #19 Solution (2/3) Z= A xor B xor C xor D Decompose around A: Z = A’ (B xor C xor D) + A (B xor C xor D)’ Now Decompose (B xor C xor D) around B: B xor C xor D = B’ (C xor D) + B (C xor D)’ Z ( B xor C xor D) Z C xor D ELEC1041 - Combinational Logic Examples - 76

ELEC1041 - Combinational Logic Examples - 77 Problem #19 Solution (3/3) Now Decompose (C xor D) around C: C xor D = C’ D + B D’ Z D ELEC1041 - Combinational Logic Examples - 77