Logical subtraction Tatac of truth. In what order to perform logical operations

1. Determine the procedure.

2. Determine the dimension of the truth table.


The number of columns is determined by the number of logical variables (their two A, B) and the number of action (there are also two).


4. Formulate the answer.
In the last column one "0", corresponding to a, equal to "1", and in equal to "0". It turns out that this function is false if and only if the logical variable is true, and the logical variable is false, which corresponds to the logical function.
So this function is equal to the logical consequence of variables A and B: if a, then V.

Make a truth table for logical function:


1. Determine the procedure.


2. Determine the dimension of the truth table.

The "cap" table contains two lines - action numbers and logical action operations.
The number of columns is determined by the number of logical variables (their two A, B) and the number of action (their five).
The number of rows in the table is equal to a degree to a degree equal to the number of logical variables - in the case of two variables, 4 lines are obtained ..
3. Alternately fill the table columns in accordance with the logical function of this column.


4. Formulate the answer.
In the last column "1", correspond to the equal in, and "0" - and unequal V. It turns out that this function is true, when A is equal to the false, when not equal to, which corresponds to the logical function of the identity.
It means that this function is equal to the logical identity of variables A and B: and identically

In digital circuit engineering, a digital signal is a signal that can receive two values \u200b\u200bconsidered as a logical "1" and logical "0".

Logic circuits may contain up to 100 million inputs and such gigantic schemes exist. Imagine that the Boolean function (equation) of such a scheme was lost. How to restore it with the smallest loss of time and without errors? The most productive way is to smash the scheme for tiers. With this method, the output function of each element is recorded in the previous tier and is substituted to the appropriate input on the next tier. This method of analyzing logic schemes with all the nuances we will consider today.

Logical schemes are implemented on logical elements: "not", "and", "or", "," and "," or non-"," excluding or "and" equivalence ". The first three logical elements allow you to realize any, arbitrarily complex logical function in the Boolean basis. We will solve problems on logic schemes implemented in the Boolean basis.

Multiple standards are used to designate logical 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 (you can click on the image with the left mouse button).

In this lesson, we will solve problems on logic schemes on which the logical elements are indicated in the standard GOST.

Objectives for logic circuits are two types: the problem of synthesis of logic schemes and the tasks of analysis of logic schemes. We will start with the task of the second type, as in such a manner it is possible to learn how to learn logic schemes faster.

Most often, in connection with the construction of logic schemes, the functions of the Logic algebra are considered:

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

Consider the construction (synthesis) of logic schemes

  • in the Boolean basis "and", "or", "not" (in the penultimate paragraph);
  • in also common basics "and not" and "or non-" (in the last paragraph).

Object analysis of logic schemes

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

  1. The logic scheme is divided into tiers. Taruses are assigned serial numbers.
  2. The findings of each logical element are indicated by the name of the desired function equipped with a digital index, where the first digit is the tier number, and the other numbers are the sequence number of the element in the tier.
  3. For each element, an analytical expression is recorded that binds its output function with input variables. The expression is determined by the logical function implemented by this logical element.
  4. A single output functions are substituted through others, until the Boolean function is obtained, expressed through the input variables.

Example 1.

Decision. We divide the logical scheme on the tiers, which is already shown in the figure. We write 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 the logic circuit and make a truth table for a logic circuit.

Example 3. Find the boolean function of the logic circuit and make a truth table for a logic circuit.


We continue to look for a Boolean function of a logic scheme together

Example 4. Find the boolean function of the logic circuit and make a truth table for a logic circuit.

Decision. We divide the logical scheme on tiers. We write all the functions starting from the 1st tier:

Now write all the functions, substituting the input variables x., y., z. :

As a result, we obtain the function that the logic scheme implements at the output:

.

Tatt of truth for this logic scheme:

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 the logic circuit and make a truth table for a logic circuit.

Decision. We divide the logical scheme on tiers. The structure of this logic scheme, in contrast to the previous examples, has 5 tiers, not 4. But one input variable is the lowest - all tiers runs up and directly enters the logical element in the first tier. We write all the functions starting from the 1st tier:

Now write all the functions, substituting the input variables x., y., z. :

As a result, we obtain the function that the logic scheme implements at the output:

.

Tatt of truth for this logic scheme:

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 synthesis of logic circuits in the Boolean basis

The development of a logic scheme for its analytical description is the name of the problem of the synthesis of the logic scheme.

Each disjunction (logical sum) corresponds to the element "or", the number of inputs of which is determined by the number of variables in disjunction. Each conjunction (logical product) corresponds to the element "and", the number of inputs of which is determined by the number of variables in conjunction. Each denial (inversion) corresponds to the "NOT" element.

Often, the development of a logic circuit begins with the definition of a logical function that the logic scheme should implement. In this case, only the truth table of the logical scheme is given. We will analyze exactly such an example, that is, we will solve the problem, fully reversed above the problem of analyzing logic schemes.

Example 6. Build a logical scheme that implements a function with this truth table.

The solution of logical expressions is accepted to record as tastes of truth - Tables in which in actions are shown, what values \u200b\u200btakes a logical expression with all possible sets of its variables.

When drawing up a truth table for a logical expression, it is necessary to consider the procedure for performing logical operations , namely:

      1. actions in brackets,
      2. inversion (denial),
      3. & (conjunction),
      4. v (disjunction)
      5. \u003d\u003e (implication),
      6. <=> (equivalence ).

TRID TOTAL ALGORITHM :

1. Find out the number of rows in the table (calculated as 2 n, where n - Number of variables + string of column headers).

2. Find out the number of columns (calculated as the number of variables + the number of logical operations).

3. Set the sequence of logical operations.

4. Build a table, indicating the names of columns and possible sets of initial logic variables.

5. Fill the truth table by columns.

6. Record the answer.

Example 6.

Build a truth table for expressionF \u003d (AV B) & ( ¬ A. v.¬ B.) .

1. Number of rows \u003d 2 2 (2 variables + string of column headers) \u003d 5.

2. Number of columns \u003d 2 Logic variables (A, B) + 5 logical operations (v.,&, ¬ , v., ¬ ) = 7.

3. Let us separate the procedure for performing operations: 1 5 2 43

(A. v.B) & ( ¬ A. v.¬ B)

4-5. Build a table and fill it in columns:

BUT v.AT

¬ BUT

¬ AT

¬ BUT v.¬ AT

(A. v.B) & ( ¬ A. v.¬ B)

0

0

0

1

1

0

6. Answer: F \u003d 0, at a \u003d b \u003d 0 and A \u003d b \u003d 1

Example 7.

Build a truth table for a logical expression F \u003d X. v.Y & ¬ Z..

1. The number of rows \u003d 2 3 + 1 \u003d (3 variables + string of column headers) \u003d 9.

2. Number of columns \u003d 3 Logical variables + 3 logical operations \u003d 6.

3. Let us point out the procedure: 3 2 1

X. v.Y & ¬ Z.

4-5. Buildingm table and fill it in columns:

¬ Z.

Y & ¬ Z.

X. v.Y & ¬ Z.

0

0

0

0

0

0

1

0

6. Answer:

F \u003d 0, when X \u003d y \u003d z \u003d0; for X \u003d y \u003d 0 and Z \u003d.1.

Exercise 8.

Build truth tables for the following logical expressions:

1. F \u003d (AV B) & ( ¬ A & ¬ B).

2. F \u003d X & ¬ Y. v.Z.

Check yourself (Response Estate)

Note!

Sets of input variables, in order to avoid errors, it is recommended to list as follows:

A) divide the column of values \u200b\u200bof the first variable in half and fill the upper part of the column by zeros, and the lower units;

B) split the column in four parts into four parts and fill each quarter alternating groups of zeros and units, starting with a group of zeros;

C) continue dividing columns of subsequent variables by 8, 16, etc. Parts and filling them by groups of zeros or units until groups of zeros and units will consist of one symbol.

Tautology - identically true formula true " ("1

Contradiction - identically false formula , or the resulting formula " false " ("0 ") For any values \u200b\u200bof variables that are included in it.

Equipment of formulas - Two formulas BUT and AT Taking the same values, with the same sets of values \u200b\u200bof the variables included in them.The equifiability of the two formulas of the logic algebra is indicated by the symbol.

Definition 1.

Logical function - Function, whose variables take one of two values: $ 1 $ or $ 0 $.

Any logical function can be set using the truth table: the set of all possible arguments is recorded in the left side of the table, and the corresponding values \u200b\u200bof the logical function are on the right side.

Definition 2.

Tank truth - Table that shows what values \u200b\u200bwill take an composite expression with all possible sets of the values \u200b\u200bof the simple expressions included in it.

Definition 3.

Equivalent Logical expressions are called, the last columns of the truth tables are coincided. The equifiability is denoted by the mark $ "\u003d" $.

When drawing up a truth table, it is important to consider the following procedure for performing logical operations:

Picture 1.

Priority in the execution of the procedure for performing operations enjoy brackets.

Algorithm for constructing the truth table of logical function

    Determine the number of rows: lines \u003d $ 2 ^ n + 1 $ (for the title row), $ n $ is the number of simple expressions. For example, for the functions of two variables, there is $ 2 ^ 2 \u003d 4 $ combination of sets of variable values \u200b\u200bfor functions of three variables - $ 2 ^ 3 \u003d $ 8, etc.

    Determine the number of columns: number of columns \u003d Number of variables + Number of logical operations. In determining the number of logical operations, the procedure for their execution is also taken into account.

    Fill columns by the results of logical operations In a specific sequence, given the truth table of basic logical operations.

Figure 2.

Example 1.

Make a table of truth of the logical expression $ d \u003d \\ bar (a) \\ VEE (B \\ Vee C) $.

Decision:

    Determine the number of rows:

    number of strings \u003d $ 2 ^ 3 + 1 \u003d 9 $.

    The number of variables is $ 3 $.

    1. inversion ($ \\ bar (a) $);
    2. disjunction, because It is in brackets ($ B \\ Vee C $);
    3. dysjunction ($ \\ Overline (A) \\ Vee \\ Left (B \\ Vee C \\ Right) $) is a desired logical expression.

      Column = $3 + 3=6$.

    Fill the table, given the truth table of logical operations.

Figure 3.

Example 2.

According to this logical expression, build a table of truth:

Decision:

    Determine the number of rows:

    The number of simple expressions is $ n \u003d $ 3, it means

    lines = $2^3 + 1=9$.

    We define the number of columns:

    The number of variables is $ 3 $.

    The number of logical operations and their sequence:

    1. denial ($ \\ bar (C) $);
    2. disjunction, because It is in brackets ($ A \\ Vee B $);
    3. conjunction ($ (A \\ Vee B) \\ BigWedge \\ Overline (C) $);
    4. denial, which denote $ F_1 $ ($ \\ overline ((a \\ vee b) \\ BigWedge \\ Overline (C)) $);
    5. disjunction ($ A \\ Vee C $);
    6. conjunction ($ (A \\ Vee C) \\ Bigwedge B $);
    7. denial, which denote $ F_2 $ ($ \\ overline ((A \\ Vee C) \\ BigWedge B) $);
    8. dysiaunction is a desired logical function ($ \\ overline ((a \\ vee b) \\ BigWedge \\ Overline (C)) \\ vee \\ overline ((A \\ Vee C) \\ Bigwedge B) $).

Construction of truth and logical functions

Logical function - This is a function in which the variables take only two values: a logical unit or logical zero. The truth or fart of complex judgments is the function of truth or falsity of simple. This function is called the milk function of the judgment F (A, B).

Any logical function can be specified using the truth table, in the left part of which the set of arguments is recorded, and the corresponding values \u200b\u200bof the logical function are recorded. When constructing a truth table, it is necessary to take into account the procedure for performing logical operations.

The procedure for performing logical operations In complex logical terms:

1. Inversion;

2. conjunction;

3. disjunction;

4. implication;

5. Equivalence.

To change the specified procedure for performing operations, brackets are used.

Algorithm for constructing truth tables for complex expressions :

number of rows \u003d 2 n. + string for header ,

n - the number of simple statements.

number of columns \u003d number of variables + number of logical operations ;

· Determine the number of variables (simple expressions);

· Determine the number of logical operations and the sequence of their execution.

3. Fill the columns by the results of the logical operations in the designated sequence, taking into account the truth tables of the basic logical operations.

Example: Make a table of truth of a logical expression:

D. \u003d A & (B.V.C.)

Decision:

1. Determine the number of rows:

at the entrance, three simple statements: A, B, with therefore N \u003d 3 and the number of rows \u003d 23 +1 \u003d 9.

2. Determine the number of columns:

simple expressions (variables): A, B, with;

intermediate results (logical operations):

BUT - Inversion (denoted through E.);

B.V.C. - operation of disjunction (we denote through F.);

as well as the desired final value of the arithmetic expression:

D. \u003d A & (B.V.C.) . i.e. D. = E. & F. - This is an operation of conjunction.

Fill the columns taking into account the tables of the truth of logical operations.

font-Size: 12.0PT "\u003e Build a logical function according to its truth table:

Let's try to solve the opposite task. Let the truth table for some logical function z (x, y):

font-Size: 12.0PT "\u003e 1.

Since two rows, we get a disjunction of two elements: () V. () .

Each logical element in this disjunction will be recorded in the form of conjunction of the arguments of the function X and Y: ( X. & Y.) V. ( X. & Y.).