Constructing and simulating a digital circuit in logic-sim