MULTIPLE OPERAND ADDITION. Multioperand Addition

Similar documents
EE878 Special Topics in VLSI. Computer Arithmetic for Digital Signal Processing

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Digital Computer Arithmetic ECE 666

Multi-Operand Addition Ivor Page 1

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: continued. Consulting hours. Introduction to Sim. Milestone #1 (due 1/26)

Timing for Ripple Carry Adder

Digital Computer Arithmetic

DIGITAL ARITHMETIC. Miloš D. Ercegovac Computer Science Department University of California Los Angeles and

Area Efficient, Low Power Array Multiplier for Signed and Unsigned Number. Chapter 3

CS 64 Week 1 Lecture 1. Kyle Dewey

Number Systems. Decimal numbers. Binary numbers. Chapter 1 <1> 8's column. 1000's column. 2's column. 4's column

Chapter 3: part 3 Binary Subtraction

EE878 Special Topics in VLSI. Computer Arithmetic for Digital Signal Processing

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Digital Computer Arithmetic ECE 666

ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012

Computer Arithmetic Multiplication & Shift Chapter 3.4 EEC170 FQ 2005

ECE468 Computer Organization & Architecture. The Design Process & ALU Design

COMP 122/L Lecture 2. Kyle Dewey

Computer Architecture Set Four. Arithmetic

Binary Adders: Half Adders and Full Adders

Number Systems for Computers. Outline of Introduction. Binary, Octal and Hexadecimal numbers. Issues for Binary Representation of Numbers

Boolean Unit (The obvious way)

Department of Electrical and Computer Engineering University of Wisconsin - Madison. ECE/CS 352 Digital System Fundamentals.

Chapter 4 Arithmetic Functions

Computer Architecture, IFE CS and T&CS, 4 th sem. Fast Adders

Review. Steps to writing (stateless) circuits: Create a logic function (one per output)

Binary Adders. Ripple-Carry Adder

Chapter 3 Arithmetic for Computers

Arithmetic Logic Unit. Digital Computer Design

A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation

10.1. Unit 10. Signed Representation Systems Binary Arithmetic

Arithmetic Processing

ELEC 326: Class project

Lecture 5. Other Adder Issues

Computer Architecture and Organization

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010

Week 7: Assignment Solutions

ECE 341. Lecture # 6

Array Multipliers. Figure 6.9 The partial products generated in a 5 x 5 multiplication. Sec. 6.5

Fast Arithmetic. Philipp Koehn. 19 October 2016

We are quite familiar with adding two numbers in decimal

Chapter 2 Bits, Data Types, and Operations

Data Representation Type of Data Representation Integers Bits Unsigned 2 s Comp Excess 7 Excess 8

8/27/2016. ECE 120: Introduction to Computing. Graphical Illustration of Modular Arithmetic. Representations Must be Unambiguous

CARLETON UNIVERSITY. Laboratory 2.0

CS/COE 0447 Example Problems for Exam 2 Spring 2011

Outline. Introduction to Structured VLSI Design. Signed and Unsigned Integers. 8 bit Signed/Unsigned Integers

CHW 261: Logic Design

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 3. Arithmetic for Computers Implementation

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

Chapter 2 Bits, Data Types, and Operations

VTU NOTES QUESTION PAPERS NEWS RESULTS FORUMS Arithmetic (a) The four possible cases Carry (b) Truth table x y

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

Logical Bases: Representation of Numbers Decimal number Positional notation Binary numbers

Integer Multiplication and Division

Arithmetic Circuits. Nurul Hazlina Adder 2. Multiplier 3. Arithmetic Logic Unit (ALU) 4. HDL for Arithmetic Circuit

Principles of Computer Architecture. Chapter 3: Arithmetic

The CPU and Memory. How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram:

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

4. Write a sum-of-products representation of the following circuit. Y = (A + B + C) (A + B + C)

EE 109 Unit 6 Binary Arithmetic

1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two Solutions 26 February 2014

ECE 30 Introduction to Computer Engineering

High Throughput Radix-D Multiplication Using BCD

*Instruction Matters: Purdue Academic Course Transformation. Introduction to Digital System Design. Module 4 Arithmetic and Computer Logic Circuits

Basic Definition INTEGER DATA. Unsigned Binary and Binary-Coded Decimal. BCD: Binary-Coded Decimal

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

Partial product generation. Multiplication. TSTE18 Digital Arithmetic. Seminar 4. Multiplication. yj2 j = xi2 i M

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

Tailoring the 32-Bit ALU to MIPS

Number Systems and Computer Arithmetic

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor.

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Week 6: Processor Components

Lec-6-HW-3-ALUarithmetic-SOLN

CPE300: Digital System Architecture and Design

CS 24: INTRODUCTION TO. Spring 2015 Lecture 2 COMPUTING SYSTEMS

Improved Design of High Performance Radix-10 Multiplication Using BCD Codes

Chapter 3 Arithmetic for Computers. ELEC 5200/ From P-H slides

Binary Multiplication

EECS150 - Digital Design Lecture 13 - Combinational Logic & Arithmetic Circuits Part 3

Efficient Radix-10 Multiplication Using BCD Codes

Chapter 2 Bits, Data Types, and Operations

EE260: Logic Design, Spring n Integer multiplication. n Booth s algorithm. n Integer division. n Restoring, non-restoring

Outline. Combinational Circuit Design: Practice. Sharing. 2. Operator sharing. An example 0.55 um standard-cell CMOS implementation

Combinational Circuit Design: Practice

Homework 3. Assigned on 02/15 Due time: midnight on 02/21 (1 WEEK only!) B.2 B.11 B.14 (hint: use multiplexors) CSCI 402: Computer Architectures

Integer Multiplication and Division

Operations On Data CHAPTER 4. (Solutions to Odd-Numbered Problems) Review Questions

Announcements. Lab Friday, 1-2:30 and 3-4:30 in Boot your laptop and start Forte, if you brought your laptop

International Journal of Engineering and Techniques - Volume 4 Issue 2, April-2018

OPTIMIZATION OF FIR FILTER USING MULTIPLE CONSTANT MULTIPLICATION

Format. 10 multiple choice 8 points each. 1 short answer 20 points. Same basic principals as the midterm

SWITCHING THEORY AND LOGIC CIRCUITS

Final Examination (Open Katz, asynchronous & test notes only, Calculators OK, 3 hours)

Lec-6-HW-2-digitalDesign

Slide Set 1. for ENEL 339 Fall 2014 Lecture Section 02. Steve Norman, PhD, PEng

Part 2,Number Systems Questions

COMPUTER ARCHITECTURE AND ORGANIZATION. Operation Add Magnitudes Subtract Magnitudes (+A) + ( B) + (A B) (B A) + (A B)

Transcription:

MULTIPLE OPERAND ADDITION Chapter 3 Multioperand Addition Add up a bunch of numbers Used in several algorithms Multiplication, recurrences, transforms, and filters Signed (two s comp) and unsigned Don t deal with overflow 1

Bit Arrays Simplify things by assuming that all arguments have the same range of values Bit arrays are rectangular Means you may end up sign-extended operands If you are adding m operands where each operand is an n-bit array: the sum has n+p bits Extend operands (0-fill or sign-extend) to n+p bits Sign Extension 2

Sign Extension Trick Sign extension requires that all the adder bits for the sign extended bits be implemented A trick for collecting all the sign extensions into one extra term is: Recall: In other words: represent x as a fraction, and because of two s comp, x 0 has negative weight Sign Extension Trick Apply identity So this transforms signed operand to be replaced by Now you can invert the x0 s and add up number of times you did that 3

Sign Extension Trick (Show Example ) Example for m=5-5=1011 What happens if we add this to x 0? 1+x 0 = 1+(1 - x 0 ) = 2 - x 0 10-0=10, 10-1=01, 1+x 0 =x 0 x 0 0+x 0 =x 0 4

Example for m=5-5=1011 What happens if we add this to x 0? 1+x 0 = 1+(1 - x 0 ) = 2 - x 0 10-0=10, 10-1=01, 1+x 0 =x 0 x 0 0+x 0 =x 0 Reduction Primitive operation in multioperand addition Produces a smaller output bit-array by adding the inputs bits Main approaches are: Reduction by rows (using adders or compressors) Reduction by columns (using counters) 5

[p:2] Adders Reduce p bit-vectors to 2 bit-vectors This means carry-save form at the output [3:2] adder is a regular full adder [4:2] adder adds two carry-save inputs [5:2], [7:2] take even more rows as inputs and reduces them to two output rows 3:2 4:2 5:2 7:2 Example with [3:2] adders x P=3 y 3:2 z v s v c C in 6

Example with [4:2] adders P=4 v s v c w x y z C in 4:2 [4:2] Compressor Adder Note that even though it looks like carry is propagated, the Cout from each [4:2] cell is computed directly from the A and B inputs General Case k can be Greater than 1 7

In General Consider p vectors Break them up into k- bit chunks End up with k-wide [p: 2] adder Imagine k=1, p=3 Then you can use regular [3:2] adders Note h out doesn t wait for h in General [p:2] adder Complexity depends on # of columns k Minimize columns, but pay attention to max possible values Also minimize carries H 8

Typical [p:2] modules p H k W 3 1 1 1 4 2 2 4 5 3 2 3 6 4 3 10 7 5 3 9 9 7 3 7 11 9 4 21 [4:2] Adder P=4 4 rows of bit operands (or 2 carry save ops) K=2 Clumps of 2 bits H=2 2 carry bits W=4 3 bits of intermediate sum W is computed from inputs only (no carries) 9

[5:2] Adder P=5 5 rows of operands K=2 Clumps of 2 bits H=3 3 carry bits W=3 2 bits of intermediate sum [7:2] Adder P=7 7 rows of operands K=3 Clumps of 3 bits H=5 5 carry bits W=9 4 bits of intermediate sum 10

Rows vs. Columns Reduction by rows adds up p rows and produces a vector of 2 rows (carry save) Different adders may take a different sized clump Deals with carries from previous stage, and produces carries to next stage No propagation further than one stage though! Reduction by columns adds a whole column Produces a single-row output As many bits as necessary for that size column (p:q] Counters Add up a column of p bits Result is q bits that represent the sum of those column bits If p inputs, then max output value is p (all ones) For example, ten rows (p=10) You must be able to represent ten in q output bits 11

(p:q] Counters Add column of p bits of the same weight Produce q bits of adjacent weights (3:2], (7:3], and (15:4] are examples (7:3] Counter 12

Gate Network for (7:3] Input is seven binary bit-vectors Output is three bits Partition the input array into two subvectors X A = (x 2,x 1,x 0 ) X B = (x 6,x 5,x 4,x 3 ) Gate Network for (7:3] Partial sums of subvectors are Sum q A is like a full adder (three inputs) 13

Gate Network for (7:3] X 6 X 5 X 4 X 3 q B2 q B1 q B0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 1 0 1 0 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 1 1 0 0 1 0 0 1 1 1 0 1 1 1 0 0 0 0 0 1 1 0 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 1 0 1 0 1 1 1 1 1 0 0 1 1 1 1 1 1 1 0 0 Gate Network for (7:3] Finally, q=q A +q B sum Carry from 0 G1 P1 G0 14

Gate Network for (7:3] Multicolumn Counters 15

Sequential Implementation If your input array is big You can add rows sequentially Uses only one adder and a register Sequential Implementation 16

Sequential Implementation Sequential Implementation m operands m/(p-2) iterations 4 operands = 4/(3-2) = 4 iterations with [3:2] adders Each iteration adds 1 row plus s and c Using [4:2] adders = 4/(4-2) = 2 iterations In each iteration you add 2 rows plus s and c 17

Combinational Implementation Reduction by rows Linear array of [p:2] adders Tree of [p:2] adders Reduction by columns Using (p:q] counters Linear Array Last adder may have additional bits for the sign extension trick we saw at the beginning of the chapter. 18

Adder Trees Because addition is associative, you can organize as a tree Number of adders is the same (same number of inputs ) Adder Trees l 1 2 3 4 5 6 7 8 9 m l 3 4 6 9 13 19 28 42 63 Reduction sequence 19

Adder tree for 9 operands 6 4 3 Three-level tree (6 operands) 20

Four-level tree (7 vs 9 operands) 5-level Tree (13 inputs) 21

Tree of [4:2] adders for m=16 Reduction by Columns Use multiple levels of (p:q] counters to reduce the columns to rows This example uses 4 (7:3] counters Each counter counts the 1 s in one column Then add the rows 22

Reduction by Columns Why draw it that way? 1 0 1 1 11 0 0 1 0 2 1 0 0 1 9 0 1 1 0 6 1 0 1 0 10 1 1 1 1 15 0 1 1 0 6 0 1 1 11 0 011 100 1 1 1 0 1 1 59 Reduction by Columns Why draw it that way? 1 0 1 1 11 0 0 1 0 2 1 0 0 1 9 0 1 1 0 6 1 0 1 0 10 1 1 1 1 15 0 1 1 0 6 0 1 1 11 0 011 100 1 1 1 0 1 1 59 23

Number of Counter Levels Sequences of Counters How many rows can be reduced with L levels of counters? (3:2] counters (7:3] counters 24

Example with (7:3] and 15 rows Table says we can do it in 2 levels of counters (example ) Systemic Design Method 25

Reduction Process Use a mix of FA and HA cells. Transfer the other bits. Why not 4 FA? Relation at Level l FA takes 3 bits, produces 1 sum (reduction of 2) HA takes two bits, produces 1 sum Plus carry bits from column to right 26

Relation at Level l Relation at Level l 27

m=8, n=5 (26 FA, 4HA) Example Build array to compute Operands are integers in the range 4 to 3 Two s comp Compute range of result Thus f requires 6 bits Decompose 3b and 3c into 2b+b and 2c+c 28

Example: f=a+3b+3c+d Note left shifts to compute 2b and 2c Example: f=a+3b+3c+d Use sign extension trick Keep track of weight of sign extension bits! -4x4 + -8x2 = -32-32 = 100000 29

Example: f=a+3b+3c+d Remember the 100000 (-32) Example: f=a+3b+3c+d Determine adder types at each level * Helps by reducing the width of the CPA 30

Example: f=a+3b+3c+d Example: f=a+3b+3c+d 31

Example: f=a+3b+3c+d Pipelined Arrays You can always add pipelining to increase throughput! 32

Partially Combinational Arrays Non-pipelined Pipelined k operands are added per iteration (k = 4 in these examples) m/k iterations required for complete result Partially Combinational Arrays Note that if the partial sum is added to the top of the array, you can t pipeline. Here s a general technique for summing q operands per iteration 33

Conclusion Lots of ways of adding up a bunch of numbers Arguments are a bit-array Reduce that bit array by reducing rows or columns End result is typically in carry-save form So you might need a CPA if you want the answer in conventional form Pipelining is always an option 34