Logic circuits 1. Basic concepts of logic algebra, logic circuits. Example of constructing logic circuits


Logic elements can operate with both positive voltages and negative voltages. Figure 10.3 shows time diagrams of such voltages.

Fig. 10.3. Timing diagrams of operation of logic elements with positive and negative voltages

OR and AND gates can be implemented using diodes.

Figures 10.4 and 10.5 show electrical circuits of OR logic elements built on diodes using positive and negative voltages.

Let's consider the operation of the circuit in Fig. 10.4. If the diode inputs x1 And x2 send log signals 0 , then diodes VD1 And VD2 will be closed at the exit y The log will appear. 0 . If a positive log voltage is applied to one of the inputs, for example to In.1. 1 , and on In.2 – log. 0 , then the diode VD1 will open and current will flow through the load, at the output y a log signal will appear. 1 . In this case, the diode VD2 will be closed.

Fig. 10.4. Diode circuit of an OR gate with positive

stresses

Fig. 10.5. Diode OR gate circuit with negative

stresses

The circuit shown in Fig. 10.5 works similarly. The input and output signals of the circuit will correspond to the truth table:

Figure 10.6 shows electrical diagram logic element AND, built on diodes VD1, VD2 and limiting resistor R. The circuit is powered by a DC source.

If logical signals at one of the inputs x1 And x2 or at two inputs of the element correspond to log. 0 , then the signal at the output of the circuit will also be equal to log. 0 . This happens because one of the diodes or both diodes will be open and current will flow from +E through a resistor R, one or two diodes, input or two element inputs to -E. At the same time, the internal resistance of the inputs is small Rin.in. . If at the entrances x1 And x2 log signals will appear. 1 , then at the output y element also a log signal appears. 1 , since diodes VD1, VD2 closed by positive voltages of input signals.

In this article we will tell you what logical elements are and consider the simplest logical elements.

Any digital device - a personal computer, or a modern automation system consists of digital integrated circuits (ICs) that perform certain complex functions. But to perform one complex function, it is necessary to perform several simple functions. For example, the addition of two one-byte binary numbers occurs inside a digital chip called a “processor” and is performed in several stages by a large number of logic elements located inside the processor. Binary numbers are first stored in the buffer memory of the processor, then rewritten into special “main” registers of the processor, then they are added, the result is stored in another register, and only after that the result of the addition is output through the buffer memory from the processor to other computer devices.

The processor consists of functional units: input-output interfaces, memory cells - buffer registers and “accumulators”, adders, shift registers, etc. These functional units consist of the simplest logical elements, which in turn consist of semiconductor transistors, diodes and resistors. When designing simple trigger and other electronic pulse circuits, complex processors cannot be used, but using transistor cascades is “last century”. This is where they come to the rescue - logic gates.

Logic elements, these are the simplest “cubes”, components of a digital microcircuit that perform certain logical functions. At the same time, a digital microcircuit can contain from one to several units, tens, ... and up to several hundred thousand logical elements, depending on the degree of integration. In order to figure it out, what are logical elements, we will consider the simplest of them. And then, as we build up our knowledge, we’ll deal with more complex digital elements.

Let's start with the fact that the unit of digital information is “one bit”. It can take two logical states - a logical zero “0” when the voltage is zero (low level), and a logical one state “1” when the voltage is equal to the supply voltage of the microcircuit (high level).

Since the simplest logic element is an electronic device, this means that it has inputs (input pins) and outputs (output pins). There may be one input and output, or there may be more.

In order to understand the principles of operation of the simplest logical elements, it is used "truth table". In addition, to understand the principles of operation of logical elements, the inputs, depending on their number, are designated: X1, X2, ... XN, and the outputs: Y1, Y2, ... YN.

The functions performed by the simplest logic elements have names. As a rule, a number indicating the number of inputs is placed in front of the function. The simplest logic elements always have only one output.

Let's consider the simplest logical elements

By adding the “NOT” element to the “2I” element, we got the “2I-NOT” element. This is how we can assemble a circuit if we need a “2I-NOT” element, but we only have the “2I” and “NOT” elements at our disposal.

By adding the “NOT” element to the “2I-NOT” element, we got the “2I” element. This is how we can assemble a circuit if we need the “2I” element, but we only have at our disposal the “2I-NOT” and “NOT” elements.

Similarly, by connecting the inputs of the “2AND-NOT” element, we can obtain the “NOT” element:

Please note that a new element has been introduced in the designation of elements - a hyphen separating the right and left parts in the name “2I-NOT”. This hyphen is an indispensable attribute when inverting the output (“NOT” function).

By analogy with the “2AND-NOT” element, by connecting the inputs of the “2OR-NOT” element we can obtain the “NOT” element:

The above logical elements perform static functions, and on their basis more complex static and dynamic elements (devices) are built: flip-flops, registers, counters, encoders, decoders, adders, multiplexers.

In digital circuitry, a digital signal is a signal that can take on two values, considered as a logical "1" and a logical "0".

Logic circuits are implemented using logical elements: “NOT”, “AND”, “OR”, “AND-NOT”, “OR-NOT”, “XOR” and “Equivalence”. The first three logical elements allow you to implement any, no matter how complex, logical function in a Boolean basis. We will solve problems on logical circuits implemented precisely in a Boolean basis.

Several standards are used to designate logic elements. The most common are American (ANSI), European (DIN), international (IEC) and Russian (GOST). The figure below shows the designations of logical elements in these standards (to enlarge, you can click on the figure with the left mouse button).

In this lesson we will solve problems on logical circuits, in which logical elements are designated in the GOST standard.

Logic circuit problems are of two types: the task of synthesizing logical circuits and the task of analyzing logical circuits. We will start with the second type of task, since in this order we can quickly learn to read logic circuits.

Most often, in connection with the construction of logical circuits, the functions of logic algebra are considered:

  • three variables (will be considered in analysis problems and in one synthesis problem);
  • four variables (in synthesis problems, that is, in the last two paragraphs).

Let's consider the construction (synthesis) of logical circuits

  • in the Boolean basis "AND", "OR", "NOT" (in the penultimate paragraph);
  • in the also common bases “AND-NOT” and “OR-NOT” (in the last paragraph).

Logic circuit analysis problem

The task of analysis is to determine the function f, implemented by a given logic circuit. When solving such a problem, it is convenient to adhere to the following sequence of actions.

  1. The logical diagram is divided into tiers. Tiers are assigned sequential numbers.
  2. The outputs of each logical element are designated by the name of the desired function, equipped with a digital index, where the first digit is the tier number, and the remaining digits are the serial number of the element in the tier.
  3. For each element, an analytical expression is written that connects its output function with the input variables. The expression is determined by the logical function implemented by the given logical element.
  4. Substitution of some output functions through others is carried out until a Boolean function is obtained, expressed in terms of input variables.

Example 1.

Solution. We divide the logical circuit into tiers, which is already shown in the figure. Let's write down all the functions, starting from the 1st tier:

x, y, z :

x y z f
1 1 1 0 1 1 1 1
1 1 0 0 0 0 1 0
1 0 1 0 0 0 1 0
1 0 0 0 0 0 1 0
0 1 1 0 0 0 1 0
0 1 0 0 0 0 1 0
0 0 1 0 0 0 1 0
0 0 0 1 0 1 0 0

Example 2. Find the Boolean function of a logic circuit and construct a truth table for the logic circuit.

Example 3. Find the Boolean function of a logic circuit and construct a truth table for the logic circuit.


We continue to search for the Boolean function of the logic circuit together

Example 4. Find the Boolean function of a logic circuit and construct a truth table for the logic circuit.

Solution. We divide the logical diagram into tiers. Let's write down all the functions, starting from the 1st tier:

Now let's write down all the functions, substituting the input variables x, y, z :

As a result, we get the function that the logic circuit implements at the output:

.

Truth table for this logic circuit:

x y z f
1 1 1 0 1 1
1 1 0 0 1 1
1 0 1 1 0 1
1 0 0 0 0 0
0 1 1 0 1 1
0 1 0 0 1 1
0 0 1 0 1 1
0 0 0 0 1 1

Example 5. Find the Boolean function of a logic circuit and construct a truth table for the logic circuit.

Solution. We divide the logical diagram into tiers. The structure of this logical circuit, unlike previous examples, has 5 tiers, not 4. But one input variable - the lowest one - runs through all the tiers and directly enters the logical element in the first tier. Let's write down all the functions, starting from the 1st tier:

Now let's write down all the functions, substituting the input variables x, y, z :

As a result, we get the function that the logic circuit implements at the output:

.

Truth table for this logic circuit:

x y z f
1 1 1 1 1 1
1 1 0 1 1 1
1 0 1 1 0 1
1 0 0 1 0 1
0 1 1 1 1 1
0 1 0 1 1 1
0 0 1 1 0 1
0 0 0 1 0 1

The problem of synthesizing logic circuits in a Boolean basis

The development of a logical circuit according to its analytical description is called the problem of logical circuit synthesis.

Each disjunction (logical sum) corresponds to an “OR” element, the number of inputs of which is determined by the number of variables in the disjunction. Each conjunction (logical product) corresponds to an “AND” element, the number of inputs of which is determined by the number of variables in the conjunction. Each negation (inversion) corresponds to a “NOT” element.

Logic design often begins with defining the logical function that the logic circuit must implement. In this case, only the truth table of the logic circuit is given. We will analyze just such an example, that is, we will solve a problem that is completely opposite to the problem of analyzing logical circuits discussed above.

Example 6. Construct a logical circuit that implements a function with a given truth table:

x y f
1 1 0
1 0 0
0 1 1
0 0 0

Solution. Let's analyze the truth table for a logic circuit. We define the function that will be obtained at the output of the circuit and intermediate functions that take arguments as input x And y. In the first line, the result of implementing the output function, given that the values ​​of the input variables are equal to ones, should be a logical "0", in the second line - with different values ​​of the input variables, the output should also be a logical "0". Therefore, it is necessary that the output function be a conjunction (logical product).

Software for the design and simulation of digital logic circuits.

Logisim has a simple graphical interface and is primarily used as an educational tool. The application includes: a toolbar, a menu bar, an explorer panel (with a list of circuits and tools of loaded libraries), an attribute table of the selected component or tool, and a working window with circuit components.

Logisim has an extensive library. Among the main elements we can note: a block of logical elements (controlled inverter and buffer, NOT, OR, AND, even and odd, etc.), wiring elements (splitter, sensor, contact, matching resistor, transfer valve, tunnel, etc.). etc.), input/output elements (button, keyboard, joystick, LED, seven-segment indicator, terminal, LED matrix, etc.), a set of multiplexers, a block of arithmetic operations (adder, multiplier, subtractor, divider, comparator, negative and etc.), memory elements (triggers, registers, RAM and ROM, counters, random number generators, etc.). The application also allows you to draw vertical/horizontal conductors and automatically connects them to circuit elements.

The Logisim program makes it possible not only to draw digital circuits, but also to simulate their behavior. In this case, the calculation of processes occurs directly during the editing of the circuit - the values ​​​​at the inputs/outputs change, the output elements display the corresponding information, the state of memory devices is updated, and the wires change their color depending on the values. For clocked circuits, simulation can be done either clockwise or by setting the maximum clock frequency.

One of the most important features of Logisim is the creation of subcircuits for the purpose of reusing already designed parts, as well as to simplify the debugging process. The application includes a small vector graphics editor that can change the appearance and pin layout of subcircuits when they are added to other circuits. Another module, Combination Analysis, allows you to convert data between logical expressions, logic circuits and truth tables, making it possible to convert information in all directions. All wires in the Logisim program have one of seven colors that carry information about their purpose. Wires can be collected into bundles with the order of entry into the bundle assigned. In addition, it is supported: creating custom component libraries in Java, binding any tool to a specific key combination, displaying complete statistics on the number and types of components contained in the circuit. It should be noted that the Logisim program does not provide the ability to work with analog elements.

The Logisim program was developed by Hendrix College teacher, Professor Karl Birch (USA, Arkansas, Conway). Translation into Russian was done by Ilya Lilov. This logic circuit modeling tool first appeared in 2001, and has been regularly updated and expanded since then.

The Logisim application is free software (GNU GPL license). The software includes: help on library elements, a complete user manual and a short guide for beginners.

The Logisim program is available in Russian (including full documentation), English, German, Spanish, Portuguese and Greek.

To operate the diagram designer in question, you must have the Java Runtime Environment package (version 5 or later). Logisim is cross-platform software and works on operating systems: Microsoft Windows (all latest versions are supported), MacOS, Linux and Solaris. The application distribution contains one executable file that does not require installation.

Program distribution: free.

Logisim file formats: CIRC

8 / 12 592

print version

For setting up and repairing ZX-Spectrum compatible computers, a useful device is a logic probe. Essentially, this is a device that displays the logical level of the signal at the input (log.0 or log.1). Since the logic levels may be different depending on the type of chip used (TTL, CMOS), the probe should ideally be configurable for use with different types of signals.

ZX-Spectrums almost always use chips with TTL inputs/outputs, so it would be appropriate to consider the logic probe circuit taking into account TTL signal levels.

Here I will repeat a little the common truths, which are already known to everyone interested... The voltage values ​​of log.1 and log.0 for TTL can be seen from the following schematic diagram:

As you can see, the extreme levels of log.0 and log.1 for inputs and outputs are somewhat different from each other. For the input, log.0 will be at a voltage of 0.8V or less. And the output level log.0 is 0.4V or less. For log.1 it will be 2.0V and 2.4V, respectively.

This is done so that the extreme levels of log.0 and log.1 for the outputs are guaranteed to fall within the voltage range for the inputs. That is why such a small “spread” was made in the levels of inputs and outputs.

Anything that falls within the voltage range between log.0 and log.1 (from 0.8V to 2.0V) is not recognized by the logic element as one of the logical levels. If there were no such difference in levels (2-0.8 = 1.2V), any interference would be regarded as a change in signal level. And so the logic element is resistant to interference with an amplitude of up to 1.2V, which, you see, is very good.

TTL inputs have an interesting feature: if the input is not connected anywhere, then the microcircuit “believes” that logic 1 is applied to it. Of course, such a “non-connection” is very bad, if only because the input of the microcircuit hanging “in the air” “catches” all the interference, as a result of which false positives are possible. However, we are interested in something else - at the input “hanging in the air” there is always some voltage, the value of which falls in an indefinite interval between the logical levels:

There should be a video here, but it won't work unless you enable JavaScript for this site.

This level is called a “hanging unit”, i.e. as if there is a unit (it is regarded by the microcircuit as log.1), but in reality it is not there :)

In relation to the process of repairing and setting up computers, the concept of a “hanging unit” is useful in that if a conductor on the board breaks or the output of any microcircuit burns out, no signal is sent to the inputs of the microcircuits connected to them, and therefore there will be a “hanging unit”, and this moment can be recorded, because We already know the approximate voltage levels in this state of the microcircuit (on the order of 0.9V and up to 2.4V).

That is, if, for example, according to the circuit, the input of the microcircuit should be connected somewhere, but in reality it is not 0 or 1, but a “hanging one,” then something is wrong here. This is very useful in terms of the repair process!

Based on the above, we can formulate a technical specification for creating a logic probe:
- Voltage from 0 to 0.8V inclusive is considered as log.0;
- Voltage from 2.0V to 5.0V is considered as log.1;
- Voltages from 0.9V to 2.4V are considered as a “hanging unit”.

Various Logic Probe Designs

There are a lot of logic probe circuits. Just search in any search engine and enter the phrase “logical probe”. However, according to various criteria, these schemes do not suit me:
- The output is sent to a seven-segment indicator, the brightness of which does not allow one to determine the approximate duty cycle of the pulses;
- There is no definition of a "hanging unit";
- Other criteria like “I just didn’t like the scheme” :)

A slightly more "advanced" version of this scheme:

I used this sampler for about 18 years. Despite its simplicity, this probe shows everything: log.0, log.1. It even shows a “hanging unit” - while the LED (log.1) barely glows. You can determine the duty cycle of pulses by the brightness of the LEDs. This probe does not even burn out when voltages of -5V, +12V and even higher are applied to its inputs! When -5V is applied to the probe, the LED (log.0) lights up with very high brightness. At +12V at the input, the LED (log.1) lights up with high brightness. In short, an indestructible scheme :)

To record short pulses that are not visible to the eye (for example, a port selection pulse), I attached a “latch” to the probe on the half of the TM2 trigger:

Probe appearance:

Your own version of a logic probe

I have attempted to make a logic probe with an indication of a “hanging one” on the comparators. In statics everything worked and was detected, but in dynamics the probe turned out to be inoperative. The problem lies in the speed of the comparators. The comparators available to me (LM339, K1401CA1, KR554CA3, etc.) are quite slow and do not allow operation at frequencies above 1.5-2 MHz. This is completely unsuitable for working with the ZX-Spectrum circuit. What's the use of a probe if it can't even show the processor clock speed?

But just recently on YouTube I came across a video lecture on the operation of a logic probe:

Lecture on the principles of operation of a logic probe

The lecture is very interesting and informative. Watch it in full!

This probe design interested me very much, and I decided to repeat it and test it. According to the diagram from the lecture, everything worked except for the cascade for determining the level of the “hanging” unit. However, this is not a problem, and I made a cascade on the comparator. There is no question of performance here, because... the term "dangling unit" applies to the static state of the chip.

The result was a probe with the following circuit:

P.S. The probe circuit is not the most ideal, and if desired, you can certainly make it simpler and better.

Description of the circuit and process of setting up a logic probe

The input stages of the probe are made on emitter followers on transistors VT1 and VT2. In the initial state (when nothing is supplied to the probe input), the transistors are closed, so logic 0 is applied to the inputs of DD1.1 through resistor R4, LED VD1 is not lit. In the same way, transistor VT2 is closed, and through resistor R5, logic 1 is supplied to the inputs of DD1.2, LED VD3 does not light up.

When a signal with a level of log.0 (0...0.8V) is applied, transistor VT2 opens, log.0 is supplied to the inputs DD1.2, LED VD3 lights up.

When a signal with a level of log.1 (2...5V) is applied, transistor VT1 opens, log.1 is supplied to the inputs DD1.1, and the LED VD1 lights up.

Resistors R2-R3 at the probe input set the voltage to about 0.87-0.9V. Those. It is necessary that this voltage be in the range of 0.8..0.9V so that the VD3 LED does not light up when the probe input is not connected anywhere.

A circuit for determining the “hanging unit” was made on the DA3 comparator. Resistors R6-R7 set a voltage of the order of 0.92..0.95V, at which the comparator will determine that the “hanging unit” level is at the input and the VD2 LED will light up. The voltage at the 2DA2 input is selected such a value that the VD2 LED does not light up when the probe input is not connected anywhere.

The color of the LEDs can be selected so that log.0 is shown in green, log.1 in red, and the “hanging unit” in yellow. I don’t know about you, but it’s more convenient for me. It is best to take transparent (not matte) LEDs VD1 and VD3 so that the crystal is clearly visible, and, if possible, bright, so that it is easier to replace if the LED glows even a little.

The DD3 chip contains a counter of pulses arriving at the input of the probe. With short pulses that are not visible to the eye, the VD4-VD7 LEDs will regularly show the number of pulses in binary form :) Using the SB1 button, the counter is reset with all LEDs going out.

The inverters of the DD2 chip are used to ensure that the active level (when the LED lights up) is log.0, because The TTL output at log.0 is capable of delivering current up to 16 mA to the load. With output logic 1, the output is capable of delivering a current of 1 mA, and if we connect an LED to it (so that it lights up with logic 1 at the output), we will overload the output. Current-limiting resistors are selected so that the maximum current flowing through the LEDs does not exceed 15 mA.

The probe is powered by a separate power supply (I used it from a Belarus tape recorder). Voltage stabilizer DA2 is located on the probe board. Considering that the current consumption of the probe is not too high, the stabilizer chip is used without an additional heat sink, and does not overheat.

The probe input circuits VT1, VT2, DA3 are powered by a separate reference voltage source DA1. This was done because when the current consumption of the probe changes (for example, when most of the LEDs are on), the output voltage of the DA2 stabilizer changes slightly, and all reference voltages will change accordingly, which is unacceptable.

Editor's Choice
From the very first days, you want to surround your child with everything that is best, safe, reliable, and most importantly, something that will serve faithfully...

From every water tap flows water saturated with a terrible poison, used during the war as a chemical weapon, the name...

According to statistics, it was revealed that the cost of LED lamps has decreased significantly. Such indicators led to...

Autumn fairy tale in kindergartenI bring to your attention some ideas for decorating a room for the autumn holidays. The material will be useful...
New Year's vytynanki have become an indispensable attribute of this holiday along with garlands and. They are most often cut out and glued to windows...
Local estimates (estimates) 4.1. Local estimates (estimates) for certain types of construction and installation work, as well as...
Category: Making molds Molding materials and mixtures Molding materials. Molding materials used for...
A modern kitchen is equipped with cooler electrical equipment than starships in old movies. And it requires a responsible approach to selection and installation...
As mentioned earlier, the causes of yellowing and drying of the peduncle can be divided into a natural process and the consequences of improper...