Combinational Logic Design Combinational Functions and Circuits

Similar documents
MODULAR CIRCUITS CHAPTER 7

Chapter 4. Combinational: Circuits with logic gates whose outputs depend on the present combination of the inputs. elements. Dr.

Logic. Combinational. inputs. outputs. the result. system can

Design of Sequential Circuits

COMBINATIONAL LOGIC FUNCTIONS

Combinational Logic. By : Ali Mustafa

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering

Fundamentals of Digital Design

Philadelphia University Student Name: Student Number:

CHAPTER1: Digital Logic Circuits Combination Circuits

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3


Combinational Logic. Mantıksal Tasarım BBM231. section instructor: Ufuk Çelikcan

ELCT201: DIGITAL LOGIC DESIGN

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

Class Website:

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

Contents. Chapter 3 Combinational Circuits Page 1 of 36

( c) Give logic symbol, Truth table and circuit diagram for a clocked SR flip-flop. A combinational circuit is defined by the function

Sample Test Paper - I

211: Computer Architecture Summer 2016

Systems I: Computer Organization and Architecture

Digital Logic. CS211 Computer Architecture. l Topics. l Transistors (Design & Types) l Logic Gates. l Combinational Circuits.

ELECTRONICS & COMMUNICATION ENGINEERING PROFESSIONAL ETHICS AND HUMAN VALUES

Digital Logic Appendix A

CprE 281: Digital Logic

CSE 140 Lecture 11 Standard Combinational Modules. CK Cheng and Diba Mirza CSE Dept. UC San Diego

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS6201 DIGITAL PRINCIPLES AND SYSTEM DESIGN

Review. EECS Components and Design Techniques for Digital Systems. Lec 06 Minimizing Boolean Logic 9/ Review: Canonical Forms

Combinational Logic. Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C.

Z = F(X) Combinational circuit. A combinational circuit can be specified either by a truth table. Truth Table

Chapter 4: Combinational Logic Solutions to Problems: [1, 5, 9, 12, 19, 23, 30, 33]

2009 Spring CS211 Digital Systems & Lab CHAPTER 2: INTRODUCTION TO LOGIC CIRCUITS

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Boolean Algebra. Digital Logic Appendix A. Postulates, Identities in Boolean Algebra How can I manipulate expressions?

A B D 1 Y D 2 D 3. Truth table for 4 to 1 MUX: A B Y 0 0 D D D D 3

Combinational Logic. Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C.

CSC9R6 Computer Design. Practical Digital Logic

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

Review for Test 1 : Ch1 5

IT T35 Digital system desigm y - ii /s - iii

Boolean Algebra. Digital Logic Appendix A. Boolean Algebra Other operations. Boolean Algebra. Postulates, Identities in Boolean Algebra

Section 3: Combinational Logic Design. Department of Electrical Engineering, University of Waterloo. Combinational Logic

CS 226: Digital Logic Design

ECE 341. Lecture # 3

DIGITAL LOGIC CIRCUITS

Lecture A: Logic Design and Gates

Lecture 22 Chapters 3 Logic Circuits Part 1

COMBINATIONAL LOGIC CIRCUITS. Dr. Mudathir A. Fagiri

COSC 243. Introduction to Logic And Combinatorial Logic. Lecture 4 - Introduction to Logic and Combinatorial Logic. COSC 243 (Computer Architecture)

Digital System Design Combinational Logic. Assoc. Prof. Pradondet Nilagupta

Combinational Logic. Jee-Hwan Ryu. School of Mechanical Engineering Korea University of Technology and Education

Chapter 3 Ctd: Combinational Functions and Circuits

Combinatorial Logic Design Principles

Logic Design. Chapter 2: Introduction to Logic Circuits

Combinational Logic Design Arithmetic Functions and Circuits

COSC3330 Computer Architecture Lecture 2. Combinational Logic

UNIT II COMBINATIONAL CIRCUITS:

Introduction to Digital Logic Missouri S&T University CPE 2210 Multiplexers/Demultiplexers

DIGITAL LOGIC CIRCUITS

Department of Electrical & Electronics EE-333 DIGITAL SYSTEMS

The Design Procedure. Output Equation Determination - Derive output equations from the state table

Number System. Decimal to binary Binary to Decimal Binary to octal Binary to hexadecimal Hexadecimal to binary Octal to binary

ECE 545 Digital System Design with VHDL Lecture 1A. Digital Logic Refresher Part A Combinational Logic Building Blocks

Written exam for IE1204/5 Digital Design with solutions Thursday 29/

Show that the dual of the exclusive-or is equal to its compliment. 7

Adders, subtractors comparators, multipliers and other ALU elements

Adders, subtractors comparators, multipliers and other ALU elements

CSE370: Introduction to Digital Design

CSE140: Components and Design Techniques for Digital Systems. Decoders, adders, comparators, multipliers and other ALU elements. Tajana Simunic Rosing

LOGIC CIRCUITS. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

SAU1A FUNDAMENTALS OF DIGITAL COMPUTERS

CPE100: Digital Logic Design I

Combinational Logic Circuits Part II -Theoretical Foundations

CS470: Computer Architecture. AMD Quad Core

Logic and Computer Design Fundamentals. Chapter 8 Sequencing and Control

EE260: Digital Design, Spring n MUX Gate n Rudimentary functions n Binary Decoders. n Binary Encoders n Priority Encoders

Appendix A: Digital Logic. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V. Heuring

KUMARAGURU COLLEGE OF TECHNOLOGY COIMBATORE

DE58/DC58 LOGIC DESIGN DEC 2014

ECE 545 Digital System Design with VHDL Lecture 1. Digital Logic Refresher Part A Combinational Logic Building Blocks


Part 1: Digital Logic and Gates. Analog vs. Digital waveforms. The digital advantage. In real life...

CMPE12 - Notes chapter 2. Digital Logic. (Textbook Chapters and 2.1)"

Every time has a value associated with it, not just some times. A variable can take on any value within a range

Chapter 7 Logic Circuits

Vidyalankar S.E. Sem. III [CMPN] Digital Logic Design and Analysis Prelim Question Paper Solution

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

CPE100: Digital Logic Design I

SIR C.R.REDDY COLLEGE OF ENGINEERING ELURU DIGITAL INTEGRATED CIRCUITS (DIC) LABORATORY MANUAL III / IV B.E. (ECE) : I - SEMESTER

Logic. Basic Logic Functions. Switches in series (AND) Truth Tables. Switches in Parallel (OR) Alternative view for OR

CS/COE0447: Computer Organization and Assembly Language

Time Allowed 3:00 hrs. April, pages

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science SOLUTIONS

Review: Additional Boolean operations

Unit II Chapter 4:- Digital Logic Contents 4.1 Introduction... 4

DIGITAL LOGIC DESIGN

Combinational Logic. Course Instructor Mohammed Abdul kader

Digital Logic Design ENEE x. Lecture 14

Transcription:

Combinational Logic Design Combinational Functions and Circuits

Overview Combinational Circuits Design Procedure Generic Example Example with don t cares: BCD-to-SevenSegment converter Binary Decoders Functionality Circuit Implementation with Decoders Expansion Multiplexers (MUXs) Functionality Circuit Implementation with MUXs Expansions Fall 27 Digital Technique by Todor Stefanov, Leiden University 2

Combinational Circuits A combinational circuit consists of logic gates n-inputs m-outputs The circuit outputs, at any time, are determined by combining the values of the inputs For n inputs, there are 2 n possible binary input combinations For each combination, there is one possible binary value on each output Hence, a combinational circuit can be described by: Truth Table lists the output values for each combination of the inputs m Boolean functions, one for each output Fall 27 Digital Technique by Todor Stefanov, Leiden University 3

Combinational vs. Sequential Circuits Combinational circuits are memory-less! Thus, the output values depend ONLY on the current input values n m n-inputs Combinational Circuit m-outputs Sequential circuits consist of combinational logic as well as memory (storage) elements! Memory elements used to store certain circuit states Outputs depend on BOTH current input values and previous input values kept in the storage elements n-inputs Combinational Circuit Next state Storage Elements m-outputs Present state Fall 27 Digital Technique by Todor Stefanov, Leiden University 4

Combinational Circuit Design Design of a combinational circuit is the development of a circuit from a description of its function It starts with a problem specification It produces a logic diagram OR set of Boolean equations that represent the circuit Fall 27 Digital Technique by Todor Stefanov, Leiden University 5

Design Procedure Consists of 5 major steps:. Determine the required number of inputs and outputs and assign variables to them 2. Derive the truth table that defines the required relationship between inputs and outputs 3. Obtain and simplify the Boolean functions -- Use K-maps, algebraic manipulation, CAD tools, etc. -- Consider any design constraints (area, delay, power, available libraries, etc.) 4. Draw the logic diagram 5. Verify the correctness of the design Fall 27 Digital Technique by Todor Stefanov, Leiden University 6

Design Example Design a combinational circuit with 4 inputs that generates a when the # of s on the inputs equals the # of s OR the # of s on the inputs equals to Constraints: Use only 2-input NAND gates! Let us do it on the black board Fall 27 Digital Technique by Todor Stefanov, Leiden University 7

Another Example: BCD-to-Seven-Segment Converter Converts BCD code to Seven-Segment code Used to display numeric info on 7 segment display Input is a 4-bit BCD code (w, x, y, z) Output is a 7-bit code (a,b,c,d,e,f,g) Example: w x y z BCD to 7-Segment a b c d e f g f e a g b c Input: BCD Output: (a=b=c=d=e=f=, g=) Fall 27 Digital Technique by Todor Stefanov, Leiden University 8 d

BCD-to-Seven-Segment (cont.) Truth Table Digit wxyz abcdefg Digit wxyz abcdefg 8 9 X 2 XXXXXXX 3 XXXXXXX 4 XXXXXXX 5 XXXXXXX 6 X XXXXXXX 7 X XXXXXXX Continue the design at home?? a f g e b c Fall 27 Digital Technique by Todor Stefanov, Leiden University d 9

Design Procedure for Complex Circuits In general, digital systems are complex and sophisticated circuits A circuit may consist of millions of gates! Impossible to design each and every circuit from scratch using the procedure you have just seen There is no formal procedure to design complex digital circuits! How to design complex digital circuits? Fall 27 Digital Technique by Todor Stefanov, Leiden University

Design Procedure for Complex Circuits Fortunately, complex digital circuits can be implemented as composition of smaller and simpler circuits These smaller and simpler circuits are fundamental and we call them basic functional blocks Basic functional blocks can be designed using the procedure you have just seen! Reuse basic functional blocks to design new circuits Use Design Hierarchy Use Computer-Aided Design (CAD) tools Schematic Capture tools Hardware Description Languages (HDL) Logic Simulators Logic Synthesizers More details will be given at the Hands-on tutorials! Fall 27 Digital Technique by Todor Stefanov, Leiden University

Basic Functional Blocks Combinational Functional Blocks Logic Gates Code Converters Binary Decoders and Encoders Multiplexers and Demultiplexers Programmable Logic Arrays Binary Adders and Subtractors Binary Multipliers and Dividers Shifters, Incrementors and Decrementors Sequential Functional Blocks Flip-Flops and Latches Registers and Counters Sequencers Micro-programmed Controllers Memories Fall 27 Digital Technique by Todor Stefanov, Leiden University 2

Binary Decoder A combinational circuit that converts an n-bit binary number to a unique 2 n -bit one-hot code! Circuit is called n-to-2 n decoder For each input combination only one unique output is (one-hot code)! Enable signal (E) if E = then all outputs are else y j = f(x,x,,x n- ) (j =..2 n -) Fall 27 Digital Technique by Todor Stefanov, Leiden University 3

-to-2 Decoder -to-2 Decoder without Enable signal Logic Symbol Truth Table and Equations Logic Circuit -to-2 Decoder D A 2 D A D D D = A D = A A D D -to-2 Decoder with Enable signal -to-2 Decoder D A 2 D E enable E A D D E D = EA D = EA A D decoder logic enable logic Fall 27 Digital Technique by Todor Stefanov, Leiden University 4 D

2-to-4 Decoder Logic Symbol 2-to-4 Decoder D A 2 D A 2 2 D 2 3 D 3 A Logic Circuit A Truth Table and Equations A A D D D 2 D 3 2-to-4 Decoder with Enable A D = A A D = A A D 2 = A A D 3 = A A All minterms of 2 variables A E D D D 2 D 3 2-to-4 Decoder A 2 D A 2 2 D 2 E enable 3 D 3 Fall 27 Digital Technique by Todor Stefanov, Leiden University 5 D D D D 2 D 3

3-to-8 Decoder Logic Symbol 3-to-8 Decoder D D A 2 2 D 2 A 2 3 D 3 A 2 2 4 D 4 2 5 D 5 6 D 6 7 D 7 3-to-8 Decoder D D A 2 2 D 2 A 2 3 D 3 A 2 2 4 D 4 2 5 D 5 6 D E 6 enable 7 D 7 Truth Table A 2 A A D D D 2 D 3 D 4 D 5 D 6 D 7 Notice: D to D7 represent all minterms of 3 variables. Fall 27 Digital Technique by Todor Stefanov, Leiden University 6

3-to-8 Decoder (Logic Circuit) D to D7 are all minterms of 3 variables! Fall 27 Digital Technique by Todor Stefanov, Leiden University 7

n-to-2 n Decoder (generalization) n inputs, A, A,..., A n-, are decoded into 2 n outputs, D through D2 n-. Each output D j represents one of the minterms of the n input variables D j = when the binary number (A n- A A ) = j Shorthand: D j = m j The outputs are mutually exclusive exactly one output has the value at any time the others are Due to the above properties, an arbitrary Boolean function of n variables can be implemented with n-to-2 n Decoder and OR gates! Fall 27 Digital Technique by Todor Stefanov, Leiden University 8

Implementing Boolean Functions using Decoders Select outputs of a decoder that implement minterms included in the Boolean function Make a logic OR of the selected outputs Example: Implement Boolean function F(W,X,Y,Z) = m(,5,6,3,5) F is a function of 4 variables we use 4-to-6 Decoder Any combinational circuit can be constructed using decoders and OR gates! Why? Z Y 2 X 2 2 W 2 3 Fall 27 Digital Technique by Todor Stefanov, Leiden University 9 2 4-to-6 Decoder 2 3 4 5 6 7 8 9 2 3 4 5 F

Another Example: Implementing a Binary Full Adder using a Decoder Binary Full Adder has 3 inputs and 2 outputs: Inputs: two bits to be added (b and b ) and a carry-in (C in ) Outputs: sum (S = b +b +C in ) and carry-out (C out ) Logic Functions: C in b b S C out b S(C in,b,b ) = Σm(,2,4,7) C out (C in,b,b ) = Σm(3,5,6,7) b C C out in Fall 27 Digital Technique by Todor Stefanov, Leiden University 2 S

Decoder Expansions Larger decoders can be constructed using a number of smaller ones Use composition of smaller decoders to construct larger decoders Example: Given: 2-to-4 decoders Required: 3-to-8 decoder Solution: Each decoder realizes half of the minterms Enable selects which decoder is active: A2 = : enable top decoder A2 = : enable bottom decoder Fall 27 Digital Technique by Todor Stefanov, Leiden University 2

4-to-6 Decoder with 2-to-4 Decoders: Tree Composition of Decoders Fall 27 Digital Technique by Todor Stefanov, Leiden University 22

Multiplexer (MUXs) Selects one of many input data lines and directs it to a single output line Enable Selection controlled by set of input lines whose # depends on the # of the data input lines 2 n Data Inputs : 2 n - Data Output A 2 n -to- multiplexer has n 2 n data input lines output line n selection lines Select Inputs Fall 27 Digital Technique by Todor Stefanov, Leiden University 23

2 n -to- Multiplexer (General Structure) DataFlow Data Inputs 2 n Selection Circuit Enabling Circuit Data Output Select Inputs n Control n-to-2 n Decoder 2 n Selection Lines Enable Input Fall 27 Digital Technique by Todor Stefanov, Leiden University 24

2-to- Multiplexer Logic Symbol S I I S I I S Logic Circuits -to-2 Decoder 2-to- MUX 2-to- MUX With Enable Y Y E 2 x 2 AND-OR Selection Circuit Truth Tables (compact and full) K-map and Equation I I S S S I S I Y = SI + S I -to-2 Decoder Y I I 2 x 2 AND-OR Selection Circuit S I I Y Enable Circuit I Y I Y I I Fall 27 Digital Technique by Todor Stefanov, Leiden University 25 E

4-to- Multiplexer without Enable Logic Symbol Compact Truth Tables Equation I I I 2 I 3 4-to- MUX Y 2 3 S S Y I I I 2 I 3 Y = S S I + S S I + S S I 2 + S S I 3 S S 2-to-4 Decoder 4 x 2 AND-OR Selection Circuit S S I Logic Circuit I Y I 2 Fall 27 Digital Technique by Todor Stefanov, Leiden University 26 I 3

4-to- Multiplexer with Enable I I I 2 I 3 S S Logic Symbol 4-to- MUX Y 2 3 S E Compact Truth Tables 2-to-4 Decoder E S S Y I I I 2 I 3 x x Equation Y = E ( S S I + S S I + S S I 2 + S S I 3 ) 4 x 2 AND-OR Selection Circuit Enable Circuit S I Logic Circuit I I 2 Y Fall 27 Digital Technique by Todor Stefanov, Leiden University 27 I 3 E

2 n -to- Multiplexer n-to-2 n Decoder 2 n x 2 AND-OR Selection Circuit Enable Circuit D I S A :. :. :. :. Y S n- A n- D 2 n - I 2 n - E Fall 27 Digital Technique by Todor Stefanov, Leiden University 28

Implementing Boolean Functions using Multiplexers Any Boolean function of n variables can be implemented using a 2 n -to- Multiplexer. Why? Multiplexer is basically a decoder with outputs ORed together! SELECT signals generate the minterms of the function The data inputs identify which minterms are to be combined with an OR Example: Consider function F(A,B,C) = m(,3,5,6) It has 3 variables, therefore we can implement it with 8-to- MUX A B C S 2 S S 7 6 5 4 3 2 8-to- Muliplexer Fall 27 Digital Technique by Todor Stefanov, Leiden University 29 Y F

Another Example Consider function F(A,B,C,D) specified by the truth table on the right-hand side F has 4 variables we use 6-to- MUX D C B A 6-to- MUX 2 3 4 5 6 7 8 9 2 3 4 5 S S S 2 S 3 Y A B C D F Fall 27 Digital Technique by Todor Stefanov, Leiden University 3 F

Efficient Method for Implementing Boolean Functions using Multiplexers We have seen that implementing a function of n variables with 2 n -to- MUX is straightforward. However, there exist more efficient method where any function of n variables can be implemented with 2 n- -to- MUX. Consider an arbitrary function F(X,X 2,,X n ): We need a 2 n- line MUX with n- select lines. Enumerate function as a truth table with consistent ordering of variables, i.e., X,X 2,,X n. Attach the most significant n- variables to the n- select lines, i.e., X,X 2,,X n- Examine pairs of adjacent rows. The least significant variable in each pair is X n = and X n =. Determine whether the function output F for the (X,X 2,,X n-,) and (X,X 2,,X n-,) combination is (,), (,), (,), or (,). Attach, X n, X n, or to the data input corresponding to (X,X 2,,X n- ) respectively. Fall 27 Digital Technique by Todor Stefanov, Leiden University 3

Example Again, consider function F(A,B,C) = m(,3,5,6) It has 3 variables We can implement it using 4-to- MUX instead of 8-to- MUX. A B C F F = C F = C F = C F = C C Fall 27 Digital Technique by Todor Stefanov, Leiden University 32 B A 4-to- MUX Y F 2 3 S S

Another Example Again, consider function F(A,B,C,D) specified by the truth table below. F has 4 variables we use 8-to- MUX instead of 6-to- MUX. Fall 27 Digital Technique by Todor Stefanov, Leiden University 33

MUX as a Universal Gate We can construct OR, AND, and NOT gates using 2-to- MUX Thus, 2-to- MUX is a universal gate! Recall the equation of 2-to- MUX: Z = S I + S I OR NOT AND S S S x z = x + x x = x + x x = (x +x ) (x +x ) z = x + x = x z = x x + x = x x = (x + x ) = x + x Fall 27 Digital Technique by Todor Stefanov, Leiden University 34

Multiplexer Expansions Larger multiplexers can be constructed using a number of smaller ones Use composition of smaller multiplexers Example: Given: 4-to- multiplexers Required: 8-to- multiplexer Solution: Each multiplexer selects half of the data inputs. Enable signal selects which multiplexer is active: S 2 = : enable top multiplexer S 2 = : enable bottom multiplexer S S S 2 I I I 2 I 3 I 4 I 5 I 6 I 7 4-to- MUX 2 3 S S Y 4-to- MUX 2 3 E Y Y S S E Fall 27 Digital Technique by Todor Stefanov, Leiden University 35

Multiplexer Expansions (cont.) Until now, we have examined -bit data inputs selected by a MUX What if we want to select m-bit data/words? Example: MUX that selects between 2 sets of 4-bit inputs A(..3) B(..3) S 4 4 2-to- 4-line MUX E 4 How to construct this 2-to- 4-line MUX? A B S Y(..3) 2-to- MUX E S Y(..3) A(..3) B(..3) x Fall 27 Digital Technique by Todor Stefanov, Leiden University 36 E Y

Example: 2-to- 4-line Multiplexer Uses four 2-to- MUXs with common select (S) and enable (E) Select line chooses between A i s and B i s. The selected four-wire digital signal is sent to the Y i s Enable line turns MUX on and off (E= is on) S E A B A B A 2 B 2 A 3 B 3 2-to- MUX Y S E 2-to- MUX Y S E 2-to- MUX Y 2 S E 2-to- MUX Y 3 S E Fall 27 Digital Technique by Todor Stefanov, Leiden University 37