Design of Arithmetic Units ECE152B AU 1

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

Week 7: Assignment Solutions

Computer Architecture Set Four. Arithmetic

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

CO Computer Architecture and Programming Languages CAPL. Lecture 9

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

carry in carry 1101 carry carry

Overview. EECS Components and Design Techniques for Digital Systems. Lec 16 Arithmetic II (Multiplication) Computer Number Systems.

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

Chapter 3 Arithmetic for Computers

CS/COE 0447 Example Problems for Exam 2 Spring 2011

Arithmetic Logic Unit. Digital Computer Design

CS Computer Architecture. 1. Explain Carry Look Ahead adders in detail

Experiment 7 Arithmetic Circuits Design and Implementation

REGISTER TRANSFER LANGUAGE

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

Introduction to Digital Logic Missouri S&T University CPE 2210 Multipliers/Dividers

ECE331: Hardware Organization and Design

ECE 341. Lecture # 6

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

EE 8351 Digital Logic Circuits Ms.J.Jayaudhaya, ASP/EEE

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

COMP 303 Computer Architecture Lecture 6

ECE 341 Midterm Exam

Combinational Circuits

CS/COE 0447 Example Problems for Exam 2 Fall 2010

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 3 DLD P VIDYA SAGAR

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

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

MULTIPLICATION TECHNIQUES

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

Chapter 3 Part 2 Combinational Logic Design

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

Integer Multiplication and Division

CS 5803 Introduction to High Performance Computer Architecture: Arithmetic Logic Unit. A.R. Hurson 323 CS Building, Missouri S&T

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

Combinational Circuit Design

Learning Outcomes. Spiral 2-2. Digital System Design DATAPATH COMPONENTS

DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS

Lecture 19: Arithmetic Modules 14-1

Week 6: Processor Components

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

Timing for Ripple Carry Adder

VARUN AGGARWAL

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

Outline. EEL-4713 Computer Architecture Multipliers and shifters. Deriving requirements of ALU. MIPS arithmetic instructions

Bawar Abid Abdalla. Assistant Lecturer Software Engineering Department Koya University

Arithmetic Logic Unit

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University

Binary Adders: Half Adders and Full Adders

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

Writing Circuit Descriptions 8

Digital Computer Arithmetic

CPE 335 Computer Organization. MIPS Arithmetic Part I. Content from Chapter 3 and Appendix B

Learning Outcomes. Spiral 2 2. Digital System Design DATAPATH COMPONENTS

Digital Logic & Computer Design CS Professor Dan Moldovan Spring 2010

Basic Arithmetic (adding and subtracting)

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

EXPERIMENT NUMBER 11 REGISTERED ALU DESIGN

University of Illinois at Chicago. Lecture Notes # 10

ECE 30 Introduction to Computer Engineering

Combinational Logic. Prof. Wangrok Oh. Dept. of Information Communications Eng. Chungnam National University. Prof. Wangrok Oh(CNU) 1 / 93

More complicated than addition. Let's look at 3 versions based on grade school algorithm (multiplicand) More time and more area

Computer Organization

Computer Architecture and Organization

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

Boolean Algebra. Chapter 3. Boolean Algebra. Chapter 3 Arithmetic for Computers 1. Fundamental Boolean Operations. Arithmetic for Computers

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences

Digital Design Laboratory Lecture 2

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

CHAPTER 9 MULTIPLEXERS, DECODERS, AND PROGRAMMABLE LOGIC DEVICES

CS429: Computer Organization and Architecture

By, Ajinkya Karande Adarsh Yoga

Addition and multiplication

Learning Outcomes. Spiral 2 2. Digital System Design DATAPATH COMPONENTS

EECS150 Homework 2 Solutions Fall ) CLD2 problem 2.2. Page 1 of 15

Note that none of the above MAY be a VALID ANSWER.

COMPUTER ARCHITECTURE AND ORGANIZATION Register Transfer and Micro-operations 1. Introduction A digital system is an interconnection of digital

Chapter 3: part 3 Binary Subtraction

Microcomputers. Outline. Number Systems and Digital Logic Review

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

Number Systems and Computer Arithmetic

UNIT-III REGISTER TRANSFER LANGUAGE AND DESIGN OF CONTROL UNIT

EE 109 Unit 6 Binary Arithmetic

LECTURE 4. Logic Design

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

CPE300: Digital System Architecture and Design

1. Prove that if you have tri-state buffers and inverters, you can build any combinational logic circuit. [4]

DIGITAL SYSTEM DESIGN

Arithmetic Circuits. Design of Digital Circuits 2014 Srdjan Capkun Frank K. Gürkaynak.

Numbering Systems. Number Representations Part 1

ECEN 468 Advanced Logic Design

We are quite familiar with adding two numbers in decimal

HIGH PERFORMANCE FUSED ADD MULTIPLY OPERATOR

VHDL Structural Modeling II

Part I: Translating & Starting a Program: Compiler, Linker, Assembler, Loader. Lecture 4

EECS150: Components and Design Techniques for Digital Systems

CARLETON UNIVERSITY. Laboratory 2.0


Transcription:

Design of Arithmetic Units ECE152B AU 1

Design of Arithmetic Units We will discuss the design of Adders/Substractors Multipliers/Dividers li id and analyze algorithms & methods to perform the desired d operations within an acceptable time. Addition A basic cell is the full adder (FA) ECE152B AU 2

A i B i C in C out=a i B i +B i C in+a i C in A B C in FA Cot F F i=a i B i C in C out F I AI-H BI-H COUT-H AI-H BI-H CIN-H FI-H CIN-H AI-H ECE152B AU 3

A word adder composed of full adders: A 7 B 7 A 6 B 6 A 5 B 5 A 4 B 4 A 3 B 3 A 2 B 2 A 1 B 1 A 0 B 0 A B C in A B C in A B C in A B C in A B C in A B C in A B C in A B C in FA FA FA FA FA FA FA FA Cot F Cot F Cot F Cot F Cot F Cot F Cot F Cot F C out F 7 F 6 F 5 F 4 F 3 F 2 F 1 F 0 ECE152B AU 4

This kind of addition process is called a ripple carry adder, since the carry at each stage is propagated to the next stage. For an N-bit addition: (G: one gate delay) T ADDRCA =N T FA = N (2 G) Ripple carry adders are an example of a minimal gate solution, but the time required for the result may not be acceptable. Look-ahead carry adder (LACA): more hardware while faster ECE152B AU 5

Now look at the logic equation of Cout: C out = AB+AC in +BC in = AB+C in (A+B) If AB is asserted, there will be a carry regardless of the value of the carry input: this term (AB) is called the carry generate (CG) function. If (A+B) is asserted, any carry supplied to this stage is passed on to the next: this term (A+B) is called the carry propagate (CP) function. ECE152B AU 6

Data In Carry in A B Cin CG LACA CP F Carry Generate Carry Propagate Sum out The time required to create the carry generate and carry propagate is a single gate delay. The carry generate and carry propagate lines are not function of the carry input. A four-bit LACA: ECE152B AU 7

CG0 CP0 Cin Look-Ahead Carry Generator C3 CG3 CP3 C2 CG2 CP2 C1 CG1 CP1 CG0 CP0 A 3 B 3 A 2 B 2 A 1 B 1 A 0 B 0 A B Cin CG LACA CP F A B Cin CG LACA CP F A B Cin CG LACA CP F A B Cin CG LACA CP F F 3 F 2 F 1 F 0 ECE152B AU 8

All of the CG & CP lines will be stable one gate delay after the inputs are stable. The Look-Ahead Carry Generator (LACG) has the responsibility of creating the carry for each stage: C 1 will be asserted if CG 0 is asserted or if CP 0 is asserted & Cin is asserted. i.e. C 1 = CG 0 +CP 0 C in C 2 =CG 1 +CP 1 C 1 =CG 1 +CP 1 (CG 0 +CP 0 C in ) =CG 1 +CP 1 CG 0 +CP 1 CP 0 C in ECE152B AU 9

As the carries become more significant the amount of logic needed to generate the carry becomes larger. However, all carries will be generated in 2 gate delays (in LACG). The addition performed by the above 4-bit LACA requires only 5 gate delay: 1 to generate CG & CP for each LACA. 2 to generate all carries. 2 to propagate the effect of the carries to the outputs ECE152B AU 10

For a 4-bit Ripple Carry Adder, the delay is 4 2=8 gate delay. A LACG the provided the carries for a large adder (e.g. 64 bits) would be prohibitively expensive in terms of # of gates. Solution: cascade the LACGs in exactly the same fashion as the LACAs The LACG also generates a CG & CP that can be utilized by a second stage of LACG. ECE152B AU 11

( Computer Design, by G.Langdon, JR, P145) ECE152B AU 12

181s, 4-bit ALUs, generate the CG & CP signals required. 182s are 4-bit LACGs that t handle the CG&CP signals from 4 modules. The time required for such an addition: T LACA = 2 + 4 (log b (N) -1) Where N: # of bits to be added d b: # of bits handled by an ALU or a LACG. If no LACG is needed d (N <= b), T LACA =2. ECE152B AU 13

The LACGs are added in a tree type of structure, where the fanout of each node of the tree is b. Each level of LACGs requires a 4-gate delay: 2 gate delay for generating g CG&CP for the next level of LACGs & 2 gate delay for computing the carries after Cin is ready. ECE152B AU 14

Addition for a 2 s complement system Consider 75 10 +58 10 01001011 -- 75 in base 2 00111010 -- 58 in base 2 10000101 -- In 2 s complement this is -123 An 8-bit two s complement number system can only represent values from -128 to +127.The most significant bit is a sign bit. The above addition causes an overflow ECE152B AU 15

Design a circuit that will detect the occurrence of an overflow for a two scomplement system. The overflow occurs when i) Two position numbers are added & a negative number results; or ii) Two negative numbers are added & a positive number results. SIGN_A SIGN_B ALU_SIGN SIGN_A SIGN_B ALU_SIGN OVER_FLOW ECE152B AU 16

The arithmetic bits included in the status register are set & cleared as directed by the control logic. Not all of the instructions will be allowed to modify the status bits, and some status bits will be modified by more instructions than other bits. ECE152B AU 17

Set_over_bit_L Over_flow_H Strobe_over_H Sys_clk_L clear_over_bit_l Sys_reset_L D S clear Over_flow_bit ECE152B AU 18

Multiplication Iterative multiplication methods Assume 2 5-bit numbers A: A 4 A 3 A 2 A 1 A 0 B: B 4 B 3 B 2 B 1 B 0 P=A B = A B 4 B 3 B 2 B 1 B 0 = A B 4 + 3 + 2 + 1 4 2 A B 3 2 A B 2 2 A B 1 2 + A B 0 2 0 In practice, we can write it as follows: ECE152B AU 19

A4 A3 A2 A1 A0 B4 B3 B2 B1 B0 PP0 A4 B0 A3 B0 A2 B0 A1 B0 A0 B0 PP1 A4 B1 A3 B1 A2 B1 A1 B1 A0 B1 PP PP2 A4 B2 A3 B2 A2 B2 A1 B2 A0 B2 PP3 A4 B3 A3 B3 A2 B3 A1 B3 A0 B3 PP4 A4 B4 A3 B4 A2 B4 A1 B4 A0 B4 PR sum of all rows PP 0 to PP 4 are called partial product arrays. The most straight-forward method for doing the multiply is the traditional shift and add method. ECE152B AU 20

0 MIER_CLK MIER_LD 8 Multiplier Multiplier 01101001 Multiplicand 0 1 0 1 1 0 1 0 PP 0 00000000 PP 1 01101001 PP 2 00000000 8 PP 3 01101001 PP 1 0 1 1 0 1 0 0 1 PP 5 00000000 PP 6 01101001 PP 7 00000000 8 Product 0 0 1 0 0 1 0 0 1 1 1 0 1 0 1 0 shift register Multiplicand PP 4 0 1 1 0 1 0 0 1 prod_clk 1 8 8-bit adder Cout D 0 D 7 D 1 7 7 8-bit register 8-bit register prod_clr D 0 D 7 D 1 7 8 ECE152B AU 21

An 8 8 8 Multiplier: li ECE152B AU 22

An 8-bit adder (2 4-bit 283s) is used to add a partial product array to the accumulating sum stored in a 16-bit register (2 273s). The partial product is created by ANDing the multiplicand with a multiplier bit obtain from a shift register. The shifting of the result is done by hard wiring the accumulating sum to line up with the appropriate p bit positions in the partial product. the timing diagram of the control signals: ECE152B AU 23

MIER_LD-L MIER_CLK-H PROD_CLR-L PROD_CLK-H Clear Product Reg, Load Multiplier Add partial Products to Product Register, Shift Multiplier register to next bit The time required for the multiplication: T MULT = T SETUP +N T ITER ECE152B AU 24

T SETUP : the time required to clear the product register & load the multiplier. T ITER : the time required to created the partial product, to add the partial product to the running sum, and to load the resulting value into the product register. T ITER = T AND +T SUM +T REG ECE152B AU 25