Working truth table based simulation.