itpp_sci  1.0.0
it++ based simulation framework for scicoslab, scilab and scipy
Public Member Functions | List of all members
SIM::counter Class Reference

binary modulo N up counter
Core function SIM::counter.generate()
More...

Inheritance diagram for SIM::counter:
Inheritance graph
[legend]

Public Member Functions

 counter ()
 
 ~counter ()
 
void set_N (int N)
 
void set_state (int c)
 
int get_N ()
 
int get_state ()
 
void reset ()
 
bvec generate (const bvec &ce)
 

Detailed Description

binary modulo N up counter
Core function SIM::counter.generate()

Constructor & Destructor Documentation

SIM::counter::counter ( )
inline
SIM::counter::~counter ( )
inline

Member Function Documentation

bvec SIM::counter::generate ( const bvec &  ce)

for active clock ticks [ce] increment state modulo N, carry is an output

Parameters
ce- [bvec] - clock enable vector sizeof(ce)=N
Returns
y - [bvec] - state of carry flag
int SIM::counter::get_N ( )
inline

get counter modulo value

Returns
- [int] counter modulo number
int SIM::counter::get_state ( )
inline

get counter state value

Returns
- [int] counter state
void SIM::counter::reset ( )
inline

reset counter state value

void SIM::counter::set_N ( int  N)

set counter modulo value \ modulo checked to be > 0

Parameters
[in]N- [int] counter modulo number
void SIM::counter::set_state ( int  c)

set internal counter state \ state checked to be > 0 and < Nmod

Parameters
[in]c- [int] counter state

The documentation for this class was generated from the following files: