UCR CS 122B Winter 2004 Prof. Frank Vahid Quiz 2 1. What is the approximate fastest sampling rate, in seconds, of a 128-tap FIR filter dealing with 12-bit data samples for the following processing technologies. Assume an infinitely-fast A2D converter. Show your work for each, state your assumptions, and give the speedups of (b) and (c) compared to (a). (a) A 200 MHz 32-bit microprocessor (b) A 2 GHz 32-bit microprocessor (c) An FPGA running at 200 MHz (briefly explain the design you are assuming). 2. We want to sample any signal every 10 microseconds and perform a a 32-tap FIR filtering on that signal. Using the above implementation technologies, compute the number of different signals that we can simultaneously process. Assume unlimited pins are available for each technology. Again, show your work and state all assumptions clearly. 3. Optimize the following code for **performance**. Explain why you chose to optimize what you did, and GIVE AN ESTIMATE OF THE OVERALL SPEEDUP you obtain. ASSUME that the code was originally written for readability and maintainability, and thus you should only make changes if they really make a substantial difference. Full credit will be given as long as *most* of the available speedup is obtained -- getting the absolute maximum speedup isn't required. #define MAX1 1000 #define MAX2 2000 int M[MAX1], N[MAX2]; int total=0; int minM=32000, minN=32000; for (i=0; i < MAX1; i++) { M[i] = 0; // initialize M } for (j=0; j < MAX2; 2++) { N[j] = 0; // initialize N } for (i=0; i < MAX1; i++) { cin>> M[i]; // fill M } for (j=0; j < MAX2; j++) { cin>> N[j]; // fill N } for (i=0; i < MAX1; i++) { for (j=0; j < MAX2; j++) { if (M[i] < minM) { // find smallest in M minM = M[i]; } if (N[j] < minN) { // find smallest in N minN = N[j]; } } } for (i=0; i < MAX1; i++) { total = total + (minM * minN * i); }