DOC PREVIEW
Berkeley COMPSCI 152 - Lecture 19 – Real Processor Walkthru II

This preview shows page 1-2-3-4-5-6 out of 17 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

UC Regents Fall 2004 © UCBCS 152 L19: Real Processor Walkthru II2004-11-04 Dave Patterson(www.cs.berkeley.edu/~patterson)John Lazzaro (www.cs.berkeley.edu/~lazzaro)CS 152 Computer Architecture and EngineeringLecture 19 – Real Processor Walkthru II www-inst.eecs.berkeley.edu/~cs152/1UC Regents Fall 2004 © UCBCS 152 L19: Real Processor Walkthru IILast Time: Leon, an open-source SPARCRemoval of FPU would reduce area. (power ?cycle time ?).40 mm²0.35μ, 65 MHz2UC Regents Fall 2004 © UCBCS 152 L19: Real Processor Walkthru IIToday: Focus on Leon’s multiplierConfigurable: Leon offers 5 multiplier design options.Mapping: on FPGAs, uses built-in multiplier and fast adder resources.Final Project: All groups must add a multiplier, one design option is a “fast” multiplier.3UC Regents Fall 2004 © UCBCS 152 L19: Real Processor Walkthru IISPARC Unsigned Multiply: UMULUMUL reg_rs1, reg_rs2 or immed, reg_rdGeneral-purpose 32-bit registers13-bit inline constant32 LSBs32 MSBsreg_rdY registerQ. Why use GP register for LSB destination?32*reg_rs13264reg_rs24UC Regents Fall 2004 © UCBCS 152 L19: Real Processor Walkthru IIRecall: Unsigned Multiply AlgorithmTime / Space (resource) Trade-offs• Carry select and CLA utilize more silicon to reduce time.• Can we use more time to reduce silicon?• How few FAs does it take to do addition?Bit-serial Adder• Addition of 2 n-bit numbers:– takes n clock cycles,– uses 1 FF, 1 FA cell, plus registers– the bit streams may come from or go to other circuits, thereforethe registers may be optional.• Requires controller– What does the FSM look like? Implemented?• Final carry out?• A, B, and R held in shift-registers. Shift right once per clock cycle.• Reset is asserted by controller.n-bit shift registern-bit shift registersscresetRFAFFBAlsbAnnouncements• Reading: 5.8• Regrades in with homework on Friday• Digital Design in the news – from UCB– Organic e-textiles (Prof. Vivek Subramanian)Basic concept of multiplication!"#$%&#%'()*!"#$%&#%+,--.-///0-12-.--///0--2--.---.-....--.-3-...----0-4125(,$%(#/&,6*"'$7• product of 2 n-bit numbers is an 2n-bit number– sum of n n-bit partial products• unsignedCombinational Multiplier:accumulation of partial products8.9.8./9.8-9-8-/9.8./9-8:9:8:/9.8-/9-8./9:81918:/9.8:/9-8-/9:8./9181/9-8:/9:8-/9181/9:8:/9181/91;<;=;4;1 ;:;- ;.;>Array Multiplierb3 0 b2 0 b1 0 b0 0P7 P6 P5 P4a00a10a20a30P0P1P2P3FAbjsum insum outcarryoutaicarryinEach row: n-bit adder with AND gatesWhat is the critical path?Generates all n partial products simultaneously.2/11/03 ©UCB Spring 2004CS152 / Kubiatowicz Lec6.21MIPS arithmetic instructions°Instruction Example Meaning Comments°add add $1,$2,$3 $1 = $2 + $3 3 operands; exception possible°subtract sub $1,$2,$3 $1 = $2 – $3 3 operands; exception possible°add immediate addi $1,$2,100 $1 = $2 + 100 + constant; exception possible°add unsigned addu $1,$2,$3 $1 = $2 + $3 3 operands; no exceptions°subtract unsigned subu $1,$2,$3 $1 = $2 – $3 3 operands; no exceptions°add imm. unsign. addiu $1,$2,100 $1 = $2 + 100 + constant; no exceptions°multiply mult $2,$3 Hi, Lo = $2 x $3 64-bit signed product°multiply unsigned multu$2,$3 Hi, Lo = $2 x $3 64-bit unsigned product°divide div $2,$3 Lo = $2 ÷ $3, Lo = quotient, Hi = remainder °Hi = $2 mod $3 °divide unsigned divu $2,$3 Lo = $2 ÷ $3, Unsigned quotient & remainder °Hi = $2 mod $3°Move from Hi mfhi $1 $1 = Hi Used to get copy of Hi°Move from Lo mflo $1 $1 = Lo Used to get copy of Lo2/11/03 ©UCB Spring 2004CS152 / Kubiatowicz Lec6.22MULTIPLY (unsigned)°Paper and pencil example (unsigned):Multiplicand 1000Multiplier 10011000000000001000 Product 01001000°m bits x n bits = m+n bit product°Binary makes it easy:•0 => place 0 ( 0 x multiplicand)•1 => place a copy ( 1 x multiplicand)°4 versions of multiply hardware & algorithm: •successive refinement2/11/03 ©UCB Spring 2004CS152 / Kubiatowicz Lec6.23Unsigned Combinational MultiplierB0A0A1A2A3A0A1A2A3A0A1A2A3A0A1A2A3B1B2B3P0P1P2P3P4P5P6P700 00°Stage i accumulates A * 2 iif Bi== 1°Q: How much hardware for 32 bit multiplier? Critical path?2/11/03 ©UCB Spring 2004CS152 / Kubiatowicz Lec6.24How does it work?A0A1A2A3A0A1A2A300 00000B0A0A1A2A3B1B2A0A1A2A3B3P6°At each stage shift A left ( x 2)°Use next bit of B to determine whether to add in shifted multiplicand°Accumulate 2n bit partial product at each stageP0P1P2P7P5P4P3Facts to remember5UC Regents Fall 2004 © UCBCS 152 L19: Real Processor Walkthru IIDesign #1: Spatially compute A x B = PCinCoutx yzs1-bit signals: x, y, z, s, Cin, CoutIf z = 1, {Cout, s} <= x + y + CinIf z = 0, {Cout, s} <= y + Cin6UC Regents Fall 2004 © UCBCS 152 L19: Real Processor Walkthru IIArray to compute A x B = P2/11/03 ©UCB Spring 2004CS152 / Kubiatowicz Lec6.21MIPS arithmetic instructions°Instruction Example Meaning Comments°add add $1,$2,$3 $1 = $2 + $3 3 operands; exception possible°subtract sub $1,$2,$3 $1 = $2 – $3 3 operands; exception possible°add immediate addi $1,$2,100 $1 = $2 + 100 + constant; exception possible°add unsigned addu $1,$2,$3 $1 = $2 + $3 3 operands; no exceptions°subtract unsigned subu $1,$2,$3 $1 = $2 – $3 3 operands; no exceptions°add imm. unsign. addiu $1,$2,100 $1 = $2 + 100 + constant; no exceptions°multiply mult $2,$3 Hi, Lo = $2 x $3 64-bit signed product°multiply unsigned multu$2,$3 Hi, Lo = $2 x $3 64-bit unsigned product°divide div $2,$3 Lo = $2 ÷ $3, Lo = quotient, Hi = remainder °Hi = $2 mod $3 °divide unsigned divu $2,$3 Lo = $2 ÷ $3, Unsigned quotient & remainder °Hi = $2 mod $3°Move from Hi mfhi $1 $1 = Hi Used to get copy of Hi°Move from Lo mflo $1 $1 = Lo Used to get copy of Lo2/11/03 ©UCB Spring 2004CS152 / Kubiatowicz Lec6.22MULTIPLY (unsigned)°Paper and pencil example (unsigned):Multiplicand 1000Multiplier 10011000000000001000 Product 01001000°m bits x n bits = m+n bit product°Binary makes it easy:•0 => place 0 ( 0 x multiplicand)•1 => place a copy ( 1 x multiplicand)°4 versions of multiply hardware & algorithm: •successive refinement2/11/03 ©UCB Spring 2004CS152 / Kubiatowicz Lec6.23Unsigned Combinational MultiplierB0A0A1A2A3A0A1A2A3A0A1A2A3A0A1A2A3B1B2B3P0P1P2P3P4P5P6P700 00°Stage i accumulates A * 2 iif Bi== 1°Q: How much hardware for 32 bit multiplier? Critical path?2/11/03 ©UCB Spring 2004CS152 / Kubiatowicz Lec6.24How does it


View Full Document

Berkeley COMPSCI 152 - Lecture 19 – Real Processor Walkthru II

Documents in this Course
Quiz 5

Quiz 5

9 pages

Memory

Memory

29 pages

Quiz 5

Quiz 5

15 pages

Memory

Memory

29 pages

Memory

Memory

35 pages

Memory

Memory

15 pages

Quiz

Quiz

6 pages

Midterm 1

Midterm 1

20 pages

Quiz

Quiz

12 pages

Memory

Memory

33 pages

Quiz

Quiz

6 pages

Homework

Homework

19 pages

Quiz

Quiz

5 pages

Memory

Memory

15 pages

Load more
Download Lecture 19 – Real Processor Walkthru II
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 19 – Real Processor Walkthru II and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 19 – Real Processor Walkthru II 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?