AI For DIY

Friday, October 14, 2022

Logic circuit design

1. About logic circuit design

Since we have seen logic operations and logic gates earlier, we want to set a desired goal and design a logic circuit suitable for it. Here, the relationship between input and output is listed as a truth table, and the logical expression is converted into a logical expression according to the simplification process. A logic circuit is designed based on the arranged final logic expression.
  This process is divided into a problem based on the completed truth table and a descriptive problem that requires logical interpretation.

 

2. Truth table-based logic circuit design

Input

Output

Serial No.

A

B

C

D

Q

0

0

0

0

0

0

1

0

0

0

1

0

2

0

0

1

0

0

3

0

0

1

1

1

4

0

1

0

0

0

5

0

1

0

1

1

6

0

1

1

0

0

7

0

1

1

1

1

8

1

0

0

0

0

9

1

0

0

1

0

10

1

0

1

0

0

11

1

0

1

1

1

12

1

1

0

0

1

13

1

1

0

1

1

14

1

1

1

0

1

15

1

1

1

1

1

 

As above, if all cases of input can be arranged in a truth table, the design of a logic circuit is easy. First, with respect to the inputs in the case where the output occurs, since each input is absolutely necessary for each other, it is arranged as a logical product. And with respect to the logical terms in which the output is generated, an output is generated even if there is only one of each logical terms, so they are arranged as a logical sum. Based on the logic table, if you follow the above contents, it is as follows.

 

Q(A,B,C,D)=∑m(3,5,7,11,12,13,14,15)m(3)m(5)m(7)m(11)m(12)m(13)m(14)m(15)

Q(A’·B’·C·D)(A’·B·C’·D)(A’·B·C·D)(A·B’·C·D)(A·B·C’·D’)(A·B·C’·D)(A·B·C·D’)(A·B·C·D)

(Here, 'm(serial number)' is an acronym for minterm, and refers to a term in which all variables are used once to form a product. If m(0) is A’·B’·C’·D’ and if m(15), it becomes A·B·C·D.)

 

 

As above, logic expressions are expressed long or with a large number of gates, which can be organized into short logic expressions and logic circuits with a small number of gates according to the laws of logic operation. This is called simplification of logic expressions or simplification of logic circuits.
  The above logical expression is summarized as follows.

Q(A’·B’·C·D)(A’·B·C’·D)(A’·B·C·D)(A·B’·C·D)((A·B)·((C’·D’)(C’·D)(C·D’)(C·D))) (Distribution)

(A’·B’·C·D)(A’·B·C’·D)(A’·B·C·D)(A·B’·C·D)(A·B·(1))) (Complementary)

(A’·B’·C·D)(A’·B·C’·D)(A’·B·C·D)(A·B’·C·D)(A·B) (Identity)

(A’·B’·C·D)(A’·B·C’·D)(A’·B·C·D)(A·B’·C·D)(A·B)(A·B·C·D) (Absorption)

(((A’·B’)(A’·B)(A·B’)(A·B))·(C·D))(A’·B·C’·D)(A·B) (Distribution)

((1)·(C·D))(A’·B·C’·D)(A·B) (Complementary)

(C·D)(A’·B·C’·D)(A·B) (Identity)

((C·D)(A’·B·C·D))(A’·B·C’·D)(A·B) (Absorption)

(C·D)((A’·B·C)(A’·B·C’))·D)(A·B) (Distribution)

(C·D)((A’·B)·D)(A·B) (Unity)

(C·D)(A’·B·D)((A·B)(A·B·D)) (Absorption)

(C·D)(A·B)(((A’)(A))·B·D) (Distribution)

(C·D)(A·B)((1)·B·D) (Complementary)

(C·D)(A·B)(B·D) (Identity)

 

 

By substituting the input of the truth table into the organized logical expression or input, it can be confirmed that the output matches. The logic circuit is also greatly reduced in scale from the 10 NOT gates + 8 4-input AND gate circuits to 3 2-input AND gate circuits, and it can be seen that the input and output relationships are the same.

 

3. Description-based logic circuit design

In logic, there are cases where the number of all cases for an output is known, but there are cases where some may not. In particular, when it is expressed verbally or in writing, there are cases where it is impossible to distinguish true from false because the mention is omitted or expressed vaguely. As an example, summarize the logic according to the description below.

 

There is a small gym, and we plan to open it according to the schedule for the reserved teams A, B, C, and D. First, team A and team B cannot be booked at the same time because they are large. Team C must follow either Team A or Team B if there is one, and do not reserve alone. Team D makes as many reservations as possible regardless of other teams.”

 

It is similar to statistics in mathematics in that it counts the number of cases, but logic can only be expressed as true or false. The omission in the description cannot be expressed as true or false, which is called “don’t care” and is marked with an ‘X’ in the truth table. That is, it is logically established because it does not affect the original statement with or without the corresponding term.
  Looking at the presented problems one by one, since there is no case where team A and team B are together, m(12), m(13), m(14), and m(15) with
A·B are all ‘0’. Team C does not go alone, so m(2) of A’·B’·C·D’ becomes '0', and m(4), m(5), m(8), and m(9) with A·C’ and B·C’ because team A or B must follow, it are all '0'. Conversely, m(6), m(7), m(10), and m(11) including A·B’·C or A’·B·C are all '1'. Team D goes as possible, so all terms that contain D among the others become '1'. Since there is no description of the case where there are no reservations for all four teams A, B, C, and D, m(0) of A’·B’·C’·D’ becomes ‘X’ with no relation. This can be summarized in a truth table as follows.

 

Input

Output

Serial No.

A

B

C

D

Q

0

0

0

0

0

X

1

0

0

0

1

1

2

0

0

1

0

0

3

0

0

1

1

1

4

0

1

0

0

0

5

0

1

0

1

0

6

0

1

1

0

1

7

0

1

1

1

1

8

1

0

0

0

0

9

1

0

0

1

0

10

1

0

1

0

1

11

1

0

1

1

1

12

1

1

0

0

0

13

1

1

0

1

0

14

1

1

1

0

0

15

1

1

1

1

0

 

As you can see from the description, if there is only team A or team B, it becomes irrelevant whether or not team D has a reservation. Similarly, if there are both teams A and B, they are excluded regardless of team C and team D, so it can be expressed as an irrelevant statement. It can be summarized as follows in the truth table by inserting this information.

 

Input

Output

Serial No.

A

B

C

D

Q

0

0

0

0

0

X

1

0

0

0

1

1

2

0

0

1

0

0

3

0

0

1

1

1

4~5

0

1

0

X

0

6~7

0

1

1

X

1

8~9

1

0

0

X

0

10~11

1

0

1

X

1

12~15

1

1

X

X

0

 

Based on this logical table, the logical expression becomes as follows. In this case, the terms whose output is “don’t care” are excluded first. Two terms with “don’t care” inputs such as m(6), m(7), m(10), and m(11) are merged into one to make three inputs. (Even if released, terms are merged with the law of complementarity in the simplification process.)

 

Q(A,B,C,D)=∑m(1,3,6,7,10,11)m(1)m(3)m(6,7)m(10,11)

Q(A’·B’·C’·D)(A’·B’·C·D)(A’·B·C)(A·B’·C)(A’·B’·D)(A’·B·C)(A·B’·C)

 

 

In the first simplification after the simplification of the formula as above, add m(0), which has an “don’t care” output, to check whether the simplification is greater than before.

 

Qm(0)m(1,3,6,7,10,11)(A’·B’·C’·D’)((A’·B’·D)(A’·B·C)(A·B’·C))

(A’·B’·C’·D’)((A’·B’·D)(A’·B·C)(A·B’·C))(A’·B’·C’·D’)(A’·B’·D)(A’·B’·C’·D)(A’·B·C)(A·B’·C)

((A’·B’·C’)(DD’))(A’·B’·D)(A’·B·C)(A·B’·C)((A’·B’·C’)(1))(A’·B’·D)(A’·B·C)(A·B’·C)

(A’·B’·C’)(A’·B’·D)(A’·B·C)(A·B’·C)

 

 

In this form, the second simplification rather increases the terms, so the first simplification result excluding “don’t care” terms is adopted as the final result.

 

If the above question is changed to “Team C makes a reservation alone,” the final result may change. In this case, the first simplification excluding the “don’t care” term is as follows.

 

Q=∑m(1,2,3,6,7,10,11)m(1)m(2,3)m(6,7)m(10,11)

Q(A’·B’·C’·D)(A’·B’·C)(A’·B·C)(A·B’·C)(A’·B’·C’·D)((A’·B’·C)(A’·B’·C))(A’·B·C)(A·B’·C)

(A’·B’·C’·D)((A’·C)·(BB’))((A’A)·(B’·C))(A’·B’·C’·D)((A’·C)·(1))((1)·(B’·C))

(A’·B’·C’·D)(A’·C)(B’·C)(A’·B’·C’·D)((A’·B’·C·D)(A’·C))(B’·C)

((A’·B’·D)·(C’C))(A’·C)(B’·C)((A’·B’·D)·(1))(A’·C)(B’·C)

(A’·B’·D)(A’·C)(B’·C)

 

 

A second simplification is performed by adding an “don’t care” term to this result.

 

Qm(0)m(1,2,3,6,7,10,11)(A’·B’·C’·D’)(A’·B’·D)(A’·C)(B’·C)

(A’·B’·C’·D’)((A’·B’·C·D)(A’·B’·C’·D))((A’·B’·C·D’)(A’·C))(B’·C)

((A’·B’)·((C’·D’)(C·D)(C’·D)(C·D’)))(A’·C)(B’·C)((A’·B’)·(1))(A’·C)(B’·C)

(A’·B’)(A’·C)(B’·C)

 

 

The second simplification is adopted because the result of simplification by adding “don’t care” terms is further reduced. In the logic circuit designed according to the logic expression, it can be seen that the input line disappears due to the addition of the “don’t care” term.

 

As such, the result may change depending on the presence or absence of “don’t care” terms, so the simplification operation is repeated according to the number of “don’t care” terms to find the optimal design.

 

4. Conclusion

In the process of designing a logic circuit, it proceeded through the steps of input and output setting from a problem, truth table preparation, Boolean algebra conversion, logic expression simplification, and logic circuit conversion. Be sure to check whether the designed logic circuit matches the setting of the problem before proceeding. In addition, in the process of converting to a logical expression, there is also a term called the Maxterm, which is expressed in the form of addition because all variables are used once, but it is omitted here because it is not used relatively well.

No comments:

Post a Comment