Hyperflex® Architecture High-Performance Design Handbook

ID 683353
Date 12/06/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

2.4.2.17. Ternary Adders

Implementing ternary adders can increase resource usage in Hyperflex® architecture FPGAs. However, unless your design heavily relies on ternary adder structure, additional resource usage may not be noticeable at the top design level. However, a review of the design level at which you add a ternary adder structure can show an increase in LUT count. In addition, the amount of resource increase directly correlates to the size of the adder. Small width adders (size < 16 bits) do not cause much resource difference. However, increasing the size of the adder increases the resource count differential, in comparison with older FPGA technology.

Ternary Adder RTL Code

module ternary_adder (CLK, A, B, C, OUT);
	parameter WIDTH = 16;
	input [WIDTH-1:0] A, B, C;
	input 			  CLK;
	output [WIDTH-1:0] OUT;

	wire [WIDTH-1:0]    sum1;	
	reg [WIDTH-1:0]   sumreg1;

   	// 3-bit additions
	assign 			  sum1 = A + B + C;		
	assign 			  OUT = sumreg1;

	// Registers
	always @ (posedge CLK)
		begin
			sumreg1 <= sum1;
		end
endmodule

This increase in device resource use occurs because the Hyperflex® architecture ALM does not have a shared arithmetic mode that previous FPGA technologies have. The ALM in shared arithmetic mode can implement a three-input add in the ALM. By contrast, the Hyperflex® architecture ALM can implement only a two-input add in the ALM.

Figure 82. RTL View of Arria® 10 versus Hyperflex® Architecture FPGAs to add 2 LSBs from a three 8-bit input adder

In shared arithmetic mode, the Arria® 10 ALM allows a three-input adder to use three adaptive LUT (ALUT) inputs: CIN, SHAREIN, COUT, SUMOUT, and SHAREOUT. The absence of the shared arithmetic mode restricts ALM use with only two ALUT inputs: CIN, COUT and SUMOUT. The figure below shows the resulting implementation of a ternary adder on both Arria® 10 and Hyperflex® architecture FPGAs.

Figure 83.  Arria® 10: ALMs used to add 2 LSBs from a three 8-bit input adder
Figure 84.  Hyperflex® Architecture FPGAs: ALMs used to add 2 LSBs from a three 8-bit input adder