All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class byucc.jhdl.modgen.lt

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

public class lt
extends Logic

General Description

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.

 

Implementation

All Technologies

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.

Xilinx XC4000

CLB count:

# of CLBs = 2 + width/2 CLBs placed in a column.

Author:
Tim Wheeler

Variable Index

 o cell_interface
 o cellname
The input is a generic width

Constructor Index

 o lt(Node, Wire, Wire, boolean, Wire)

Method Index

 o clock()
Clock isn't used in this module
 o compute(int, int, boolean)
Used in behavioral model to compute the output
 o defaultSimulationModelIsBehavioral()
Default simulation model is behavioral
 o getCellName()
 o propagate()
Propagate is used in the behavioral model to propagate the inputs
 o reset()
Resets the output to zero

Variables

 o cell_interface
 public static CellInterface cell_interface[]
 o cellname
 public static final String cellname
The input is a generic width

Constructors

 o lt
 public lt(Node parent,
           Wire in1,
           Wire in2,
           boolean signed,
           Wire out)
Parameters:
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

Methods

 o getCellName
 public String getCellName()
Overrides:
getCellName in class Cell
 o reset
 public void reset()
Resets the output to zero

Overrides:
reset in class Structural
 o clock
 public void clock()
Clock isn't used in this module

Overrides:
clock in class Structural
 o propagate
 public void propagate()
Propagate is used in the behavioral model to propagate the inputs

Overrides:
propagate in class Structural
 o defaultSimulationModelIsBehavioral
 protected boolean defaultSimulationModelIsBehavioral()
Default simulation model is behavioral

Overrides:
defaultSimulationModelIsBehavioral in class Structural
 o compute
 public int compute(int in1,
                    int in2,
                    boolean signed)
Used in behavioral model to compute the output

Parameters:
in1 - first input of size width
in2 - second input of size width
Returns:
1 if in1 < in2; else returns 0

All Packages  Class Hierarchy  This Package  Previous  Next  Index