Half Adder & Full Adder Patrick Marshall. Intro Adding binary digits Half adder Full adder Parallel adder (ripple carry) Arithmetic overflow.

Slides:



Advertisements
Similar presentations
Kuliah Rangkaian Digital Kuliah 7: Unit Aritmatika
Advertisements

Combinational Circuits. Analysis Diagram Designing Combinational Circuits In general we have to do following steps: 1. Problem description 2. Input/output.
Comparator.
Lab 10 : Arithmetic Systems : Adder System Layout: Slide #2 Slide #3 Slide #4 Slide #5 Arithmetic Overflow: 2’s Complement Conversions: 8 Bit Adder/Subtractor.
Addition (2). Outline Full Adder 3-Bit Adder 2’s Complement Subtraction.
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Arithmetic See: P&H Chapter 3.1-3, C.5-6.
Parallel Adder Recap To add two n-bit numbers together, n full-adders should be cascaded. Each full-adder represents a column in the long addition. The.
ECE 331 – Digital System Design
CSE-221 Digital Logic Design (DLD)
Arithmetic II CPSC 321 E. J. Kim. Today’s Menu Arithmetic-Logic Units Logic Design Revisited Faster Addition Multiplication (if time permits)
ECE C03 Lecture 61 Lecture 6 Arithmetic Logic Circuits Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Lecture 8 Arithmetic Logic Circuits
Design of Arithmetic Circuits – Adders, Subtractors, BCD adders
Arithmetic-Logic Units CPSC 321 Computer Architecture Andreas Klappenecker.
ECE 301 – Digital Electronics
ECE 301 – Digital Electronics
Chapter 5 Arithmetic Logic Functions. Page 2 This Chapter..  We will be looking at multi-valued arithmetic and logic functions  Bitwise AND, OR, EXOR,
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
Chapter 7 Arithmetic Operations and Circuits Hexadecimal Arithmetic 4 binary bits represent a single hexadecimal digit Addition –Add the digits.
Logic Gates Combinational Circuits
Calculator Lab Overview Note: Slides Updated 10/8/12
Binary Arithmetic Stephen Boyd March 14, Two's Complement Most significant bit represents sign. 0 = positive 1 = negative Positive numbers behave.
Logic Design CS221 1 st Term combinational circuits Cairo University Faculty of Computers and Information.
Binary Numbers.
Digital Arithmetic and Arithmetic Circuits
ADDERS Half Adders Recall that the basic rules of binary addition are as indicated below in Table 2-9. A circuit known as the half-adder carries out these.
Fall 2004EE 3563 Digital Systems Design EE 3563 Comparators  Comparators determine if two binary inputs are equal  Some will signal greater than/less.
Chapter # 5: Arithmetic Circuits
Topic: Arithmetic Circuits Course: Digital Systems Slide no. 1 Chapter # 5: Arithmetic Circuits.
Module 9.  Digital logic circuits can be categorized based on the nature of their inputs either: Combinational logic circuit It consists of logic gates.
Lecture 9 Topics: –Combinational circuits Basic concepts Examples of typical combinational circuits –Half-adder –Full-adder –Ripple-Carry adder –Decoder.
Logic Gates Logic gates are electronic digital circuit perform logic functions. Commonly expected logic functions are already having the corresponding.
DIGITAL CIRCUITS David Kauchak CS52 – Fall 2015.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
Digital Logic. 2 Abstractions in CS (gates) Basic Gate: Inverter IO IO GNDI O Vcc Resister (limits conductivity) Truth Table.
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
1 Lecture 12 Time/space trade offs Adders. 2 Time vs. speed: Linear chain 8-input OR function with 2-input gates Gates: 7 Max delay: 7.
Universal college of engineering & technology. .By Harsh Patel)
1 Ethics of Computing MONT 113G, Spring 2012 Session 5 Binary Addition.
Logic and computers 2/6/12. Binary Arithmetic /6/ Only two digits: the bits 0 and 1 (Think: 0 = F, 1.
Combinational Circuits
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
Computer Architecture
1 Chapter 4 Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables,
Digital Electronics Tutorial: Number System & Arithmetic Circuits Solutions.
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
Arithmetic-Logic Units. Logic Gates AND gate OR gate NOT gate.
1 Lecture 14 Binary Adders and Subtractors. 2 Overview °Addition and subtraction of binary data is fundamental Need to determine hardware implementation.
Number Representation (Part 2) Computer Architecture (Fall 2006)
1 Ethics of Computing MONT 113G, Spring 2012 Session 4 Binary Addition.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
Simple ALU  Half adder  Full adder  Constructing 4 bits adder  ALU does several operations  General ALU structure  Timing diagram of adder  Overflow.
President UniversityErwin SitompulDigital Systems 7/1 Lecture 7 Digital Systems Dr.-Ing. Erwin Sitompul President University
1 The ALU l ALU includes combinational logic. –Combinational logic  a change in inputs directly causes a change in output, after a characteristic delay.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
ETE 204 – Digital Electronics Combinational Logic Design Single-bit and Multiple-bit Adder Circuits [Lecture: 9] Instructor: Sajib Roy Lecturer, ETE,ULAB.
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.
Arithmetic Circuits I. 2 Iterative Combinational Circuits Like a hierachy, except functional blocks per bit.
Gunjeet Kaur Dronacharya Group of Institutions. Binary Adder-Subtractor A combinational circuit that performs the addition of two bits is called a half.
Combinational Circuits
Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables, logic gates,
Summary Half-Adder Basic rules of binary addition are performed by a half adder, which has two binary inputs (A and B) and two binary outputs (Carry out.
FUNCTION OF COMBINATIONAL LOGIC CIRCUIT
CSE Winter 2001 – Arithmetic Unit - 1
Week 7: Gates and Circuits: PART II
Digital Systems Section 12 Binary Adders. Digital Systems Section 12 Binary Adders.
XOR, XNOR, and Binary Adders
Combinational Circuits
ECE 352 Digital System Fundamentals
XOR Function Logic Symbol  Description  Truth Table 
Presentation transcript:

Half Adder & Full Adder Patrick Marshall

Intro Adding binary digits Half adder Full adder Parallel adder (ripple carry) Arithmetic overflow

Adding Binary Numbers = = = = 10 A key requirement of digital computers is the ability to use logical functions to perform arithmetic operations. How do we add two binary numbers? Let's start by adding two binary bits. Since each bit has only two possible values, 0 or 1, there are only four possible combinations of inputs. These four possibilities, and the resulting sums, are:

Truth table for 2 bit binary addition InputsOutputs ABCarrySum Carry = A.BSum = A.B + A.B

One possible implementation Note: The Half adder is sometimes drawn using a XOR gate to derive the sum. This is a common alternative to the circuit above which performs the same logic

Half adder HA A B Cout S It would be tedious to draw the full implementation of the half adder each time it appeared in a more complex circuit, so we commonly draw it as a box, showing the inputs and the outputs.

Adding groups of digits In digital circuits we usually have to add groups of bits together, rather than simply one bit to one bit as shown in the half adder. If multiple bit number representations, like are to be added to for each digit additions we must take into account carry bits from previous steps of the process. In other words we need a circuit which will do the full job of multiple bit binary addition. The half adder is so called because it performs ‘half’ the job of binary addition = 22 decimal = 6 decimal = 28 decimal = = = = 11

Full adder using half Adders Cin HA A B HA S2S2 C out We can implement a full adder circuit using two half adders. Inputs A and B are added together using the first HA, with the resultant Sum bit been added with the Carry in (from previous bit additions) using the second HA. The sum bit of this second adder is the true sum with the true carry been generated if either of the half adder stages generated a carry C 1 S 1 C2C2

Implementing the Full adder circuit A B C in SumC out This adder can be considered a three input adder. Two inputs, A&B, from the bits of the numbers we are adding and one bit, Cin, is from additions of previous bits Sum = ABC + ABC + ABC + ABC Cout = ABC + ABC + ABC +ABC

Full adder Cout = ABC + ABC + ABC +ABC Cout = AB + AC + BC AB C

Full adder circuits

Full adder shorthand FA A B Cin Cout S There are many other ways to implement a Full adder circuit, using Nor gates only, using Nand gates only, using Xor gates. In many cases the implementation details are unimportant, so we can use the shorthand representation shown to the left. The important thing to note is that the full adder has three inputs (A B and Carry in) and two outputs (Carry out and Sum)

Adding mulitple bits We have seen how to add two binary digits using the half adder, we have seen how to add add two binary digits and a carry digit from a previous stage using the full adder. These operations are not terribly useful as generally we need to add large numbers together which are represented by multiple binary digits. We will now look at a way to achieve this using a parallel full adder.

Parallel Full Adder A parrallel adder adds all the bits the binary numbers in a single operation. One such adder is known as the ripple carry adder

Ripple Carry adder The first stage can calculate it’s Sum and Carry as soon as the input A0 and B0 are valid. The second stage must wait for the first stage to complete it’s job before it’s output is valid.Likewise the third stage must wait for the outputs of both the first and second stage to be valid. The carry bit ripples through all the stages. This is why this circuit is known as the ripple carry adder.The length of time taken to add the two numbers is proportional to the number of bits in the number.

Notes on Ripple Carry adder Setting the “Carry in to 1 st Stage” to a ‘1’ to generate A+B+1. If input B were zero the circuit would function as an incrementor. This also is handy when applying complimentary arithmetic. The Carry out bit can be used to determine if arithmetic overflow has occurred. Overflow occurs when the resulting value of an operation performed on valid representations of numbers is out of the range of valid values. That is, the resulting value is greater than max or less than min. It is possible to reduce partially the effect of the ripple-through carry by creating what are called “carry look ahead circuits”. That is the carry out to stage 5 can be calculated by inspecting the inputs to 4, 3, 2 and 1. This high speed circuit avoids the delays experience if a ripple through carry circuit.

Arithmetic overflow Consider 4 bit two’s complement additions, so the valid decimal range is from –8 to = = = = = = = = = = = = +4 The first two sum are fine, but there’s something funny with = -6 and –8 – 4 = +4

Arithmetic Overflow Overflow occurs if the result of adding two positive numbers yields a negative result or if the adding of two negative numbers result in a positive result. If the sign bits of the two numbers are the same but the sign bit of the result is different then arithmetic overflow has occurred. Overflow (V) = A sign.B sign.Sum sign or A sign.B sign.Sum sign

Summary Adding binary digits Half adder Full adder Parallel adder (ripple carry) Arithmetic overflow