bool32 b1
bool32 b2
bool32 b3
bool32 b4
bool32 b5
bool32 b6
bool32 b7
bool32 b8
bool32 b9
bool32 b10
bool32 b11
bool32 b12
bool32 b13
bool32 b14
bool32 b15
bool32 b16
int32.positive output
bool32.tgl latch index
int index;
index = 0;
if (inlet_b1)
index = 1;
else if (inlet_b2)
index = 2;
else if (inlet_b3)
index = 3;
else if (inlet_b4)
index = 4;
else if (inlet_b5)
index = 5;
else if (inlet_b6)
index = 6;
else if (inlet_b7)
index = 7;
else if (inlet_b8)
index = 8;
else if (inlet_b9)
index = 9;
else if (inlet_b10)
index = 10;
else if (inlet_b11)
index = 11;
else if (inlet_b12)
index = 12;
else if (inlet_b13)
index = 13;
else if (inlet_b14)
index = 14;
else if (inlet_b15)
index = 15;
else if (inlet_b16)
index = 16;
else if (!param_indexlatch)
index = 0;
outlet_out = index;