Skip to main content

Decoders & Plexers

CircuitVerse features the following circuit elements in this category:

  1. Multiplexer
  2. Demultiplexer
  3. BitSelector
  4. Most Significant Bit (MSB) Detector
  5. Least Significant Bit (LSB) Detector
  6. Priority Encoder
  7. Decoder
  8. Parity Generator & Parity Detector

Multiplexer

A Multiplexer selectively passes only one of the inputs provided to it using a control signal. The number of inputs is always a power of 2. If there are N control bits, then there can be a maximum of 2^N inputs.

Properties that can be customized in the PROPERTIES panel include: BitWidth, Control Signal Size

Consider a 2 to 1 multiplexer that takes two single-bit inputs (T1 and T2), a single-bit control signal (S) and has an output (Out). Using Table 4.1, you can verify the behavior of a 2 to 1 multiplexer.

Table 4.1: Truth table of a 2 to 1 multiplexer

SOut
0T1
1T2

Using Table 4.2, you can verify the behavior of the Multiplexer circuit element in the live circuit of a 4 to 1 multiplexer embedded below:

Table 4.2: Truth table of a 4 to 1 multiplexer

S1S0Out
00T1
01T2
10T3
11T4

Demultiplexer

A Demultiplexer takes an input and passes it to only one of outputs using a control signal. The number of outputs is always a power of 2. If there are N control bits, we can choose to pass the output to any one of the 2^N output lines.

Properties that can be customized in the PROPERTIES panel include: BitWidth, Control Signal Size

In the live circuit embedded below, a 1 to 2 demultiplexer takes in a single-bit input (T), a single-bit control signal (S) and two single-bit outputs (O1 and O2). Table 4.3 displays the truth table of a 1 to 2 demultiplexer.

Table 4.3: Truth table of a 1 to 2 demultiplexer

SO1O2
0T0
10T

In another example of a live circuit embedded below, a 1 to 4 demultiplexer takes in a three-bit input and a two-bit control signal. Table 4.4 displays the truth table of a 1 to 4 demultiplexer.

Table 4.4: Truth table of a 1 to 4 demultiplexer

S1S0O1O2O3O4
00T000
010T00
1000T0
11000T

BitSelector

As its name suggests, the BitSelector circuit element takes a single or multi-bit input and outputs the bit that must be isolated using a single or multi-bit select line. The select line value indicates the specific bit that must be isolated within its body in decimal form.

Properties that can be customized in the PROPERTIES panel include: BitWidth, Selector Bit Width

In the live circuit embedded below, a BitSelector with a four-bit input is used. Each of its bits can be addressed separately as T3, T2, T1, T0 (from most significant to least significant). It also includes a two-bit select line (S1 and S0) and a single-bit output (Out). Table 4.5 displays the truth table of a four-bit BitSelector.

Table 4.5: Truth table of a four-bit bit selector

S1S0Out
00T0
01T1
10T2
11T3

Most Significant Bit (MSB) Detector

The Most Significant Bit (MSB) detector circuit element outputs the bit position of the most significant bit of the input. In other words, it outputs the bit position of the rightmost bit. An enable output is also provided to show if the MSB detector is active. The bit position of the MSB is also shown in decimal form within the body of the MSB detector.

You can verify the behavior of the Most Significant Bit (MSB) detector circuit element with a four-bit input in the live circuit embedded below:

Least Significant Bit (LSB) Detector

The Least Significant Bit (LSB) detector circuit element outputs the bit position of the least significant bit of the input. In other words, it outputs the bit position of the leftmost bit. An enable output is also provided to show if the LSB detector is active. The bit position of the LSB is also shown in decimal form within the body of the LSB detector.

You can verify the behavior of the Least Significant Bit (LSB) detector circuit element with a four-bit input in the live circuit embedded below:

Priority Encoder

The Priority Encoder circuit element works similarly to the MSB and LSB detectors. There is a specific output based on the bit position of the MSB, irrespective of the lesser significant bits. An enable input is also provided to activate/deactivate the priority encoder. If there are N outputs, there will be 2^N inputs.

In the live circuit embedded below, a Priority Encoder with four single-bit inputs (T3, T2, T1, and T0 from most to least-significant bit) and two single-bit outputs (O2 and O1 from most to least-significant bit). Table 4.6 displays the truth table of the four-input priority encoder.

Properties that can be customized in the PROPERTIES panel include: BitWidth

Table 4.6: Truth table of a four-input priority encoder

T3T2T1T0O2O1
000100
001X01
01XX10
1XXX11

Decoder

The Decoder circuit element includes N input bits and has 2^N output lines.

In the live circuit embedded below, a Decoder with a single two-bit input (T1 and T0 from most to least-significant bit) and four single-bit output lines (O4, O3, O2, and O1 from most to least-significant bit). For the input values set in T1 and T0, the corresponding output line (O4, O3, O2, and O1) is HIGH. Table 4.7 displays the truth table for a two-bit decoder.

Properties that can be customized in the PROPERTIES panel include: BitWidth

Table 4.7: Truth table of a two-bit decoder

T1T0O4O3O2O1
000001
010010
100100
111000

Parity Generator & Parity Detector

The Parity Generator and Parity Detector combinational circuit elements are used together for error-tolerant data transmission. The Parity Generator circuit element is used by the sender, and the Parity Detector circuit element is used by the receiver.

Parity Generator

The Parity Generator circuit element generates a parity bit which is later used by parity detectors to detect errors in data transmission. The parity bit is added to the original message that must be sent.

If the input message of an even parity generator has an even number of 1s, the parity bit will be 0. On the other hand, if there are an odd number of 1s, the parity bit generated will be 1. Table 4.8 displays the truth table for an even three-bit input parity generator.

Table 4.8: Truth table for an even three-bit parity generator

ABCPARITY BIT (P)
0000
0011
0101
0110
1001
1010
1100
1111

If the input message of an odd parity generator has an even number of 1s, the parity bit will be 1. Alternatively, if there are an odd number of 1s, the parity bit generated will be 0. The parity bit generated is then added to the message to be sent. Table 4.9 displays the truth table for an odd three-bit input parity generator.

Table 4.9: Truth table for an odd three-bit parity generator

ABCPARITY BIT (P)
0001
0010
0100
0111
1000
1011
1101
1110

Parity Detector

The Parity Detector circuit element receives the message and checks it for errors. If an error is detected, the parity error check bit gives 1 as output and 0 when no error is detected. Table 4.10 and Table 4.11 display the truth tables for an even and odd three-bit input parity detector, respectively.

ABCPPARITY ERROR CHECK
00011
00101
00110
01001
01010
01100
01111
10001
10010
10100
10111
11000
11011
11101
11110

ABCPPARITY ERROR CHECK
00001
00010
00100
00111
01000
01011
01101
01110
10000
10011
10101
10110
11001
11010
11100
11111

Although the parity detector can detect most errors, some of its limitations include:

  • Error is detected only if there are an odd number of error bits.
  • Error in parity bit might lead to error detection despite correct transmission.
  • Parity detector will not be able to detect errors where both parity and data bits have such an error that matches the parity bit.

You can verify the same in the live circuit embedded below: