Basic digital logic gates
Source: InternetPublisher:石榴姐 Keywords: digital circuit logic gate circuit Updated: 2021/05/21
Whether it is digital circuits or C language, we will often encounter logical operations and logic circuits. Here I will introduce them. Everyone will have a brief understanding first. If you know that there is such a thing, you will encounter it later and study it in detail.
First of all, within the conceptual category of "logic", there are two logical values: true and false. When corresponding to digital circuits or C language, they become "non-zero value" and "zero value". Value, that is, logical "false" is the value of "0" in digital circuits or C language, and logical "true" is all other "non-zero values".
Then, let's analyze several main logical operators in detail. We assume that there are 2 byte variables: A and B. The result of some logical operation on the two is F.
The following logical operators operate on the overall value of the variable, and are usually called logical operators:
&&: Logical AND, F = A && B. When the values of A and B are both true (that is, non-zero values, the same below), the operation result F is true (the specific value is 1, the same below); when A, When any one of the B values is false (that is, 0, the same below), the result F is false (the specific value is 0, the same below).
||: Logical OR, F = A || B. When either A or B is true, the operation result F is true; when both A and B are false, the result F is false.
!: Logical negation, F = !A. When the value of A is false, the operation result F is true; when the value of A is true, the result F is false.
The following logical operators operate on each bit in the variable, and are usually called bitwise operators:
&: Bitwise AND, F = A & B, perform AND operation on each bit of the two bytes A and B, and then combine the obtained results of each bit into the total result F, for example, A = 0b11001100, B = 0b11110000, then the result F is equal to 0b11000000.
|: Bitwise OR, F = A | B, perform an OR operation on each bit of the two bytes A and B, and then combine the obtained results of each bit into the total result F, for example, A = 0b11001100, B = 0b11110000, then the result F is equal to 0b11111100.
~: Bitwise inversion, F = ~A, perform a NOT operation (that is, inversion) on each bit in the A byte, and then combine the obtained results of each bit into the total result F, for example, A = 0b11001100, Then the result F is equal to 0b00110011; we have already used this operator in the previous running water lamp experiment. Now if we look back, it will be much clearer.
^: Bitwise XOR, XOR means that if the values of both sides of the operation are different (that is, different), the result is true, and if the values of both sides are the same, the result is false. There is no XOR operation based on the overall value of the variable in C language, so we only take bitwise XOR as an example, F = A ^ B, A = 0b11001100, B = 0b11110000, then the result F is equal to 0b00111100.
When we read information or chip manuals in the future, we will often encounter some circuit symbols. Table 1 shows the commonly used symbols in digital circuits. Knowing these symbols will help us understand the logical structure of the device, especially focusing on understanding the "foreign symbols" in the following table. Popular Graphic Symbols”. Let’s take a brief look at it here first. If you encounter it later, you can check it here.
![Basic digital logic gates](http://www.eeworld.com.cn/circuit/upload/b6d057d6e185e9816a0d1c1d73b3912e/b1728bd9c5a8dc57e5866c51ff46a474.jpg)
- What is the function of a voltage regulator in a circuit? How to connect a voltage regulator?
- How does a series arrangement of Zener diodes affect the electrical behavior?
- What types of power field effect tubes are there? Selection criteria for power field effect tubes
- Transfer characteristics of BJT, how to apply Shockley equation?
- Beautiful crown wreath made with LED
- Why use PWM? What are its advantages?
- How to install the accelerometer
- What is the difference between JFET and MOSFET
- Using an Op Amp to Drive a Simple and Practical Power Amplifier
- LED Night Light
- Basic digital logic gates
- Light control alarm circuit diagram, light control alarm circuit principle
- Digital circuit part of ICL7107 chip (2)
- Interface circuit between power supply coupler and digital circuit
- Digital circuit sound and light control stair delay switch circuit (3)
- Touch-type delay circuit using digital circuits (3)
- Touch-type delay circuit using digital circuits (1)
- Delay light circuit using digital circuit (1)
- Improving digital circuits using photoconductive reflective elements
- 9V charger with digital circuit timer