LIBRARY ieee; USE ieee.std logic 1164.all; ENTITY Seq_Detector_Moore IS PORT ( Clock : IN STD_LOGIC ; Resetn : IN STD _LOGIC ; w : IN STD_LOGIC ; z : OUT STD _LOGIC ) ; END Seq_Detector_Moore; ARCHITECTURE Behavior OF Seq_Detector_Moore IS TYPE state _type IS ( A, B, C) ; SIGNAL current _state, next _state : state _type; BEGIN
Task: Draw the State Diagram for the Moore Sequence Detector FSM. How many states have the New State diagram?
Given VHDL Code for the Moore Sequence Detector FSM:
LIBRARY ieee;
USE ieee.std logic 1164.all;
ENTITY Seq_Detector_Moore IS
PORT ( Clock : IN STD_LOGIC ;
Resetn : IN STD _LOGIC ;
w : IN STD_LOGIC ;
z : OUT STD _LOGIC ) ;
END Seq_Detector_Moore;
ARCHITECTURE Behavior OF Seq_Detector_Moore IS
TYPE state _type IS ( A, B, C) ;
SIGNAL current _state, next _state : state _type;
BEGIN
--next state decoder
Process (current_state, w)
BEGIN
CASE current_state IS
WHEN A =>
IF w = ’1’ THEN next _state <= A ;
ELSE next _state <= B ;
END IF ;
WHEN B =>
IF w = ’1’ THEN next _state <= A ;
ELSE next _state <= C ;
END IF ;
WHEN C =>
IF w = ’1’ THEN next _state <= A ;
ELSE next _state <= C ;
END IF ;
WHEN OTHERS =>
next_state<= A ; -- go back to the initial state
END CASE
END PROCESS ;
--state memory (FFs)
PROCESS ( Clock, Resetn )
BEGIN
IF Resetn = ’1’ THEN
current_state <= A ; --initial state
ELSIF Clock’EVENT AND Clock = ’1’ THEN
curent_state <=next_state ;
END IF;
END PROCESS;
--output decoder
z<= ’1’ WHEN current_state= C ELSE ’0’ ;
END Behavior ;
----output decoder , another way
PROCESS (current_state)
BEGIN
If curent_state=C
then z <= ’1’ ;
ELSE z <= ’0’ ;
END IF ;
END PROCESS ;
END Behavior ;
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)