Given the finite state machine circuit as shown, assume that the D flip-flops are initially reset to zero before the machine begins.
Build this circuit.
前言
两个输入,包括一个时钟clk,一个待处理的输入信号x;一个输出信号z。
代码
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15module top_module ( input clk, input x, output z ); reg q1,q2,q3; initial z=1'b1; always@(posedge clk)begin z<=~(x^q1|z&~q2|x|~q3); q1<=x^q1; q2<=x&~q2; q3<=x|~q3; end endmodule
总结
在该例中初始赋值只能使用initial,当使用assign或者always模块时会由于赋值冲突产生错误。
最后
以上就是时尚月饼最近收集整理的关于HDLBits练习——Exams/ece241 2014 q4前言代码总结的全部内容,更多相关HDLBits练习——Exams/ece241内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复