Computer Science 281

Third Hour Exam

 

Name ___________________________

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Tuesday, April 23

100 pts.


1.                  Some definitions (20 pts.)

 

      Pick four (four only) from the following list and give brief defintions of them.  Please be sure to identify which terms you are defining (or describing).

 

Memory Cache

VLSI

RISC

CISC

Microprogramming

Moore's Law

RAID

Bus

 

a.

 

 

 

 

 

 

 

 

b.

 

 

 

 

 

 

c.

 

 

 

 

 

 

d.

 

 

 

 

 

 

e.

 

 


2.   (20 pts.)     Consider the following routine written in C to calculate the scalar

            product of two integer arrays of size size:

 

      function scalar(int a[], int b[], int size) {

            int i, sum;

            sum = 0;

            for (i = 0; i < size; ++i)

                        sum += a[i] * b[i];

            return sum;

            }

 

      Implement the function in assembly language.

 


3.   (15 pts.)

 

      The array ary is an integer array defined by

 

            int ary[5][8]

 

      Write the code to put the value of ary[i][j] into register %g1 where i is in register %i0

      and j is in register %i1.

 


4.            (20 pts.)     Write a rotate routine in assembly language.  For example, if we have (in the calling program)

 

                     int a = 3; b = 4; c = 5;

                     rotate(&a,&b,&c)

 

               the result will have a = 5, b = 3, and c = 4.  Note the use of call-by-location.

 


5.            (15 pts.)     Sketch a D flip-flop and say what the inputs and outputs do.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6.            (10 pts.)     Look at the diagram (from Tanenbaum) on the last page of this exam.  The page with the diagram (the next page) may be torn off for reference, and need not be turned in with the rest of the exam.  Suppose that we want to write the three-bit word given by I0, I1, I2 into memory location 2 (with memory location 0 being the first (topmost) memory location..  What signals (high/low) must be placed on the other inputs to do this?

 

 


(this page may be torn off and need not be turned in with the rest of the exam)