Computer Organization and Design: The Hardware/Software Interface

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

View Full Document Right Arrow Icon
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.
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern