Skip to content

Design and Functional Simulation of Land rover FIGO FSM. #1

Description

@Iswar2010

module mealy100patterndetector(IN, CLK, RST, OUT);

input IN, CLK, RST;
output reg OUT;

parameter A = 2'b00;
parameter B = 2'b01;
parameter C = 2'b10;

reg [1:0] current_state;
reg [1:0] next_state;

always@(IN or current_state)
case(current_state)
A:
if(IN)
next_state = B;
else
next_state = A;
B:
if(IN)
next_state = B;
else
next_state = C;
C:
if(IN)
next_state = B;
else
next_state = A;
default: next_state = A;
endcase

always@(posedge CLK)
if(RST)
current_state <= A;
else
current_state <= next_state;

always@(IN or current_state)
case(current_state)
A: OUT = 0;
B: OUT = 0;
C:
begin
if(IN)
OUT = 0;
else
OUT = 1;
end
default: OUT = 2'bzz;
endcase

endmodule

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions