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.lt
Generic less-than comparator.

Lt takes in two inputs of the same size. The output is high when in1 < in2, it is low otherwise. The comparison is signed or unsigned based on parameter "signed". An exception will be thrown if the two inputs are different widths.
This module works by instantiating a subtractor. If the user wants a signed comparator, the module sign extends the input by 1 bit, performs in1 - in2, and then returns the sign bit of the result. If the user wants an unsigned comparator, the module simply performs in1 - in2, inverts the carry-out, and returns that as the output.
CLB count:
public static CellInterface cell_interface[]
public static final String cellname
public lt(Node parent,
Wire in1,
Wire in2,
boolean signed,
Wire out)
parent - Parent of the class (this)
in1 - First input to the comparator of size width
in2 - Second input to the comparator of size width
signed - True = signed compare; False = unsigned compare
out - 1-bit output of the comparator
public String getCellName()
public void reset()
public void clock()
public void propagate()
protected boolean defaultSimulationModelIsBehavioral()
public int compute(int in1,
int in2,
boolean signed)
in1 - first input of size width
in2 - second input of size width
All Packages Class Hierarchy This Package Previous Next Index