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

Write assembly or C software to implement the following Mealy FSM ( Figure 2.42

ID: 3542144 • Letter: W

Question

Write assembly or C software to implement the following Mealy FSM (Figure 2.42). Include the FSM state machine, port initialization, timer initialization, and the FSM controller. The command sequence will be input, output, wait 10 ms, input, then branch to next state. The 1-bit input is on Port P (PP0), and the 3-bit output is on Port P (PP3, PP2, PP1). Assume the E clock is 8 MHz.


Write assembly or C software to implement the following Mealy FSM (Figure 2.42). Include the FSM state machine, port initialization, timer initialization, and the FSM controller. The command sequence will be input, output, wait 10 ms, input, then branch to next state. The 1-bit input is on Port P (PP0), and the 3-bit output is on Port P (PP3, PP2, PP1). Assume the E clock is 8 MHz.

Explanation / Answer

Answer:

State_type fsm1[3]=

{

{{1,2},{Hungry1,Happy1}},

{{3,4},{Sleepy1,Hungry1}},

{{5, 6},{Hungry1,Happy1}}

}