Question: DIGITAL ELECTRONICS (verilog code) can you explain about this code and output step by step becoz i need to understand it. ------------------verilog code---------------------------- module state_machine(CLK,RESET,X,present_state,next_state,Z);

DIGITAL ELECTRONICS (verilog code) can you explain about this code and output step by step becoz i need to understand it. ------------------verilog code----------------------------

module state_machine(CLK,RESET,X,present_state,next_state,Z); input CLK,RESET,X; output [1:0]present_state,next_state; output Z; reg [1:0]present_state=2'b00,next_state=2'b00; reg Z=0; parameter A=2'b00,B=2'b01,C=2'b10,D=2'b11; always@(posedge CLK or posedge RESET) begin if (RESET) present_state

-----------------------------------test bench ----------------------------------------

module demo_ve_tb; reg CLK,RESET,X; wire [1:0]present_state; wire [1:0]next_state; wire Z; state_machine uut(.CLK(CLK),.RESET(RESET),.X(X), .present_state(present_state),.next_state(next_state),.Z(Z));

initial begin CLK=0; forever #10 CLK = ~CLK; end initial begin RESET=1'b0; X=1'b0; #30; X=1'b1; #20; X=1'b1; #20; X=1'b1; #20; X=1'b0; #20; X=1'b1; #20; X=1'b0; #20; X=1'b1; #20; X=1'b1; #20; X=1'b0; #20; X=1'b0; #20; X=1'b1; #20; X=1'b0;RESET=1'b1; #20; RESET=1'b0; X=1'b1; #20; X=1'b0; #20; X=1'b0; #20; end endmodule output waveform DIGITAL ELECTRONICS (verilog code) can you explain about this code and output

Name Value 0.000 50.000 100.000 150.000 25 200.000 250.000 200.000 350.000 ne 400 0 CLK RESET 0 O 2 present_state[1:00 V nad_state101 D 0 DOO D D D

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!