|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbyucc.jhdl.base.Nameable
byucc.jhdl.base.Node
byucc.jhdl.base.Cell
byucc.jhdl.base.Structural
byucc.jhdl.Logic.LogicGates
byucc.jhdl.Logic.LogicStatic
byucc.jhdl.Logic.Logic
byucc.jhdl.Logic.Modules.FloatingPoint.toFloat
Fixed-point to floating-point converter (or integer to floating-point).
To learn about the floating-point format, see the FloatingPoint package summary.
The toFloat module can also be instanced
using static method calls in the FLOATINGPOINT
class.
If desired, however, the constructor calls
may be made explicitly, as shown below.
First, you must import the Logic.Modules.FloatingPoint package:
import byucc.jhdl.Logic.Modules.FloatingPoint.*;
To instance a toFloat the following constructor would be used:
new toFloat (this, fixedWire, floatWire, fixedExponent, fixedIsSigned, floatExpWidth, pipelined, name);
For a more complete example, see examples/toFloatExample.java.
For example: 1000 (binary two's complement) = -8, but this takes five bits in signed-magnitude form (1(sign) 1000(magnitude)). All other four-bit two's complement representations fit in four bits in signed-magnitude form.
Solution: If the lowest negative number must be handled, sign-extend the input by one bit.
For all available constructors, see
Constructor Summary or
Constructor Detail.
Field Summary | |
static CellInterface[] |
cell_interface
|
Fields inherited from class byucc.jhdl.Logic.Logic |
ABOVE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_LEFT, ALIGN_LSB, ALIGN_MSB, ALIGN_RIGHT, ALIGN_TOP, BELOW, DOWN, EAST_OF, LEFT_OF, MAX_PACK, NORTH_OF, ON, ONTOP, ONTOP_OF, RIGHT_OF, SOUTH_OF, TOLEFT, TORIGHT, UNCONSTRAINED, UP, WEST_OF |
Fields inherited from class byucc.jhdl.Logic.LogicGates |
tech_mapper |
Constructor Summary | |
toFloat(Node parent,
Wire fixedWire,
Wire floatWire,
int fixedExponent,
boolean fixedIsSigned,
int floatExponentWidth,
boolean pipelined)
Generates a fixed-to-float converter with a default instance name. |
|
toFloat(Node parent,
Wire fixedWire,
Wire floatWire,
int fixedExponent,
boolean fixedIsSigned,
int floatExponentWidth,
boolean pipelined,
java.lang.String instanceName)
Generates a fixed-to-float converter. |
Method Summary | |
void |
clock()
Used by the simulator. |
void |
compute(BV fixedBV,
int fixedExponent,
FloatBV floatBV)
Computes a bit-accurate result without timing information. |
boolean |
defaultSimulationModelIsBehavioral()
Used by the simulator. |
int |
getLatency()
Returns the latency of the design. |
void |
propagate()
Used by the simulator. |
void |
reset()
Used by the simulator. |
Methods inherited from class byucc.jhdl.base.Node |
addObservable, addSimulatorCallback, checkAll, delete, getBuildingFlag, getChildren, getChildrenEnumeration, getInstanceName, getParent, getParentCell, getRelatives, getSystem, getWires, optimize, orphanAllowed, printAllChildren, printTree, removeSimulatorCallback, setDefaultClock |
Methods inherited from class byucc.jhdl.base.Nameable |
caseSensitivity, caseSensitivity, disableNameClashChecking, getFullName, getFullNameNoTestBench, getHierNameNoTestBench, getInstanceNo, getInstanceNumber, getLeafName, getLeafName, getRelativeName, getUserName, getUserName, hasUserSpecifiedName, isDescendantOf, setInstanceNumber |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static CellInterface[] cell_interface
Constructor Detail |
public toFloat(Node parent, Wire fixedWire, Wire floatWire, int fixedExponent, boolean fixedIsSigned, int floatExponentWidth, boolean pipelined)
See toFloat(Node, Wire, Wire, int, boolean, int, boolean, String)
.
public toFloat(Node parent, Wire fixedWire, Wire floatWire, int fixedExponent, boolean fixedIsSigned, int floatExponentWidth, boolean pipelined, java.lang.String instanceName)
The input wire fixedWire
holds the fixed-point or integer
value to be converted.
The input is treated as an integer with a fixed base-two exponent,
so that the true value is
fixedWire * 2fixedExponent
The fixedIsSigned
parameter tells whether the value is
signed (two's complement) or unsigned.
The output wire is the converted floating-point result.
The floatExponentWidth
parameter specifies the number
of bits used for the exponent.
Method Detail |
public int getLatency()
getLatency
in interface Pipelineable
public void reset()
reset
in interface Clockable
reset
in class Structural
public void clock()
clock
in interface Clockable
clock
in class Structural
public void propagate()
propagate
in interface byucc.jhdl.base.Propagateable
propagate
in class Structural
public boolean defaultSimulationModelIsBehavioral()
defaultSimulationModelIsBehavioral
in class Structural
public void compute(BV fixedBV, int fixedExponent, FloatBV floatBV)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |