encode 4

binary encoder (4 bit plus sign)
Author: Sputnki
License: BSD
Github: sptnk/logic/encode 4.axo

Inlets

bool32 bit 0 LSB

bool32 bit 1

bool32 bit 2

bool32 bit 3 MSB

bool32 sign bit

Outlets

int32 output

Declaration
int i_out;
Control Rate
i_out = inlet_b0 * 1 + inlet_b1 * 2 + inlet_b2 * 4 + inlet_b3 * 8;
if (inlet_sign == 1)
  i_out = -1 - i_out;
outlet_out = i_out;

Privacy

© 2024 Zrna Research