hjlab/hachan-lab1
node { void evaluate(Context ctx) { bool oldState = getValue<output_Q>(ctx); bool newState = oldState; bool C= isInputDirty<input_C>(ctx); bool J= getValue<input_J>(ctx); bool K= getValue<input_K>(ctx); if (C && !J && K) { newState= false; } else if (C && J && !K) { newState= true; } else if (C && J && K) { newState =! oldState; } else if (!C || !J && !K) { newState= oldState; } if (newState == oldState) return; bool Q_=!newState; emitValue<output_Q>(ctx, newState); emitValue<output_Q_>(ctx, Q_); } }
© 2017–2024XOD Inc
Contact us: hello@xod.io