CS 152 Computer Architecture and Engineering

Size: px
Start display at page:

Download "CS 152 Computer Architecture and Engineering"

Transcription

1 CS 52 Computer Architecture and Engineering Lecture 26 Mid-Term II Review John Lazzaro ( TAs: Udam Saini and Jue Sun www-inst.eecs.berkeley.edu/~cs52/ CS 52 L26: Mid-Term II Review UC Regents Fall 26 UCB

2 CS 52: What s left... Today: HKN, Mid-term II Review. Homework II due in class. Tuesday 2/5: Mid-term II, 6:-9: PM, 36 Soda. No class -2:3 that day. No electronic devices, no notes, leave backpacks in front of class... Thursday 2/7: Final presentations. slides to cs52-staff@cory by :5 PM. CS 52 L26: Mid-Term II Review UC Regents Fall 26 UCB 2

3 Mid-Term Review Session Homework II solutions Solution PDF will be on website soon after class. Study guide for Mid-Term II CS 52 L26: Mid-Term II Review UC Regents Fall 26 UCB 3

4 Q: Multithreading and Forwarding Multithreading (2 points) In class, we showed a 4-way static multithreading architecture. Below we show a variant of this architecture, that supports 2 threads instead of 4 (note the thread select line is only bit wide). The architecture uses load delay and branch delay slots; branch comparison is done in the ID stage, so that control hazards do not occur. To prevent RAW data hazards in this datapath, it is necessary to add forwarding paths. Thus, we have added the two muxes labelled Fwd. Draw in all NECESSARY forwarding paths to the FWD muxes to handle data hazards. ONLY draw in the necessary forwarding paths; DO NOT draw in forwarding paths that are not needed to prevent RAW data hazards. Points will be taken off for each unnecessary forwarding path drawn. CS 52 L26: Mid-Term II Review UC Regents Fall 26 UCB 4

5 Draw only NECESSARY inputs to Fwd muxes Instr Mem IF IR ID (Decode) IR EX IR MEM IR WB Addr Data PC T PC T2 T h d rs rs2 ws wd rs rs2 ws wd RegFile T rd rd2 WE RegFile T2 WE rd rd2 T h d T h d F w d F w d A M op A L U 32 Y M Data Memory Addr Dout Din WE MemToReg R Ext B bit Thread Select 5

6 Q2. Write-back, no write on allocate cache L: LRU bit. L indicates left set (as drawn on page) has been read or written most recently. L indicates right set has been read or written most recently. Setting V does not update L. 2 Cache Tag (28 bits) x Left most recent (L) x2 Index (2 bits) Ex: x 2 6 x x x2 x CS 52 L7: Advanced Processors I Left Right x x2 word 28 bits Writes that miss cache DO 28 bits word NOT allocate cache lines Addr Value Addr Value Addr Value x 2 x 2 x2 2 x4 24 x4 6 x24 6 x8 5 x8 3 x28 7 xc 4 xc 3 x2c 5 Main Memory Addr in hex, values in decimal 7 3 UC Regents Fall 25 UCB 6

7 Instr : SW R 6(R) L: LRU bit. L indicates left set (as drawn on page) has been read or written most recently. L indicates right set has been read or written most recently. Setting V does not update L. 2 Cache Tag (28 bits) x Left most recent (L) x2 Index (2 bits) Ex: x 2 6 x x x2 x CS 52 L7: Advanced Processors I Left Right x x2 word 28 bits Writes that miss cache DO 28 bits word NOT allocate cache lines Addr Value Addr Value Addr Value x 2 x 2 x2 2 x4 24 x4 6 x24 6 x8 5 x8 3 x28 7 xc 4 xc 3 x2c 5 Main Memory Addr in hex, values in decimal 7 3 UC Regents Fall 25 UCB 7

8 Instr : SW R 6(R) L: LRU bit. L indicates left set (as drawn on page) has been read or written most recently. L indicates right set has been read or written most recently. Setting V does not update L. Cache Tag (28 bits) x Left most recent (L) x2 Index (2 bits) Ex: x 2 6 x x x2 x CS 52 L7: Advanced Processors I Left Right x x2 word 28 bits Writes that miss cache DO 28 bits word NOT allocate cache lines Addr Value Addr Value Addr Value x 2 x 2 x2 2 x4 24 x4 6 x24 6 x8 5 x8 3 x28 7 xc 4 xc 3 x2c 5 Main Memory Addr in hex, values in decimal 7 3 UC Regents Fall 25 UCB 8

9 Instr 2: LW R2 2(R) L: LRU bit. L indicates left set (as drawn on page) has been read or written most recently. L indicates right set has been read or written most recently. Setting V does not update L. Cache Tag (28 bits) x Left most recent (L) x2 Index (2 bits) Ex: x 2 6 x x x2 x CS 52 L7: Advanced Processors I Left Right x x2 word 28 bits Writes that miss cache DO 28 bits word NOT allocate cache lines Addr Value Addr Value Addr Value x 2 x 2 x2 2 x4 24 x4 6 x24 6 x8 5 x8 3 x28 7 xc 4 xc 3 x2c 5 Main Memory Addr in hex, values in decimal 7 3 UC Regents Fall 25 UCB 9

10 Instr 2: LW R2 2(R) [no state change] L: LRU bit. L indicates left set (as drawn on page) has been read or written most recently. L indicates right set has been read or written most recently. Setting V does not update L. Cache Tag (28 bits) x Left most recent (L) x2 Index (2 bits) Ex: x 2 6 x x x2 x CS 52 L7: Advanced Processors I Left Right x x2 word 28 bits Writes that miss cache DO 28 bits word NOT allocate cache lines Addr Value Addr Value Addr Value x 2 x 2 x2 2 x4 24 x4 6 x24 6 x8 5 x8 3 x28 7 xc 4 xc 3 x2c 5 Main Memory Addr in hex, values in decimal 7 3 UC Regents Fall 25 UCB

11 Instr 3: LW R2 24(R) L: LRU bit. L indicates left set (as drawn on page) has been read or written most recently. L indicates right set has been read or written most recently. Setting V does not update L. Cache Tag (28 bits) x Left most recent (L) x2 Index (2 bits) Ex: x 2 6 x x x2 x CS 52 L7: Advanced Processors I Left Right x x2 word 28 bits Writes that miss cache DO 28 bits word NOT allocate cache lines Addr Value Addr Value Addr Value x 2 x 2 x2 2 x4 24 x4 6 x24 6 x8 5 x8 3 x28 7 xc 4 xc 3 x2c 5 Main Memory Addr in hex, values in decimal 7 3 UC Regents Fall 25 UCB

12 Instr 3: LW R2 24(R) L: LRU bit. L indicates left set (as drawn on page) has been read or written most recently. L indicates right set has been read or written most recently. Setting V does not update L. Cache Tag (28 bits) x Left most recent (L) x2 Index (2 bits) Ex: x 2 6 x x x2 x CS 52 L7: Advanced Processors I Left Right x x2 word 28 bits Writes that miss cache DO 28 bits word NOT allocate cache lines Addr Value Addr Value Addr Value x 2 x 2 x2 2 x4 24 x4 6 x24 6 x8 7 x8 3 x28 7 xc 4 xc 3 x2c 5 Main Memory Addr in hex, values in decimal 3 3 UC Regents Fall 25 UCB 2

13 Instr 4: LW R22 2(R) L: LRU bit. L indicates left set (as drawn on page) has been read or written most recently. L indicates right set has been read or written most recently. Setting V does not update L. Cache Tag (28 bits) x Left most recent (L) x2 Index (2 bits) Ex: x 2 6 x x x2 x CS 52 L7: Advanced Processors I Left Right x x2 word 28 bits Writes that miss cache DO 28 bits word NOT allocate cache lines Addr Value Addr Value Addr Value x 2 x 2 x2 2 x4 24 x4 6 x24 6 x8 7 x8 3 x28 7 xc 4 xc 3 x2c 5 Main Memory Addr in hex, values in decimal 3 3 UC Regents Fall 25 UCB 3

14 Instr 4: LW R22 2(R) L: LRU bit. L indicates left set (as drawn on page) has been read or written most recently. L indicates right set has been read or written most recently. Setting V does not update L. Cache Tag (28 bits) x Left most recent (L) x2 Index (2 bits) Ex: x 2 6 x x x2 x CS 52 L7: Advanced Processors I Left Right x x2 word 28 bits Writes that miss cache DO 28 bits word NOT allocate cache lines Addr Value Addr Value Addr Value x 2 x 2 x2 2 x4 24 x4 6 x24 6 x8 7 x8 3 x28 7 xc 4 xc 3 x2c 5 Main Memory Addr in hex, values in decimal 3 3 UC Regents Fall 25 UCB 4

15 Instr 5: SW R (R) L: LRU bit. L indicates left set (as drawn on page) has been read or written most recently. L indicates right set has been read or written most recently. Setting V does not update L. Cache Tag (28 bits) x Left most recent (L) x2 Index (2 bits) Ex: x 2 6 x x x2 x CS 52 L7: Advanced Processors I Left Right x x2 word 28 bits Writes that miss cache DO 28 bits word NOT allocate cache lines Addr Value Addr Value Addr Value x 2 x 2 x2 2 x4 24 x4 6 x24 6 x8 7 x8 3 x28 7 xc 4 xc 3 x2c 5 Main Memory Addr in hex, values in decimal 3 3 UC Regents Fall 25 UCB 5

16 Instr 5: SW R (R) L: LRU bit. L indicates left set (as drawn on page) has been read or written most recently. L indicates right set has been read or written most recently. Setting V does not update L. Cache Tag (28 bits) x Left most recent (L) x2 Index (2 bits) Ex: x 2 6 x x x2 x CS 52 L7: Advanced Processors I Left Right x x2 word 28 bits Writes that miss cache DO 28 bits word NOT allocate cache lines Addr Value Addr Value Addr Value x x 2 x2 2 x4 24 x4 6 x24 6 x8 7 x8 3 x28 7 xc 4 xc 3 x2c 5 Main Memory Addr in hex, values in decimal 3 3 UC Regents Fall 25 UCB 6

17 Q2. Answer (red numbers from last slide) L: LRU bit. L indicates left set (as drawn on page) has been read or written most recently. L indicates right set has been read or written most recently. Setting V does not update L. Cache Tag (28 bits) Left most recent (L) Index (2 bits) Ex: x 4 x CS 52 L7: Advanced Processors I Left Right x 3 word 28 bits Writes that miss cache DO 28 bits word NOT allocate cache lines Addr Value Addr Value Addr Value x x x2 x4 x4 x24 x8 7 x8 x28 Main Memory Addr in hex, values in decimal xc xc x2c UC Regents Fall 25 UCB 7

18 Q3: Finish specifying this Hamming Code data bits 4 parity bits DD9D8D7D6D5D4D₃D₂D₁D₀ P3P₂P₁P₀ Use this word bit arrangement C3C₂C₁C₀ D D9 D8 D7 D6 D5 D4 P3 D₃ D₂ D₁ P₂ D₀ P₁ P₀ signals the flipped bit position. P3 Fill in the equations for P, P2, P3 P₂ P₁ P₀ D xor D8 xor D6 xor D4 xor D₃ xor D₁ xor D₀ 8

19 Q3 Answer: Done by analysis of C3C₂C₁C₀ data bits 4 parity bits DD9D8D7D6D5D4D₃D₂D₁D₀ P3P₂P₁P₀ Use this word bit arrangement D D9 D8 D7 D6 D5 D4 P3 D₃ D₂ D₁ P₂ D₀ P₁ P₀ C3C₂C₁C₀ signals the flipped bit position. Fill in the equations for P, P2, P3 P3 D xor D9 xor D8 xor D7 xor D6 xor D5 xor D4 P2 D xor D9 xor D8 xor D7 xor D3 xor D2 xor D P D xor D9 xor D6 xor D5 xor D3 xor D2 xor D P₀ D xor D8 xor D6 xor D4 xor D₃ xor D₁ xor D₀ 9

20 line index b b b b Q4: Simple branch predictor Address of BNEZ instruction b[...] BNEZ R Loop target address 2 bits Branch Target Buffer (BTB) 28-bit address tag 28 bits b[...] PC Loop Branch History Table (BHT) N L Update BHT once taken/ not taken status is known CS 52 L7: Advanced Processors I On a miss, replace BTB for the line with the new branch tag & target. Next slide defines initial BHT N and L. UC Regents Fall 25 UCB 2

21 Simple ( 2-bit ) Branch History State N bit Prediction for Next branch ( take, not take) L bit Was Last prediction correct? ( yes, no) D Q D Q N L old N old L branch new N new L not taken taken not taken taken not taken taken not taken taken When replacing the tag value for a line, initialize branch history state to (N, L ) (for taken branches) or to (N, L ) (for not taken branches). 2

22 Branch predictor state before first inst. in trace executes 28-bit address tag x x 3 x 5 x 7 target address PC Lab PC Lab4 PC Lab6 PC Lab8 N L line index b b b b x BEQ R R2 Lab Taken x PC Lab b x 3 PC Lab4 b x 5 PC Lab6 b x 7 PC Lab8 b 22

23 x PC Lab b x 3 PC Lab4 b x 5 PC Lab6 b x 7 PC Lab8 b 2 x 34 BEQ R7 R8 Lab4 Not Taken x PC Lab b x 3 PC Lab4 b x 5 PC Lab6 b x 7 PC Lab8 b 23

24 x PC Lab b x 3 PC Lab4 b x 5 PC Lab6 b x 7 PC Lab8 b 3 x 6C BEQ R3 R4 Lab7 Not Taken x PC Lab b x 3 PC Lab4 b x 5 PC Lab6 b x 6 PC Lab7 b 24

25 x PC Lab b x 3 PC Lab4 b x 5 PC Lab6 b x 6 PC Lab7 b 4 x 58 BEQ R R2 Lab6 Taken x PC Lab b x 3 PC Lab4 b x 5 PC Lab6 b x 6 PC Lab7 b 25

26 x PC Lab b x 3 PC Lab4 b x 5 PC Lab6 b x 6 PC Lab7 b 5 x 2 BNE R5 R6 Lab3 Taken x 2 PC Lab3 b x 3 PC Lab4 b x 5 PC Lab6 b x 6 PC Lab7 b 26

27 x 2 PC Lab3 b x 3 PC Lab4 b x 5 PC Lab6 b x 6 PC Lab7 b 6 x 34 BEQ R7 R8 Lab4 Taken x 2 PC Lab3 b x 3 PC Lab4 b x 5 PC Lab6 b x 6 PC Lab7 b 27

28 x 2 PC Lab3 b x 3 PC Lab4 b x 5 PC Lab6 b x 6 PC Lab7 b 7 x 6C BEQ R3 R4 Lab7 Not Taken Q4 Answer: Branch predictor state after 7 branches complete x 2 x 3 x 5 x 6 PC Lab3 PC Lab4 PC Lab6 PC Lab7 b b b b 28

29 Q5. Router switch arbitration... Line Line Engine Inputs A B C Switch Outputs A B C Line Line Engine Line D D Line A pipelined arbitration system decides how to connect up the switch. The connections for the transfer at epoch N are computer in epochs N-3, N-2 and N-, using dedicated switch allocation wires. CS 52 L22: Routers UC Regents Fall 25 UCB 29

30 How traditional port allocation works Input Ports (A, B, C, D) Output Ports (A, B, C, D) A B C D A B C D A codes that an input has a packet ready to send to an output. Note an input may have several packets ready. Allocator returns a matrix with at most one in each row and column to set switches. Algorithm should be fair, so no port always loses... should also scale to run large matrices fast. CS 52 L22: Routers A B C D A B C D UC Regents Fall 25 UCB 3

31 Q5: Unusual Switch Fabric Port Allocation Switch Input Ports A B C D E Switch Output Ports A B C D E A 2 B 2 C D 2 2 E 2 2 A B C D E Fill in the allocation with the most highpriority packet transfers A 2 codes that an input has a high-priority packet ready to send to an output. A codes that an input has a low-priority packet ready to send to an output. A codes no packet to send. A B C D E A B C D E Fill in the allocation that transfers the most packets of any priority No need to fill in s, just show s (at most, one per row, one per column). 3

32 Q5 Answers: Port Allocations Switch Input Ports Switch Output Ports A B C D E A 2 B 2 C D 2 2 E 2 2 A B C D E A B C D E Fill in the allocation with the most highpriority packet transfers A 2 codes that an input has a high-priority packet ready to send to an output. A codes that an input has a low-priority packet ready to send to an output. A codes no packet to send. A B C D E A B C D E Fill in the allocation that transfers the most packets of any priority No need to fill in s, just show s (at most, one per row, one per column). 32

33 Tail of List Q6. Reorder Buffer: Initial Values... 7: ADD R3 R R2 8: SUB R3 R3 R 9: ADD R4 R2 R3 : SUB R5 R3 R4 : SUB R5 R3 R5 Head of List Next inst in program goes here. Question 6a (3 points). By examining the issue logic setup, fill in the values of the architected registers below, at the moment BEFORE instruction 7 executes: R R2 R R2 2 Inst # Op U E # #2 #d P P2 Pd P value Physical register numbers bits for values P2 value Pd value 7 ADD SUB ADD SUB Physical register values (in decimal) 33

34 Tail of List Q6b. Trace through instructions... Head of List Next inst in program goes here. 7: ADD R3 R R2 8: SUB R3 R3 R 9: ADD R4 R2 R3 : SUB R5 R3 R4 : SUB R5 R3 R5 Inst # Op U E # #2 #d P P2 Pd P value Physical register numbers bits for values P2 value Pd value 7 ADD SUB ADD SUB Physical register values (in decimal) 34

35 Tail of List Q6b. Trace through instructions... Head of List Next inst in program goes here. 7: ADD R3 R R2 8: SUB R3 R3 R 9: ADD R4 R2 R3 : SUB R5 R3 R4 : SUB R5 R3 R5 Inst # Op U E # #2 #d P P2 Pd P value Physical register numbers bits for values P2 value Pd value 7 ADD SUB ADD SUB Physical register values (in decimal) 35

36 Tail of List Q6b. Trace through instructions... Head of List Next inst in program goes here. 7: ADD R3 R R2 8: SUB R3 R3 R 9: ADD R4 R2 R3 : SUB R5 R3 R4 : SUB R5 R3 R5 Inst # Op U E # #2 #d P P2 Pd P value Physical register numbers bits for values P2 value Pd value 7 ADD SUB ADD SUB Physical register values (in decimal) 36

37 Tail of List Q6b. Trace through instructions... Head of List Next inst in program goes here. 7: ADD R3 R R2 8: SUB R3 R3 R 9: ADD R4 R2 R3 : SUB R5 R3 R4 : SUB R5 R3 R5 Inst # Op U E # #2 #d P P2 Pd P value Physical register numbers bits for values P2 value Pd value 7 ADD SUB ADD SUB Physical register values (in decimal) 37

38 Tail of List Q6c: Add Inst # line for: SUB R5 R3 R5 Head of List Next inst in program goes here. 7: ADD R3 R R2 8: SUB R3 R3 R 9: ADD R4 R2 R3 : SUB R5 R3 R4 : SUB R5 R3 R5 Inst # Op U E # #2 #d P P2 Pd P value P2 value Pd value 7 ADD SUB ADD SUB SUB Physical register numbers bits for values Physical register values (in decimal) 38

39 Name: CS52 Midterm 2 December 5th, 26 # Points of problems, points per problem subject to change! SSID: All the work is my own. I have no prior knowledge of the exam contents, aside from guidance from class staff. I will not share the contents with others in CS52 who have not taken it yet. Signature: Please write clearly, and put your name on each page. Please abide by word limits. Good luck! Udam Saini Jue Sun John Lazzaro Tot 39

40 Mid-Term II Facts... Eight problems But we might drop a few. Shorter problems Goal is a -page test. More Fill in the blank Fewer partial credit chances. Easier than Mid-term I Expect a mix of easier and harder problems. CS 52 L26: Mid-Term II Review # Points Tot UC Regents Fall 26 UCB 4

41 Part I: Cache and TLB Design Typical Topics Simulate a cache or a TLB by hand (like HW). Design a part of a cache to meet a specification. Design a part of a TLB to meet a specification. # Points Tot CS 52 L: Midterm I Review UC Regents Fall 26 UCB 4

42 Part II: ECC math and applications Typical Topics Hamming Code Math Parity Code Math Checksum Math Apply this math to one of a topics. # Points Tot CS 52 L: Midterm I Review UC Regents Fall 26 UCB 42

43 Part III: Advanced Processors Typical Topics Pipelining Memory Interleaving Superpipelining Pipelining ALUs Superscalar Dynamic Scheduling Out of Order Execution Exceptions Multithreading Multicore CS 52 L: Midterm I Review # Points Tot UC Regents Fall 26 UCB 43

44 Part IV: Synchronization, Multiprocessors # Points Typical Topics 2 5 Sequential Consistency Critical Sections Cache Coherency Clusters Tot CS 52 L: Midterm I Review UC Regents Fall 26 UCB 44

45 Administrivia: Mid-term I... Starts at 6PM in 36 Soda. No class on Tuesday Assigned seating: Look for your namecard on the desk. Put all electronic devices (cell phones, caclulators, PDAs, computers) at the front of the room. Put bookbags and other personal belongings at the front of the room. CS 52 L: Midterm I Review UC Regents Fall 26 UCB 45

46 Administrivia: Mid-term I... Starts at 6PM in 36 Soda. No class on Tuesday Just writing implements at your desk (pencils, pens, erasers, etc). Test problems include useful information for the problems so, no one sheet of paper allowed for this test. You won t be able to bring one to job interviews either... CS 52 L: Midterm I Review UC Regents Fall 26 UCB 46

47 CS 52: Good luck on the mid-term! Today: HKN, Mid-term II Review. Homework II due in class. Tuesday 2/5: Mid-term II, 6:-9: PM, 36 Soda. No class -2:3 that day. No electronic devices, no notes, leave backpacks in front of class... Thursday 2/7: Final presentations. slides to by :5 PM. CS 52 L26: Mid-Term II Review UC Regents Fall 26 UCB 47

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer Architecture and Engineering Lecture 7 Pipelining I 2005-9-20 John Lazzaro (www.cs.berkeley.edu/~lazzaro) TAs: David Marquardt and Udam Saini www-inst.eecs.berkeley.edu/~cs152/ Office Hours

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer Architecture and Engineering Lecture 18 Advanced Processors II 2006-10-31 John Lazzaro (www.cs.berkeley.edu/~lazzaro) Thanks to Krste Asanovic... TAs: Udam Saini and Jue Sun www-inst.eecs.berkeley.edu/~cs152/

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer Architecture and Engineering Lecture 7 Pipelining I 2006-9-19 John Lazzaro (www.cs.berkeley.edu/~lazzaro) TAs: Udam Saini and Jue Sun www-inst.eecs.berkeley.edu/~cs152/ Last Time: ipod

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer Architecture and Engineering Lecture 17 Advanced Processors I 2005-10-27 John Lazzaro (www.cs.berkeley.edu/~lazzaro) TAs: David Marquardt and Udam Saini www-inst.eecs.berkeley.edu/~cs152/

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer Architecture and Engineering Lecture 6 Superpipelining + Branch Prediction 2014-2-6 John Lazzaro (not a prof - John is always OK) TA: Eric Love www-inst.eecs.berkeley.edu/~cs152/ Play:

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer Architecture and Engineering Lecture 26 -- Midterm II Review Session 2014-4-29 John Lazzaro (not a prof - John is always OK) TA: Eric Love www-inst.eecs.berkeley.edu/~cs152/ Play: CS 152

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer Architecture and Engineering Lecture 20 Advanced Processors I 2005-4-5 John Lazzaro (www.cs.berkeley.edu/~lazzaro) TAs: Ted Hong and David Marquardt www-inst.eecs.berkeley.edu/~cs152/ Last

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 52 Computer Architecture and Engineering Lecture 6 -- Midterm I Review Session 204-3-3 John Lazzaro (not a prof - John is always OK) TA: Eric Love www-inst.eecs.berkeley.edu/~cs52/ Play: CS 52 L6: Midterm

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer Architecture and Engineering Lecture 22 Advanced Processors III 2005-4-12 John Lazzaro (www.cs.berkeley.edu/~lazzaro) TAs: Ted Hong and David Marquardt www-inst.eecs.berkeley.edu/~cs152/

More information

/ : Computer Architecture and Design Fall Midterm Exam October 16, Name: ID #:

/ : Computer Architecture and Design Fall Midterm Exam October 16, Name: ID #: 16.482 / 16.561: Computer Architecture and Design Fall 2014 Midterm Exam October 16, 2014 Name: ID #: For this exam, you may use a calculator and two 8.5 x 11 double-sided page of notes. All other electronic

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer rchitecture and Engineering Lecture 10 Pipelining III 2005-2-17 John Lazzaro (www.cs.berkeley.edu/~lazzaro) Ts: Ted Hong and David arquardt www-inst.eecs.berkeley.edu/~cs152/ Last time:

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer Architecture and Engineering Lecture 19 Advanced Processors III 2006-11-2 John Lazzaro (www.cs.berkeley.edu/~lazzaro) TAs: Udam Saini and Jue Sun www-inst.eecs.berkeley.edu/~cs152/ 1 Last

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer Architecture and Engineering Lecture 14 - Cache Design and Coherence 2014-3-6 John Lazzaro (not a prof - John is always OK) TA: Eric Love www-inst.eecs.berkeley.edu/~cs152/ Play: 1 Today:

More information

CS 61C: Great Ideas in Computer Architecture Pipelining and Hazards

CS 61C: Great Ideas in Computer Architecture Pipelining and Hazards CS 61C: Great Ideas in Computer Architecture Pipelining and Hazards Instructors: Vladimir Stojanovic and Nicholas Weaver http://inst.eecs.berkeley.edu/~cs61c/sp16 1 Pipelined Execution Representation Time

More information

CS 152 Computer Architecture and Engineering Lecture 4 Pipelining

CS 152 Computer Architecture and Engineering Lecture 4 Pipelining CS 152 Computer rchitecture and Engineering Lecture 4 Pipelining 2014-1-30 John Lazzaro (not a prof - John is always OK) T: Eric Love www-inst.eecs.berkeley.edu/~cs152/ Play: 1 otorola 68000 Next week

More information

EECS Digital Design

EECS Digital Design EECS 150 -- Digital Design Lecture 11-- Processor Pipelining 2010-2-23 John Wawrzynek Today s lecture by John Lazzaro www-inst.eecs.berkeley.edu/~cs150 1 Today: Pipelining How to apply the performance

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer Architecture and Engineering Lecture 27 Multiprocessors 2005-4-28 John Lazzaro (www.cs.berkeley.edu/~lazzaro) TAs: Ted Hong and David Marquardt www-inst.eecs.berkeley.edu/~cs152/ Last Time:

More information

Control Hazards - branching causes problems since the pipeline can be filled with the wrong instructions.

Control Hazards - branching causes problems since the pipeline can be filled with the wrong instructions. Control Hazards - branching causes problems since the pipeline can be filled with the wrong instructions Stage Instruction Fetch Instruction Decode Execution / Effective addr Memory access Write-back Abbreviation

More information

CS 152, Spring 2011 Section 2

CS 152, Spring 2011 Section 2 CS 152, Spring 2011 Section 2 Christopher Celio University of California, Berkeley About Me Christopher Celio celio @ eecs Office Hours: Tuesday 1-2pm, 751 Soda Agenda Q&A on HW1, Lab 1 Pipelining Questions

More information

Final Exam Fall 2007

Final Exam Fall 2007 ICS 233 - Computer Architecture & Assembly Language Final Exam Fall 2007 Wednesday, January 23, 2007 7:30 am 10:00 am Computer Engineering Department College of Computer Sciences & Engineering King Fahd

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer Architecture and Engineering Lecture 4 Testing Processors 2005-1-27 John Lazzaro (www.cs.berkeley.edu/~lazzaro) TAs: Ted Hong and David Marquardt www-inst.eecs.berkeley.edu/~cs152/ Last

More information

CS 152 Computer Architecture and Engineering Lecture 1 Single Cycle Design

CS 152 Computer Architecture and Engineering Lecture 1 Single Cycle Design CS 152 Computer Architecture and Engineering Lecture 1 Single Cycle Design 2014-1-21 John Lazzaro (not a prof - John is always OK) TA: Eric Love www-inst.eecs.berkeley.edu/~cs152/ Play: 1 Today s lecture

More information

CS 351 Exam 2, Fall 2012

CS 351 Exam 2, Fall 2012 CS 351 Exam 2, Fall 2012 Your name: Rules You may use one handwritten 8.5 x 11 cheat sheet (front and back). This is the only resource you may consult during this exam. Include explanations and comments

More information

UC Berkeley CS61C : Machine Structures

UC Berkeley CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c UC Berkeley CS61C : Machine Structures Lecture 40 Hardware Parallel Computing 2006-12-06 Thanks to John Lazarro for his CS152 slides inst.eecs.berkeley.edu/~cs152/ Head TA

More information

CS/CoE 1541 Mid Term Exam (Fall 2018).

CS/CoE 1541 Mid Term Exam (Fall 2018). CS/CoE 1541 Mid Term Exam (Fall 2018). Name: Question 1: (6+3+3+4+4=20 points) For this question, refer to the following pipeline architecture. a) Consider the execution of the following code (5 instructions)

More information

CS 61C: Great Ideas in Computer Architecture. MIPS CPU Datapath, Control Introduction

CS 61C: Great Ideas in Computer Architecture. MIPS CPU Datapath, Control Introduction CS 61C: Great Ideas in Computer Architecture MIPS CPU Datapath, Control Introduction Instructor: Alan Christopher 7/28/214 Summer 214 -- Lecture #2 1 Review of Last Lecture Critical path constrains clock

More information

/ : Computer Architecture and Design Fall 2014 Midterm Exam Solution

/ : Computer Architecture and Design Fall 2014 Midterm Exam Solution 16.482 / 16.561: Computer Architecture and Design Fall 2014 Midterm Exam Solution 1. (8 points) UEvaluating instructions Assume the following initial state prior to executing the instructions below. Note

More information

CS 110 Computer Architecture. Pipelining. Guest Lecture: Shu Yin. School of Information Science and Technology SIST

CS 110 Computer Architecture. Pipelining. Guest Lecture: Shu Yin.   School of Information Science and Technology SIST CS 110 Computer Architecture Pipelining Guest Lecture: Shu Yin http://shtech.org/courses/ca/ School of Information Science and Technology SIST ShanghaiTech University Slides based on UC Berkley's CS61C

More information

CS152 Computer Architecture and Engineering. Lecture 15 Virtual Memory Dave Patterson. John Lazzaro. www-inst.eecs.berkeley.

CS152 Computer Architecture and Engineering. Lecture 15 Virtual Memory Dave Patterson. John Lazzaro. www-inst.eecs.berkeley. CS152 Computer Architecture and Engineering Lecture 15 Virtual Memory 2004-10-21 Dave Patterson (www.cs.berkeley.edu/~patterson) John Lazzaro (www.cs.berkeley.edu/~lazzaro) www-inst.eecs.berkeley.edu/~cs152/

More information

Question 1: (20 points) For this question, refer to the following pipeline architecture.

Question 1: (20 points) For this question, refer to the following pipeline architecture. This is the Mid Term exam given in Fall 2018. Note that Question 2(a) was a homework problem this term (was not a homework problem in Fall 2018). Also, Questions 6, 7 and half of 5 are from Chapter 5,

More information

CS420/520 Homework Assignment: Pipelining

CS420/520 Homework Assignment: Pipelining CS42/52 Homework Assignment: Pipelining Total: points. 6.2 []: Using a drawing similar to the Figure 6.8 below, show the forwarding paths needed to execute the following three instructions: Add $2, $3,

More information

Outline. Lecture 40 Hardware Parallel Computing Thanks to John Lazarro for his CS152 slides inst.eecs.berkeley.

Outline. Lecture 40 Hardware Parallel Computing Thanks to John Lazarro for his CS152 slides inst.eecs.berkeley. CS61C L40 Hardware Parallel Computing (1) inst.eecs.berkeley.edu/~cs61c UC Berkeley CS61C : Machine Structures Lecture 40 Hardware Parallel Computing 2006-12-06 Thanks to John Lazarro for his CS152 slides

More information

CS252 Graduate Computer Architecture Midterm 1 Solutions

CS252 Graduate Computer Architecture Midterm 1 Solutions CS252 Graduate Computer Architecture Midterm 1 Solutions Part A: Branch Prediction (22 Points) Consider a fetch pipeline based on the UltraSparc-III processor (as seen in Lecture 5). In this part, we evaluate

More information

Chapter 4. The Processor

Chapter 4. The Processor Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware We will examine two MIPS implementations A simplified

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer Architecture and Engineering Lecture 15 Cache II 2005-3-8 John Lazzaro (www.cs.berkeley.edu/~lazzaro) TAs: Ted Hong and David Marquardt www-inst.eecs.berkeley.edu/~cs152/ Last Time: Locality

More information

COMPUTER ORGANIZATION AND DESIGN

COMPUTER ORGANIZATION AND DESIGN COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle

More information

CS152 Computer Architecture and Engineering March 13, 2008 Out of Order Execution and Branch Prediction Assigned March 13 Problem Set #4 Due March 25

CS152 Computer Architecture and Engineering March 13, 2008 Out of Order Execution and Branch Prediction Assigned March 13 Problem Set #4 Due March 25 CS152 Computer Architecture and Engineering March 13, 2008 Out of Order Execution and Branch Prediction Assigned March 13 Problem Set #4 Due March 25 http://inst.eecs.berkeley.edu/~cs152/sp08 The problem

More information

OPEN BOOK, OPEN NOTES. NO COMPUTERS, OR SOLVING PROBLEMS DIRECTLY USING CALCULATORS.

OPEN BOOK, OPEN NOTES. NO COMPUTERS, OR SOLVING PROBLEMS DIRECTLY USING CALCULATORS. CS/ECE472 Midterm #2 Fall 2008 NAME: Student ID#: OPEN BOOK, OPEN NOTES. NO COMPUTERS, OR SOLVING PROBLEMS DIRECTLY USING CALCULATORS. Your signature is your promise that you have not cheated and will

More information

CS 61C: Great Ideas in Computer Architecture. Lecture 13: Pipelining. Krste Asanović & Randy Katz

CS 61C: Great Ideas in Computer Architecture. Lecture 13: Pipelining. Krste Asanović & Randy Katz CS 61C: Great Ideas in Computer Architecture Lecture 13: Pipelining Krste Asanović & Randy Katz http://inst.eecs.berkeley.edu/~cs61c/fa17 RISC-V Pipeline Pipeline Control Hazards Structural Data R-type

More information

ECE232: Hardware Organization and Design

ECE232: Hardware Organization and Design ECE232: Hardware Organization and Design Lecture 17: Pipelining Wrapup Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Outline The textbook includes lots of information Focus on

More information

SOLUTION. Midterm #1 February 26th, 2018 Professor Krste Asanovic Name:

SOLUTION. Midterm #1 February 26th, 2018 Professor Krste Asanovic Name: SOLUTION Notes: CS 152 Computer Architecture and Engineering CS 252 Graduate Computer Architecture Midterm #1 February 26th, 2018 Professor Krste Asanovic Name: I am taking CS152 / CS252 This is a closed

More information

Computer Architecture Spring 2016

Computer Architecture Spring 2016 Computer Architecture Spring 2016 Lecture 02: Introduction II Shuai Wang Department of Computer Science and Technology Nanjing University Pipeline Hazards Major hurdle to pipelining: hazards prevent the

More information

EECS 470 Midterm Exam Answer Key Fall 2004

EECS 470 Midterm Exam Answer Key Fall 2004 EECS 470 Midterm Exam Answer Key Fall 2004 Name: unique name: Sign the honor code: I have neither given nor received aid on this exam nor observed anyone else doing so. Scores: # Points Part I /23 Part

More information

ECE331: Hardware Organization and Design

ECE331: Hardware Organization and Design ECE331: Hardware Organization and Design Lecture 27: Midterm2 review Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Midterm 2 Review Midterm will cover Section 1.6: Processor

More information

Pipeline Control Hazards and Instruction Variations

Pipeline Control Hazards and Instruction Variations Pipeline Control Hazards and Instruction Variations Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University See P&H Appendix 4.8 Goals for Today Recap: Data Hazards Control Hazards

More information

/ : Computer Architecture and Design Fall Final Exam December 4, Name: ID #:

/ : Computer Architecture and Design Fall Final Exam December 4, Name: ID #: 16.482 / 16.561: Computer Architecture and Design Fall 2014 Final Exam December 4, 2014 Name: ID #: For this exam, you may use a calculator and two 8.5 x 11 double-sided page of notes. All other electronic

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer Architecture and Engineering Lecture 22 Advanced Processors III 2004-11-18 Dave Patterson (www.cs.berkeley.edu/~patterson) John Lazzaro (www.cs.berkeley.edu/~lazzaro) www-inst.eecs.berkeley.edu/~cs152/

More information

CS 2410 Mid term (fall 2015) Indicate which of the following statements is true and which is false.

CS 2410 Mid term (fall 2015) Indicate which of the following statements is true and which is false. CS 2410 Mid term (fall 2015) Name: Question 1 (10 points) Indicate which of the following statements is true and which is false. (1) SMT architectures reduces the thread context switch time by saving in

More information

Data Hazards Compiler Scheduling Pipeline scheduling or instruction scheduling: Compiler generates code to eliminate hazard

Data Hazards Compiler Scheduling Pipeline scheduling or instruction scheduling: Compiler generates code to eliminate hazard Data Hazards Compiler Scheduling Pipeline scheduling or instruction scheduling: Compiler generates code to eliminate hazard Consider: a = b + c; d = e - f; Assume loads have a latency of one clock cycle:

More information

Department of Computer and IT Engineering University of Kurdistan. Computer Architecture Pipelining. By: Dr. Alireza Abdollahpouri

Department of Computer and IT Engineering University of Kurdistan. Computer Architecture Pipelining. By: Dr. Alireza Abdollahpouri Department of Computer and IT Engineering University of Kurdistan Computer Architecture Pipelining By: Dr. Alireza Abdollahpouri Pipelined MIPS processor Any instruction set can be implemented in many

More information

Chapter 4. The Processor

Chapter 4. The Processor Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware We will examine two MIPS implementations A simplified

More information

CS 152 Exam #2 Solutions

CS 152 Exam #2 Solutions University of California, Berkeley College of Engineering Department of Electrical Engineering and Computer Sciences all 2004 Instructors: Dave Patterson and John Lazzaro November 23 rd, 2004 CS 152 Exam

More information

CS2100 Computer Organisation Tutorial #10: Pipelining Answers to Selected Questions

CS2100 Computer Organisation Tutorial #10: Pipelining Answers to Selected Questions CS2100 Computer Organisation Tutorial #10: Pipelining Answers to Selected Questions Tutorial Questions 2. [AY2014/5 Semester 2 Exam] Refer to the following MIPS program: # register $s0 contains a 32-bit

More information

1. Truthiness /8. 2. Branch prediction /5. 3. Choices, choices /6. 5. Pipeline diagrams / Multi-cycle datapath performance /11

1. Truthiness /8. 2. Branch prediction /5. 3. Choices, choices /6. 5. Pipeline diagrams / Multi-cycle datapath performance /11 The University of Michigan - Department of EECS EECS 370 Introduction to Computer Architecture Midterm Exam 2 ANSWER KEY November 23 rd, 2010 Name: University of Michigan uniqname: (NOT your student ID

More information

LECTURE 3: THE PROCESSOR

LECTURE 3: THE PROCESSOR LECTURE 3: THE PROCESSOR Abridged version of Patterson & Hennessy (2013):Ch.4 Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU

More information

Computer Systems Architecture Spring 2016

Computer Systems Architecture Spring 2016 Computer Systems Architecture Spring 2016 Lecture 01: Introduction Shuai Wang Department of Computer Science and Technology Nanjing University [Adapted from Computer Architecture: A Quantitative Approach,

More information

3/12/2014. Single Cycle (Review) CSE 2021: Computer Organization. Single Cycle with Jump. Multi-Cycle Implementation. Why Multi-Cycle?

3/12/2014. Single Cycle (Review) CSE 2021: Computer Organization. Single Cycle with Jump. Multi-Cycle Implementation. Why Multi-Cycle? CSE 2021: Computer Organization Single Cycle (Review) Lecture-10b CPU Design : Pipelining-1 Overview, Datapath and control Shakil M. Khan 2 Single Cycle with Jump Multi-Cycle Implementation Instruction:

More information

CS61C : Machine Structures

CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #19 Designing a Single-Cycle CPU 27-7-26 Scott Beamer Instructor AI Focuses on Poker CS61C L19 CPU Design : Designing a Single-Cycle CPU

More information

Pipelining. CSC Friday, November 6, 2015

Pipelining. CSC Friday, November 6, 2015 Pipelining CSC 211.01 Friday, November 6, 2015 Performance Issues Longest delay determines clock period Critical path: load instruction Instruction memory register file ALU data memory register file Not

More information

Computer and Information Sciences College / Computer Science Department Enhancing Performance with Pipelining

Computer and Information Sciences College / Computer Science Department Enhancing Performance with Pipelining Computer and Information Sciences College / Computer Science Department Enhancing Performance with Pipelining Single-Cycle Design Problems Assuming fixed-period clock every instruction datapath uses one

More information

CSE 378 Midterm 2/12/10 Sample Solution

CSE 378 Midterm 2/12/10 Sample Solution Question 1. (6 points) (a) Rewrite the instruction sub $v0,$t8,$a2 using absolute register numbers instead of symbolic names (i.e., if the instruction contained $at, you would rewrite that as $1.) sub

More information

Lecture 10: Simple Data Path

Lecture 10: Simple Data Path Lecture 10: Simple Data Path Course so far Performance comparisons Amdahl s law ISA function & principles What do bits mean? Computer math Today Take QUIZ 6 over P&H.1-, before 11:59pm today How do computers

More information

Lecture Topics. Announcements. Today: Single-Cycle Processors (P&H ) Next: continued. Milestone #3 (due 2/9) Milestone #4 (due 2/23)

Lecture Topics. Announcements. Today: Single-Cycle Processors (P&H ) Next: continued. Milestone #3 (due 2/9) Milestone #4 (due 2/23) Lecture Topics Today: Single-Cycle Processors (P&H 4.1-4.4) Next: continued 1 Announcements Milestone #3 (due 2/9) Milestone #4 (due 2/23) Exam #1 (Wednesday, 2/15) 2 1 Exam #1 Wednesday, 2/15 (3:00-4:20

More information

CSE140: Components and Design Techniques for Digital Systems

CSE140: Components and Design Techniques for Digital Systems CSE4: Components and Design Techniques for Digital Systems Tajana Simunic Rosing Announcements and Outline Check webct grades, make sure everything is there and is correct Pick up graded d homework at

More information

Midterm #2 Solutions April 23, 1997

Midterm #2 Solutions April 23, 1997 CS152 Computer Architecture and Engineering Computer Science Division Department of Electrical Engineering and Computer Sciences University of California, Berkeley Sp97 D.K. Jeong Midterm #2 Solutions

More information

Pipeline Hazards. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Pipeline Hazards. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Pipeline Hazards Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Hazards What are hazards? Situations that prevent starting the next instruction

More information

Cache Organizations for Multi-cores

Cache Organizations for Multi-cores Lecture 26: Recap Announcements: Assgn 9 (and earlier assignments) will be ready for pick-up from the CS front office later this week Office hours: all day next Tuesday Final exam: Wednesday 13 th, 7:50-10am,

More information

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

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. 5 th. Edition. Chapter 4. The Processor COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle

More information

CS61C Fall 2013 Final Instructions

CS61C Fall 2013 Final Instructions CS61C Fall 2013 Final Instructions This exam is closed book, closed notes, open two- sided crib sheet. Please put away all phones and calculators - - you won t need them. The exam is worth 50 points and

More information

ECE473 Computer Architecture and Organization. Pipeline: Control Hazard

ECE473 Computer Architecture and Organization. Pipeline: Control Hazard Computer Architecture and Organization Pipeline: Control Hazard Lecturer: Prof. Yifeng Zhu Fall, 2015 Portions of these slides are derived from: Dave Patterson UCB Lec 15.1 Pipelining Outline Introduction

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer Architecture and Engineering Lecture 10 -- Cache I 2014-2-20 John Lazzaro (not a prof - John is always OK) TA: Eric Love www-inst.eecs.berkeley.edu/~cs152/ Play: CS 152 L10: Cache I UC

More information

CS152 Computer Architecture and Engineering. Lecture 9 Performance Dave Patterson. John Lazzaro. www-inst.eecs.berkeley.

CS152 Computer Architecture and Engineering. Lecture 9 Performance Dave Patterson. John Lazzaro. www-inst.eecs.berkeley. CS152 Computer Architecture and Engineering Lecture 9 Performance 2004-09-28 Dave Patterson (www.cs.berkeley.edu/~patterson) John Lazzaro (www.cs.berkeley.edu/~lazzaro) www-inst.eecs.berkeley.edu/~cs152/

More information

COSC 6385 Computer Architecture - Pipelining

COSC 6385 Computer Architecture - Pipelining COSC 6385 Computer Architecture - Pipelining Fall 2006 Some of the slides are based on a lecture by David Culler, Instruction Set Architecture Relevant features for distinguishing ISA s Internal storage

More information

2 GHz = 500 picosec frequency. Vars declared outside of main() are in static. 2 # oset bits = block size Put starting arrow in FSM diagrams

2 GHz = 500 picosec frequency. Vars declared outside of main() are in static. 2 # oset bits = block size Put starting arrow in FSM diagrams CS 61C Fall 2011 Kenny Do Final cheat sheet Increment memory addresses by multiples of 4, since lw and sw are bytealigned When going from C to Mips, always use addu, addiu, and subu When saving stu into

More information

EE 457 Midterm Summer 14 Redekopp Name: Closed Book / 105 minutes No CALCULATORS Score: / 100

EE 457 Midterm Summer 14 Redekopp Name: Closed Book / 105 minutes No CALCULATORS Score: / 100 EE 47 Midterm Summer 4 Redekopp Name: Closed Book / minutes No CALCULATORS Score: /. (7 pts.) Short Answer [Fill in the blanks or select the correct answer] a. If a control signal must be valid during

More information

Review. N-bit adder-subtractor done using N 1- bit adders with XOR gates on input. Lecture #19 Designing a Single-Cycle CPU

Review. N-bit adder-subtractor done using N 1- bit adders with XOR gates on input. Lecture #19 Designing a Single-Cycle CPU CS6C L9 CPU Design : Designing a Single-Cycle CPU () insteecsberkeleyedu/~cs6c CS6C : Machine Structures Lecture #9 Designing a Single-Cycle CPU 27-7-26 Scott Beamer Instructor AI Focuses on Poker Review

More information

CS 230 Practice Final Exam & Actual Take-home Question. Part I: Assembly and Machine Languages (22 pts)

CS 230 Practice Final Exam & Actual Take-home Question. Part I: Assembly and Machine Languages (22 pts) Part I: Assembly and Machine Languages (22 pts) 1. Assume that assembly code for the following variable definitions has already been generated (and initialization of A and length). int powerof2; /* powerof2

More information

University of California, Berkeley College of Engineering

University of California, Berkeley College of Engineering University of California, Berkeley College of Engineering Department of Electrical Engineering and Computer Sciences Summer 25 Instructor: Sagar Karandikar 25-7-28 L J After the exam, indicate on the line

More information

EECS 470 Lecture 6. Branches: Address prediction and recovery (And interrupt recovery too.)

EECS 470 Lecture 6. Branches: Address prediction and recovery (And interrupt recovery too.) EECS 470 Lecture 6 Branches: Address prediction and recovery (And interrupt recovery too.) Announcements: P3 posted, due a week from Sunday HW2 due Monday Reading Book: 3.1, 3.3-3.6, 3.8 Combining Branch

More information

CISC 662 Graduate Computer Architecture Lecture 6 - Hazards

CISC 662 Graduate Computer Architecture Lecture 6 - Hazards CISC 662 Graduate Computer Architecture Lecture 6 - Hazards Michela Taufer http://www.cis.udel.edu/~taufer/teaching/cis662f07 Powerpoint Lecture Notes from John Hennessy and David Patterson s: Computer

More information

CS 61C Summer 2016 Guerrilla Section 4: MIPS CPU (Datapath & Control)

CS 61C Summer 2016 Guerrilla Section 4: MIPS CPU (Datapath & Control) CS 61C Summer 2016 Guerrilla Section 4: MIPS CPU (Datapath & Control) 1) If this exam were a CPU, you d be halfway through the pipeline (Sp15 Final) We found that the instruction fetch and memory stages

More information

EECS150 - Digital Design Lecture 9 Project Introduction (I), Serial I/O. Announcements

EECS150 - Digital Design Lecture 9 Project Introduction (I), Serial I/O. Announcements EECS150 - Digital Design Lecture 9 Project Introduction (I), Serial I/O September 22, 2011 Elad Alon Electrical Engineering and Computer Sciences University of California, Berkeley http://www-inst.eecs.berkeley.edu/~cs150

More information

Outline. A pipelined datapath Pipelined control Data hazards and forwarding Data hazards and stalls Branch (control) hazards Exception

Outline. A pipelined datapath Pipelined control Data hazards and forwarding Data hazards and stalls Branch (control) hazards Exception Outline A pipelined datapath Pipelined control Data hazards and forwarding Data hazards and stalls Branch (control) hazards Exception 1 4 Which stage is the branch decision made? Case 1: 0 M u x 1 Add

More information

UC Berkeley CS61C : Machine Structures

UC Berkeley CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c Review! UC Berkeley CS61C : Machine Structures Lecture 28 Intra-machine Parallelism Parallelism is necessary for performance! It looks like itʼs It is the future of computing!

More information

ECE Sample Final Examination

ECE Sample Final Examination ECE 3056 Sample Final Examination 1 Overview The following applies to all problems unless otherwise explicitly stated. Consider a 2 GHz MIPS processor with a canonical 5-stage pipeline and 32 general-purpose

More information

The University of Michigan - Department of EECS EECS 370 Introduction to Computer Architecture Midterm Exam 2 solutions April 5, 2011

The University of Michigan - Department of EECS EECS 370 Introduction to Computer Architecture Midterm Exam 2 solutions April 5, 2011 1. Performance Principles [5 pts] The University of Michigan - Department of EECS EECS 370 Introduction to Computer Architecture Midterm Exam 2 solutions April 5, 2011 For each of the following comparisons,

More information

CS/CoE 1541 Exam 1 (Spring 2019).

CS/CoE 1541 Exam 1 (Spring 2019). CS/CoE 1541 Exam 1 (Spring 2019). Name: Question 1 (8+2+2+3=15 points): In this problem, consider the execution of the following code segment on a 5-stage pipeline with forwarding/stalling hardware and

More information

Perfect Student CS 343 Final Exam May 19, 2011 Student ID: 9999 Exam ID: 9636 Instructions Use pencil, if you have one. For multiple choice

Perfect Student CS 343 Final Exam May 19, 2011 Student ID: 9999 Exam ID: 9636 Instructions Use pencil, if you have one. For multiple choice Instructions Page 1 of 7 Use pencil, if you have one. For multiple choice questions, circle the letter of the one best choice unless the question specifically says to select all correct choices. There

More information

Full Datapath. Chapter 4 The Processor 2

Full Datapath. Chapter 4 The Processor 2 Pipelining Full Datapath Chapter 4 The Processor 2 Datapath With Control Chapter 4 The Processor 3 Performance Issues Longest delay determines clock period Critical path: load instruction Instruction memory

More information

ECE 2300 Digital Logic & Computer Organization. Caches

ECE 2300 Digital Logic & Computer Organization. Caches ECE 23 Digital Logic & Computer Organization Spring 217 s Lecture 2: 1 Announcements HW7 will be posted tonight Lab sessions resume next week Lecture 2: 2 Course Content Binary numbers and logic gates

More information

CS146 Computer Architecture. Fall Midterm Exam

CS146 Computer Architecture. Fall Midterm Exam CS146 Computer Architecture Fall 2002 Midterm Exam This exam is worth a total of 100 points. Note the point breakdown below and budget your time wisely. To maximize partial credit, show your work and state

More information

Computer Organization and Structure

Computer Organization and Structure Computer Organization and Structure 1. Assuming the following repeating pattern (e.g., in a loop) of branch outcomes: Branch outcomes a. T, T, NT, T b. T, T, T, NT, NT Homework #4 Due: 2014/12/9 a. What

More information

LECTURE 9. Pipeline Hazards

LECTURE 9. Pipeline Hazards LECTURE 9 Pipeline Hazards PIPELINED DATAPATH AND CONTROL In the previous lecture, we finalized the pipelined datapath for instruction sequences which do not include hazards of any kind. Remember that

More information

HY425 Lecture 05: Branch Prediction

HY425 Lecture 05: Branch Prediction HY425 Lecture 05: Branch Prediction Dimitrios S. Nikolopoulos University of Crete and FORTH-ICS October 19, 2011 Dimitrios S. Nikolopoulos HY425 Lecture 05: Branch Prediction 1 / 45 Exploiting ILP in hardware

More information

CS 351 Exam 2 Mon. 11/2/2015

CS 351 Exam 2 Mon. 11/2/2015 CS 351 Exam 2 Mon. 11/2/2015 Name: Rules and Hints The MIPS cheat sheet and datapath diagram are attached at the end of this exam for your reference. You may use one handwritten 8.5 11 cheat sheet (front

More information

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 2

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 2 CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 2 Instructors: Krste Asanović & Randy H. Katz http://inst.eecs.berkeley.edu/~cs61c/ 10/16/17 Fall 2017 - Lecture #15 1 Outline

More information

Mo Money, No Problems: Caches #2...

Mo Money, No Problems: Caches #2... Mo Money, No Problems: Caches #2... 1 Reminder: Cache Terms... Cache: A small and fast memory used to increase the performance of accessing a big and slow memory Uses temporal locality: The tendency to

More information

Department of Electrical Engineering and Computer Sciences Fall 2016 Instructors: Randy Katz, Bernhard Boser

Department of Electrical Engineering and Computer Sciences Fall 2016 Instructors: Randy Katz, Bernhard Boser University of California, Berkeley College of Engineering Department of Electrical Engineering and Computer Sciences Fall 2016 Instructors: Randy Katz, Bernhard Boser 2016-12-16 L CS61C FINAL J After the

More information

CS 61C Fall 2016 Guerrilla Section 4: MIPS CPU (Datapath & Control)

CS 61C Fall 2016 Guerrilla Section 4: MIPS CPU (Datapath & Control) CS 61C Fall 2016 Guerrilla Section 4: MIPS CPU (Datapath & Control) 1) If this exam were a CPU, you d be halfway through the pipeline (Sp15 Final) We found that the instruction fetch and memory stages

More information

The Evolution of Microprocessors. Per Stenström

The Evolution of Microprocessors. Per Stenström The Evolution of Microprocessors Per Stenström Processor (Core) Processor (Core) Processor (Core) L1 Cache L1 Cache L1 Cache L2 Cache Microprocessor Chip Memory Evolution of Microprocessors Multicycle

More information