/***************************** flipFlop.lib *****************************/ component { in clock, opd1 } simpleFlipFlop { out result1 } begin path opd2, clkOpd1, clkOpd2, result2; { in opd1 } not( 1 ) { out opd2 }; { in clock opd1 } and( 2 ) { out clkOpd1 }; { in clock opd2 } and( 2 ) { out clkOpd2 }; { in clkOpd1 result1 } or( 2 ).not( 1 ) { out result2 }; { in clkOpd2 result2 } or( 2 ).not( 1 ) { out result1 }; end component { in clock1, opd } masterSlaveFlipFlop { out result } begin path clock2, value; { in clock1 } not( 1 ) { out clock2 }; { in clock1, opd } simpleFlipFlop { out value }; { in clock2, value } simpleFlipFlop { out result }; end component { in clock, opd[ n ] } bitMemory( n ) { out result[ n ] } begin for i from 0 upto n do { in clock, opd[ i ] } masterSlaveFlipFlop { out result[ i ] }; end end