Computing Library › Digital Logic & Circuits
Digital Logic & Circuits

Demultiplexer

A demultiplexer takes one input and routes it to one of several outputs chosen by select lines, the inverse of a multiplexer.

What it does

A demultiplexer, or demux, has one data input, n select lines, and 2^n outputs. The value on the select lines determines which output the input is delivered to; all other outputs are held at 0. It performs the opposite job of a multiplexer.

1-to-4 example

Kronos motion — three outputs

With select bits S1 S0 and input D, the four outputs are Y0 = D when S = 00, Y1 = D when S = 01, and so on. Each output is D ANDed with the matching minterm of the select lines.

Relation to a decoder

A demultiplexer is a decoder with an enable input. If the data input is treated as the enable and held at 1, the demux behaves exactly like a decoder, activating one output line per select code.

Uses

Demultiplexers distribute a single signal to many destinations: steering a data bit to a selected register, routing a serial stream to different channels, or driving one of several devices from a shared line.

In code

python
outputs = [0, 0, 0, 0]
outputs[sel] = d  # sel in 0..3