一、同步复位
module top_module (
input clk,reset,
input [7:0]d,
output [7:0] q );
always @(posedge clk) begin
if (reset) begin
q = 8'b0000_0000;
end
else begin
q = d;
end
end
endmodule

二、异步复位
module top_module(
input clk,areset,
input [7:0]d,
input [7:0]q
);
always @(posedge clk or posedge areset) begin
if (areset) begin
q = 7'd0;
end
else begin
q = d;
end
end
endmodule

三、小结
同步和异步复位触发器之间代码的唯一区别在于灵敏度列表。
最后
以上就是灵巧网络最近收集整理的关于【Verilog】D触发器的同步复位和异步复位一、同步复位二、异步复位三、小结的全部内容,更多相关【Verilog】D触发器内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复