Combinational Functions and Circuits

Similar documents
Binary full adder. 2-bit ripple-carry adder. CSE 370 Spring 2006 Introduction to Digital Design Lecture 12: Adders

Combinational Logic Design

Two-level logic using NAND gates

Karnaugh Maps (K-map) Alternate representation of a truth table

Chapter 2 Logic Gates and Introduction to Computer Architecture

BOOLEAN ALGEBRA & LOGIC GATES

Karnaugh Maps. Circuit-wise, this leads to a minimal two-level implementation

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

Sistemas Digitais I LESI - 2º ano

COMBINATIONAL CIRCUITS

Elementary Logic Gates

Combinational circuits

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

CSE140: Components and Design Techniques for Digital Systems

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

3.Basic Gate Combinations

Read-only memory Implementing logic with ROM Programmable logic devices Implementing logic with PLDs Static hazards

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Systems I: Computer Organization and Architecture

[ 4 ] Logic Symbols and Truth Table

Lecture 8: Synchronous Digital Systems

RAM & ROM Based Digital Design. ECE 152A Winter 2012

NAND and NOR Implementation

5 Combinatorial Components. 5.0 Full adder. Full subtractor

Basic Logic Gates Richard E. Haskell

Counters are sequential circuits which "count" through a specific state sequence.

Binary Adders: Half Adders and Full Adders

Course Requirements & Evaluation Methods

Digital Electronics Detailed Outline

University of St. Thomas ENGR Digital Design 4 Credit Course Monday, Wednesday, Friday from 1:35 p.m. to 2:40 p.m. Lecture: Room OWS LL54

Understanding Logic Design

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

Combinational-Circuit Building Blocks

Chapter 7 Memory and Programmable Logic

DESIGN OF GATE NETWORKS

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

Figure 8-1 Four Possible Results of Adding Two Bits

Mixed Logic A B A B. 1. Ignore all bubbles on logic gates and inverters. This means

6. BOOLEAN LOGIC DESIGN

Gates, Circuits, and Boolean Algebra

Karnaugh Maps & Combinational Logic Design. ECE 152A Winter 2012

ERROR DETECTION AND CORRECTION

earlier in the semester: The Full adder above adds two bits and the output is at the end. So if we do this eight times, we would have an 8-bit adder.

Upon completion of unit 1.1, students will be able to

CHAPTER 3 Boolean Algebra and Digital Logic

Adder.PPT(10/1/2009) 5.1. Lecture 13. Adder Circuits

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, Lab 2. The Full-Adder

CONTENTS PREFACE 1 INTRODUCTION 1 2 NUMBER SYSTEMS AND CODES 25. vii

Multipliers. Introduction

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Lecture 5: Gate Logic Logic Optimization

SECTION C [short essay] [Not to exceed 120 words, Answer any SIX questions. Each question carries FOUR marks] 6 x 4=24 marks

Logic Reference Guide

Chapter 3 Digital Basics

Counters and Decoders

GETTING STARTED WITH PROGRAMMABLE LOGIC DEVICES, THE 16V8 AND 20V8

NEW adder cells are useful for designing larger circuits despite increase in transistor count by four per cell.

2.0 Chapter Overview. 2.1 Boolean Algebra

Design Example: Counters. Design Example: Counters. 3-Bit Binary Counter. 3-Bit Binary Counter. Other useful counters:

Digital Electronics Part I Combinational and Sequential Logic. Dr. I. J. Wassell

BINARY CODED DECIMAL: B.C.D.

Gray Code Generator and Decoder by Carsten Kristiansen Napier University. November 2004

Systems I: Computer Organization and Architecture

Simplifying Logic Circuits with Karnaugh Maps

Memory Systems. Static Random Access Memory (SRAM) Cell

2011, The McGraw-Hill Companies, Inc. Chapter 3

(Refer Slide Time: 00:01:16 min)

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, The Binary Adder

ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path

exclusive-or and Binary Adder R eouven Elbaz reouven@uwaterloo.ca Office room: DC3576

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

CSE140: Midterm 1 Solution and Rubric

Ladder and Functional Block Programming

Sequential Logic Design Principles.Latches and Flip-Flops

Digital Design. Assoc. Prof. Dr. Berna Örs Yalçın

Computer Systems Structure Main Memory Organization

Lab 1: Study of Gates & Flip-flops

C H A P T E R. Logic Circuits

CPU Organisation and Operation

CSEE 3827: Fundamentals of Computer Systems. Standard Forms and Simplification with Karnaugh Maps

Digital codes. Resources and methods for learning about these subjects (list a few here, in preparation for your research):

INTRODUCTION TO DIGITAL SYSTEMS. IMPLEMENTATION: MODULES (ICs) AND NETWORKS IMPLEMENTATION OF ALGORITHMS IN HARDWARE

Flip-Flops, Registers, Counters, and a Simple Processor

(1) /30 (2) /30 (3) /40 TOTAL /100

We r e going to play Final (exam) Jeopardy! "Answers:" "Questions:" - 1 -

Instruction Set Architecture. Datapath & Control. Instruction. LC-3 Overview: Memory and Registers. CIT 595 Spring 2010

The string of digits in the binary number system represents the quantity

Module 3: Floyd, Digital Fundamental

ELEC EXPERIMENT 1 Basic Digital Logic Circuits

DDR4 Memory Technology on HP Z Workstations

Today. Binary addition Representing negative numbers. Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic

The components. E3: Digital electronics. Goals:

CHAPTER 16 MEMORY CIRCUITS

A s we saw in Chapter 4, a CPU contains three main sections: the register section,

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

DIGITAL-TO-ANALOGUE AND ANALOGUE-TO-DIGITAL CONVERSION

Logic gates. Chapter. 9.1 Logic gates. MIL symbols. Learning Summary. In this chapter you will learn about: Logic gates

Transcription:

Introduction to Digital Logic Prof. Nizamettin DIN naydin@yildiz.edu.tr naydin@ieee.org ourse Outline. Digital omputers, Number Systems, rithmetic Operations, Decimal, lphanumeric, and Gray odes. inary Logic, Gates, oolean lgebra, Standard orms. ircuit Optimization, Two-Level Optimization, Map Manipulation, Multi-Level ircuit Optimization. dditional Gates and ircuits, Other Gate Types, Exclusive-OR Operator and Gates, High-Impedance Outputs. Implementation Technology and Logic Design, Design oncepts and utomation, The Design Space, Design Procedure, The major design steps 6. Programmable Implementation Technologies: Read-Only Memories, Programmable Logic rrays, Programmable rray Logic,Technology mapping to programmable logic devices 7. ombinational unctions and ircuits. rithmetic unctions and ircuits 9. Sequential ircuits Storage Elements and Sequential ircuit nalysis. Sequential ircuits, Sequential ircuit Design State Diagrams, State Tables. ounters, register cells, buses, & serial operations. Sequencing and ontrol, Datapath and ontrol, lgorithmic State Machines (SM). Memory asics Introduction to Digital Logic Lecture 7 ombinational unctions and ircuits Overview unctions and functional blocks Rudimentary logic functions Decoding Encoding Selecting Implementing ombinational unctions Using: Decoders and OR gates Multiplexers (and inverter) ROMs PLs PLs Lookup Tables unctions and unctional locks The functions considered are those found to be very useful in design orresponding to each of the functions is a combinational circuit implementation called a functional block. In the past, many functional blocks were implemented as SSI, MSI, and LSI circuits. Today, they are often simply parts within a VLSI circuit. Rudimentary Logic unctions unctions of a single variable an be used on the inputs to functional blocks to implement other than the block s intended function unctions of One Variable = = = = V or V DD (c) (d) 6 opyright N. DIN. ll rights reserved.

Multiple-bit Rudimentary unctions Enabling unction Multi-bit Examples: wide line is used to represent a bus which is a vector signal In of the example, = (,,, ) is a bus. The bus can be split into individual bits as shown in Sets of bits can be split from the bus as shown in (c) for bits and of. : (:) (c),: (), (:) (d) The sets of bits need not be continuous as shown in (d) for bits,, and of. Enabling permits an input signal to pass through to an output Disabling blocks an input signal from passing through to an output, replacing it with a fixed value The value on the output when it is disable can be Hi-Z (as for three-state buffers and transmission gates),, or When disabled, output EN When disabled, output Enabling applications? EN 7 Decoding Decoder Examples Decoding - the conversion of an n-bit input code to an m-bit output code with n m n such that each valid code word produces a unique output code ircuits that perform decoding are called decoders Here, functional blocks for decoding are called n-to-m line decoders, where m n, and generate n (or fewer) minterms for the n input variables -to--line Decoder -to--line Decoder D D D D D D Note that the --line made up of -to-- line decoders and ND gates. D = D = D = D = D = D = 9 Decoder Expansion General procedure given in book for any decoder with n inputs and n outputs. This procedure builds a decoder backward from the outputs. The output ND gates are driven by two decoders with their numbers of inputs either equal or differing by. These decoders are then designed using the same procedure until -to--line decoders are reached. The procedure can be modified to apply to decoders with the number of outputs n Decoder Expansion - Example -to--line decoder Number of output NDs = Number of inputs to decoders driving output NDs = losest possible split to equal -to--line decoder -to--line decoder -to--line decoder Number of output NDs = Number of inputs to decoders driving output NDs = losest possible split to equal Two -to--line decoders opyright N. DIN. ll rights reserved.

Decoder Expansion - Example Decoder Expansion - Example Result -input NDs -input NDs -to--line decoder -to--line decoders -to- Line decoder D D D D D D D 6 D 7 7-to--line decoder Number of output NDs = Number of inputs to decoders driving output NDs = 7 losest possible split to equal -to-6-line decoder -to--line decoder -to-6-line decoder Number of output NDs = 6 Number of inputs to decoders driving output NDs = losest possible split to equal -to--line decoders omplete using known - and -to- line decoders Decoder with Enable In general, attach m-enabling circuits to the outputs Truth table for the function Note use of s to denote both and ombination containing two s represent four binary combinations lternatively, can be viewed as distributing value of signal EN to of outputs EN In this case, called a demultiplexer EN D D D D D D D D Encoding Encoding - the opposite of decoding - the conversion of an m-bit input code to a n-bit output code with n m n such that each valid code word produces a unique output code ircuits that perform encoding are called encoders n encoder has n (or fewer) input lines and n output lines which generate the binary code corresponding to the input values Typically, an encoder converts a code containing exactly one bit that is to a binary code corresponding to the position in which the appears. 6 Encoder Example decimal-to-d encoder Inputs: bits corresponding to decimal digits through 9, (D,, D 9 ) Outputs: bits with D codes unction: If input bit D i is a, then the output (,,, ) is the D code for i, The truth table could be formed, but alternatively, the equations for each of the four outputs can be obtained directly. Encoder Example (continued) Input D i is a term in equation j if bit j is in the binary value for i. Equations: = D + D 9 = D + D + D 6 + D 7 = D + D + D 6 + D 7 = D + D + D + D 7 + D 9 = D 6 + D 7 can be extracted from and 7 opyright N. DIN. ll rights reserved.

Priority Encoder If more than one input value is, then the encoder just designed does not work. One encoder that can accept all possible combinations of input values and produce a meaningful result is a priority encoder. mong the s that appear, it selects the most significant input position (or the least significant input position) containing a and responds with the corresponding binary code for that position. Priority Encoder Example Priority encoder with inputs (D, D, D, D, D ) - highest priority to most significant present - ode outputs,, and V where V indicates at least one present. No. of Minterms/Row D D Inputs D D 6 s in input part of table represent or ; thus table entries correspond to product terms instead of minterms. The column on the left shows that all minterms are present in the product terms in the table D Outputs V 9 Priority Encoder Example (continued) ould use a K-map to get equations, but can be read directly from table and manually optimized if careful: = D = D D + D D D = D, = (D + D ) = D D + D D D D = D (D + D D) V = D + + D + D Selecting Selecting of data or information is a critical function in digital systems and computers ircuits that perform selecting have: set of information inputs from which the selection is made single output set of control lines for making the selection Logic circuits that perform selecting are called multiplexers Selecting can also be done by three-state logic or transmission gates Multiplexers multiplexer selects information from an input line and directs the information to an output line typical multiplexer has n control inputs (S n, S ) called selection inputs, n information inputs (I n, I ), and one output multiplexer can be designed to have m information inputs with m < n as well as n selection inputs -to--line Multiplexer Since =, n = The single selection variable S has two values: S = selects input I S = selects input I The equation: = SI + SI The circuit: S Decoder I I Enabling ircuits opyright N. DIN. ll rights reserved.

-to--line Multiplexer (continued) Example: -to--line Multiplexer Note the regions of the multiplexer circuit shown: -to--line Decoder Enabling circuits -input OR gate To obtain a basis for multiplexer expansion, we combine the Enabling circuits and OR gate into a ND-OR circuit: -to--line decoder ND-OR In general, for an n -to--line multiplexer: n-to- n -line decoder n ND-OR -to- -line decoder ND-OR S S S S Decoder Decoder I I I x ND-OR I 6 Multiplexer Width Expansion Select vectors of bits instead of bits Use multiple copies of n ND-OR in parallel Example: -to--line quad multiplexer Other Selection Implementations Three-state logic in place of ND-OR S I I S I I Gate input cost = compared to (or ) for gate implementation 7 Other Selection Implementations ombinational unction Implementation Transmission Gate Multiplexer S Gate input S cost = compared I (S = ) to for -state logic I (S = ) and or for gate logic I (S = ) I (S = ) (S = ) (S = ) lternative implementation techniques: Decoders and OR gates Multiplexers (and inverter) ROMs PLs PLs Lookup Tables an be referred to as structured implementation methods since a specific underlying structure is assumed in each case 9 opyright N. DIN. ll rights reserved.

Decoder and OR Gates Implement m functions of n variables with: Sum-of-minterms expressions One n-to- n -line decoder m OR gates, one for each output pproach : ind the truth table for the functions Make a connection to the corresponding OR from the corresponding decoder output wherever a appears in the truth table pproach ind the minterms for each output function OR the minterms together Decoder and OR Gates Example Implement the following set of odd parity functions of ( 7, 6,, ) P = 7 + + 7 P = 7 + 6 + 6 P = 7 6 + + inding sum of minterms expressions P = Σ m (,,,6,,,,) P = Σ m (,,,6,,,,) P = Σ m (,,,,,9,,) ind circuit Is this a good idea? 6 7 9 P P P Multiplexer pproach Example: Gray to inary ode Implement m functions of n variables with: Sum-of-minterms expressions n m-wide n -to--line multiplexer Design: ind the truth table for the functions. In the order they appear in the truth table: pply the function input variables to the multiplexer inputs S n,, S Label the outputs of the multiplexer with the output variables Value-fix the information inputs to the multiplexer using the values from the truth table (for don t cares, apply either or ) Design a circuit to convert a -bit Gray code to a binary code The formulation gives the truth table on the right It is obvious from this table that = and the and Z are more complex Gray inary x y z Gray to inary (continued) Gray to inary (continued) Rearrange the table so that the input combinations are in counting order unctions y and z can be implemented using a dual -to--line multiplexer by: connecting,, and to the multiplexer select inputs placing y and z on the two multiplexer outputs connecting their respective truth table values to the inputs Gray inary x y z D D D D D D D6 D7 S S S Out -to- MU Note that the multiplexer with fixed inputs is identical to a ROM with -bit addresses and -bit data! D D D D D D D6 D7 S S S Out -to- MU Z 6 opyright N. DIN. ll rights reserved. 6

Multiplexer pproach Example: Gray to inary ode Implement any m functions of n + variables by using: n m-wide n -to--line multiplexer single inverter Design: ind the truth table for the functions. ased on the values of the first n variables, separate the truth table rows into pairs or each pair and output, define a rudimentary function of the final variable (,,, ) Using the first n variables as the index, value-fix the information inputs to the multiplexer with the corresponding rudimentary functions Use the inverter to generate the rudimentary function Design a circuit to convert a -bit Gray code to a binary code The formulation gives the truth table on the right It is obvious from this table that x = and the and Z are more complex Gray inary x y z 7 Gray to inary (continued) Rearrange the table so that the input combinations are in counting order, pair rows, and find rudimentary functions Gray inary x y z Rudimentary unctions of for y = = = = Rudimentary unctions of for z = = = = ssign the variables and functions to the multiplexer inputs: Gray to inary (continued) D D D D S S Out -to- MU Note that this approach (pproach ) reduces the cost by almost half compared to pproach. This result is no longer ROM-like Extending, a function of more than n variables is decomposed into several sub-functions defined on a subset of the variables. The multiplexer then selects among these sub-functions. D D D D S S Out -to- MU Z 9 Read Only Memory Truth table unctions are implemented by storing the truth table Other representations such as equations more convenient Generation of programming information from equations usually done by software Text Example - : Design a combinational circuit using a ROM. The circuit accepts a bit number and generates an output binary number equal to the square of the input number opyright N. DIN. ll rights reserved. 7

Implementation Programmable rray Logic Two outputs are generated outside of the ROM In the implementation of the system, these two functions are hardwired and even if the ROM is reprogrammable or removable, cannot be corrected or updated There is no sharing of ND gates as in the ROM and PL Design requires fitting functions within the limited number of NDs per OR gate Single function optimization is the first step to fitting Otherwise, if the number of terms in a function is greater than the number of NDs per OR gate, then factoring is necessary Programmable rray Logic Example Programmable rray Logic Example ND gates inputs Equations: = + + + = + + must be factored since four terms actor out last two terms as W Product term 6 7 9 ND Inputs D W Outputs W = + = = + + W = = + + D Product term 6 7 9 W D D W W ll fuses intact (always ) use intact use blown W D D W 6 Programmable Logic rray The set of functions to be implemented must fit the available number of product terms The number of literals per term is less important in fitting The best approach to fitting is multiple-output, two-level optimization (which has not been discussed) Since output inversion is available, terms can implement either a function or its complement or small circuits, K-maps can be used to visualize product term sharing and use of complements or larger circuits, software is used to do the optimization including use of complemented functions Programmable Logic rray Example K-map specification How can this be implemented with four terms? omplete the programming table = + + = + + = + + + = + + PL programming table Product Inputs term Outputs (T) 7 opyright N. DIN. ll rights reserved.

Programmable Logic rray Example Lookup Tables use intact use blown Lookup tables are used for implementing logic in ield-programmable Gate rrays (PGs) and omplex Logic Devices (PLDs) Lookup tables are typically small, often with four inputs, one output, and 6 entries Since lookup tables store truth tables, it is possible to implement any -input function Thus, the design problem is how to optimally decompose a set of given functions into a set of - input two- level functions. We will illustrate this by a manual attempt 9 Lookup Table Example Equations to be implemented: (,,,D,E) = D E + D E + D E (,,D,E,) = D E + D E + D E Extract -input function: (,,D,E) = D E + D E (,D,E, ) = + D E (D,E,, ) = + D E The cost of the solution is lookup tables opyright N. DIN. ll rights reserved. 9