All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class byucc.jhdl.modgen.arrayMult

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

public class arrayMult
extends Logic
implements UserDefinedSchematic
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.

General Description

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:

  • The multiplicand and the multiplier must be as least 3 bits. Currently the behavioral model will be valid if the sum of the bit widths of the multiplicand and the multiplier does not exceed 64. The multiplier structurally should be valid for input widths up to 64 bits (although any case where either of the input wire widths are greater than 32 bits or the output wires width is greater than 64 bits have not been tested thouroughly and are not guaranteed to be correct).
  • The width of x determines the height and the width of y determines the width of the multiplier (see technology section below for exact sizes).
  •  

    Implementation

    All Technologies

    This is a standard array multiplier.

    Pipelining

    This multiplier will place a pipeline register after every 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
     

    Xilinx XC4000

    Area

    Enter parameters below to find the size of a specific sized multiplier (units are in CLBs). Note that the dimensions count any CLB that is partially used (i.e. the flip-flops in the CLB may be used but not the LUTs and carryLogic). An important note is that if the clock enable pin is tied high, the Xilinx placement tools will optimize this net away, thus eliminating the potential critical path of a clock enable net.
    Fill in the fields below and press compute

    Input X Width (must be >= 3, default 3):

    Input Y Width (must be >= 3, default 3):

    Number of Pipeline Stages (default 0):
    0 = purely combinational
    1 = fully pipelined (pipeline register after every adder stage)
    2 = half-pipelined (pipeline register after every other adder stage)

    Signed: Signed

    Part Size:

    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.

    Author:
    Russell Fredrickson

    Variable Index

     o cell_interface
    Standard JHDL CellInterface.

    Constructor Index

     o arrayMult(Node, Wire, Wire, Wire, Wire, int, int)
    Constructor without an instance name parameter.
     o arrayMult(Node, Wire, Wire, Wire, Wire, int, int, String)
    Constructor with an instance name parameter.

    Method Index

     o cellInterfaceDeterminesUniqueNetlistStructure()
     o clock()
    Clock method is used for behavioral pipelined similuation.
     o compute(long, int, long, int, int, int)
    Compute method will provide a mathematically correct answer to what the multiplier would compute with the given parameters and inputs.
     o defaultSimulationModelIsBehavioral()
    The default simulation model is behavioral.
     o getLatency()
    Method to get the latency of a multiplier is already constructed.
     o getNumOfStages()
    Method to get the number of pipelinable logic stages of a multiplier that is already constructed.
     o initUserDefinedNode(UserDefinedNode)
    init method needed for UserDefinedSchematic interface.
     o latency(int, boolean, int)
    The latency method gives the latency in clock cycles of the module with the given input parameters.
     o numOfStages(int, boolean)
    Method that calculates the number of pipelinable logic stages (stages consist of mulitplier/adder units).
     o paint(UserDefinedNode)
    paint method for UserDefinedSchematic interface.
     o propagate()
    Propagate method for combinational behavioral simulation (no registers).
     o reset()
    Reset method simply puts zeros onto pout wire and clears behavioral delay array.

    Variables

     o cell_interface
     public static CellInterface cell_interface[]
    
    Standard JHDL CellInterface.

    Constructors

     o arrayMult
     public arrayMult(Node parent,
                      Wire x,
                      Wire y,
                      Wire clk_en,
                      Wire pout,
                      int sign,
                      int pipedepth)
    
    Constructor without an instance name parameter.

    Parameters:
    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.
    Throws: arrayMult. ParamException
    Thrown when multiplier parameters are invalid, impossible to implement, or when either the x or y wire width is less than 3 bits.
     o arrayMult
     public arrayMult(Node parent,
                      Wire x,
                      Wire y,
                      Wire clk_en,
                      Wire pout,
                      int sign,
                      int pipedepth,
                      String instanceName)
    
    Constructor with an instance name parameter.

    Parameters:
    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.
    Throws: arrayMult. ParamException
    Thrown when multiplier parameters are invalid, impossible to implement, or when either the x or y wire width is less than 3 bits.

    Methods

     o cellInterfaceDeterminesUniqueNetlistStructure
     public boolean cellInterfaceDeterminesUniqueNetlistStructure()
    
    Overrides:
    cellInterfaceDeterminesUniqueNetlistStructure in class Cell
     o initUserDefinedNode
     public void initUserDefinedNode(UserDefinedNode udn)
    
    init method needed for UserDefinedSchematic interface.

     o paint
     public void paint(UserDefinedNode udn)
    
    paint method for UserDefinedSchematic interface.

     o latency
     public static int latency(int yWidth,
                               boolean virtexMult,
                               int pipedepth)
    
    The latency method gives the latency in clock cycles of the module with the given input parameters. When an arrayMult module is constructed the class variable latency is set using this method.

    Parameters:
    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.
    Returns:
    Integer representing the latency of the multiplier. 0 means that there is no delay (fully-combinational), 1 means that the outputs will appear one cycle after corresponding inputs, etc.
     o getLatency
     public int getLatency()
    
    Method to get the latency of a multiplier is already constructed.

     o numOfStages
     public static int numOfStages(int yWidth,
                                   boolean virtexMult)
    
    Method that calculates the number of pipelinable logic stages (stages consist of mulitplier/adder units).

    Parameters:
    yWidth - the width of the y input (second input) bus.
    virtexMult - Is this a virtex multiplier?.
    Returns:
    Integer value that represents the number of pipelinable logic stages.
     o getNumOfStages
     public int getNumOfStages()
    
    Method to get the number of pipelinable logic stages of a multiplier that is already constructed.

     o defaultSimulationModelIsBehavioral
     protected boolean defaultSimulationModelIsBehavioral()
    
    The default simulation model is behavioral.

    Overrides:
    defaultSimulationModelIsBehavioral in class Structural
     o reset
     public void reset()
    
    Reset method simply puts zeros onto pout wire and clears behavioral delay array.

    Overrides:
    reset in class Structural
     o clock
     public void clock()
    
    Clock method is used for behavioral pipelined similuation. This uses a delay array and a global pointer count to create simulated pipelining.

    Overrides:
    clock in class Structural
     o propagate
     public void propagate()
    
    Propagate method for combinational behavioral simulation (no registers).

    Overrides:
    propagate in class Structural
     o compute
     public static long compute(long x,
                                int lx,
                                long y,
                                int ly,
                                int lp,
                                int sign)
    
    Compute method will provide a mathematically correct answer to what the multiplier would compute with the given parameters and inputs. Note that this method will not be valid if (lp>(lx+ly)) and will return a 0.

    Parameters:
    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.
    Returns:
    Long integer product of x and y valid for lp number of bits. If (lp>(lx+ly)) then a 0 will be returned.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index