World Class Education in Chitwan Boolean Algebra - Madhav Adhikari © Madhav Adhikari Introduction to Boolean Algebra Boolean Algebra is used to analyze and simplify the digital (logic) circuits. It uses only the binary numbers i.e. 0 and 1. It is also called as Binary Algebra or logical Algebra. Boolean algebra was invented by George Boole in 1854. It is used to analyze and simplify the digital or logical circuits. It only uses binary numbers and is also called binary algebra or Logical Algebra. 2 © Madhav Adhikari Differences between Ordinary Algebra and Boolean Algebra • Boolean algebra does not have operations equivalent to division and subtraction. • Ordinary algebra deals with real numbers, which contains an infinite number of elements (1, 2, 3…). But Boolean algebra has only a finite set of elements. That is, it deals with only two elements 0 and 1. • Operations like addition, subtraction, division and so on are not used in Boolean algebra. Here, the basic operations used are AND, OR, NOT, NAND, etc. • In Boolean algebra, there are no coefficients or exponents, i.e. A+A= A and A.A= A • The distributive law [(A +B) . (A+C)= A + (B.C)] does not hold on ordinary algebra. • Unlike in ordinary algebra, there are several graphical methods of representing Boolean expression. Note: Boolean algebra has an application in binary things either 0 or 1, a fundamental feature of modern digital electronic computers. 3 © Madhav Adhikari Terms in Boolean Algebra Boolean values The values used in Boolean algebra are called Boolean values. They can only be either true or false which can be represented by 1 and 0. Boolean Variable A variable with its value i.e. either true or false ( 1 or 0) is called a Boolean variable. It is also known as logical variable. The variable can be denoted by A,B,C,X,Y and so on. Boolean Expression A Boolean expression is a statement using Boolean operators that expresses a condition that is either true or false. A Boolean expression always produces a Boolean value. A Boolean expression is composed of a combination of the Boolean constants (True or False), Boolean variables and logical connectives. Each Boolean expression represents a Boolean function. Example: A.B′.C , A+B+C are Boolean expression. 4 © Madhav Adhikari Terms in Boolean Algebra Logic Function (Boolean Function) A Logic function is an expression formed by binary variables, binary operators OR, AND, unary operator NOT, parenthesis, and equal sign. For a given value of the variables, the function can be either 0 or 1. Example: Consider the Boolean function in an algebraic expression: F = X.Y.Z’+X.Y Here, X, Y and Z are Boolean variables. The right hand side of the above equation is known as expression. Each occurrence of a variable or its complement in an expression is called literal. In the above expression, there are three variables (X, Y and Z) and five literals (X, Y, Z’, X, and Y). Logical Circuit The high and low level voltage electrical signals are produced by using transistors or ICs or LSIs (known as logical elements). The circuit composed of logical elements for a specific operation is called logical circuit. 5 © Madhav Adhikari Terms in Boolean Algebra Truth Table A table that represents the input-output relationship of the binary variables for each logical gate is called a truth table. It shows the relationship between all inputs and output in tabular form. Thus a truth table is a table representing the results of the logical operations on all possible combinations of logical values. In another words, we can say that a truth table is a useful tool for describing the terminal behavior of a logic network. The number of rows in a truth table is equal to 2n (where n= no. of variables). For example, for 3 input variables, no. of rows will be 23= 8. 6 © Madhav Adhikari EXAMPLE: No of inputs(n) = 3 No of inputs(n) = 2 7 © Madhav Adhikari Boolean operation Operator : An operator is a special symbol that indicates the operation to be carried out between the operands. Operands: They are the variables, constants or values on which operation is performed. Operation: An operation is an action to be carried out upon the operands. In Boolean Algebra there are three basic operations. They are: • AND operator • OR operator • NOT operator 8 © Madhav Adhikari Boolean operation AND operation: AND operator is also known as logical multiplication. It is carried out by dot(.) operator or simply by AND. It generates true output if all inputs are true. Otherwise, the output will be false. The logical equation of AND operation is written as C = A.B or C = A AND B. The truth table of AND operation is as below: Inputs Output A B C = A.B False False False False True False True False False True True True 9 © Madhav Adhikari Boolean operation OR operation: OR operator is also known as logical addition. It is carried out by dot(+) operator or simply by OR. It generates true output if at least one input is true. Otherwise, the output will be false. The logical equation of OR operation is written as C = A+B or C = A OR B. The truth table of OR operation is as below: Inputs Output A B C = A+B False False False False True True True False True True True True 10 © Madhav Adhikari Boolean operation NOT operation: NOT operator is also known as logical complement. It is carried out by prime(‘) or bar( )̅ operator or simply by NOT. This operator takes only one input. It generates true output if the input is false. Otherwise, the output will be false. The logical equation of NOT operation is written as C = A’. The truth table of NOT operation is as below: Inputs Output A C = A’ False True True False 11 © Madhav Adhikari Logic Gate A logic gate is an electronic circuit that operates on one or more input signals to produce an output signal. The logic gate is used for binary operation and is the basic component of a digital computer. It is embodied in the Integrated Circuit (IC). Each gate has a specific function and graphical symbol. It produces signals of binary 1 or 0 (ON or OFF) when input logic requirements are satisfied. Each logic gate has a unique graphical symbol and its operation can be represented in terms of Boolean expression. In digital computers there are three basic logic gates: AND, OR and NOT. Beside these, there are other gates which are derived rom these three basic gates and they are: NAND gate, NOR gate, X-OR gate ( Exclusive OR gate) and X-NOR gate (Exclusive NOR gate gate). 12 © Madhav Adhikari AND Gate AND gate is an electronic circuit, which produces true value(1) output when all inputs are true. Otherwise, the output will be false (0). The output is equal to the product of the logic inputs. It can have two or more inputs and produces a single output. It is denoted by a dot (“.”) and is also referred as arithmetic multiplication. Its logic function is: F = A . B Where ‘.’ stands for AND operation, A and B are inputs and F is output. Its logic or graphical symbol is: Its truth table is: 13 © Madhav Adhikari OR Gate OR gate is an electronic circuit, which produces true (1) output when any one of the input is true (1). If all inputs are false (0), then the output will also be false (0). The output is equal to the sum of the logic inputs. It has two or more inputs and produces a single output. It is denoted by plus sign(“+”) and referred as arithmetic addition. Its logic function is: F = A + B Where ‘+’ stands for OR operation, A and B are inputs and F is output. Its logic or graphical symbol is: Its truth table is: Inputs 14 Output A B C = A+B 0 0 0 0 1 1 1 0 1 1 1 1 © Madhav Adhikari NOT Gate NOT gate is an electronic circuit whose output is the complement of the input. It is also called an inverter. If we provide true input (1) to this gate, it will produce false output (0) & vice-versa. It takes only one input and gives the output. It is denoted by prime sign (‘). Its logic function is: F = A’ Its logic or graphical symbol is: Its truth table is: 15 © Madhav Adhikari NAND Gate The NAND gate is the combination of AND and NOT gate. This electronic gate produces False (0) output, when all inputs are true (1), otherwise, the output will be true (1). It is the complement of AND gate. It has two or more inputs and produces a single output. Its logic function is: F = (A.B)‘ Its logic or graphical symbol is: Its truth table is: 16 © Madhav Adhikari NOR Gate NOR gate is the combination of the OR gate and NOT gate. This electronic gate produces true (1) output when all inputs are false (0) otherwise, the output will be false (0). It is the complement of the OR gate. It has two or more inputs and produces a single output. Its logic function is: F = (A+B)‘ Its logic or graphical symbol is: Its truth table is: 17 © Madhav Adhikari Exclusive-OR (X-OR) Gate It is an electric circuit used to perform either / or operation. It can also have two or more inputs which produces single output. The XOR gate produces true output (1) when the inputs are at opposite logic levels or inputs are not same. It is also known as even parity generator. Its logic function is: F = A ⊕ B = A‘.B + A.B‘ Its logic or graphical symbol is: Its truth table is: Inputs 18 Output A B C=A⊕B 0 0 0 0 1 1 1 0 1 1 1 0 9/4/2020 © Madhav Adhikari 19 © Madhav Adhikari Exclusive-NOR (X-NOR) Gate It performs logical complement of X-OR operator. It also have two or more inputs which produces single output. The XOR gate produces true output (1) when both input are at same logic level else it gives false output(0). Its logic function is: F = (A ⊕ B)‘ = A.B + A‘.B‘ Its logic or graphical symbol is: Its truth table is: Inputs 20 Output A B C = (A ⊕ B)’ 0 0 1 0 1 0 1 0 0 1 1 1 © Madhav Adhikari 9/4/2020 Laws of Boolean algebra 21