Math2mat
Public Member Functions | Protected Attributes | Package Functions

m2m.backend.buildingblocks.BuildingBlockFixed Class Reference

Inheritance diagram for m2m.backend.buildingblocks.BuildingBlockFixed:
Inheritance graph
[legend]
Collaboration diagram for m2m.backend.buildingblocks.BuildingBlockFixed:
Collaboration graph
[legend]

List of all members.

Public Member Functions

final NumType numType ()
boolean useGenericSize ()
boolean setSize (int size, int decimals)
int getSize ()
int getDecimals ()

Protected Attributes

int m_size
int m_decimals

Package Functions

 BuildingBlockFixed ()

Detailed Description

This class represents the base class for a building block performing calculation on fixed point numbers. It allows to set the number of bits, as well as the number of decimal bits, in order to generate correct VHDL. By default, the VHDL components are considered to be generic.

Definition at line 12 of file BuildingBlockFixed.java.


Constructor & Destructor Documentation

m2m.backend.buildingblocks.BuildingBlockFixed.BuildingBlockFixed ( ) [package]

Default constructor, setting the data size to 16, and the number of decimal bits to 8.

Definition at line 18 of file BuildingBlockFixed.java.


Member Function Documentation

int m2m.backend.buildingblocks.BuildingBlockFixed.getDecimals ( )

Returns the number of decimal bits used to represent the data.

Returns:
the number of decimal bits

Definition at line 73 of file BuildingBlockFixed.java.

int m2m.backend.buildingblocks.BuildingBlockFixed.getSize ( )

Returns the number of bits used to represent the data.

Returns:
the number of bits

Definition at line 65 of file BuildingBlockFixed.java.

final NumType m2m.backend.buildingblocks.BuildingBlockFixed.numType ( ) [virtual]

Returns the numbers type (NumType.FIXED).

Returns:
NumType.FIXED

Implements m2m.backend.buildingblocks.BuildingBlock.

Definition at line 26 of file BuildingBlockFixed.java.

boolean m2m.backend.buildingblocks.BuildingBlockFixed.setSize ( int  size,
int  decimals 
)

Sets the size of the data, as well as the number of decimal bits.

Parameters:
sizeTotal size of the data
decimalsnumber of decimal bits
Returns:
false if the number of decimal bits is greater than the total number of bits, or if one of these numbers is negative, true else.

Definition at line 49 of file BuildingBlockFixed.java.

boolean m2m.backend.buildingblocks.BuildingBlockFixed.useGenericSize ( )

Indicates if the operands have a generic size or not. For fixed point data, the default is yes, as generic building blocks should be quite easy to describe.

Returns:
true

Reimplemented from m2m.backend.buildingblocks.BuildingBlock.

Definition at line 37 of file BuildingBlockFixed.java.


Member Data Documentation

Number of decimal bits

Definition at line 85 of file BuildingBlockFixed.java.

Data size

Definition at line 80 of file BuildingBlockFixed.java.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations