Computers and modern gadgets

One of the very important elements of digital technology, and especially in computers and control systems, are encoders and decoders.

When we hear the word encoder or decoder, phrases from spy films come to mind. Something like: decrypt the dispatch and encrypt the response.

There is nothing wrong with this, since the encryption machines of our and foreign stations use encryptors and decryptors.

Encryptors.

Thus, an encoder (coder) is an electronic device, in this case a microcircuit, that converts the code of one number system into the code of another system. The most widely used in electronics are encoders that convert positional decimal code into parallel binary. This is how the encoder can be indicated on a circuit diagram.

For example, imagine that we are holding in our hands an ordinary calculator, which any schoolchild now uses.

Since all actions in the calculator are performed with binary numbers (remember the basics of digital electronics), after the keyboard there is an encoder that converts the entered numbers into binary form.

All the buttons of the calculator are connected to a common wire and by pressing, for example, button 5 at the input of the encoder, we will immediately receive the binary form of this number at its output.

Of course, the calculator's encoder has a larger number of inputs, since in addition to numbers, you need to enter some other symbols of arithmetic operations into it, so not only numbers in binary form, but also commands are removed from the outputs of the encoder.

If we consider the internal structure of the encoder, it is easy to see that it is made on the simplest basic logical elements.

All control devices that operate on binary logic, but have a decimal keyboard for operator convenience, use encoders.

Decoders.

Decryptors belong to the same group, but they work exactly the opposite. They convert parallel binary to positional decimal. The symbolic graphic symbol on the diagram may look like this.

Or like this.

If we talk about decryptors more fully, then it is worth saying that they can convert binary code into different number systems (decimal, hexadecimal, etc.). It all depends on the specific purpose and purpose of the microcircuit.

The simplest example. You have seen a digital seven-segment indicator, for example, an LED, more than once. It displays decimal digits and numbers that we are accustomed to since childhood (1, 2, 3, 4...). But, as you know, digital electronics work with binary numbers, which represent a combination of 0 and 1. What converted the binary code into decimal and fed the result to the seven-segment digital indicator? You probably already guessed that the decoder did this.

The work of the decoder can be assessed live if you assemble a simple circuit that consists of a decoder chip K176ID2 and a seven-segment LED indicator, which is also called the “figure eight”. Take a look at the diagram; it will make it easier to understand how the decoder works. To quickly assemble a circuit, you can use a solderless breadboard.

For reference. The K176ID2 chip was developed to control a 7-segment LED indicator. This chip is capable of converting binary code from 0000 before 1001 , which corresponds to the decimal digits from 0 to 9 (one decade). The remaining, higher combinations are simply not displayed. Pins C, S, K are auxiliary.

The K176ID2 chip has four inputs (1, 2, 4, 8). They are also sometimes designated D0 - D3. A parallel binary code (for example, 0001) is supplied to these inputs. In this case, the binary code has 4 bits. The microcircuit converts the code so that the outputs ( a-g) signals appear that form the decimal digits and numbers to which we are accustomed on the seven-segment indicator. Since the K176ID2 decoder is capable of displaying decimal digits in the range from 0 to 9, we will only see them on the indicator.

4 toggle switches (S1 - S4) are connected to the inputs of the K176ID2 decoder, with the help of which a parallel binary code can be supplied to the decoder. For example, when the toggle switch is closed S1 A logical unit is supplied to pin 5 of the microcircuit. If you open the contacts of the toggle switch S1- this will correspond to logical zero. Using toggle switches, we can manually set logical 1 or 0 at the inputs of the microcircuit. I think this is all clear.

The diagram shows how code 0101 is applied to the inputs of the DD1 decoder. The LED indicator will display the number 5. If you close only the S4 toggle switch, the indicator will display the number 8. To write a number from 0 to 9 in binary code, four digits are enough: a 3 * 8 + a 2 * 4 + a 1 * 2 + a 0 * 1, Where a 0 - a 3, are numbers from the number system (0 or 1).

Let's represent the number 0101 in decimal form 0101 = 0*8 + 1*4 + 0*2 + 1*1 = 4 + 1 = 5 . Now let's look at the diagram and see that the weight of the digit corresponds to the number by which 0 or 1 is multiplied in the formula.

A decoder based on TTL technology - K155ID1 was used at one time to control gas-discharge digital indicators such as IN8, IN12, which were in great demand in the 70s, since low-voltage LED indicators were still very rare.

Everything changed in the 80s. It was possible to freely purchase seven-segment LED matrices (indicators) and there was a boom in the assembly of electronic watches among radio amateurs. Only the lazy did not assemble a homemade electronic clock for the home.

Lab Report

Topic: Study of the Operation of Decryptors

Target: Explore the work of encryptors and decryptors

Equipment: PC, software: Windows OS

Progress

1. Researched the operation of the Decoder using logical elements

2. Code converter for seven-segment indicator.

3. Decoder for the 7-segment indicator on the chip.

1.Decryptors
I used simple logic elements that can be used to construct more complex devices that implement the corresponding functions. Such devices are, for example, encryptors and decryptors.

Decoders, also called encoders, can convert decimal numbers (positional code) to binary. The encoder works as follows: the encoder has n inputs, at the current time only one of which is receiving a signal (this input will be active); Based on the number of the active input, a binary code corresponding to the position of the active input is generated at the decoder outputs. For example, if the fifth input was active, then the outputs will have the combination (except for the leading zeros): 5 10 =101 2.

3. Logic element decoder

Three-input decoder based on logical elements “AND” and “NOT”.



4. Code converter for seven-segment indicator.

Decoders and display decoders/shapers generate digital codes for the seven-segment display, and then transmit the code to the generator or directly to the display. In a seven-segment decimal digit indicator, each segment (there are seven of them) represents a separate light-emitting element (alphabetic segment identification is also used, respectively from a to g). A luminous image of numbers or symbols is obtained when voltage is applied to certain segments:
Such a code converter must satisfy the truth table given below:


Decoder for a 7-segment indicator based on logical elements.

Decoder for a 7-segment indicator on a chip.

This decoder converts binary-decimal code supplied to inputs A, B, C, D into control code for a 7-segment indicator. A binary decimal code is a set of binary numbers ordered by bits, in which the following “weights” are assigned to the bits in decreasing order of precedence. D – 8, C – 4, B – 2, A – 1. Therefore, this code is also called code 8-4-2-1. In fact, this code writes the decimal numbers from 0 to 15 in the truth table input variables:



Code decoder for the 7-segment indicator on the 7448 chip

Conclusion: I studied the work of encryptors and decryptors

1. Decoders
Using the simplest logic elements, it is possible to construct more complex devices that implement the corresponding functions. Such devices are, for example, encryptors and decryptors.

Encryptors, also called encoders, can convert decimal numbers (positional code) to binary. The encoder works as follows: the encoder has n inputs, at the current time only one of which is receiving a signal (this input will be active); Based on the number of the active input, a binary code corresponding to the position of the active input is generated at the decoder outputs. For example, if the fifth input was active, then the outputs will have the combination (except for the leading zeros): 5 10 =101 2.
The decoder or decoder performs the opposite operation to encryption, i.e. Converts binary to decimal. The decoder inputs are used to supply binary numbers, and the outputs are numbered sequentially with decimal numbers. When a binary number is applied to the inputs, the output signal appears at the output, which has the number of the corresponding decimal number.
There are two types of decoders: logic decoders and display decoders/shapers. Logic decoders are medium-integration circuits (chips containing up to 100 LEs), controlled by an address. They select and activate a specific output identified by an address. Decryptors are used in structures for retrieving storage device addresses, decompressing data routing, etc.

A seven-segment display is often used to display decimal and hexadecimal digits. The appearance of the seven-segment indicator and the designation of its segments is shown in Figure 6.11.

Figure 6.11 – Appearance of a seven-segment indicator and the name of its segments

To display the number 0 on such an indicator, it is enough to light segments a, b, c, d, e, f. To represent the number 1, segments b and c are lit. In exactly the same way, you can obtain images of all other decimal or hexadecimal digits. All combinations of binary codes that allow the formation of images of numbers (and some letters) are called a seven-segment code.

Let's create a truth table for a decoder that will allow you to convert a binary (or rather BCD) code into a seven-segment one. Let the indicator segments light up at zero potential. Then the truth table of the seven-segment decoder will take the form shown in Table 6.4. The specific value of the signals at the output of the decoder depends on the connection diagram of the indicator segments to the output of the microcircuit. These diagrams will be discussed later in the chapter on displaying different types of information.

Table 6.4 – Truth table of a seven-segment decoder.

Inputs Exits
Combination No. a b c d e f g

In accordance with the principles of constructing a circuit using an arbitrary truth table, we implement a circuit diagram of a seven-segment decoder, operating in accordance with the truth table written in Table 6.4. This time we will not describe in detail the process of developing the circuit. To test your understanding of the digital circuit design algorithm, try obtaining this circuit yourself. The schematic diagram of a seven-segment decoder obtained as a result of this synthesis is shown in Figure 6.12.

To facilitate understanding of the principles of operation of the circuit shown in Figure 6.12, the output of logical elements “AND” shows the row numbers of the truth table implemented by them. For example, at the output of segment ‘a’ a logical one will appear only when a combination of binary signals 0001 (1) and 0100 (4) is applied to the input. This is done by combining the corresponding circuits with the “2OR” element. At the output of segment ‘b’, a logical one will appear only when a combination of binary signals 0101 (5) and 0110 (6) is applied to the input, and so on.

Figure 6.12 – Schematic diagram of a seven-segment decoder

Currently, seven-segment decoders are produced in the form of separate microcircuits or used as ready-made units as part of other microcircuits. The graphical designation of the seven-segment decoder microcircuit is shown in Figure 6.13.

Figure 6.13 – Graphic designation of a seven-segment decoder

As an example of seven-segment decoders, we can name such domestically produced microcircuits as K176ID3. They are intended for connecting gas-discharge indicators. In modern digital circuits, seven-segment decoders are usually included in large integrated circuits.

Encryptors

Quite often, digital equipment developers are faced with a problem that is the opposite of the one solved by decryptors. For example, you want to convert octal or decimal linear code to binary. The linear octal code may come from the output of a mechanical switch, for example. Let's create a truth table for such a device.

Table 6.5 – Truth table of the octal encoder.

Inputs Exits
Combination No.

Another source of linear octal code can be analog comparators with different response thresholds. This line of comparators is used as part of a parallel analog-to-digital converter to convert an analog signal into a digital code. Binary code is more compact and convenient for subsequent processing. Therefore, a linear to binary code converter is required. The truth table of such a device is slightly different from the table given in Table 6.5. The truth table of the parallel analog-to-digital converter encoder is given in Table 6.6.

Table 6.6 – Truth table of the parallel analog-to-digital converter encoder.

Inputs Exits
Combination No.

The truth tables of the two devices considered can be combined. In this case, table cells for which it does not matter whether a zero or a one are written in them are marked with an "X".

Table 6.7 – Octal truth table

universal encoder.

Inputs Exits
Combination No. A2 A1 A0
X
X X
X X X
X X X X
X X X X X
X X X X X X

Now you can draw up a diagram of the device. The fact that almost all strings contain undefined values ​​makes it possible to significantly simplify the octal encoder circuit.

The simplest solution is obtained for the highest digit. Here you can get by with a “4OR” logic element circuit. To obtain a single signal in the output signal '2' in rows 6 and 7 of the truth table, it is sufficient to combine the input signals '7' and '6'. Lines 2 and 3 are added in the same way, but here you will need to decipher the input signals 2, 3, 4 and 5. The resulting circuit diagram of the octal encoder is shown in Figure 6.15.


Figure 6.14 – Schematic diagram of an octal encoder

Currently, encryptors (encoders) are produced in the form of separate microcircuits or used as ready-made units as part of other microcircuits, such as parallel ADCs. The graphical designation of the encoder is shown in Figure 6.15.

As an example of the integrated design of encryptors, we can name such domestically produced microcircuits as K555IV1 (octal encoder) and K555IV3 (decimal encoder).

Figure 6.15 – Graphic designation of the octal encoder

Multiplexers

Multiplexers are devices that allow you to connect multiple outputs to one input. In other words, a multiplexer is a switch that has several inputs and one output. In the simplest case, such switching can be accomplished using electronically controlled keys:

Figure 6.16 – Switch (multiplexer) assembled using keys

Such a switch will work equally well with both analog and digital signals. However, the speed of operation of mechanical keys leaves much to be desired, and the keys often have to be controlled automatically using some kind of circuit.

Digital circuits require switches to be controlled using logic levels. Therefore, it is advisable to select a device that could perform the functions of an electronic key with electronic control of a digital signal.

This type of decoder is also designed to output binary code in the form we are familiar with, but for this it uses special indicators, the numbers of which are dialed from segments:

Now let’s take a look at the circuit of such a decoder using the K176ID2 microcircuit as an example:

Like any other decoder, the microcircuit has inputs for receiving a binary code (1, 2, 4, 8) and 7 outputs on which a code is generated in accordance with the location of the segments on the indicator:

If, for example, we apply code 0110 to the input, then the microcircuit will set high levels at pins A, F, E, D, C, G and as a result we will see the number 6 (its binary equivalent is exactly 0110). Like simple BCD decoders, seven-segment indicators come in different types - it all depends on what types of indicators they are designed to work with.

If the indicators are LED, then the decoder must have good load capacity in order to withstand the current of the segment LED (K555ID18); if they are liquid crystal, then the output current can be small, but the decoder must be able to output an antiphase signal to the indicator (K564ID4). Luminescent indicators do not require a large current and operate with a constant voltage, but they must be supplied with a relatively high voltage (K176ID2).

For the convenience of constructing all kinds of digital scales (for example, clocks or frequency meters), decoders can be combined with counters. A classic example is K176IE3 and K176IE4:

It is enough to start sending pulses to the input C of such a counter-decoder, and it will begin to count and display the counting result on a seven-segment indicator: 0, 1, 2, 3, etc. A pulse was applied to input R (reset) and the indicator showed “0” - the counter was “reset”. What’s noteworthy is that IE4 can count up to 9 (then starts from zero again), and IE3 can count up to 6. Ideal for counting tens of minutes or seconds on an electronic watch. Going back a little (more precisely, to

A seven-segment display is often used to display decimal and hexadecimal digits. An image of a seven-segment indicator and the names of its segments are shown in Figure 3.

Figure 3.3 Image of a seven-segment indicator and the name of its segments.

To display the number 0 on such an indicator, it is enough to light segments a, b, c, d, e, f. To display the number "1", segments b and c are lit. In exactly the same way, you can obtain images of all other decimal or hexadecimal digits. All combinations of such images are called a seven-segment code.

Let's create a truth table for a decoder that will allow you to convert a binary code into a seven-segment one. Let the segments ignite at zero potential. Then the truth table of the seven-segment decoder will take the form shown in Table 3.2. The specific value of the signals at the output of the decoder depends on the connection diagram of the indicator segments to the output of the microcircuit. We will look at these diagrams later, in the chapter devoted to displaying different types of information.

Table 3.2. Truth table of a seven-segment decoder.

Inputs Exits
a b c d e f g

In accordance with the principles of constructing a circuit using an arbitrary truth table, we obtain a schematic diagram of a seven-segment decoder (decoder) that implements the truth table given in Table 2. This time we will not describe in detail the process of developing the circuit. The resulting circuit diagram of a seven-segment decoder is shown in Figure 3.4.


Figure 3.4. Schematic diagram of a seven-segment decoder (decoder).

To facilitate understanding of the principles of operation of the circuit at the output of logical elements "AND", the numbers of the truth table rows implemented by them are shown.

For example, at the output of segment a, a logical one will appear only when a combination of binary signals 0001 (1) and 0100 (4) is applied to the input. This is accomplished by combining the corresponding circuits with the “2OR” element. At the output of segment b, a logical one will appear only when a combination of binary signals 0101 (5) and 0110 (6) is applied to the input, and so on.

Currently, seven-segment decoders are produced in the form of separate microcircuits or are used in the form of ready-made blocks as part of other microcircuits. The graphical designation of the seven-segment decoder microcircuit is shown in Figure 3.5.

If you notice an error, select a piece of text and press Ctrl+Enter
SHARE:
Computers and modern gadgets