A JK flip-flop has the below truth table. Implement a JK flip-flop with only a D-type flip-flop and gates. Note: Qold is the output of the D flip-flop before the positive clock edge.

前言
三个输入,包括一个时钟clk,一个主输入信号j,一个副输入信号k;一个输出信号Q。
代码
module top_module (
input clk,
input j,
input k,
output Q);
always@(posedge clk)begin
Q<=(j^k)?j:k?(~Q):Q;
end
endmodule
总结
观察真值表找出输出值与输入值之间的联系,以及判断语句的复用。
最后
以上就是受伤过客最近收集整理的关于HDLBits练习——Exams/ece241 2013 q7前言代码总结的全部内容,更多相关HDLBits练习——Exams/ece241内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复