Fsm1_hdlbits
【Fsm1_hdlbits】状态机学习link:
https://wenku.baidu.com/view/9e44f7650066f5335a8121e3.html
module top_module(
input clk,
input areset,// Asynchronous reset to state B
input in,
output out);
//parameter A=0, B=1;
reg state, next_state;
always @(*) begin// This is a combinational always block
// State transition logic
case (state)
A: next_state = in? A:B;
B: next_state = in? B:A;
endcase
endalways @(posedge clk, posedge areset) begin// This is a sequential always block
// State flip-flops with asynchronous reset
if (areset)
state <= B;
else
state <= next_state;
end// Output logic
// assign out = (state == ...);
assign out = (state == B);
endmodule
推荐阅读
- 宽容谁
- 我要做大厨
- 增长黑客的海盗法则
- 画画吗()
- 2019-02-13——今天谈梦想()
- 远去的风筝
- 三十年后的广场舞大爷
- 叙述作文
- 20190302|20190302 复盘翻盘
- 学无止境,人生还很长