All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class byucc.jhdl.modgen.fp.floatMult

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.floatMult

public class floatMult
extends Logic

General Description

Floating Point Multiplier with generic sized exponent and mantissa

FloatMult takes in two inputs of the same size, multiplies the two together using floating point arithmetic, and then outputs the result. The output must be the same size as the inputs, otherwise an exception is thrown.

 

Implementation

All Technologies

The user will specify the size "expSize" of the exponent. The first bit of the inputs bit is treated as the sign bit, the next "expSize" bits are treated as the exponent, and all the remaining bits are treated as the mantissa. The output is generated using floating point arithmetic, using an adder to add the exponents and an array multiplier to do the multiplication of the mantissas. The result of this multiplication is truncated as needed. The array multiplier may be pipelined, as specified by the pipeDepth parameter. If pipeDepth=0, the multiplier is purely combinational. Otherwise, if pipeDepth="n", then registers are placed every "n" stages of the multiplier. See Array Multiplier Documentation for more details.

In addition, the floating point multiplier can take into consideration special numbers. For example, an input of all zeros represents the numeric value 0. If the exponent is all ones and the mantissa is all zeros, this can represent +/- infinity. If the exponent is all ones, but the mantissa is not all zeros, this represents NaN, or Not a Number. This floating point multiplier doesn't support denormalized numbers, or numbers with zeros as the exponent and something nonzero as the mantissa.

The floating point multiplier checks for overflow and underflow as it does the multiply. This condition occurs when the exponent field isn't large enough to hold the new calculated exponent.

Xilinx XC4000

CLB count:

Fill in the fields below and press compute

Exponent Size (must be >= 2, default 2):

Mantissa Size (must be >= 2, default 2):

Number of Pipeline Stages (default 0):
0 = purely combinational
1 = fully pipelined (pipeline register after every adder stage)
2 = half-pipelined (pipeline register after every other adder stage)
N = pipeline register every Nth stage

Approx CLB count:

Author:
Tim Wheeler

Variable Index

 o cell_interface
 o cellname

Constructor Index

 o floatMult(Node, Wire, Wire, Wire, Wire, Wire, int, int)

Method Index

 o clock()
Clock is used in the behavioral model if there is pipelining
 o compute(long, long, int, int, int)
Used in behavioral model to compute the output
 o defaultSimulationModelIsBehavioral()
Default simulation model is behavioral
 o getCellName()
returns the cellname
 o getDelayDepth()
returns the number of clock cycles it takes to generate an output due to pipelining
 o getMantSize()
returns the size of the mantissa
 o propagate()
Propagate is used if the circuit is purely combinational logic
 o reset()
Resets the output to zero

Variables

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

Constructors

 o floatMult
 public floatMult(Node parent,
                  Wire in1,
                  Wire in2,
                  Wire clk_en,
                  Wire out,
                  Wire flowError,
                  int expSize,
                  int pipeDepth)
Parameters:
parent - Parent of the class (this)
in1 - input 1
in2 - input 2
clk_en - clock enable
out - the output of the floating point multiplier
flowError - 1 = overflow or underflow occurred
expSize - the size of the exponent
pipeDepth - determines the number of pipestages

Methods

 o getCellName
 public String getCellName()
returns the cellname

Overrides:
getCellName in class Cell
 o getMantSize
 public int getMantSize()
returns the size of the mantissa

 o getDelayDepth
 public int getDelayDepth()
returns the number of clock cycles it takes to generate an output due to pipelining

 o reset
 public void reset()
Resets the output to zero

Overrides:
reset in class Structural
 o clock
 public void clock()
Clock is used in the behavioral model if there is pipelining

Overrides:
clock in class Structural
 o propagate
 public void propagate()
Propagate is used if the circuit is purely combinational logic

Overrides:
propagate in class Structural
 o defaultSimulationModelIsBehavioral
 protected boolean defaultSimulationModelIsBehavioral()
Default simulation model is behavioral

Overrides:
defaultSimulationModelIsBehavioral in class Structural
 o compute
 public long[] compute(long in1,
                       long in2,
                       int width,
                       int expSize,
                       int mantSize)
Used in behavioral model to compute the output

Parameters:
in1 - input 1
in2 - input 2
width - the input and output width
expSize - the size of the exponent
mantSize - the size of the mantissa
Returns:
An array containing the output and the overflow/underflow bit

All Packages  Class Hierarchy  This Package  Previous  Next  Index