// lut4.sv: behavioural model of a 4-input look-up table. // INIT holds the 16 configuration bits. Bit i is the output when the // inputs {d, c, b, a} form the binary number i. This is how a LUT works // in hardware: the inputs select one of 16 stored bits. `timescale 1ns/1ps module lut4 #( parameter logic [15:0] INIT = 16'h0000 ) ( input logic a, input logic b, input logic c, input logic d, output logic y ); assign y = INIT[{d, c, b, a}]; endmodule