COE 202: Digital Logic Design Combinational Circuits Part 2. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Similar documents
Carry Look Ahead Adders

Chapter 03: Computer Arithmetic. Lesson 03: Arithmetic Operations Adder and Subtractor circuits Design

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

Combinational Logic. By : Ali Mustafa

Adders - Subtractors

Midterm Exam Two is scheduled on April 8 in class. On March 27 I will help you prepare Midterm Exam Two.

COE 202: Digital Logic Design Combinational Logic Part 2. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Chapter 5 Arithmetic Circuits

UNIT II COMBINATIONAL CIRCUITS:

ELCT201: DIGITAL LOGIC DESIGN

3. Combinational Circuit Design

CSEE 3827: Fundamentals of Computer Systems. Combinational Circuits

EECS150 - Digital Design Lecture 10 - Combinational Logic Circuits Part 1

CprE 281: Digital Logic

Class Website:

Logic and Computer Design Fundamentals. Chapter 5 Arithmetic Functions and Circuits

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

COE 202: Digital Logic Design Combinational Circuits Part 4. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Adders, subtractors comparators, multipliers and other ALU elements

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

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

Binary addition by hand. Adding two bits

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

14:332:231 DIGITAL LOGIC DESIGN

Digital Logic Design. Combinational Logic

Systems I: Computer Organization and Architecture

Combinational Logic Design Arithmetic Functions and Circuits

COE 202: Digital Logic Design Sequential Circuits Part 4. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

EFFICIENT MULTIOUTPUT CARRY LOOK-AHEAD ADDERS

ELEN Electronique numérique

1 Short adders. t total_ripple8 = t first + 6*t middle + t last = 4t p + 6*2t p + 2t p = 18t p

Lecture 12: Adders, Sequential Circuits

Adders, subtractors comparators, multipliers and other ALU elements

Lecture 12: Adders, Sequential Circuits

CprE 281: Digital Logic

Combinational Logic. Course Instructor Mohammed Abdul kader

PG - TRB UNIT-X- DIGITAL ELECTRONICS. POLYTECHNIC-TRB MATERIALS

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

CMSC 313 Lecture 17. Focus Groups. Announcement: in-class lab Thu 10/30 Homework 3 Questions Circuits for Addition Midterm Exam returned

Module 2. Basic Digital Building Blocks. Binary Arithmetic & Arithmetic Circuits Comparators, Decoders, Encoders, Multiplexors Flip-Flops

CSE140: Components and Design Techniques for Digital Systems. Logic minimization algorithm summary. Instructor: Mohsen Imani UC San Diego

CSE 140L Spring 2010 Lab 1 Assignment Due beginning of the class on 14 th April

CMPUT 329. Circuits for binary addition

Combina-onal Logic Chapter 4. Topics. Combina-on Circuit 10/13/10. EECE 256 Dr. Sidney Fels Steven Oldridge

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

Overview. Arithmetic circuits. Binary half adder. Binary full adder. Last lecture PLDs ROMs Tristates Design examples

We are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors

CHAPTER1: Digital Logic Circuits Combination Circuits

UNIVERSITI TENAGA NASIONAL. College of Information Technology

Standard & Canonical Forms

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

Total Time = 90 Minutes, Total Marks = 100. Total /10 /25 /20 /10 /15 /20

DIGITAL TECHNICS. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

Hardware Design I Chap. 4 Representative combinational logic

EE260: Digital Design, Spring n Binary Addition. n Complement forms. n Subtraction. n Multiplication. n Inputs: A 0, B 0. n Boolean equations:

Lecture 13: Sequential Circuits

COMBINATIONAL LOGIC FUNCTIONS

Chapter 2: Boolean Algebra and Logic Gates

CMSC 313 Lecture 18 Midterm Exam returned Assign Homework 3 Circuits for Addition Digital Logic Components Programmable Logic Arrays

CS 140 Lecture 14 Standard Combinational Modules

CHAPTER 2 BOOLEAN ALGEBRA

ARITHMETIC COMBINATIONAL MODULES AND NETWORKS

EECS150. Arithmetic Circuits

COE 202: Digital Logic Design Sequential Circuits Part 3. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Review for Test 1 : Ch1 5

Design of A Efficient Hybrid Adder Using Qca

Total Time = 90 Minutes, Total Marks = 50. Total /50 /10 /18

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

Chapter 2. Boolean Algebra and Logic Gates

ISSN (PRINT): , (ONLINE): , VOLUME-4, ISSUE-10,

Digital Systems and Information Part II

UNIT 4 MINTERM AND MAXTERM EXPANSIONS

Lecture 6: Gate Level Minimization Syed M. Mahmud, Ph.D ECE Department Wayne State University

CS 121 Digital Logic Design. Chapter 2. Teacher Assistant. Hanin Abdulrahman

UNSIGNED BINARY NUMBERS DIGITAL ELECTRONICS SYSTEM DESIGN WHAT ABOUT NEGATIVE NUMBERS? BINARY ADDITION 11/9/2018

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

Chapter 2: Switching Algebra and Logic Circuits

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

L8/9: Arithmetic Structures

COE 202: Digital Logic Design Sequential Circuits Part 3. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

HIGH SPEED AND INDEPENDENT CARRY CHAIN CARRY LOOK AHEAD ADDER (CLA) IMPLEMENTATION USING CADENCE-EDA K.Krishna Kumar 1, A.

Mach-Zehnder Interferometer based All Optical Reversible Carry-Look ahead Adder

Chapter 4: Designing Combinational Systems Uchechukwu Ofoegbu

MC9211 Computer Organization

Cs302 Quiz for MID TERM Exam Solved

ELECTRONICS & COMMUNICATION ENGINEERING PROFESSIONAL ETHICS AND HUMAN VALUES

EEL 3701 Fall Multiply out the following logic expressions to obtain the Sum of Products.

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

CS221: Digital Design. Dr. A. Sahu. Indian Institute of Technology Guwahati

EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits)

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 1. Digital Logic Refresher Part A Combinational Logic Building Blocks

Outline. EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits) Combinational Logic (CL) Defined

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

Ex code

Building a Computer Adder

The logic is straightforward. Adding two 0s will result in 0. Adding two 1s results in 10 where 1 is the carry bit and 0 is the sum bit.

EECS150 - Digital Design Lecture 22 - Arithmetic Blocks, Part 1

DIGITAL CIRCUIT LOGIC BOOLEAN ALGEBRA

Transcription:

COE 202: Digital Logic Design Combinational Circuits Part 2 Dr. Ahmad Almulhem Email: ahmadsm AT kfupm Phone: 860-7554 Office: 22-324

Objectives Arithmetic Circuits Adder Subtractor Carry Look Ahead Adder BCD Adder Multiplier

Adder Design an Adder for 1-bit numbers?

Adder Design an Adder for 1-bit numbers? 1. Specification: 2 inputs (X,Y) 2 outputs (C,S)

Adder Design an Adder for 1-bit numbers? 1. Specification: 2 inputs (X,Y) 2 outputs (C,S) 2. Formulation: X Y C S 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0

Adder Design an Adder for 1-bit numbers? 1. Specification: 3. Optimization/Circuit 2 inputs (X,Y) 2 outputs (C,S) 2. Formulation: X Y C S 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0

Half Adder This adder is called a Half Adder Q: Why? X Y C S 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0

Full Adder A combinational circuit that adds 3 input bits to generate a Sum bit and a Carry bit

Full Adder A combinational circuit that adds 3 input bits to generate a Sum bit and a Carry bit X Y Z C S 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1

Full Adder A combinational circuit that adds 3 input bits to generate a Sum bit and a Carry bit X Y Z C S 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 Sum YZ X 0 Carry 1 X YZ 0 1 00 01 11 10 0 1 0 1 1 0 1 0 00 01 11 10 0 0 1 0 0 1 1 1 S = X Y Z + X YZ + XY Z +XYZ = X Y Z C = XY + YZ + XZ

Full Adder = 2 Half Adders Manipulating the Equations: S = X Y Z C = XY + XZ + YZ

Full Adder = 2 Half Adders Manipulating the Equations: S = ( X Y ) Z C = XY + XZ + YZ = XY + XYZ + XY Z + X YZ + XYZ = XY( 1 + Z) + Z(XY + X Y) = XY + Z(X Y )

Full Adder = 2 Half Adders Manipulating the Equations: S = ( X Y ) Z C = XY + XZ + YZ = XY + Z(X Y ) Think of Z as a carry in Src: Mano s Book

Bigger Adders How to build an adder for n-bit numbers? Example: 4-Bit Adder Inputs? Outputs? What is the size of the truth table? How many functions to optimize?

Bigger Adders How to build an adder for n-bit numbers? Example: 4-Bit Adder Inputs? 9 inputs Outputs? 5 outputs What is the size of the truth table? 512 rows! How many functions to optimize? 5 functions

Binary Parallel Adder To add n-bit numbers: Use n Full-Adders in parallel The carries propagates as in addition by hand Use Z in the circuit as a C in 1 0 0 0 0 1 0 1 0 1 1 0 1 0 1 1

Binary Parallel Adder To add n-bit numbers: Use n Full-Adders in parallel The carries propagates as in addition by hand Src: Mano s Book This adder is called ripple carry adder

Ripple Adder Delay Assume gate delay = T 8 T to compute the last carry Total delay = 8 + 1 = 9T 1 delay form first half adder Delay = (2n+1)T Src: Course CD

Subtraction (2 s Complement) How to build a subtractor using 2 s complement?

Subtraction (2 s Complement) How to build a subtractor using 2 s complement? 1 S = A + ( -B) Src: Mano s Book

Adder/Subtractor How to build a circuit that performs both addition and subtraction?

Adder/Subtractor 0 : Add 1: subtract Src: Mano s Book Using full adders and XOR we can build an Adder/Subtractor!

Binary Parallel Adder (Again) To add n-bit numbers: Use n Full-Adders in parallel The carries propagates as in addition by hand Src: Mano s Book This adder is called ripple carry adder

Ripple Adder Delay Assume gate delay = T 8 T to compute the last carry Total delay = 8 + 1 = 9T 1 delay form first half adder Delay = (2n+1)T How to improve? Src: Course CD

Carry Look Ahead Adder How to reduce propagation delay of ripple carry adders? Carry look ahead adder: All carries are computed as a function of C 0 (independent of n!) It works on the following standard principles: A carry bit is generated when both input bits Ai and Bi are 1, or When one of input bits is 1, and a carry in bit exists Carry bits Carry Out Cn Cn-1.Ci.C2C1C0 An-1.Ai.A2A1A0 Bn-1.Bi.B2B1B0 Sn Sn-1.Si.S2S1S0

Carry Look Ahead Adder A i B i P i S i G i C i C i+1 The internal signals are given by: Pi = Ai Bi Gi = Ai.Bi Carry Generate Gi : C i+1 = 1 when G i = 1, regardless of the input carry C i Carry Propagate Pi : Propagates C i to C i+1 Note: P i and G i depend only on A i and B i!

Carry Look Ahead Adder A i B i P i S i G i C i C i+1 The internal signals are given by: Pi = Ai Bi Gi = Ai.Bi The output signals are given by: Si = Pi Ci Ci+1 = Gi + PiCi

Carry Look Ahead Adder A i B i P i S i G i C i C i+1 The carry outputs for various stages can be written as: C1 = Go + PoCo C2 = G1 + P1C1 = G1 + P1(Go + PoCo) = G1 + P1Go + P1PoCo C3 = G2 + P2C2 = G2 + P2G1 + P2P1G0 + P2P1P0C0 C4 = G3 + P3C3 = G3 + P3G2 + P3P2G1 + P3P2P1G0 + P3P2P1P0C0

Carry Look Ahead Adder Conclusion: Each carry bit can be expressed in terms of the input carry Co, and not based on its preceding carry bit Each carry bit can be expressed as a SOP, and can be implemented using a two-level circuit, i.e. a gate delay of 2T

Carry Look Ahead Adder C0 A0 B0 P0 G0 S0 Carry Look Ahead Block A1 B1 P1 C1 S1 G1 A2 B2 P2 C2 S2 A3 B3 G2 P3 C3 S3 G3 C4 C4

Carry Look Ahead Adder Steps of operation: - All P and G signals are initially generated. Since both XOR and AND can be executed in parallel. Total delay = 1T - The Carry Look Ahead block will generate the four carry signals C4, C3, C2, C1. Total delay = 2T - The four XOR gates will generate the Sums. Total delay = 1T Total delay before the output can be seen = 4T Compared with the Ripple Adder delay of 9T, this is an improvement of more than 100% CLA adders are implemented as 4-bit modules, that can together be used for implementing larger circuits

BCD Adder BCD digits are valid for decimal numbers 0-9 Addition of two BCD numbers will generate an output, that may be greater than 1001 (9). In such cases, the BCD number 0110 is added to the result as a correction step When adding two BCD numbers, the maximum result that can be obtained is: 9 + 9 = 18 If we include a carry in bit, then the maximum result that can be obtained is: 19 (10011) Both numbers 18 and 19 are invalid BCD digits. Therefore, a 6 needs to be added to bring them to correct BCD format.

Adding two BCD numbers Truth Table * From course CD The truth table defines the outputs when two BCD numbers are added The function F is 1 for all invalid BCD digits, and therefore acts as a BCD verifier To minimize the expression, a 5 variable can be used, or: -A 4 variable k map can be used to minimize the function F, and -The result is ORed with CO, since the function is always 1 whenever CO is 1

Adding two BCD numbers Minimization F Z3Z2 00 Z1Z0 01 11 10 00 01 11 10 0 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 F = Z3Z2 + Z3Z1 + CO

Adding two BCD numbers Circuit B3 B2B1B0 A3A2A1A0 Cout 4-bit Binary Adder Z3 Z2 Z1 Z0 Carry In 0 Correction Step 4-bit Binary Adder S3 S2 S1 S0

Adding two BCD numbers - Steps The two 4-bit BCD inputs are added by the 4-bit binary adder to produce the sum Z3Z2Z1Z0 and a Carry Out (Cout) When Cout =0, the correction step executes by adding 0000 to Z3Z2Z1Z0, and the output remains the same When Cout =1, the correction step adds 0110 to Z3Z2Z1Z0 to generate the corrected output The output carry is the same as Cout If additional decimal digits need to be added, the BCD adder can be cascaded, with the output carry of one phase connected to the input of the other

Binary Multiplication Similar to decimal multiplication Multiplying 2 bits will generate a 1 if both bits are equal to 1, and will be 0 otherwise. Resembles an AND operation Multiplying two 2-bit numbers is done as follows: B 1 B 0 x A 1 A 0 ---------------- A 0 B 1 A 0 B 0 A 1 B 1 A 1 B 0 + ---------------------------------- This operation is an addition, requires an ADDER C3 C2 C1 C0

Binary Multiplication Therefore, for multiplying two 2-bit numbers, AND gates and ADDERS will be sufficient Half Adders