# Computer Organization and Design: The Hardware/Software Interface

This preview shows pages 1–2. Sign up to view the full content.

University of California, Berkeley - College of Engineering Electrical Engineering and Computer Science, Computer Science Division Spring 2004 J. Kubiatowicz CS152 - Computer Architecture and Engineering Homework Quiz #3 Solutions Pseudo-code for bzero looks like this (roughly) * : Count Å B; While (Count) { WrAdr Å A + (Count << 2); Mem[WrAdr] Å 0; Count--; } New components, wires, and values are highlighted bold. 1. Answer: There were three essential changes to the datapath: i. A way to load “B” into the counter, ii. A way to add “count << 2” and “A”, and iii. A way to put a constant zero as the input to Mem. Here’s an example of such an organization. i: Counter (.load( load ), .dec( dec ), .val(B), .out( cout ), .zero?( zero? )) ii: Shift<<2 (.in( cout ), .out( ALUSelBInput4 )) iii: Mux2 (.in0(B), .in1( Constant0 ), .sel( DInSel ), .out(Din)) Grading: i worth 2 pts, ii worth 2 pts, iii worth 1 pt. 2. Answer: New Fields: “Counter” New Values: Memory.Write0 = Put 0 on Din by raising DInSel SRC2.counter = Put count as input 2 to ALU by setting ALUSelb to input #4.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern