FPGA以SLICE为单位实现组合逻辑,外围加Block、Multiplier,以及IOB实现外设通信。
其中,最重要的是SLICE种的LUT4(Look-Up-Table)。每一个LUT4为4输入1输出的选择电路,4输入有16种情况。
以如下代码为例
module inner_LUT(
input clk,
input a,
input b,
input c,
input d,
output reg x
);
always@(posedge clk)
begin
if(a)
begin
x<=c;
end else if(b)
begin
x<=d;
end else
begin
x<=1'b1