LUT4 - 2023.2 English

Vivado Design Suite 7 Series FPGA and Zynq 7000 SoC Libraries Guide (UG953)

Document ID
Release Date
2023.2 English

Primitive: 4-Bit Look-Up-Table with General Output


This design element is a 4-bit look-up table (LUT) with general output (O).

An INIT attribute with an appropriate number of hexadecimal digits for the number of inputs must be attached to the LUT to specify its function. This element provides a look-up table version of a buffer or inverter. These elements are the basic building blocks. Multiple variants of LUTs accommodate additional types of outputs that can be used by different timing models for more accurate pre-layout timing estimation.

The INIT parameter for the FPGA LUT primitive gives the LUT its logical value. By default, this value is zero, thus driving the output to a zero regardless of the input values (acting as a ground). However, in most cases a new INIT value must be determined in order to specify the logic function for the LUT primitive. There are at least two methods by which the LUT value can be determined.

  • The Logic Table Method Create a binary logic table of all possible inputs, specify the desired logic value of the output and then create the INIT string from those output values.
  • The Equation Method Define parameters for each input to the LUT that correspond to their listed truth value and use those to build the logic equation you are after. This method is easier to understand once you have grasped the concept and is more self-documenting than the above method. However, this method does require the code to first specify the appropriate parameters.

Logic Table

Inputs Outputs
I3 I2 I1 I0 O
0 0 0 0 INIT[0]
0 0 0 1 INIT[1]
0 0 1 0 INIT[2]
0 0 1 1 INIT[3]
0 1 0 0 INIT[4]
0 1 0 1 INIT[5]
0 1 1 0 INIT[6]
0 1 1 1 INIT[7]
1 0 0 0 INIT[8]
1 0 0 1 INIT[9]
1 0 1 0 INIT[10]
1 0 1 1 INIT[11]
1 1 0 0 INIT[12]
1 1 0 1 INIT[13]
1 1 1 0 INIT[14]
1 1 1 1 INIT[15]
INIT = Binary equivalent of the hexadecimal number assigned to the INIT attribute

Design Entry Method

Instantiation Yes
Inference Recommended
IP Catalog No
Macro support No

Available Attributes

Attribute Type Allowed Values Default Description
INIT HEX Any 16-Bit Value All zeros Initializes look-up tables.

VHDL Instantiation Template

Unless they already exist, copy the following two statements and paste them before the entity declaration.
Library UNISIM;
use UNISIM.vcomponents.all;

-- LUT4: 4-input Look-Up Table with general output
--       7 Series
-- Xilinx HDL Language Template, version 2023.2

LUT4_inst : LUT4
generic map (
   INIT => X"0000")
port map (
   O => O,   -- LUT general output
   I0 => I0, -- LUT input
   I1 => I1, -- LUT input
   I2 => I2, -- LUT input
   I3 => I3  -- LUT input

-- End of LUT4_inst instantiation

Verilog Instantiation Template

// LUT4: 4-input Look-Up Table with general output (Mapped to a LUT6)
//       7 Series
// Xilinx HDL Language Template, version 2023.2

LUT4 #(
   .INIT(16'h0000)  // Specify LUT Contents
) LUT4_inst (
   .O(O),   // LUT general output
   .I0(I0), // LUT input
   .I1(I1), // LUT input
   .I2(I2), // LUT input
   .I3(I3)  // LUT input

// End of LUT4_inst instantiation

Related Information

  • 7 Series FPGAs Configurable Logic Block User Guide (UG474)