← All exercises

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.

Inputs and outputs

TagTypeDefaultDescription
In_ValueDINT42Value to route
In_SelectDINTSelector switch; 0 = select Out_0, 1 = select Out_1, 2 = select Out_2, 3 = select Out_3
Out_0DINTFirst output value
Out_1DINTSecond output value
Out_2DINTThird output value
Out_3DINTFourth output value

Required behavior