Computer Organization and Design: The Hardware/Software Interface

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

View Full Document Right Arrow Icon
1 University of California, Berkeley College of Engineering Computer Science Division EECS Spring 1999 John Kubiatowicz Homework Quiz (HW #4) March 15, 1999 CS152 Computer Architecture and Engineering This quiz covers one of the problems from homework #4. Good Luck! Your Name: SID Number: Discussion Section: Total:
Image of page 1

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

View Full Document Right Arrow Icon
2 The VSCALE instrucition Figure 1: A multicycle data path In your homework, you implemented the bcp (block copy) instruction. Here is the pseudo-code for a related instruction, called vscale . It is the same as block copy, except that it multiplies every source word by a constant before copying it to its destination. Let v1 be the starting address of the input vector, v2 be the starting address of the destination vector, length be the length of both vectors (in words), and scale be the scale factor: vscale(v1,v2,length,scale) { int index = (length-1) × 4; /* mult × 4 since we want byte addr */ while (index >= 0) { M[v2+index] = scale × M[v1+index]; index = index – 4; } } Your job is to implement the vscale instruction in the multicycle data path. Here is the coding of vscale instruction: opcode = Instruction[31:26] = 0x31 (an unused opcode) R[rs] v1, R[rt] v2, R[rd] length-1, Instruction[10:0] scale The scale value is hard-coded into the lower 11 bits of the instruction.
Image of page 2
Image of page 3
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