Demux 4
easy
Routes a single input to one of four outputs based on a selector value, acting as the inverse of a multiplexer.
What it teaches
Inverse of Mux 4 — the select value decides which one of four outputs follows the input while the rest stay 0. Reinforces that mux and demux are duals: the same per-value cases with the roles of input and output swapped.
Parameters
| Tag | Direction | Type | Default | Description |
|---|---|---|---|---|
| In_Value | Input | DINT | 42 | Value to route |
| In_Select | Input | DINT | 0 | Selector switch; 0 = select Out_0, 1 = select Out_1, 2 = select Out_2, 3 = select Out_3 |
| Out_0 | Output | DINT | 0 | First output value |
| Out_1 | Output | DINT | 0 | Second output value |
| Out_2 | Output | DINT | 0 | Third output value |
| Out_3 | Output | DINT | 0 | Fourth output value |
Required behavior
- When In_Select is 0, Out_0 equals In_Value while all other outputs are 0.
- When In_Select is 1, Out_1 equals In_Value while all other outputs are 0.
- When In_Select is 2, Out_2 equals In_Value while all other outputs are 0.
- When In_Select is 3, Out_3 equals In_Value while all other outputs are 0.
- When In_Select is outside the 0 to 3 range, all outputs are 0.