Where is a multiplexer used? Multiplexers and demultiplexers: circuits, operating principles

Where is a multiplexer used?  Multiplexers and demultiplexers: circuits, operating principles
Where is a multiplexer used? Multiplexers and demultiplexers: circuits, operating principles

A multiplexer is a device that samples one of several inputs and connects it to its output. The multiplexer has several information inputs (D 0, D 1, ...), address inputs (A 0 A 1, ...), an input for supplying a strobe signal C and one output Q. In Fig. 1,f shows a symbolic image of a multiplexer with four information inputs.

Each information input of the multiplexer is assigned a number called an address. When a strobe signal is applied to input C, the multiplexer selects one of the inputs, the address of which is specified by a binary code at the address inputs, and connects it to the output.

Thus, by supplying the addresses of different information inputs, can be transferred digital signals from these inputs to output Q. Obviously, the number of information inputs n inf and the number of address inputs n adr are related by the relation n inf = 2 nadr.

Table 1

Addressinputs

Strobesignal

Exit

The operation of the multiplexer is determined by table. 1. In the absence of a strobe signal (C = 0), there is no connection between the information inputs and the output (Q = 0). When a strobe signal (C = l) is applied, the logical level of that of the information inputs D i whose number i in binary form is specified at the address inputs is transmitted to the output. So, when setting the address A l A 0 = ll 2 = 3 10, an information input signal with address 3 10, i.e. D 3, will be transmitted to output Q.

Using this table, we can write the following logical expression for output Q:

The circuit diagram of a multiplexer constructed using this expression is shown in Fig. 1, b.

In cases where it is necessary to transmit multi-bit input data to the outputs in parallel form, parallel connection of multiplexers is used according to the number of bits of the transmitted data.

Using multiplexers for the synthesis of combinational devices.

Multiplexers can be used to synthesize logic functions. In this case, the number of elements used in the circuit (integrated circuit packages) can be significantly reduced.

The multiplexer's Boolean expression contains members with all combinations of address variables. Consequently, if it is necessary to synthesize a function of three variables f(x 1, x 2, x 3), then two of these variables (for example, x 1, x 2) can be supplied to the address inputs A 1, and A 0, and the third x 3 - to the information input.

For example, suppose you need to synthesize a function given in table. 2. Logical function expression

Considering the variables x l, x 2 as address variables, we obtain table. 3, from which it can be seen that the multiplexer at output Q implements a given logical function. Schematic diagram shown in Fig. 2.

Obviously, any function of three variables can be synthesized on four-input multiplexers, any function of four variables on eight-input multiplexers, etc.

When synthesizing combinational circuits, multiplexers can be used in conjunction with elements of a certain basis. Let the total number variable functions n. Then, if the multiplexer has n addresses of address inputs, then n addresses of variables are supplied to them, and to its information inputs functions n-n variable address.

For example, suppose you want to synthesize a four-variable logic function using a four-input multiplexer. If the address variables are x 1, x 2, then the functions of the variables x 3 and x 4, defined as shown in the table, must be supplied to the information inputs of the multiplexer. 5 areas of the Veitch table. Within each area of ​​the Veitch table outlined for information inputs, minimization is carried out using conventional methods, after which circuits are constructed that form the functions supplied to the information inputs of the multiplexer.

Let us demonstrate this technique using the implementation of the function given in Table. 6.

When the variables x 1 and x 2 are supplied to the address inputs of the multiplexer, D 0 = 1 must be supplied to its information inputs; D 1 = 0; D2 = x3.

4, D 3 = 4. The circuit that implements the given function is shown in Fig. 3.

It should be borne in mind that when synthesizing a logic device using a multiplexer, it is also necessary to construct a version of the circuit without using a multiplexer. Then, by comparing the resulting options, determine which option is the best in terms of the number of integrated circuit packages used in the circuit.

3.7. Multiplexers and demultiplexers is a device that samples one of several inputs and connects it to its single output, depending on the state of the binary code. In other words, a multiplexer is a signal switch controlled by a binary code and having several inputs and one output. The input whose number corresponds to the control binary code is connected to the output.

Well, a private definition: multiplexer is a device that converts parallel code into serial code.

The structure of a multiplexer can be represented by various schemes, for example, this one:

Rice. 1 – Example of a specific multiplexer circuit

The largest element here is an AND-OR element with four inputs. Squares with ones are inverters.

Let's look at the conclusions. Those on the left, namely D0-D3, are called information inputs. They are presented with information to be selected. Inputs A0-A1 are called address inputs. This is where the binary code is supplied, which determines which of the inputs D0-D3 will be connected to the output, designated in this diagram as Y. Input C – synchronization, operation permission.

The diagram also has address inputs with inversion. This is to make the device more versatile.

The figure shows, as it is also called, a 4X1 multiplexer. How do we know that the number of different binary numbers, which the code can specify, is determined by the number of bits of the code as 2 n, where n is the number of bits. You need to set 4 multiplexer states, which means there should be 2 bits in the address code (2 2 = 4).

To explain the principle of operation of this circuit, let's look at its truth table:

This is how the binary code selects the desired input. For example, we have four objects, and they send signals, but we have one display device. We take a multiplexer. Depending on the binary code, a signal from the desired object is connected to the display device.

The multiplexer is designated by the microcircuit as follows:

Rice. 2 – Multiplexer like ISS

Demultiplexer- a device inverse to the multiplexer. That is, the demultiplexer has one input and many outputs. The binary code determines which output will be connected to the input.

In other words, demultiplexer is a device that samples one of its several outputs and connects it to its input, or else it is a signal switch controlled by binary code and having one input and several outputs.

The output whose number corresponds to the state of the binary code is connected to the input. And a private definition: demultiplexer is a device that converts serial code into parallel.

Typically used as a demultiplexer decryptors binary code into positional code, in which an additional gating input is introduced.

Due to the similarity of multiplexer and demultiplexer circuits, CMOS series have microcircuits that are simultaneously a multiplexer and a demultiplexer, depending on which side the signals are supplied from.

For example, K561KP1, operating as an 8x1 switch and a 1x8 switch (that is, as a multiplexer and demultiplexer with eight inputs or outputs). In addition, in CMOS microcircuits, in addition to switching digital signals (logical 0 or 1), it is possible to switch analog ones.

In other words, it is an analog signal switch controlled by a digital code. Such microcircuits are called switches. For example, using a switch you can switch the signals entering the amplifier input (input selector). Consider the input selector circuit UMZCH. Let's build it using flip-flops and a multiplexer.

Rice. 3 - Input selector

So, let's look at the work. On the triggers of the DD1 microcircuit, a ring counter button presses with 2 digits (two triggers - 2 digits). Double-digit binary code goes to the address inputs D0-D1 of the DD2 chip. The DD2 chip is a dual four-channel switch.

In accordance with the binary code to the outputs of the microcircuit A And IN inputs A0-A3 and B0-B3 are connected respectively. Elements R1, R2, C1 eliminate bouncing of the button contacts.

Differentiation chain R3C2 sets the flip-flops to zero when power is turned on, with the first input connected to the output. When you press the button, trigger DD1.1 switches to the log state. 1 and the second input is connected to the output, etc. The inputs are enumerated in a ring, starting from the first.

On the one hand it’s simple, on the other it’s a little inconvenient. Who knows how many times the button was pressed after turning it on and which input is connected to the output now. It would be nice to have an indicator for the connected input.

Let's remember the seven-segment decoder. We transfer the decoder with the indicator to the switch circuit and connect the first two inputs of the decoder (in the diagram as DD3), i.e. 1 and 2 (pins 7 and 1) to the direct outputs of the triggers DD1.1 DD1.2 (pins 1 and 13) . We connect decoder inputs 4 and 8 (pins 2 and 6) to the housing (i.e., we supply logic 0). The indicator will show the status of the ring counter, namely numbers from 0 to 3. Number 0 corresponds to the first input, 1 to the 2nd, etc.

Multiplexers and demultiplexers (mux and demux in English abbreviation) are fairly common components in digital electronics. Understanding the logical processes occurring in them will allow us to better understand the circuits with their participation and develop more complex electronic devices



Multiplexers and demultiplexers work opposite to each other, but according to the same principle. They consist of information inputs, information outputs and a switch (selector).


The image below shows a schematic representation of a multiplexer and a demultiplexer.



The multiplexer has several information inputs. The multiplexer switch selects which of these inputs should be used and connects it to the information output, of which the multiplexer has only one. This situation can be compared to if a bunch of people would like to tell you something of their own, but you can only listen to one at a time.


A demultiplexer, on the contrary, has only one information input, and the switch connects it to one information output at a time. That is, it is the same as if you want to say something to a crowd of people, but at any given time you can only say it to one person from this crowd.


There are also microcircuits that combine the functions of multiplexers and demultiplexers. In English they are usually designated mux/demux. They can also be called bidirectional multiplexers or simply switches. They allow the signal to be transmitted in both directions. So not only can you talk to someone, but someone in the crowd can talk to you in certain moment time.


In this case, the internal switch usually has several information inputs that are addressed in binary form. Almost all such microcircuits have an OE line (output enable or output is active). There is also a demultiplexer inside the chip with one input and usually four outputs. To select an output, the microcircuit also has two lines for addressing the output (00, 01, 10, 11).


There are both digital and analog multiplexers. Digital switches are logical switches whose output voltage will be the same as the supply voltage. Analog ones connect the voltage of the selected input to the output.


The principle of multiplexing and demultiplexing was used at the dawn of the development of telephony at the beginning of the last century. Then the person who wanted to call his friend picked up the phone and waited for the operator to answer. This is a multiplexer part, since at a certain point in time the operator selects from among the set the line on which this person “sits”. The person says that he wants to talk to a friend whose number is 12345. This is the switchboard part, here the operator receives the number (address). Next, he connects the connector to his friend’s channel. This is the demultiplexer part. Here one line from many channels connects to only one.


Multiplexers and demultiplexers will help you solve the problem of expanding the number of input or output lines if the number of GPIOs of your microcontroller is too small. If your project includes many sensors, then you can connect them to a multiplexer. The output of the multiplexer then needs to be connected to the ADC and, by switching the addresses of the lines, sequentially read data from the sensors.


Multiplexers are also useful when you have several I2C interface chips that have the same address. Simply connect the SDA/SCL lines to the switch and control them in series. Multiplexers and demultiplexers can also be used as level converters.

Priority Encryptors

Purpose: to ensure the generation of a code for a given key, regardless of the number of keys pressed.

Let's convert: “x out of 10” to “1 out of 10”, and then into the code “8421”

Let's consider an example of constructing a priority encoder for converting decimal numbers to code 8421, shown in Table 3:

Table 3

0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 1 X 0 0 0 1
0 0 0 0 0 0 0 1 X 0 0 0 1 0
0 0 0 0 0 0 1 0 0 X 0 0 1 1
0 0 0 0 0 1 X 0 0 0 0 1 0 0
0 0 0 0 1 X 0 0 0 0 0 1 0 1
0 0 0 1 X 0 0 0 0 0 0 1 1 0
0 0 1 X 0 0 X 0 0 0 0 1 1 1
0 1 X 0 0 0 0 0 0 0 1 0 0 0
1 X 0 0 0 0 0 0 0 0 1 0 0 1

Let's write down mathematical expressions for the variables:

To obtain a priority encoder circuit, it is enough to connect the outputs x 9, ..., x 0 of the “X of 10” to “1 of 10” converter. to the corresponding inputs of the code converter "1 of 10" into code 8421. Figure 4 shows this scheme:

Fig.5

The reverse conversion of binary code to 1-of-n code is performed by code converters called decoders.

Figure 5 shows a decoder circuit that performs the inverse conversion:

Linear decoders

Purpose: select one of n possible combinations (1 of n)

The device circuit is determined by the formula:

where m is the number of control inputs

n – number of outputs or objects

If then the decoder is complete,

If then in this case the decoder will not be complete.

Option 2 m

Let's imagine the state table of the complete decoder:

Table 4

0 0 0 0 0 1
0 1 0 0 1 0
1 0 0 1 0 0
1 1 1 0 0 0

Let's write down the mathematical expressions of the functions:

For this decoder: m=2,n=4

Figure 6 shows the functional diagram of this decoder:

Fig.6

Multiplexers and demultiplexers

Purpose – transfer of information fromm channels onn channels (the multiplexer provides transmission fromm channels to one channel, and the demultiplexer - from one channel ton channels).

Each multiplexer or demultiplexer contains a basic element - a decoder.

Table of logical states of multiplexers

Inputs Addresses A 1 A 0 Exit Y
X 3 X 2 X 1 X 0 00 01 10 11 X 0 X 1 X 2 X 3

Basic multiplexer circuit in Fig. 5

Fig.5

The symbol for the multiplexer is shown in Fig. 6

Fig.6

Sometimes multiplexers include a clock signal to perform an operation at fixed time intervals. Figure 7 shows the circuit of a multiplexer with a clock input.

Fig.7

To increase the number of information transmission channels, multiplexers are combined according to a pyramidal scheme, which is shown in Fig. 8


Fig.8

Application of multiplexers

Multiplexers are used to convert parallel code into serial code. To do this, use a synchronous change in address combinations at the input of the multiplexer. Let the combinations 0,1,1,0 be supplied to the inputs of the multiplexer, respectively (see Fig. 9).

The timing diagram is shown in Fig. 10

Fig. 10, where F is the clock signal in accordance with which the addresses A 1, A 0 change.

Another use of a multiplexer is to perform transformations on logical functions.

To perform a certain logical function consisting of a set of arguments, a multiplexer is used, in which each address combination of written Boolean functions is assigned to a specific channel, on which a logical “1” is set, and on the remaining channels a logical “0” is connected.

Demultiplexers

Used to transmit information from one channel to n channels.

Correspondence table of demultiplexer states(n=4)

Inputs Addresses A 1 A 0 Exits Y 3 Y 2 Y 1 Y 0
X 00 01 10 11 000X 00X0 0X00 X000

The implementation diagram is shown in Fig. 11

Fig.11

Symbol - in Fig. 12

Fig.12

A universal device that performs the function of a multiplexer and demultiplexer with the ability to transfer information from output to input is shown in Fig. 13

Fig. 13, where MOS transistors M 1 - M 3 are n-type.

A common disadvantage of the considered schemes is the transmission of only digital information, which narrows the scope of application. It is also impossible to ensure the transfer of information from input to output and vice versa in one device, which is often necessary in switching circuits. To transmit analog information without distorting the signal level, instead of transistors M 1 - M 3, you must use an analog switch (see previous lectures).

The pyramidal scheme for connecting demultiplexers makes it possible to increase the number of switched channels (see Fig. 14)

Fig.14


Related information.