FPGA入门学习—简单时序逻辑的理解:
- 时序逻辑与组合逻辑的比较
- 以简单的 out=a&b&c 逻辑为例
组合逻辑:
`timescale 1ns / 1ps
module reg_test(
input clk,
input a,
input b,
input c,
output reg out
);
always@(*)begin
out <= a & b & c;
end
endmodule
时序逻的RTL原理图:
时序逻辑:
`timescale 1ns / 1ps
module reg_test(
input clk,
input a,
input b,
input c,
output reg out
);
//时序逻辑:posedge clk
always@(posedge clk)begin
out <= a & b & c;
end
endmodule
时序逻的RTL原理图:
总结:时序逻辑的输出,一般是在时钟的升降沿产生,因此相比组合逻辑,其在RTL的电路图中会有一个触发器,用以保证在边沿输出。