We are big fans of the Falstad circuit simulator ... which is 6 nanoseconds of game time. // we do as little work in here as possible. function didStep(sim) { var c = clk.getVoltage(); if ...