Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can someone explain to me the logic for this high level state machine? I don\'t

ID: 2266093 • Letter: C

Question

Can someone explain to me the logic for this high level state machine? I don't understand what the sample state does won't it just set temp0 to temp 3 to current value?

So for example the first time it samples let's say CT = 100. Temp 0 to temp3 will be set to 100.

Then the second time around CT = 101 so Temp 0 to temp 3 will be 101 and so on.

I don't understand how that would get the average of 4 CONSECUTIVE temperatures.

5.14 Use the RTL design process to create an alarm system that sets a single-bit output alarm to 1 when the average temperature of four consecutive samples meets or exceeds a user-defined threshold value. A 32-bit unsigned input CT indicates the cuirent temperature, and a 32-bit unsigned input WT indicates the warning thresh- hold. Samples should be taken every few clock cycles. A single-bit input clr when 1 disables the alarm and the sampling process. Start by capturing the desired system behavior as an HLSM, and then convert to a controller/datapath Step 1 - Capture a high-level state machine Inputs: CT, WT (32 bits); clr (bit) Outputs: alarm (bit) Local Registers: tmp0, tmp1, tmp2, tmp3, avg (32 bits) clr AlrmOn Clr clr (avg WT clr Init Sample AlrmO larm tmp0 := 0 tmp1 0 tmp2 :=0 tmp3 :=0 avg := 0 tmp0-CT tmp1-tmpo tmp2 := tmp1 tmp3 := tmp2 avg := (tmp0+ tmpl (avg-WT) alarm-0 +tmp2 tmp3)/4

Explanation / Answer

5.14 ) In the above state diagram after sample state we should have another state to find average. So at sample state temp0 set to the current temperature ,so temp1 hold the temp0 value and so temp3 holds the temp2 value that is current temperature reading. After that temp0 will take another reading so temp1 is temp0 and temp2 holds temp1 value.here temp3 value is not temp2 as it holds past reading.so now this Reading Will be stored in temp2.

In similar way another two temperature values assigned to temp1 and temp0.After that goes to average state there average calculation is done.

Then comparison Will be done if condition satisfy then alarm on otherwise off.

Hope this clears your doubt.