- A Logic Circuit Simulation Library in C++ |
#include <nor.h>
Inheritance diagram for lcs::Nor< width, delay >:
width
denotes the number of lines in the input data bus. In other words, the template parameter width
denotes the number of inputs to the NOR gate. Hence, one can instantiate an N-input NOR gate by setting the template parameter value to N. The second template parameter indicates the propogation delay from the input to the output of the NOR gate.
Public Member Functions | |
Nor (const Bus< 1 > &output, const InputBus< width > &input) | |
virtual | ~Nor () |
virtual void | onStateChange (int portId) |
Static Public Attributes | |
static const int | INPUT = 0 |
static const int | OUTPUT = 1 |
lcs::Nor< width, delay >::Nor | ( | const Bus< 1 > & | output, | |
const InputBus< width > & | input | |||
) |
The only meaningfull constructor for the class. A default constructor is not explicitly provided. Moreover, the one synthesized by the compiler is practically useless.
output | The single line output bus of the gate. | |
input | The multiline input bus to the gate. | |
width | The number of lines in the input bus. |
Destructor.
void lcs::Nor< width, delay >::onStateChange | ( | int | portId | ) | [virtual] |
Propogates the input data line states to the output. This function is called by the input bus lines to notify the gate of a lcs::LINE_STATE_CHANGE event. When notified, a NOR operation is performed on the line states of the data lines of the input bus and the result is propogated to the single line output bus.
Reimplemented from lcs::Module.
const int lcs::Nor< width, delay >::INPUT = 0 [static] |
A constant integer which denotes the port id for the input port/bus.
const int lcs::Nor< width, delay >::OUTPUT = 1 [static] |
A constant integer which denotes the port id for the output bus/port.