Dedicated lookahead carry logic is provided mainly to perform fast arithmetic operations. Each CLB SLICE has a lookahead logic block. The fast carry logic paths and associated elements are shown in the following figure. As an example, each lookahead logic block shown in the following figure can be used to implement an 8-bit adder or subtractor. Many lookahead logic blocks can be cascaded to support wider arithmetic logic.
The carry out outputs, CO[7:0], and the sum outputs, O[7:0], drive FFMUXs, which allow them to be registered or remained combinatorial before driving the general routing. Unlike previous architectures, Versal lookahead logic only generates the odd carry out outputs. The even carry out outputs are generated by the LUT. The LUT is also used to generate the sum outputs, O[7:0]. The lookahead logic has 4 muxes. Each mux together with 2 LUTs can be used to implement a fast 2-bit adder. Detailed implementation of the first two bits for an adder is shown in the following figure.
Figure 2 shows one version of how the LUTs can be configured to implement a 2-bit adder together with the first stage of the lookahead logic. If A5 of LUTA is used to initialize the adder, the lookahead logic cannot be used for the first 2 bits of the adder. The LOOKB attribute must be set to 0 so that O6 of LUTB is always selected to drive cout1. If CIN is used to initialize the adder, the LOOKB attribute should be set to 1 so that the lookahead mux can select other inputs to drive cout1 according to the PROP output of LUTA and LUTB. In this case, setting LOOKB to 0 still provides the correct functionality, but the performance is not as good. For attribute LOOKD, F, H, which controls the lookahead logic for higher bits, setting them to 1 to use the look-ahead logic is recommended for a better performance.
The carry chain runs upward and has a height of eight bits per CLB slice. The first bit in a carry chain can come from A5 input of LUTA or CIN which is COUT of the SLICE below. The value for A5 input can be either 0 (for add), 1 (for subtract), or dynamically controlled.
Currently, Vivado software only supports starting the carry chain from LUTA ,which is at the bottom of the CLB SLICE. There are dedicated connections that connect the lookahead logic from the COUT (logically the same as CO7) pin of one SLICE to the CIN pin of the SLICE above to form longer carry chain. Wide logic functions like multiplexer and comparator can also take advantage of this lookahead logic.