Adders - Subtractors

Similar documents
Carry Look Ahead Adders

Systems I: Computer Organization and Architecture

COMBINATIONAL LOGIC FUNCTIONS

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

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

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

Combinational Logic. Course Instructor Mohammed Abdul kader

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

Binary addition by hand. Adding two bits

Combinational Logic Design Arithmetic Functions and Circuits

14:332:231 DIGITAL LOGIC DESIGN

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

ELCT201: DIGITAL LOGIC DESIGN

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

14:332:231 DIGITAL LOGIC DESIGN. Why Binary Number System?

Menu. Binary Adder EEL3701 EEL3701. Add, Subtract, Compare, ALU

Chapter 5 Arithmetic Circuits

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

Combinational Logic. By : Ali Mustafa

Class Website:

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

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

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

Digital Systems and Information Part II

XOR - XNOR Gates. The graphic symbol and truth table of XOR gate is shown in the figure.

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

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

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri

UNIT II COMBINATIONAL CIRCUITS:

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

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

EE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations.

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

Introduction to Digital Logic Missouri S&T University CPE 2210 Subtractors

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

Digital Techniques. Figure 1: Block diagram of digital computer. Processor or Arithmetic logic unit ALU. Control Unit. Storage or memory unit

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

UNIVERSITI TENAGA NASIONAL. College of Information Technology

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

Looking at a two binary digit sum shows what we need to extend addition to multiple binary digits.

Chapter 2. Boolean Algebra and Logic Gates

CHAPTER1: Digital Logic Circuits Combination Circuits

mith College Computer Science CSC270 Spring 16 Circuits and Systems Lecture Notes Week 2 Dominique Thiébaut

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

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

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

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

Boolean Algebra & Logic Gates. By : Ali Mustafa

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

Addition and Subtraction

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

CS 140 Lecture 14 Standard Combinational Modules

Design of Sequential Circuits

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

Chapter 4: Designing Combinational Systems Uchechukwu Ofoegbu

Review for Test 1 : Ch1 5

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

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

Chapter 2: Switching Algebra and Logic Circuits

Menu. 7-Segment LED. Misc. 7-Segment LED MSI Components >MUX >Adders Memory Devices >D-FF, RAM, ROM Computer/Microprocessor >GCPU

Building a Computer Adder

Chapter 2: Boolean Algebra and Logic Gates

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

ELEN Electronique numérique

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.

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

Binary addition (1-bit) P Q Y = P + Q Comments Carry = Carry = Carry = Carry = 1 P Q

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

Binary addition example worked out

Chapter 1 CSCI

Chapter 2 Basic Arithmetic Circuits

Hardware Design I Chap. 4 Representative combinational logic

Chapter 2 Boolean Algebra and Logic Gates

Digital Electronics Circuits 2017

Number representation

CMPUT 329. Circuits for binary addition

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

Chapter 2 Combinational Logic Circuits

Adders, subtractors comparators, multipliers and other ALU elements

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

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

EC-121 Digital Logic Design

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

Adders, subtractors comparators, multipliers and other ALU elements

ว ตถ ประสงค ของบทเร ยน

Fundamentals of Digital Design

Chapter 5. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 5 <1>

CHAPTER 12 Boolean Algebra

Boolean Algebra & Digital Logic

UNIT 1. BOOLEAN ALGEBRA AND COMBINATIONAL CIRCUITS

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

COMPUTERS ORGANIZATION 2ND YEAR COMPUTE SCIENCE MANAGEMENT ENGINEERING UNIT 3 - ARITMETHIC-LOGIC UNIT JOSÉ GARCÍA RODRÍGUEZ JOSÉ ANTONIO SERRA PÉREZ

CS61c: Representations of Combinational Logic Circuits

CprE 281: Digital Logic

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

Universität Duisburg-Essen FCE 1. Experiment 2. Circuit simulation and Circuit Analysis

S.Y. Diploma : Sem. III [CO/CM/IF/CD/CW] Digital Techniques s complement 2 s complement 1 s complement

Lecture 7: Logic design. Combinational logic circuits

Circuits & Boolean algebra.

Review: Additional Boolean operations

Transcription:

Adders - Subtractors Lesson Objectives: The objectives of this lesson are to learn about: 1. Half adder circuit. 2. Full adder circuit. 3. Binary parallel adder circuit. 4. Half subtractor circuit. 5. Full subtractor circuit. Half Adder: A half adder (HA) is an arithmetic circuit that is used to add two bits. The block diagram of HA is shown. It has two inputs and two outputs. The inputs of the HA are the 2 bits to be added; the augend, and addend. The output is the result of this addition, i.e. a sum bit (S) and a carry bit (C). X Y C S 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0 The truth table of HA is shown. The Boolean functions for the two outputs can be obtained from the truth table which are: S = ( XY + XY) C = XY Thus, the HA can be implemented using one XOR gate and one AND gate as shown in the Figure. Full Adder: A full adder (FA) is an arithmetic circuit that is used to add three bits. The block diagram of FA is shown. It has three inputs and two outputs.

The inputs of the FA are the 3 bits to be added; the augend, addend, and carry from previous lower significant position. The output is the result of this addition, i.e. a sum bit (S) and a carry bit (C). 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 The truth table of FA is shown. The simplified Boolean functions for the two outputs can be obtained from the truth table, which are: S = XYZ + XYZ + XYZ + XYZ C = XY + XZ + YZ The Boolean functions for the two outputs can be manipulated to simplify the circuit, as shown below: (see animation in authorware version) S = XYZ + XYZ + XYZ + XYZ = ( X Y)

C = = = XY XY XY + + + X Y Z + X YZ Z ( X Y + X Y ) Z ( X Y ) Thus the full adder can be implemented using two half adders and an OR gate as shown in the Figure. Binary Parallel Adder: An n-bit adder is a circuit which adds two n-bits numbers, say, A and B. In addition, an n-bit adder will have another single-bit input which is added to the two numbers called the carry-in (C in ). The output of the n-bit adder is an n-bit sum (S) and a carry-out (C out ) bit. The block diagram of the n-bit adder is shown. If all input bits of the two numbers (A & B) are applied simultaneously in parallel, the adder is termed a Parallel Adder. Consider the problem of designing a 4-bit binary parallel adder. The total number of inputs is 9, since the two numbers have 4-bits each in addition to the C in bit. Using conventional techniques for design would require a truth table of 2 9 =512 rows. This causes the conventional design procedure to be unacceptable in this case. Alternatively, the 4-bit binary parallel adder can be designed using 4 full adders connected in-cascade as shown in the figure.

That is the carry-out bit of one full adder stage is used as carry-in input to the next stage. In general, an n-bit binary parallel adder can be built out of n full adders connected in cascade. Since a carry of 1 may appear near the least significant bit of the adder and yet propagate through many full adders to the most significant bit, just as a wave ripples outward from a pebble dropped in a pond. That is why this parallel adder is also called as ripple carry adder. The disadvantage of the ripple-carry adder is that it can get very slow when one needs to add many bits. The propagation delay of this adder is fairly long since under worst case conditions, the carry has to propagate through all the stages as shown in the figure by red colored path. This propagation delay is a limiting factor on the adder speed. The signal from the input carry to the output carry propagates through an AND gate and OR gate, which constitute two gate levels. If there are four full adders, the output carry would have 2 x 4 = 8 levels from C 0 to C 4. The total propagation time in this 4-bit adder would be the propagation time in one half adder (which is the first half adder) plus eight gate levels. (see animation in authorware version) Assuming that all the different types of gates have same propagation delay, say T, the propagation delay of adder can be generalized as (2n + 1) T, where n is the number of stages. In this example, n = 4, so the delay is (2 x 4 + 1) T = 9T

Since all other arithematic operations are implemented by successive additions, the time consumed during addition process is very critical. For fast applications, a better design is required. The carry-look-ahead adder solves this problem by calculating the carry signals in advance, based on the input signals. It is expalined in the next lesson. Appendix: Half Subtractor: A half subtractor is an arithmetic circuit that subtracts two bits and produces their difference. The block diagram of half subtractor is shown. The circuit has two inputs minuend (X) and subtrahend (Y) and two output bits, one is the difference bit (D) and the other is the borrow bit (B). It performs the operation X Y. It should be noted that the weight of the output borrow bit is -2, while the weight of the output difference bit is +1. X Y B D 0 0 0 0 0 1 1 1 1 0 0 1 1 1 0 0 The truth table of the half subtractor is shown. The Boolean functions for the two outputs can be obtained directly from the truth table as: D = ( XY + XY) B = X Y Full Subtractor: A full subtractor is a combinational circuit that performs a subtraction between two bits, taking into account that a 1 may have been borrowed by a lower significant bit. The block diagram of full subtractor is shown. The circuit has three inputs and two outputs.

Input variables are minuend (X), subtrahend (Y), and previous borrow (Z); output variables are difference (D) and output borrow (B). It performs the operation X Y Z. It should be noted that the weight of the output borrow bit is -2, while the weight of the output difference bit is +1. The truth table of the full subtractor is shown. X Y Z B D 0 0 0 0 0 0 0 1 1 1 0 1 0 1 1 0 1 1 1 0 1 0 0 0 1 1 0 1 0 0 1 1 0 0 0 1 1 1 1 1 The simplified Boolean functions for the two outputs are: D = XYZ + XYZ + XYZ B = X Y + X Z + YZ + XYZ