MyRTPCore
Class RecodingConstMult

java.lang.Object
  |
  +--com.xilinx.JBits.Virtex.RTPCore.Core
        |
        +--MyRTPCore.RecodingConstMult

public class RecodingConstMult
extends com.xilinx.JBits.Virtex.RTPCore.Core

This design implements a constant multiplier using signed canonical recoding, i.e. it implements for example x*7 as x<<3 - x instead of x + x<<1 + x<<2


Field Summary
protected static int K
          The constant K
 com.xilinx.JRoute.Virtex.Router.Port[] Out
          The output will be the product of X by K.
protected static int sizeK
          The size in bits of the constant K
protected static int sizeX
          The size in bits of the X input
static boolean verbose
          The user may set the verbose level
 com.xilinx.JRoute.Virtex.Router.Port[] X
          The X input, will be of size sizeX
 com.xilinx.JRoute.Virtex.Router.Port Zero
          The Zero port: the user of the core should feed it a logical zero
 
Fields inherited from class com.xilinx.JBits.Virtex.RTPCore.Core
clbColumn, clbHeight, clbRow, clbWidth, name, state, tag, uniqueTag, written
 
Constructor Summary
RecodingConstMult(int _sizeX, int _sizeK, int _K)
          Constructor of the multiplier.
 
Method Summary
static void main(java.lang.String[] arg)
          The main method tests the booth encoding functions
 void set(com.xilinx.JBits.Virtex.JBits jBits, int row, int col)
          Instantiates the multiplier in the case when there is no router object available.
 void set(com.xilinx.JBits.Virtex.JBits jBits, com.xilinx.JRoute.Virtex.Router.RouterWithPorts router, int row, int col)
          Instantiates the multiplier.
static void testBooth()
          Test function
 
Methods inherited from class com.xilinx.JBits.Virtex.RTPCore.Core
getClbColumn, getClbHeight, getClbRow, getClbWidth, getName, getState, getTag, getUniqueTag, protect, setName, setTag, setUniqueTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sizeX

protected static int sizeX
The size in bits of the X input

sizeK

protected static int sizeK
The size in bits of the constant K

K

protected static int K
The constant K

Zero

public com.xilinx.JRoute.Virtex.Router.Port Zero
The Zero port: the user of the core should feed it a logical zero

X

public com.xilinx.JRoute.Virtex.Router.Port[] X
The X input, will be of size sizeX

Out

public com.xilinx.JRoute.Virtex.Router.Port[] Out
The output will be the product of X by K. The size of this array is sizeX+sizeK

verbose

public static boolean verbose
The user may set the verbose level
Constructor Detail

RecodingConstMult

public RecodingConstMult(int _sizeX,
                         int _sizeK,
                         int _K)
Constructor of the multiplier. It takes the sizes of both the constant an the input port, and the constant value K. It computes the size the core will have without actually placing and routing it. This size will be in the Core variables clbWidth and clbHeight. This constructor also creates the three ports of this multiplier: the input X (of sizeX bits), the output Out (of sizeX+sizeK bits) and the input Zero, which should be connected to logic zero
Method Detail

testBooth

public static void testBooth()
Test function

set

public void set(com.xilinx.JBits.Virtex.JBits jBits,
                int row,
                int col)
         throws com.xilinx.JBits.Virtex.ConfigurationException
Instantiates the multiplier in the case when there is no router object available. Warning, this function does instantiate a router object, and using it will probably lead to resource conflicts at a later date.
Overrides:
set in class com.xilinx.JBits.Virtex.RTPCore.Core

set

public void set(com.xilinx.JBits.Virtex.JBits jBits,
                com.xilinx.JRoute.Virtex.Router.RouterWithPorts router,
                int row,
                int col)
         throws com.xilinx.JBits.Virtex.ConfigurationException
Instantiates the multiplier. This method takes a JBits object, a Router object which will be used to route the inners of the core, and the position of the multiplier

main

public static void main(java.lang.String[] arg)
The main method tests the booth encoding functions