Overview Binary encoder

This block combines several digital inputs into a single number. Each input corresponds to one bit of the output value, input B1 being the least significant bit by default. This way up to 16 switching states can be transmitted over a single address. The opposite direction is handled by the block Binary decoder.


Inputs

B1..Bn Bit Digital input. Any value other than 0 sets the corresponding bit. The number of inputs corresponds to the parameter Number of bits.



Outputs

WT Value The numeric value formed from the inputs.



Parameters

Number of bits Number of inputs, 1 to 16.
Bit order
  • Least significant bit first: B1 is bit 0 (value 1), B2 is bit 1 (value 2), B3 is bit 2 (value 4) and so on.
  • Most significant bit first: B1 is the most significant bit – with 8 bits this means value 128, B2 value 64 and so on.

See also: Binary decoder

See also common parameters of all function blocks.