
PRACTICE PROBLEMS 3
Lecture 5
1. What is the difference between a FSM and a high-level FSM?
2. Using the RTL design method, create a circuit that calculates the sum of M to N.
Implement this circuit using the algorithm provided.
a) Convert the following C code to a high-level state machine
b) Create a datapath
c) Connect the datapath to the controller
d) Derive the controller’s FSM
3. Assuming muxes have a delay of 5 ns, adders and shifters have 10 ns delay,
multipliers have 20 ns delay, and wires have 2 ns delay,
a) What is the critical path of the datapath and it’s corresponding delay?
b) What is maximum system clock frequency given the current datapath?
c) What modifications can be made to the datapath to increase the system clock
frequency?
4. Create an FSM that interfaces the datapath shown below. The FSM should use the datapath to compute the average value of the 16 32-
bit elements of any array A. Array A is stored in a memory, with the first element at address 25, the second at address 26, and so on.
Assume that putting a new value onto the address lines M_addr causes the memory to almost immediately output the read data on the
M_data lines. Ignore the possibility of overflow.
Inputs: byte M, byte N, bit start
Output: byte result, bit busy
CIRCUIT_X:
result = 0;
while(1){
busy = 0;
while(!start);
busy = 1;
result = 0;
for( int y=M; y<=N; y++ ){
result = result + y;
}
return result;
}
A B C D
+
* *
<<
+ 2
Z
i
+1
i_ld
a_ld
<16
+
25
M_addr
sum a
+
>>4
average
M_data
avg_ld
a_clr
avg_clr
i_clr
average
s_ld
s_clr
i_lt16