Question: 21. You wil design an embedded system using a Moore FSM. There are two inputs (PB3, PB2) and two outputs (PB1, PB0). The FSM runs


21. You wil design an embedded system using a Moore FSM. There are two inputs (PB3, PB2) and two outputs (PB1, PB0). The FSM runs in the background with 1 kHz SysTick periodic interrupts. Initialy both outputs will be low, and you may also assume both inputs are initially low. If PB3 rises before PB2 rises, then set PB1 high. If PB2 rises before PB3 rises, then set PB0 high. If both rise during the same 1-ms window, set both PB1 and PBO high. After either or both PB1 andor PBO become high, let the output remain fixed. The initial state is s-0 a) Show the FSM graph in Moore format. Full credit for the solution with the fewest states (hint: an FSM with 4 states exists!) b) The struct and the main program are given. PORTB_Init initializes PB3-PB0 and makes the outputs low. SysTick_Init initializes interrupts at 1 kHz. Assume PORTB_Init and SysTick_Init are also given (no need to write the code for these two procedures). Write the C code that declares, nitializes and places the FSM in ROM, and write the SysTick ISR. Employ friendly access and good programming style for full credit Assume the initial state is s-0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
