bitval 9

Output an integer corresponding to the input bits set, 9 bit input
Author: Ricard Wanderlof
License: BSD
Github: ricard/logic/bitval 9.axo

Inlets

bool32 b0

bool32 b1

bool32 b2

bool32 b3

bool32 b4

bool32 b5

bool32 b6

bool32 b7

bool32 b8

Outlets

int32 value

Control Rate
outlet_value = (inlet_b0 > 0) | (inlet_b1 > 0) << 1 | (inlet_b2 > 0) << 2 |
               (inlet_b3 > 0) << 3 | (inlet_b4 > 0) << 4 | (inlet_b5 > 0) << 5 |
               (inlet_b6 > 0) << 6 | (inlet_b7 > 0) << 7 | (inlet_b8 > 0) << 8;

Privacy

© 2024 Zrna Research