AI For DIY

Wednesday, October 5, 2022

Logic gates

1. About logic gates

If the logical operation we discussed earlier is expressed as a formula based on Boolean algebra, we want to make it a real thing. However, although it is complicated to make a circuit that actually applies or cuts off electricity, each designer has a different drawing method. In addition, there are many ways to implement logic depending on the wiring diagram (single line diagram, multi line diagram), design unit (contact device, non-contact device), and polarity of design device (P/N/CMOS, A/B/C contact), etc.
  Therefore, a unit circuit that implements the function of logic operation is drawn with a single symbol, which is called a logic gate. Since this logic gate is a symbol that unites the unit circuit, it is often reflected in the circuit diagram by treating it itself as a component.

 

2. Types of logic gates

Logic gates are usually divided into 8 types and are functionally the same as logical operators. Therefore, the operand and operation result checked in the logical operator can be brought from the logic gate to the input and output, so the symbol should be remembered in relation to the logical expression.
  The appearance of the symbol is largely divided into the old symbol and the new symbol. Old logic gates have an easy-to-identify appearance, but are difficult to draw consistently by hand. The new logic gate has the advantage that it is easy to draw by being written in a rectangle and can be applied to complex logic circuits in addition to logic gates, but it is difficult to recognize at a glance. Most of the logic gates use a old one that is easy to identify, so this takes precedence.
  Generally, the old type is divided into IEEE(Institute of Electrical and Electronics Engineers) and the new type is divided into IEC(International Electrotechnical Commission) based on the standard, but now it is cross-applied everywhere, it is judged that there is no meaning to classify by standard.

 

The first logic gate to look at is BUFFER. As a single input gate, the input and output are always the same, so they do not appear in logic operators, but exist separately in logic gates. It is used for two main purposes: to maintain a stable voltage for a long or electrically unstable signal in a circuit, and to intentionally delay the time for delay from input to output of other logic gates. The relation between input and output is QA.
  In the case of the old symbol, it is an equilateral triangle, and in the case of the new symbol, ‘1’ (meaning
×1) is written to mean that the input and output are the same.

 

 

Input

Output

A

Q

0

0

1

1

 

Next is NOT. As a single input gate, it always inverts the output compared to the input, so it is often used as an INVERTER, and is also used as a COMPLEMENTOR because it is applied to 1’s complement calculation in binary numbers. The relation between input and output is QA’ in a logical expression.
  In the symbol, a drop (old) or triangle (new) is added to the output of BUFFER, and remember that the output is inverted in this shape. Repositioning and connecting this additional shape to the input of another logic gate means that the input is inverted.

 

 

Input

Output

A

Q

0

1

1

0

 

The third gate is AND. As a multi-input gate, the result of the logical product between the inputs is output. The relation between input and output is QAB(or QAB)in a logical expression.
  In the case of the old symbol, the input side is flat and the output side is semicircular. In the case of the new symbol, ‘&’ (ampersand, usually read as ‘and’) is written as an abbreviation for AND.

 

 

Input

Output

A

B

Q

0

0

0

0

1

0

1

0

0

1

1

1

 

The fourth gate is OR. As a multi-input gate, the result of the logical sum between the inputs is output. The relation between input and output is QA+B in a logical expression.
  In the case of the old symbol, the input side is a single arc, and the output end is sharp by combining two arcs. In the case of a new symbol, ‘≥1’ is written in the sense that it is output if the sum of the inputs is 1 or more.

 

 

Input

Output

A

B

Q

0

0

0

0

1

1

1

0

1

1

1

1

 

The fifth gate is XOR. As a multi-input gate, the result of the exclusive logical sum between the inputs is output. The relation between input and output is QAB(or QA’B+AB’) as a logical expression.
  In the case of the old symbol, one more arc is added to the input side in OR, and in the case of the new symbol, ‘=1’ is written, meaning that it is output when the sum of the two inputs is 1. However, considering more than three inputs, it is good to remember as ‘a gate with an output of ‘1’ when the number of ‘1’s in the input is odd’ rather than 'a gate with an output of '1' when the inputs are different (total is 1)’.

 

 

Input

Output

A

B

Q

0

0

0

0

1

1

1

0

1

1

1

0

 

The sixth gate is NAND. The NOT gate is added to the output terminal of the AND gate, and the output is inverted to the logical product between the inputs. The relation between input and output becomes Q(AB)’ in a logical expression. And the symbol is in the form of adding NOT (droplet or triangle) to the output terminal of AND.

 

 

Input

Output

A

B

Q

0

0

1

0

1

1

1

0

1

1

1

0

 

The seventh gate is NOR. The NOT gate is added to the output terminal of the OR gate, and the output is inverted to the logical sum between the inputs. The relation between input and output becomes Q(A+B)’ in a logical expression. And the symbol is in the form of adding NOT to the output terminal of OR.

 

 

Input

Output

A

B

Q

0

0

1

0

1

0

1

0

0

1

1

0

 

The last gate is XNOR. The NOT gate is added to the output terminal of the XOR gate, and the output is inverted to the exclusive logical sum between the inputs. The relation between input and output is Q(AB)AB(or QA’B’+AB) as a logical expression.
  The symbol is in the form of adding NOT to the output terminal in XOR. And, like XOR, it should be remembered as ‘a gate whose output is ‘1’ when the number of ‘1’s in its input is even (including ‘0’)’ rather than ‘a gate whose output is ‘1’ when the inputs are the same’.

 

 

Input

Output

A

B

Q

0

0

1

0

1

0

1

0

0

1

1

1

 

If we look further into the outline of the logic gate, there is no fixed interval between the input lines. When the number of inputs of a logic gate increases, up to 4 or less, the basic type is drawn by adjusting the line spacing, but when there are more than 5, it is common to extend the input of the logic gate. In the case of the old model, an extension line was added to the input side, and in the case of the new model, the vertical length of the rectangle is longer. When drawing the input line of the old logic gate, try not to match the outline horizontal line of the gate as much as possible.

 

 

In the case of the old logic gate, the BUFFER is an equilateral triangle, so the aspect ratio is 1.732:1, but if it is 1.5:1, it can be simply drawn with an unusual appearance. For AND, OR XOR shapes, the aspect ratio of 8:6.5 is original form, but it is better to draw with 5:4. In the case of a new logic gate, the shape changes depending on the input, so it is okay to draw a square instead of a rectangle.

 

3. Universal Gate

First, if we summarize De Morgan's law as a logic gate, it is as follows.

 

 

As shown in the figure, the position of the droplet that inverts the signal while switching the logical product and logical sum is changing at the input and output. When the position of NOT is changed, the logical product and logical sum are interchanged, meaning that all logical expressions can be expressed with only one of the logical product or the logical sum.

A gate that can substitute all other logic gates with just one of these gates is called a universal gate, and among the eight basic types of gates, NAND gates and NOR gates are these.

 

 

In the figure, NOT, AND, OR, and XOR are created by combining NAND, so by adding NOT again, BUFFER, NOR, and XNOR are all created.

 

 

In the figure, NOT, OR, AND, and XNOR are created by combining NOR, so by adding NOT again, BUFFER, NAND, and XOR are all created.

You may think that it is necessary to implement a different logic gate by using a lot of one type, but note that there is an economical reason to mass-produce only one type at the manufacturing stage.

 

4. Conclusion

Logic gates can appear in relation to all logic, including contacts or switches, as well as logical operations, so it is good to get used to the functions of logic gates by looking at their appearance.

No comments:

Post a Comment