Archived page:
modgen.fysel.ntnu.no/~pihl/modgen/options.html, Wayback Machine capture of 2001-04-04.
About the rebirth
General Information
Help on options, please!
Help on functional verification, please!
This module generator is a CAD tool for generating technology independent structural netlists for high performance multipliers, adders, subtractors, and squarers. It makes extensive use of tree structures both for the adder and the multiplier, therefore trading area for lower delay.
The input options given on the web page specify among other things:
Type of operation
If registers should be inserted on inputs, outputs, or both
Multiplier options: optional Booth recoding and pipelining
Output HDL: Verilog or VHDL (default)
The output after executing the module generator, features:
An HDL file received in the browser. The file is self-contained and is straightforward to simulate.
The HDL code is a structural netlist consisting of leaf cells such as full adders, half adders, carry generate and propagate cells, flip-flops etc. The leaf cells are typically implemented with 1 to 4 gates (see How to create mapped leaf cell library in Synopsys).
The HDL code should be saved to a file by the user. It is suggested to synthesize bottom-up as described in Suggested Synopsys DC compile script
Adder structure
The adder structure is of fast carry lookahead type with a binary tree structure. This means the carries are evaluated in groups of two bits at the first level, in groups of four bits at the second level, third level in groups of 8 bits etc. Finally the sum bits are evaluated using the carries and xor/xnor gates. Because the adder structure is of binary tree type, its inputs and outputs will always have a word length of a power of two (when a width not a power of two is specified, adder width becomes the next higher power of two). The figure below shows an example of an 8-bit binary tree adder.

Multiplier target architecture
The multiplier consists of three parts: partial product generator with optional Booth recoding, partial product summation utilizing Wallace trees, and a final vector merging adder of the previously described binary tree type. Registers may also be inserted at the input or output or both, and in one or several pipelining stages internally in the multiplier. The figure below shows an overview of the multiplier target architecture.

Notice that when Booth recoding is used the number of partial products are reduced to from n to n/2, n being the word length. Booth recoding is a clever way of recoding the original partial products utilizing that multiplication by two is a simple left shift, and that subtraction is simply an inversion. Booth recoding, however, yields more improvement the larger the word length is, such that for multipliers of size approximately 8x8 bit and smaller it is of limited benefit. Also, note that with Booth recoding there will be some potentially large fan-out nodes inside the Booth recoder.
For a squarer the partial product generation exploits the symmetry of the partial product matrix. This is further described in the paper published at 39th Midwest Symposium on Circuits and Systems
Wallace tree structures
Wallace trees and its generalization Dadda's reduction scheme are tree structures for multiple additions. In this context we use the collective term Wallace trees. The figure below shows an example of partial product summation with Wallace trees, for 9-bit operands. CSA=Carry-Save Adder consisting of up to two times the word-length number of full adders.

The structure of Wallace trees is not unique, i.e. there are several ways of building a particular Wallace tree. For example, a carry generated in one column may be introduced in the next more significant column at different places, e.g. close to the tree root or close to the output. The Module Generator builds the Wallace trees dynamically with the aim of reducing the number of carries generated in each column, therefore reducing the total tree height. Note that Level in the context of Wallace trees means vertical position within the tree in terms of number of full adder levels.
Buffering and pipelining
Registers may be inserted at the input, output or both, of all generated modules as indicated in the figure on multiplier target architecture above. In addition, flip-flops may be inserted between the full adder levels within the Wallace trees. This is a unique feature for the Module Generator, giving it ability to both build the Wallace trees dynamically and insert arbitrary pipelining. The figure below shows how this is done with the Wallace tree example above, for 1-step pipeline to the left and 2-step pipeline to the right.


By selecting 'Yes, inside Wallace trees...', the user may explicitly control the insertion of pipelining in the Wallace trees. The pipelining options for pipelining inside the Wallace trees are given as two numbers: (1) the number of full adders between pipelining stages, and (2) the adder level for the first stage. Since the number of adder levels (also called Maxlevel) is determined as Modgen builds the Wallace trees, it is suggested to first make a pre-run of Modgen without pipelining and with 'Verbose' ticked. In Modgen's response there will appear a line stating what Maxlevel is for this particular design. The two numbers for pipelining inside the Wallace trees may then be specified between 1 and Maxlevel.
Notice that the closer the Wallace tree root a pipelining stage is inserted, the higher the number of flip-flops will be. At each full adder level in the Wallace trees the total number of partial product bits are reduced by approximately a factor 3/2, therefore yielding an approximate O(log3/2n) delay behavior.
Options
Operation Specify the desired module's operation. Possible values are Adder, Subtracter, Multiplier, Squarer, Wallace trees and simple register.
Operand width Specify the width of the operands. For an adder or subtracter the largest of the two given values will be used.
Registers Specify if there should be registers on the resulting modules' inputs or output or both. Default is none. All registers has a behavioral description internally. The registers will need an extra compile step at the synthesis phase.
Booth recoding Specify if Booth recoding should be used. Default is yes. When no Booth recoding is specified the partial product bits are generated with and gates in the usual way.
Pipelining For multipliers, squarers and Wallace trees, additional
pipelining may be inserted. If 1 step is chosen, there will be a register after
the Wallace trees' outputs, if 2 steps is chosen, there will be one additional
register at the root of the Wallace trees. Arbitrary pipelining may be
specified with the last alternative. As the construction process of the
Wallace trees is dynamic it is suggested to pre-run the Module Generator
without pipelining and with verbose ticked, in order to first determine the
number of full adder levels (look for the line at the end stating the value
of Maxlevel). The two arguments for pipelining inside the Wallace trees then
specify: (1) how many full adders there should be between flip-flops, and
(2) the first level after which a pipelining stage should be inserted. Both
arguments may take on values between 1 and Maxlevel. Notice that when too
large values are specified, no pipelining stages will be inserted. Default
is no pipelining.
Truncation Truncates the module output with the specified number of bits from the LSB side.
Customized Wallace trees This option allows for general Wallace
trees to be created (not just the ones tailored for multiplication and
squaring). This is done by either specifying the number of bits in each
column of the multiple addition or specifying the bit widths of each
addend. When column heights are specified, the bit heights should be
ordered from MSB to LSB and separated by spaces. When bit widths are
specified, it is assumed they are aligned on the LSB (bit widths should
in the same way be separated by spaces).
Format Specify output HDL format, Verilog or VHDL. Default is VHDL. Additionally, VHDL with std_logic data types may be selected.
Carry-save output With this option the vector merging adder is
omitted, and the carry and sum vectors become the outputs. This option only has
effect with multipliers and squarers.
Accumulate By specifying accumulate, an accumulator of the
specified bit width with synchronous reset is inserted after the Wallace trees.
This option only has effect with multipliers and squarers.
If you would like to be notified about updates and new features of the module generator, there is also a mailing list:
Add me to the Modgen mailing list.
Johnny Pihl 1998