All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class byucc.jhdl.modgen.fp.FPAdd

java.lang.Object
   |
   +----byucc.jhdl.base.Nameable
           |
           +----byucc.jhdl.base.Node
                   |
                   +----byucc.jhdl.base.Cell
                           |
                           +----byucc.jhdl.base.Structural
                                   |
                                   +----byucc.jhdl.Logic.Logic
                                           |
                                           +----byucc.jhdl.modgen.fp.FPAdd

public class FPAdd
extends Logic

General Description

This builds a generic sized floating point adder. The adder is parameterized according to mantissa size, exponent size, and pipeline level.

Implementation

All Technologies

Floating point adders have a minimum exponent size of 4 bits, and a maximum of 16 bits. The minimum mantissa size is four bits, and the maximum is 61 bits or 2^exponent size - 1, which ever is smaller.

Operand Format

The operands for the floating point adder follow the standard convention for floating point numbers. There is a sign bit associated with each number, and the mantissas are normalized with the bit point to the left of the msb of the mantissa. There is an implied 1 before the bit point. Zero is represented by a zero mantissa and zero exponent. Specific definitions described in the IEEE standard such as denormals, NaN, and infinity are not supported.

Pipelining

There are three pipelining levels for the floating point adder. Pipelining levels and their associated latencies are shown below:
Pipeline level Latency
0 (combinational) 1 cycle
1 7 cycles
2 7 + log2(mantissa size) cycles

Author:
Jeremy Anderson

Variable Index

 o cell_interface
 o cellname

Constructor Index

 o FPAdd(Node, int, Wire, Wire, Wire, Wire, Wire, Wire, Wire, Wire, Wire, Wire, Wire)
Constructor for floating point adder

Method Index

 o clock()
 o compute(int, int, long, long, int, int, int, int)
Compute is the behavioral model of this circuit.
 o defaultSimulationModelIsBehavioral()
The default simulation model is behavioral if techmapping is not enabled, structural otherwise.
 o getCellName()
 o propagate()
 o reset()

Variables

 o cell_interface
 public static CellInterface cell_interface[]
 o cellname
 public static final String cellname

Constructors

 o FPAdd
 public FPAdd(Node parent,
              int pipe_level,
              Wire clk_en,
              Wire manta,
              Wire mantb,
              Wire expa,
              Wire expb,
              Wire signa,
              Wire signb,
              Wire mantout,
              Wire expout,
              Wire signout,
              Wire ofl_flag)
Constructor for floating point adder

Parameters:
parent - Parent of this circuit
pipe_level - Pipelining level. See "Pipelining" above for details.
clk_en - High asserted clock enable pin. Pass in null for no clock enable.
manta - Mantissa of the a operand.
mantb - Mantissa of the b operand.
expa - Exponent of the a operand.
expb - Exponent of the b operand.
signa - Sign of the a operand. 1 for negative, 0 for positive.
signb - Sign of the b operand.
mantout - Mantissa of the output.
expout - Exponent of the output.
signout - Sign of the output.
ofl_flag - Flag to tell if overflow occurred in the adder.

Methods

 o getCellName
 public String getCellName()
Overrides:
getCellName in class Cell
 o defaultSimulationModelIsBehavioral
 public boolean defaultSimulationModelIsBehavioral()
The default simulation model is behavioral if techmapping is not enabled, structural otherwise.

Overrides:
defaultSimulationModelIsBehavioral in class Structural
 o compute
 public static long[] compute(int mantwidth,
                              int expwidth,
                              long manta,
                              long mantb,
                              int expa,
                              int expb,
                              int signa,
                              int signb)
Compute is the behavioral model of this circuit. All inputs should be positive.

Parameters:
mantwidth - Number of bits in the mantissa operands.
expwidth - Number of bits in the exponent operands.
manta - Input value of the mantissa of the a operand.
mantb - Input value of the mantissa of the b operand.
expa - Input value of the exponent of the a operand.
expb - Input value of the exponent of the b operand.
signa - Sign of the a operand (1 for negative, 0 for positive).
signb - Sign of the b operand.
Returns:
Array of integers containing output mantissa,output exponent, output sign, and ofl_flag.
 o propagate
 public void propagate()
Overrides:
propagate in class Structural
 o clock
 public void clock()
Overrides:
clock in class Structural
 o reset
 public void reset()
Overrides:
reset in class Structural

All Packages  Class Hierarchy  This Package  Previous  Next  Index