Logic elements

Logical operations include any actions with Boolean numbers, which are understood as 0 and 1, in the case of circuitry and microcircuits this can be GND and +5 volts, for microcircuits with a 5 volt power supply, and for 3.3 volt microcircuits this voltage will be logical unit. In logic elements, we will practically not talk about currents, since they are there in the size of 0.02 amperes, we are only interested in the presence or absence of voltage, while its exact value is not so important to us, i.e. if somewhere there is a voltage of 4.95 volts, we say that there is a logical one, although the voltage is not literally equal to 5 volts.
Семисегментный индикатор.jpg
Семисегментный индикатор.jpg

Unary operations

Since we have only two states 0 and 1, then all further action takes place in the direction of comparing these signals, of which, by the way, there can be not only two, but much more, but we will begin to logically analyze the operations using the example of exactly two inputs, or rather from the first two operations on one input and one output. The first option is called a buffer, which outputs the same thing as it received at the input, a unit came in, a one came in at the output, a 0 came in at the output 0, the second most complex is the inversion or logical gate NOT (NOT), where at the output we receive the return signal of the input, those. input 1 output 0 and vice versa. In the diagrams, inverted outputs are indicated by circles or “bubbles”

Binary operations AND and OR

Operations with one input and one output are called unary, and if there are two inputs, then such operations are called binary and the very first binary operation is AND or (AND), in the diagrams it is indicated by a rectangle with the & sign, which follows from its logic, which is the fact that if the first contact is 1, and the second is 0, but at the output we get 0, and even though the first contact is 0, and the second is 1, we still get 0 at the output, for all zeros we also we get 0 at the output. We can get 1 at the output if and only if both contacts are high or 1
High (English High) or +5 or logical 1, and Low (English Low) or. GND or logical 0 - these two designations in English are also often found in circuit design.
The second binary logical operation is OR (OR) in the diagrams is indicated by a rectangle with the number 1, which seems to tell us that if at least one value at the input is 1, then at the output we will get 1, and we will get 0 only when everything output values ​​are 0.
Inverted AND and OR differ in the schematic representation in that the output shows a “bubble” as in the unary skewer NOT. Therefore, at the output we get the opposite value of AND or OR.
Условно-графическое обозначение логических элементов.jpg

Logical operation XOP

Well, the last value of the logical operations that we will consider is XOR or exclusive OR, which essentially eliminates two repeating signals, i.e. In the classic OR, with one on the first and second contacts, we also had 1 at the output, and in exclusive OR, in this case, the output was 0, while the output would be 1 if one of the contacts is 1 and 0 if both contacts are equal, zero or unit. Also, if we add a “circle” or “bubble” to the output in the diagram, we will get an invested exclusive OR.
Таблица истинности логических компонентов.jpg

Adder

Now if we connect exclusive OR and & then we get an adder that has input A and input B which are compared with each other via XOR and then we need to remember school computer science where:
0 0 + 0 0 = 00
0 0 + 0 1 = 0 1
0 1 + 0 0 = 0 1
0 1 + 0 1 = 1 0

At the output, as we know, we can have only one signal 0 or 1, and if in the first three examples we can be guided by the last symbol, and neglect the first one, since it is 0, then in the last example we have one go higher, which is written to output P - transfer.

If we connect two or more adders, it turns out that we must take into account the carry-over from the previous adder, therefore we have a Po connector - carry-over from the previous digit.
УГО и СХЕМА сумматора.jpg

Encryptor and decryptor

The next combined logical device can be considered an encoder, which converts a signal from 8 lines into 3 lines of binary code. Those. Let's imagine that we have a device with 8 buttons, on a microcontroller that performs certain operations regarding the pressed buttons, there are only 3 free ports where information can be transferred. The encoder easily copes with this task, so for
000 - first button pressed
001 - second button pressed
010- third button pressed
***************************************
111 - button 8 pressed
A device that performs the reverse work is called a decoder; essentially, it receives a binary code at its input and, depending on it, outputs a logical signal. So, for example, if the same microcontroller needs to turn on 8 LEDs, but it only has 3 free ports, then the decoder copes with this task remarkably

000 - 1 LED is on
001 - 2 LED lights up
010- 3 LED lights up
***************************************
111 - 8 LED lights up.
Схема семисегметного дешифратора.jpg

Multiplexer

Now imagine that instead of a pressed button that has only two states, we have a square wave at the 1st input, a sine wave at the second input, a sawtooth at the third, etc. We will take a decoder with two inputs and four outputs (let’s assume we have 4 signals that need to be controlled), now we connect signals with binary &, which will only pass it when it receives 1 from the encoder on its second contact. Therefore, when we apply 0 0 to the encoder, at the output we will receive a signal from the first channel, 0 1 - from the second, etc. Such a device is called a multiplexer, and logically, a device different (mirror) from it is called a demultiplexer.

Trigger

If we connect two ORs as shown in the diagram, then we get a TRIGGER, the essence of which comes down to storing the state, since due to the logical connection, initially the output of the trigger is in state 0, but it is worth closing (applying 1) at least once the input S (set - English . set) then at the output we get 1, well, at the inverted output 0, this state will remain regardless of changes in S, until we apply a logical 1 to the R (reset) connector, then the trigger will return to state 0 at the output and will wait 1 to enter. Trigger - English Trigger.

Essentially, a trigger allows us to store the previous state and MEMORY is based on this logic, both RAM (when the power is turned off, it is erased or returned to its original position), and ROM - read-only memory.

The permanent memory can be a factory-installed ROM, a one-time programmable PROM, or a multiple-programmable EPROM, which we will talk about in the course on firmware modules for washing machines and refrigerators.
RS триггер.jpg
Offcanvas
Some text as placeholder. In real life you can have the elements you have chosen. Like, text, images, lists, etc.