1 2 3 4 5 6 7 8 | always@(posedge clk or negedge rst_n)begin if(!rst_n)begin state_c <= IDLE; end else begin state_c <= state_n; end end |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | always@(*)begin case(state_c) IDLE:begin if(idle2s1_start)begin state_n = S1; end else begin state_n = state_c; end end S1:begin if(s12s2_start)begin state_n = S2; end else begin state_n = state_c; end end S2:begin if(s22idl)begin state_n = IDLE; end else begin state_n = state_c; end end default:begin state_n = IDLE; end endcase end assign idle2s1_start = state_c==IDLE && ; assign s12s2_start = state_c==S1 && ; assign s22idl_start = state_c==S2 && ; |
1 2 3 | assign idle2s1_start = state_c==IDLE && ; assign s12s2_start = state_c==S1 && ; assign s22idl_start = state_c==S2 && ; |
1 2 3 4 5 6 7 8 9 10 11 | always @(posedge clk or negedge rst_n)begin if(!rst_n)begin out1 <=1'b0 end else if(state_c==S1)begin out1 <= 1'b1; end else begin out1 <= 1'b0; end end |
gn165625076 发表于 2017-2-15 08:21+ r5 j( |6 y6 h" p0 `5 G4 g# k
谢谢分享,学习了
f__liu 发表于 2017-11-25 20:50& ?. a/ X4 Q9 v3 j( y
支持你一下下。。
欢迎光临 EDA365电子工程师网 (https://bbs.elecnest.cn/) | Powered by Discuz! X3.2 |