Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Draw the state diagram of the machine described by the following Verilog module: module state_machine(x_in, clk, reset); input x_in, clk, reset; reg [1:0] state,

2. Draw the state diagram of the machine described by the following Verilog module:

module state_machine(x_in, clk, reset);

input x_in, clk, reset;

reg [1:0] state, next_state;

always @ (poseedge clk, negedge reset)

begin

if (reset == 1b0)

state <= 2b00:

else

state <= next_state:

end

always @(state, x_in)

begin

case (state) 2b00:

begin

if (x_in)

next_state = 2b10;

else

next_state = 2b00;

end

2b01: begin

if (x_in) next_state = 2b10;

else next_state = 2b00;

end

2b10: begin

if (x_in)

next_state = 2b11;

else

next_state = 2b10;

end

default: next_state = 2b01;

endcase

end

endmodule

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases DeMYSTiFieD

Authors: Andy Oppel

2nd Edition

0071747990, 978-0071747998

More Books

Students also viewed these Databases questions

Question

Outline the steps involved in developing a cash budget.

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago