Question: 2 ) ( 2 0 points ) 2 a ) Given the C - like code, answer the questions below. Note: 2 5 6 x

2)(20 points)
2a) Given the C-like code, answer the questions below. Note: 256x 16 Register File (with 1 read port and 1 write port) is used for A in the code.
2a.1)(5 pts) Determine minimum number of bits for totalsum such that NO overflow occurs (assume that all values in the register file A are positive number). Explain how you get your answer (no explanation, 0 point).
\(\mathbf{2 a .2}\))(5 pts) List all local storage with its minimum number of bits that should be used.
```
Inputs: A[256][16], go (1-bit)
Outputs: done (1-bit), totalsum(??)
Local Storage: ??
while(1){
while(!go);
done =0; totalsum =0; max =0;
for(k =0; k 256; k++{
totalsum = totalsum + A[k];
if(A[k]> max)
max = A[k];
}
done=1;
}
```
2b)(10 pts) Given the following state diagram of a circuit with 1 input (w) and 3 outputs (s, t , and u), specify minimum numbers of D-FFs or minimum numbers of bits for the state register that should be used if
(3 pts) the binary encoding method is used
bits
(4 pts) the one-hot encoding method is used
bits
(3 pts) the output encoding method is used
bits
Note: if the output encoding cannot be used, put -1 as your answer.
2 ) ( 2 0 points ) 2 a ) Given the C - like code,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!