Skip to main content

Theory

1. Multiplexer

A multiplexer has multiple input pins, but only has one output pin. This circuit gives an output based on which input pin is chosen.

To explain further about how multiplexer works, we can imagine it as a rotary switch that works just like how multiplexers do. In the image above, there are 4 inputs from S0 to S3. Every input (from S0 to S3) has a signal between 1 or 0. The switch now is choosing to input S0, so the output of the rotary switch is the same as S0 (in this case is signal 1). Different from the rotary switch mentioned above, a multiplexer works by using a selector signal.

Multiplexers can also be built by primitive logic gates (AND, OR, NOT gates). To get the idea, see the image below (image 1.2).

How a Multiplexer Works

  1. Input: The multiplexer receives multiple inputs, in this case/image above, its A to D.
  2. Selector: The selector signals determine which input will be passed to the output. In a 4-to-1 multiplexer, two selector signals (e.g., S1 and S0) are needed to select one of the four inputs.
  3. Output: Based on the combination of selector signals, the multiplexer forwards the value from the selected input to the output.

For example:

  • If S1 = 0 and S0 = 0, input A is selected since its the first input (0 index, where 1st = 0, and 2nd = 1,etc).
  • If S1 = 0 and S0 = 1, input B is selected since its the second input (0 index, where 1st = 0, and 2nd = 1,etc).
  • And so on, with different selector combinations choosing different inputs.

Truth Table of a 4-to-1 Multiplexer

S1S0Output
00A
01B
10C
11D

Multiplexers are useful in digital applications, especially when managing multiple data sources that need to be routed to a single destination. Remember that to build a custom multiplexer with logic gates, we need to derive the boolean function first with a truth table.

2. Demultiplexer

A demultiplexer is the opposite of a multiplexer; it has one input pin and multiple output pins. The signal or data from the input pin is directed to the selected output pin. A selector signal is also used in a demultiplexer to determine which output pin will receive the input signal. The image below shows a logic gate diagram of a demultiplexer:

Demultiplexer Logic Gate Diagram

In this diagram, the signal on the IN pin will be transmitted to the chosen output. The output will be selected by the signals S0 and S1. In the circuit above, if an output pin is not selected, it will receive a signal of 0.

How a Demultiplexer Works

  1. Input: The demultiplexer takes a single input signal from the IN pin.
  2. Selector: The selector signals (S0 and S1) determine which output pin the input signal will be directed to.
  3. Outputs: The selected output pin receives the input signal, while the other output pins receive a signal of 0.

Truth Table of a 1-to-4 Demultiplexer

S1S0Output 0Output 1Output 2Output 3
00IN000
010IN00
1000IN0
11000IN

Thus, the demultiplexer enables the distribution of a single input signal to one of several output lines based on the selector signals.