FSM `next state` does not transition when `present state` value in next state combinatorial logic block transitions - ternary operator
In my Verilog code, the ns value does not get assigned to any of the values in the next state logic. I coded the next state logic to assign a value to the ns state variable whenever there is a transition in the ps. Here is the FSM code snippet: // State registers always @(posedge clk, negedge rst) begin if (!rst) ps <= S1; else ps <= ns; end assign present_state = ps; assign next_state = ns; // Next state logic always @(ps, start) begin case (ps) S1: ns = start ? S2 : S1; S2: ns = S3; S3: ns = S1; //default : ns = S1; endcase end Here is the tb code snippet: initial begin #0 rst = 0; start = 0
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.