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.accum
Accumulator that allows a generic sized input and output.

Accum takes in a generic-sized input, either adds or subtracts
it to the current contents of the accumulator, and outputs the result.
The output wire width must be at least as wide as the input wire width.
If the result is too large to fit onto the output wire (overflow
occurs), the result is simply truncated.
All state changes occur on the rising edge. See the table
below to understand how it works:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The input is sign extended to match the output size. Thus, the input and output need not be the same width.
CLB count:
CLB placement:
public static CellInterface cell_interface[]
public accum(Node parent,
Wire in,
Wire clear,
Wire adsub,
Wire clk_en,
Wire out)
parent - Parent of the class (this)
in - Input to the accumulator
clear - When clear is asserted, out = +/-in
adsub - 1=add the input; 0=subtract the input
clk_en - When low, the output doesn't change
out - Output of the accumulator
public void reset()
public void clock()
public void propagate()
protected boolean defaultSimulationModelIsBehavioral()
public int compute(int in,
int inWidth,
int clear,
int adsub,
int outWidth)
in - input
inWidth - width to treat the input signal input
clear - when asserted, out = +/-in
adsub - 1=add the input; 0=subtract the input
outWidth - width of the output
All Packages Class Hierarchy This Package Previous Next Index