What is Boolean Logic - What is Boolean Operators - What is Truth Table - Education4CS
Boolean logic
Boolean logic is a form of algebra where all values are either true (1) or false (2). These values of true and false are used to test the conditions and help in decision-making. Boolean algebra was invented by George Boole in 1854.
Should I go to a restaurant or not?
Should I purchase a new mobile or not?
Should I opt for Computer Science or not?
Boolean Variable: It is also known as a binary variable and Logical variable. A boolean variable can h8ld only one binary value either as 1(true) or as 0 (false).
Boolean Constant: The value which is stored in a Boolean variable like 1 or 0 is known as Boolean Constants. Example: X=true
Here "X" is Boolean Variable and "true" is Boolean Constant.
Boolean Statement: It is a statement that has definite values, either true or false.
Logical Statement
- Have you finished your homework?
- Is the house locked?
- Is New Islamabad the capital of Pakistan?
Non-logical Statement
- What are your plans for tomorrow?
- Who is the President of India?
- Where is your house located?
Boolean Expression: A meaningful combination of Boolean operators (AND/OR/NOT), Boolean variable (x, y, z), and Boolean constant (0 or 1) is known as Boolean Expression or Logical
Expression. Example: X+Y.Z.
Boolean Operators/Logical Operators
OR Operator: It is a binary operator which operates on two variables and the operation performed by the OR operator is known as logical addition. The symbol for this is plus (+).
NOT Operator: It is a unary operator that operates on one variable and the operation performed by the NOT operator is known as negation or Complementation. The symbol for this is A' or A.
Precedence of Boolean Operators: 1. () 2. NOT 3. AND 4. OR Example: A.(B.C)+B.C'
Truth table: A truth table is a representation of a Boolean function or expression containing all possible combinations of input values and their result in a table format.
Draw columns for each variable and draw rows which can be calculated as 2" where n = no. of a variable.
Writing a truth Table
Q Write a truth table for the Boolean expression: F=A.B1 + C
The number of columns = Number of variables + Number of logical expressions Number of rows = 2" where n is the total numbers.
Comments