Question: Write behavioral code for up/down 4-bit binary counter. Use state machine. Following is a template for your usage- module Ctr (CLK, in, out ) ;

Write behavioral code for up/down 4-bit binary counter. Use state machine. Following is a template for your usage- module Ctr (CLK, in, out ) ; input input output reg CLK in; out; out: state variable eg 1:0te local variable reg 1:0] ne xt_statei always (posedge CLR) // registers state = next_state; always a (atate or in) Compute next statel1:0] logic (D inputs) whenever state/inputs change // Make sure state is al ways assigned to in every execution path // assign to the outputs endmodule
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
