flipflop

flipflop
Author: Johannes Taelman
License: BSD
Github: logic/flipflop.axo

Inlets

bool32.rising set

bool32.rising reset

Outlets

bool32 output

Declaration
int p_set;
int p_reset;
int op;
Init
p_set = 0;
p_reset = 0;
op = 0;
Control Rate
if ((inlet_set > 0) && !p_set) {
  op = 1;
  p_set = 1;
}
if ((inlet_reset > 0) && !p_reset) {
  op = 0;
  p_reset = 1;
}
if (!(inlet_set > 0))
  p_set = 0;
if (!(inlet_reset > 0))
  p_reset = 0;
outlet_o = (op << 27);

Privacy

© 2024 Zrna Research