Docsity

Practice Problems III for Computer-Aided Logic Design | ECE 474A, Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
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
pf2

Partial preview of the text

Download Practice Problems III for Computer-Aided Logic Design | ECE 474A and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

PRACTICE P ROBLEMS 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

Z

i

i_ld

a_ld

<

25

M_addr

sum a

4 +

average

M_data

avg_ld

a_clr

avg_clr

i_clr

average

s_ld s_clr

i_lt

5. In class we designed a FSM to detect when four 1’s appeared on the input stream. Fill in the corresponding timing diagram. Is the

functionality correct? If not, explain what’s wrong and how can it be fixed.

6. In class we designed a FSM to detect when four 1’s appeared on the input stream. Fill in the timing diagram. Is the functionality

correct? If not what’s wrong and how can it be fixed?

a) ONLY ONE condition true

b) ONE condition true

clk

w

state

count

f

Inputs: w (bit) Output: f (bit) Local Reg: count (3 bits)

s0 s

s

s

count = 0 count++

f = 1

w’

w

w’

w

w • (count ≥ 4)’ w’ • (count ≥ 4)’

count ≥ 4

Inputs: a, b, c (bit) Output: x, y (bit)

s

s

s

a’b’c

xy = 11

a

a + b + c’

a’

a’b

xy = 00

a’b’c a

xy = 01