All Packages Class Hierarchy This Package Previous Next Index
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.arrayMult
This is a variable width stallable array multiplier in JHDL with the option of signed or unsigned multiply with a generic pipeline depth.

As seen in the diagram, the multiplier will multiply the two inputs on the buses x and y and produce a product outputted on the pout bus. If the width of the pout (product) bus is less than the sum of the width of the x and y buses, then the most significant bits will be outputted with the least significant bits truncated off.
Other characterics of note:
pipedepth stages starting at the last stage
and going to the first stage. Thus, if there is a shorter stage it
will be the first stage which allows inputs more time to arrive.
The number of pipeline stages (registers between multiplier stages)
can be calculated by following formula:
(Y=width(y) P=pipedepth and the operator '/' is
an integer divide (throw away remainder))
if P=0: pipline registers=0
otherwise: pipeline registers=
((Y-1)/P) + 1
Copyright (c) 1998-1999 Brigham Young University. All rights reserved. Reproduction in whole or in part in any form or medium without express permission of Brigham Young University is prohibited.
public static CellInterface cell_interface[]
public arrayMult(Node parent,
Wire x,
Wire y,
Wire clk_en,
Wire pout,
int sign,
int pipedepth)
parent - parent parameter(this)
x - Multiplicand input wire.
Note that this wire must be at least 3 bits wide (exception
will be thrown if it is not).
y - Multiplier input wire.
Note that wire bus must be at least 3 bits wide (exception
will be thrown if it is not).
clk_en - Clock enable for flip-flops used to
pipeline multiplier.
pout - Output wire that will return all the product
bits if width(pout)=width(x)+width(y). If width(pout) <
width(x)+width(y) then the most significant bits will be
returned. If width(pout) > width(x)+width(y),
then an ParamException is thrown.
sign - If sign==0 an unsigned multiplier will be
created and if sign==1 then a signed multiplier will be
created. All signed numbers need to be
represented in twos-complement form.
pipedepth - If pipedepth==0, a purely combinational
multiplier will be created.
If pipedepth==1, a fully pipelined multiplier will be created.
If pipdepth==2, a multiplier pipelined every other
stage will be produced. If pipedepth==n, a multiplier
pipelined every n stages with the last pipeline register
after the last stage will be produced.
x or y wire width is less
than 3 bits.
public arrayMult(Node parent,
Wire x,
Wire y,
Wire clk_en,
Wire pout,
int sign,
int pipedepth,
String instanceName)
parent - parent parameter(this)
x - Input wire that contains the multiplicand bits.
Note that this wire must be at least 3 bits wide (exception
will be thrown if it is not).
y - Input wire that contains the multiplier bits.
Note that wire bus must be at least 3 bits wide (exception
will be thrown if it is not).
clk_en - Clock enable for flip-flops used to
pipeline multiplier.
pout - Output wire that will return all the product
bits if width(pout)=width(x)+width(y). If width(pout) <
width(x)+width(y) then the most significant bits will be
returned. If width(pout) > width(x)+width(y),
then an ParamException is thrown.
sign - If sign==0 an unsigned multiplier will be
created and if sign==1 then a signed multiplier will be
created. All signed numbers need to be
represented in twos-complement form.
pipedepth - If pipedepth==0, a purely combinational
multiplier will be created.
If pipedepth==1, a fully pipelined multiplier will be created.
If pipdepth==2, a multiplier pipelined every other
stage will be produced. If pipedepth==n, a multiplier
pipelined every n stages with the last pipeline register
after the last stage will be produced.
instanceName - To allow a user defined instance
name for the multiplier.
x or y wire width is less
than 3 bits.
public boolean cellInterfaceDeterminesUniqueNetlistStructure()
public void initUserDefinedNode(UserDefinedNode udn)
public void paint(UserDefinedNode udn)
public static int latency(int yWidth,
boolean virtexMult,
int pipedepth)
yWidth - the width of the y input (second input) bus.
virtexMult - Is this a virtex multiplier?.
pipedepth - pipelining frequency.
0 means combinational divider, 1 means fully-pipelined,
2 means place a pipeline register every other stage,
3 means place a pipeline register every 3rd stage, etc.
public int getLatency()
public static int numOfStages(int yWidth,
boolean virtexMult)
yWidth - the width of the y input (second input) bus.
virtexMult - Is this a virtex multiplier?.
public int getNumOfStages()
protected boolean defaultSimulationModelIsBehavioral()
public void reset()
public void clock()
public void propagate()
public static long compute(long x,
int lx,
long y,
int ly,
int lp,
int sign)
x - input multiplicand value
lx - number of bits x is valid for (width of x bus)
y - input multiplier value
ly - number of bits y is valid for (width of y bus)
lp - number of product bits
kept (width of product bus)
sign - If sign==0, unsigned multiply.
If sign==1, signed multiply.
All Packages Class Hierarchy This Package Previous Next Index