- A Logic Circuit Simulation Library in C++
The lines states of
lcs::InputBus objects can be read using the overloaded
operator of the classes
lcs::Bus. The usage is very similar to how one would read the element values from a standard data type array. Since busses of type
lcs::InputBus are readonly busses, one cannot set the bus line states of these busses. However, one can use the operator  to set the line states of
lcs::Bus objects (see this for more information on setting bus line states).
An example of reading the line states from the lines of a bus is as follows.
lcs::Bus<8> bus(128); // The bus lines are initialised to a binary equivalent of the decimal integer // 128. lcs::BitBuff<1> bits; // We shall use this bit-buffer object as a temporary storage facility. bits = bus, bits = bus; // Reading the line states of the bus using the overloaded operator // \p lcs::Bus::operator.