last_rising_4

Outputs an integer between 0 and 3, depending on the last input to see a rising edge.
Author: Jeppe Rasmussen
License: BSD
Github: klab/logic/last_rising_4.axo

Inlets

bool32.rising i0

bool32.rising i1

bool32.rising i2

bool32.rising i3

Outlets

int32.positive o0

Declaration
int ntrig0;
int latch;
int ntrig1;
int ntrig2;
int ntrig3;
Control Rate
if ((inlet_i0 > 0) && !ntrig0) {
  latch = 0;
}
if (!(inlet_i0 > 0))
  ntrig0 = 0;

if ((inlet_i1 > 0) && !ntrig1) {
  latch = 1;
}
if (!(inlet_i1 > 0))
  ntrig1 = 0;

if ((inlet_i2 > 0) && !ntrig2) {
  latch = 2;
}
if (!(inlet_i2 > 0))
  ntrig2 = 0;

if ((inlet_i3 > 0) && !ntrig3) {
  latch = 3;
}
if (!(inlet_i3 > 0))
  ntrig3 = 0;

outlet_o0 = latch;

Privacy

© 2024 Zrna Research