Part III The Arithmetic/Logic Unit

Slides:



Advertisements
Similar presentations
Introduction So far, we have studied the basic skills of designing combinational and sequential logic using schematic and Verilog-HDL Now, we are going.
Advertisements

Chapter 9 Computer Design Basics. 9-2 Datapaths Reminding A digital system (or a simple computer) contains datapath unit and control unit. Datapath: A.
L10 – Transistors Logic Math 1 Comp 411 – Spring /22/07 Arithmetic Circuits Didn’t I learn how to do addition in the second grade?
Datorteknik ArithmeticCircuits bild 1 Computer arithmetic Somet things you should know about digital arithmetic: Principles Architecture Design.
ECE C03 Lecture 61 Lecture 6 Arithmetic Logic Circuits Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Chapter # 5: Arithmetic Circuits Contemporary Logic Design Randy H
Chapter 5 Arithmetic Logic Functions. Page 2 This Chapter..  We will be looking at multi-valued arithmetic and logic functions  Bitwise AND, OR, EXOR,
Jan. 2011Computer Architecture, The Arithmetic/Logic UnitSlide 1 Part III The Arithmetic/Logic Unit.
1. Copyright  2005 by Oxford University Press, Inc. Computer Architecture Parhami2 Figure 10.1 Truth table and schematic diagram for a binary half-adder.
Chapter # 5: Arithmetic Circuits
Chapter 6-1 ALU, Adder and Subtractor
5-1 Programmable and Steering Logic Chapter # 5: Arithmetic Circuits.
07/19/2005 Arithmetic / Logic Unit – ALU Design Presentation F CSE : Introduction to Computer Architecture Slides by Gojko Babić.
1/8/ L3 Data Path DesignCopyright Joanne DeGroat, ECE, OSU1 ALUs and Data Paths Subtitle: How to design the data path of a processor.
1 CPSC3850 Adders and Simple ALUs Simple Adders Figures 10.1/10.2 Binary half-adder (HA) and full-adder (FA). Digit-set interpretation: {0, 1}
July 2005Computer Architecture, The Arithmetic/Logic UnitSlide 1 Part III The Arithmetic/Logic Unit.
Computer Architecture, The Arithmetic/Logic UnitSlide 1 Part III The Arithmetic/Logic Unit.
CDA 3101 Fall 2013 Introduction to Computer Organization The Arithmetic Logic Unit (ALU) and MIPS ALU Support 20 September 2013.
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.
1. 2 Figure 10.1 Truth table and schematic diagram for a binary half-adder Simple Adders Half-adder.
Lecture #23: Arithmetic Circuits-1 Arithmetic Circuits (Part I) Randy H. Katz University of California, Berkeley Fall 2005.
Carry-Lookahead & Carry-Select Adders
Computer Arthmetic Chapter Four P&H.
Combinational Circuits
Somet things you should know about digital arithmetic:
Subtitle: How to design the data path of a processor.
Lecture Adders Half adder.
Computer Design Basics
Swamynathan.S.M AP/ECE/SNSCT
Addition and multiplication
Morgan Kaufmann Publishers The Processor
Computer Organization and Design Arithmetic & Logic 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.
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
Computer Organization and Design Arithmetic & Logic Circuits
Topics Number representation. Shifters. Adders and ALUs.
Computer Organization and Design Arithmetic & Logic Circuits
ECE 331 – Digital System Design
CSE Winter 2001 – Arithmetic Unit - 1
Topic 3b Computer Arithmetic: ALU Design
Arithmetic Functions & Circuits
Computer Organization and Design Arithmetic & Logic Circuits
Instructor: Alexander Stoytchev
Arithmetic Circuits (Part I) Randy H
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Topic 3b Computer Arithmetic: ALU Design
CS 140 Lecture 14 Standard Combinational Modules
Chapter 5 – Number Representation and Arithmetic Circuits
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
Instructor: Alexander Stoytchev
Computer Design Basics
Addition and multiplication
ECE 352 Digital System Fundamentals
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Combinational Circuits
ECE 352 Digital System Fundamentals
Lecture 9 Digital VLSI System Design Laboratory
Carry-Lookahead, Carry-Select, & Hybrid Adders
Carry-Lookahead, Carry-Select, & Hybrid Adders
Carry-Lookahead & Carry-Select Adders
Instruction execution and ALU
Lecture 3 Combinational units. Adders
Arithmetic and Logic Circuits
Presentation transcript:

Part III The Arithmetic/Logic Unit July 2005 Computer Architecture, The Arithmetic/Logic Unit

III The Arithmetic/Logic Unit Overview of computer arithmetic and ALU design: Review representation methods for signed integers Discuss algorithms & hardware for arithmetic ops Consider floating-point representation & arithmetic Topics in This Part Chapter 9 Number Representation Chapter 10 Adders and Simple ALUs Chapter 11 Multipliers and Dividers Chapter 12 Floating-Point Arithmetic July 2005 Computer Architecture, The Arithmetic/Logic Unit

Computer Architecture, The Arithmetic/Logic Unit 10 Adders and Simple ALUs Addition is the most important arith operation in computers: Even the simplest computers must have an adder An adder, plus a little extra logic, forms a simple ALU Topics in This Chapter 10.1 Simple Adders 10.2 Carry Propagation Networks 10.3 Counting and Incrementation 10.4 Design of Fast Adders 10.5 Logic and Shift Operations 10.6 Multifunction ALUs July 2005 Computer Architecture, The Arithmetic/Logic Unit

Computer Architecture, The Arithmetic/Logic Unit 10.1 Simple Adders Digit-set interpretation: {0, 1} + {0, 1} = {0, 2} + {0, 1} (x + y = c + s) Digit-set interpretation: {0, 1} + {0, 1} + {0, 1} = {0, 2} + {0, 1} (x + y + cin = cout + s) Figures 10.1/10.2 Binary half-adder (HA) and full-adder (FA). July 2005 Computer Architecture, The Arithmetic/Logic Unit

Full-Adder Implementations Figure10.3 Full adder implemented with two half-adders, by means of two 4-input multiplexers, and as two-level gate network. July 2005 Computer Architecture, The Arithmetic/Logic Unit

Ripple-Carry Adder: Slow But Simple Critical path Figure 10.4 Ripple-carry binary adder with 32-bit inputs and output. July 2005 Computer Architecture, The Arithmetic/Logic Unit

10.2 Carry Propagation Networks gi = xi yi pi = xi  yi Figure 10.5 The main part of an adder is the carry network. The rest is just a set of gates to produce the g and p signals and the sum bits. July 2005 Computer Architecture, The Arithmetic/Logic Unit

Ripple-Carry Adder Revisited The carry recurrence: ci+1 = gi  pi ci Latency of k-bit adder is roughly 2k gate delays: 1 gate delay for production of p and g signals, plus 2(k – 1) gate delays for carry propagation, plus 1 XOR gate delay for generation of the sum bits Figure 10.6 The carry propagation network of a ripple-carry adder. July 2005 Computer Architecture, The Arithmetic/Logic Unit

First Carry Speed-Up Method: Carry Skip Figures 10.7/10.8 A 4-bit section of a ripple-carry network with skip paths and the driving analogy. July 2005 Computer Architecture, The Arithmetic/Logic Unit

Θ(log n)-time Recursive Wired-OR Carry-Skip Adder (8 bit segment shown) With this recursive structure, we can do a 2n-bit add in 2(n+1) logic levels. Hardware overhead is < 2× regular ripple-carry! Cin S A B S A B S A B S A B S A B S A B S A B S A B G Cin GCoutCin G Cin GCoutCin G Cin GCoutCin G Cin GCoutCin P P P P P P P P Pms Gls Pls Pms Gls Pls Pms Gls Pls Pms Gls Pls MS LS MS G GCout Cin G LS GCout Cin P P P P Pms Gls Pls Pms Gls Pls MS G LS GCout Cin P P Pms Gls Pls GCout LS Cin P

10.3 Counting and Incrementation Figure 10.9 Schematic diagram of an initializable synchronous counter. July 2005 Computer Architecture, The Arithmetic/Logic Unit

Circuit for Incrementation by 1 Substantially simpler than an adder Figure 10.10 Carry propagation network and sum logic for an incrementer. July 2005 Computer Architecture, The Arithmetic/Logic Unit

Computer Architecture, The Arithmetic/Logic Unit 10.4 Design of Fast Adders  Carries can be computed directly without propagation  For example, by unrolling the equation for c3, we get: c3 = g2  p2 c2 = g2  p2 g1  p2 p1 g0  p2 p1 p0 c0  We define “generate” and “propagate” signals for a block extending from bit position a to bit position b as follows: g[a,b] = gb  pb gb–1  pb pb–1 gb–2  . . .  pb pb–1 … pa+1 ga p[a,b] = pb pb–1 . . . pa+1 pa  Combining g and p signals for adjacent blocks: g[h,j] = g[i+1,j]  p[i+1,j] g[h,i] p[h,j] = p[i+1,j] p[h,i] h i i+1 j [h, j] = [i + 1, j] ¢ [h, i] July 2005 Computer Architecture, The Arithmetic/Logic Unit

Second Carry Speed-Up Method: Carry Lookahead [a,b]= For bits from positions a through b Figure 10.11 Brent-Kung lookahead carry network for an 8-digit adder, along with details of one of the carry operator blocks. July 2005 Computer Architecture, The Arithmetic/Logic Unit

Recursive Structure of Brent-Kung Carry Network Figure 10.12 Brent-Kung lookahead carry network for an 8-digit adder, with only its top and bottom rows of carry-operators shown. July 2005 Computer Architecture, The Arithmetic/Logic Unit

Carry-Lookahead Logic with 4-Bit Block Figure 10.13 Blocks needed in the design of carry-lookahead adders with four-way grouping of bits. July 2005 Computer Architecture, The Arithmetic/Logic Unit

Third Carry Speed-Up Method: Carry Select Allows doubling of adder width with a single-mux additional delay (Carry in to position a) Figure 10.14 Carry-select addition principle. July 2005 Computer Architecture, The Arithmetic/Logic Unit

10.5 Logic and Shift Operations Conceptually, shifts can be implemented by multiplexing Figure 10.15 Multiplexer-based logical shifting unit. July 2005 Computer Architecture, The Arithmetic/Logic Unit

Computer Architecture, The Arithmetic/Logic Unit Arithmetic Shifts Purpose: Multiplication and division by powers of 2 sra $t0,$s1,2 # $t0  ($s1) right-shifted by 2 srav $t0,$s1,$s0 # $t0  ($s1) right-shifted by ($s0) Figure 10.16 The two arithmetic shift instructions of MiniMIPS. July 2005 Computer Architecture, The Arithmetic/Logic Unit

Practical Shifting in Multiple Stages Figure 10.17 Multistage shifting in a barrel shifter. July 2005 Computer Architecture, The Arithmetic/Logic Unit

Bit Manipulation via Shifts and Logical Operations AND with mask to isolate a field: 0000 0000 0000 0000 1111 1100 0000 0000 Right-shift by 10 positions to move field to the right end of word The result word ranges from 0 to 63, depending on the field pattern Figure 10.18 A 4  8 block of a black-and-white image represented as a 32-bit word.   July 2005 Computer Architecture, The Arithmetic/Logic Unit

Computer Architecture, The Arithmetic/Logic Unit 10.6 Multifunction ALUs Logic fn (AND, OR, . . .) Logic unit Arith 1 Operand 1 Result Operand 2 Select fn type (logic or arith) Arith fn (add, sub, . . .) General structure of a simple arithmetic/logic unit. July 2005 Computer Architecture, The Arithmetic/Logic Unit

Computer Architecture, The Arithmetic/Logic Unit An ALU for MiniMIPS Figure 10.19 A multifunction ALU with 8 control signals (2 for function class, 1 arithmetic, 3 shift, 2 logic) specifying the operation. July 2005 Computer Architecture, The Arithmetic/Logic Unit