Binary Logic Operations : AND , OR , NOT Functions

Binary Logic Operations


Binary logic presupposes two distinguishing characteristics : two-valued variables, and appropriate logical operations. Unlike the situation of ordinary numbers, the values of the variables in binary logic can be only two in number. In fact, they do not even need numbers to be numbers. They should perhaps more properly be called states. One pair of terms that can be used to identify the two states that binary variables is : open and closed . Another suitable pair is : high and low . Other pairs are hot and cold, true and false, on and off, plus and minus, yes and no, up and down, excited and unexcited etc. In each case the binary variable can take on at any given time only one of the two value. However, on the basis of logic, these two variables should be mutually exclusive. The examples cited obviously possess this feature. However, for binary mathematical manipulations of switching and logic functions binary variables 0 and 1 are best suited.

DRex Electronics

There are three logical operations associated with binary logic viz. AND, OR, and NOT. Two binary variables A and B, each of which can assume the value of 0 or 1, are introduced so as to facilitate the description of three logical operations.

AND Function

The AND function is represented by the equation

Z = A . B       ………. (1)

and by definition of the logical AND operation Z=1 if and only if A and B, both are equal to 1. Otherwise, the result of the AND logical operation is zero. This information can be represented in tabular form as below:

0 0 0
0 1 0
1 0 0
1 1 1

Such a table is called truth table . The dot symbol is used to identify the AND function and an inspection of truth table reveals this choice to be an appropriate one if we permit ourselves for the moment to treat the dot as multiplication. Accordingly, in the first row of the table we have 0.0 = 0. Similarly in subsequent rows we have 0.1 = 0 1.o – 0 and 1.1=1. Obviously, the logical AND operation resembles multiplication.

OR Function

The OR function is represented by the equation

Z = A + B     ………..(2)

By definition of the logical OR operation Z = 1 if A = 1 or B = 1 ; other wise, Z = 0. The truth table for the OR function is given below :

0 0 0
0 1 1
1 0 1
1 1 1

A study of the truth table in this case reveals that the logical OP operation resembles addition. Observe that on successive rows we have 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 1. The use of the + symbol in Eq.(2) is, therefore, entirely appropriate. Of course to say that the OR function resembles addition does not mean that it is addition in the same sense that we use the term in ordinary arithmetic. This is obviously illustrated by the last row of the truth table. The value of the variable that represents the output of the OR function is till confined to 1, even when both A and B are at value 1.

NOT Function

The NOT function is represented by the equation

Z = A’      …………..(3)

It can also be represented by putting a bar of A instead of the single quotation mark.

The NOT function is the logical operation of negation. By definition if A = 0, then Z = 1. Similarly, if a = 1, then Z = 0. The NOT function acts as in inversion that provides the opposite state of A whatever it may be. Thus Eq.(3) is read as :Z equals the compliment of A. It is interesting to note that the NOT operation is not the part of ordinary arithmetic or algebra.