CDA3101 Recitation Section 5

Slides:



Advertisements
Similar presentations
Carry Lookahead Homework
Advertisements

1 ECE 4436ECE 5367 Computer Arithmetic I-II. 2 ECE 4436ECE 5367 Addition concepts 1 bit adder –2 inputs for the operands. –Third input – carry in from.
1 Lecture 12: Hardware for Arithmetic Today’s topics:  Designing an ALU  Carry-lookahead adder Reminder: Assignment 5 will be posted in a couple of days.
Comparator.
Chapter # 5: Arithmetic Circuits Contemporary Logic Design Randy H
ECE 301 – Digital Electronics
1 Lecture 4: Arithmetic for Computers (Part 4) CS 447 Jason Bakos.
Chapter 5 Arithmetic Logic Functions. Page 2 This Chapter..  We will be looking at multi-valued arithmetic and logic functions  Bitwise AND, OR, EXOR,
Binary Arithmetic Stephen Boyd March 14, Two's Complement Most significant bit represents sign. 0 = positive 1 = negative Positive numbers behave.
Logical Circuit Design Week 8: Arithmetic Circuits Mentor Hamiti, MSc Office ,
IKI a-Combinatorial Components Bobby Nazief Semester-I The materials on these slides are adopted from those in CS231’s Lecture Notes.
Chapter # 5: Arithmetic Circuits
07/19/2005 Arithmetic / Logic Unit – ALU Design Presentation F CSE : Introduction to Computer Architecture Slides by Gojko Babić.
Computing Systems Designing a basic ALU.
درس مدارهای منطقی دانشگاه قم مدارهای منطقی محاسباتی تهیه شده توسط حسین امیرخانی مبتنی بر اسلایدهای درس مدارهای منطقی دانشگاه.
Lecture 18: Hardware for Arithmetic Today’s topic –Intro to Boolean functions (Continued) –Designing an ALU 1.
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.
Computer Science 101 More Devices: Arithmetic. From 1-Bit Equality to N-Bit Equality = A B A = B Two bit strings.
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
1 Carry Lookahead Logic Carry Generate Gi = Ai Bi must generate carry when A = B = 1 Carry Propagate Pi = Ai xor Bi carry in will equal carry out here.
Addition and multiplication Arithmetic is the most basic thing you can do with a computer, but it’s not as easy as you might expect! These next few lectures.
1 Lecture 11: Hardware for Arithmetic Today’s topics:  Logic for common operations  Designing an ALU  Carry-lookahead adder.
ETE 204 – Digital Electronics Combinational Logic Design Single-bit and Multiple-bit Adder Circuits [Lecture: 9] Instructor: Sajib Roy Lecturer, ETE,ULAB.
Addition and multiplication1 Arithmetic is the most basic thing you can do with a computer, but it’s not as easy as you might expect! These next few lectures.
Gunjeet Kaur Dronacharya Group of Institutions. Binary Adder-Subtractor A combinational circuit that performs the addition of two bits is called a half.
Carry-Lookahead & Carry-Select Adders
Computer Arthmetic Chapter Four P&H.
Combinational Circuits
Somet things you should know about digital arithmetic:
Lecture 12 Logistics Last lecture Today HW4 due today Timing diagrams
Lecture 11: Hardware for Arithmetic
Addition and multiplication
Space vs. Speed: Binary Adders
Combinational Circuits
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.
CDA 3101 Spring 2016 Introduction to Computer Organization
Chapter 4 Combinational Logic
Computer Organization and Design Arithmetic & Logic Circuits
Combinational Circuits
Computer Organization and Design Arithmetic & Logic Circuits
ECE 331 – Digital System Design
CSE Winter 2001 – Arithmetic Unit - 1
CDA 3101 Summer 2007 Introduction to Computer Organization
Lecture 14 Logistics Last lecture Today
Computer Organization and Design Arithmetic & Logic Circuits
ECE/CS 552: Integer Multipliers
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Lecture 11: Hardware for Arithmetic
Digital Systems Section 12 Binary Adders. Digital Systems Section 12 Binary Adders.
CS 140 Lecture 14 Standard Combinational Modules
Chapter 5 – Number Representation and Arithmetic Circuits
Digital System Design Combinational Logic
Overview Part 1 – Design Procedure Part 2 – Combinational Logic
CSE 140 Lecture 14 Standard Combinational Modules
Addition and multiplication
Instructor: Mozafar Bag-Mohammadi University of Ilam
Lecture 14 Logistics Last lecture Today
Booth's Algorithm for 2's Complement Multiplication
Addition and multiplication
Instructor: Alexander Stoytchev
Combinational Circuits
Lecture 9 Digital VLSI System Design Laboratory
XOR Function Logic Symbol  Description  Truth Table 
Chapter 4 計算機算數.
Computer Organization and Design Arithmetic Circuits
Adder Circuits By: Asst Lec. Basma Nazar
2's Complement Arithmetic
Number Representation
Presentation transcript:

CDA3101 Recitation Section 5 Ripple Carry vs Carry Lookahead Adder Boolean Multiplication (Booth's Algorithm)

Boolean Addition - One Bit Adder Takes two 1-bit numbers, and a carry-in, and computes the sum, with carry-out. CIN A Y B COUT ADD

Boolean Addition - One Bit Adder CIN A Y B COUT Logic Circuit ADD Truth Table A B CIN SUM (Y) COUT 1

Ripple Carry - N Bit Adder CIN Y COUT A0 B0 Y0 Put several 1-bit adders end-to-end, connected via carry-in and carry-out Time Complexity in number of bits? Each adder must wait for previous adder's carry: O(N) A B CIN Y COUT A1 B1 Y1 A B CIN Y COUT A2 B2 Y2 Carry

Carry Lookahead Adder - N Bit Adder (CLA) Can we do better? If we could predict the carry, output at each adder, we wouldn't need to wait. For convenience, define: Pi = Ai + Bi Gi = Ai Bi Now from the truth table: COUTi = Gi + Pi CINi COUTi = Gi + Pi COUTi-1 A B CIN COUT 1

Carry Lookahead Adder - N Bit Adder (CLA) The boolean algebra expression for Ci is expanded as follows. COUT0 = G0 + P0 COUT0-1 COUT1 = G1 + P1 COUT0 = G1 + P1 G0 COUT2 = G2 + P2 COUT1 = G2 + P2 (G1 + P1 G0) COUT3 = G3 + P3 COUT2 = G3 + P3 (G2 + P2 (G1 + P1 G0)) COUT4 = G4 + P4 COUT3 = ...

Carry Lookahead Adder - N Bit Adder (CLA) Tradeoff - more hardware, lower latency. Cost to build 16 bit CLA is prohibitively expensive. Intermediate solution connects Ripple Carry Adders together using lookahead logic. Complexity - O(logN)

Pencil and Paper Multiplication Algorithm A series of partial products followed by a summation step. Problem: Does not work with negative numbers. 0010 x 1101 ------- 0000 0011010

Pencil and Paper Multiplication Algorithm

Solution: Booth’s Algorithm  A 0, Q-1 0 M Multiplicand Q Multiplier Count n START = 10 = 01 Q0,Q-1 = 00 = 11 A A - M A A + M Arithmetic shift right: A, Q, Q-1 Count Count - 1 No Yes Count = 0 ? END 10

Problem 1 - Booth's Multiplication Algorithm Use Booth's Algorithm to find the product 6x5 in signed binary notation. 6 = 0110 5 = 0101

Problem 1 - Booth's Multiplication Algorithm Operation A Q Q-1 M Count Subtract 0000 0101 0110 4 Shift 1010 Add 1101 0010 1 3 0011 0001 1001 2 1011 1100 Done 1110 Answer: 00011110 = 30

Problem 2 - Booth's Multiplication Algorithm Use Booth's Algorithm to find the product -3x9 in signed binary notation. -3 = 11101 9 = 01001 *Why are we using 5 bits now, instead of 4?

Problem 2 - Booth's Multiplication Algorithm Operation: A Q Q-1 M Count Subtract 00000 01001 11101 5 Shift 00011 Add 00001 10100 1 4 11110 11111 01010 3 10101 2 00010 Done 00101 Answer: 1111100101 = -27

Booth's Algorithm Simulator http://www.ecs.umass.edu/ece/koren/arith/simulat or/Booth/