NTA UGC NET 2023 » NTA Study Materials » Computer Science » Truth Table and Logical Statements

Truth Table and Logical Statements

This article outlines a brief study about the truth table and logical statements.

A truth table of a logic function contains lists of all of the possible values that the function can obtain for the given input. A truth table has numerous rows and columns, with the top row specifying the logical variables and combinations and the bottom row showing the final function in increasing complexity. A logic system’s truth table represents the system’s outputs for a given input in the form of rows and columns. To name the columns of a truth table, the inputs and outputs are used with the rows representing all of the circuit’s potential inputs and outputs.

What are logical statements?

A logical statement is a statement that returns either true or false, i.e, 0 or 1. If it returns true, it allows us to obtain a known set of facts or acquire a new fact from them. Example: Diagonals of a rectangle are of the same length.

Here, it will either return true or false based on the statement. It is a declarative kind of statement that returns true or false.

Some examples of logical statements:

Examples of sentences that are (or make) true statements:

  • “Tom Cruise is a man.”
  • “A triangle has three sides.”
  • “Milan is the capital of Italy.”

Examples of sentences that are false:

  • “All coolers are made of solid gold.”
  • “Two plus two equals nine.”

Examples of sentences that are not (or do not make) statements: Emotions, feelings, questions, etc. cannot be included in logical statements.

  • “Who are you?”
  • “Run!”
  • “The Queen of England is wise.”
  • “Pegasus exists.”

Operations in a logic function:

In a logical function, there are three basic operations NOT, OR and AND: 

  • NOT: It is also called inversion or negation. It is symbolised by -. It means the exact opposite or negative of the values.
  • OR: It is also called disjunction or addition. It is symbolised by +. It is like a simple addition of values. A function returns true if any of its value is true.
  •  AND: It is also called conjunction or multiplication. It is symbolised by *. It is like multiplication wear for a function to return true, both values should be true. 

Truth Tables for Unary Operators: 

Unary Logical Operators contain only one logical operator. It can either be Logical True or Logical false.

Truth Table for Logical true: For each logical input, it returns a true value.

Input

Output

T

T

F

T

Truth Table for Logical false: For each logical input, it returns a false value

Input

Output

T

F

F

F

Truth table for Compliment: It returns the exact opposite value of the logical input.

Input

Output(~)

T

F

F

T

Truth Tables for Binary Operators: 

There are two logical inputs in Binary operations. AND, OR and NOT operations are performed on these operators.

A truth table for OR Operation: It returns true if any one of the inputs is true and false if both inputs are false.

A

B

A OR B

T

T

T

T

F

T

F

T

T

F

F

F

Truth Table for AND Operation: it returns true only if both the inputs are true else false.

A

B

A AND B

T

T

T

T

F

F

F

T

F

F

F

F

Assignment Rules:

The values of the functions can be 0 or 1. Where logic 0 means false and logic 1 means true. Thus, the following rules apply:

If A = 0, then -A = 1

If A = 1, then -A = 0

A+B = 0 if A = 0 and B = 0

A+B = 1 except when A = 0 and B = 0

A*B = 1 if A = 1 and B = 1

A*B = 0 except when A = 1 and B = 1

How to evaluate the values of the Logic function:

Example: show the process of evaluating the values of the logic function -(A+B) * -(A*B).

It is determined by breaking it down into smaller constituent functions and calculating their values to reach the final step. It is a sequential process The following steps are to be followed:-

  1.  The two logic variables, A and B, are listed at the top of the first two columns. All possible combinations of values for A and B are listed in these columns by counting up in binary numerals: 00, 01, 10, 11.
  2. In the third column, the value of (A+B) is calculated by using OR operation.
  3. In the fourth column, the negative (compliment) of the third column is taken out to find the values associated to the function -(A+B)
  4. In the fifth column we calculate values of (A*B) using AND operation.
  5. We find negative of (A*B) to calculate the value of -(A*B)
  6. In the seventh column we find AND of values in the fourth column and sixth column to obtain the value of -(A+B)*-(A*B)

In this Similar way we calculate the truth table and values for all the functions. Following is the table for the expression for  -(A+B) * -(A*B).

A

B

(A+B)

-(A+B)

(A*B)

-(A*B)

-(A+B) * -(A*B)

0

0

0

1

0

1

1

0

1

1

0

0

1

0

1

0

1

0

0

1

0

1

1

1

0

1

0

0

The right-most (seventh) column contains the final function which is the function to be evaluated. The other values in other columns(3rd-6th) are determined by determining addition and multiplication and then negating the values.

Application of Truth Tables and Logical Statements:

For increasingly sophisticated logic functions, computers are employed to build truth tables. Some functions have a large number of input variables and are made up of several constituent functions; a table with hundreds of rows and columns can result. 

We can use truth tables to determine if the structure of a logical argument is valid. They are extensively used in database query-logic for sure, also in their optimization as well. Also, for general logic-related applications like expert systems. Any analysis should probably implement them in some form. Also, basic decisions (IFs, Case/Switch, IIFs etc.) structures use them. You can build any number of logic layers and it would be helpful to use them. They are there in the background of the system.

The usage of boolean theorems is an alternative to the truth table. This process is used to determine the simplest circuit that will fulfil the necessary logic function. It reduces the number of operations required to complete a given task and hence it increases the system efficiency.

faq

Frequently asked questions

Get answers to the most common queries related to the NTA Examination Preparation.

What are truth tables?

Ans. The truth table is a table showing the true value of a statement formula for each possible combination of truth...Read full

What are binary operators?

Ans. Binary Operators are the ones who perform on two logical inputs. Operations that can be performed are AND and O...Read full

What are unary operators?

Ans. Unary operators operate on one operand or input variable. It can PerformNNT operations, logical true and logica...Read full

What are the 3 basic operations?

Ans. AND, OR and NOT are the 3 basic operations in logical statements. AND and OR are binary while NOT is unary oper...Read full