Tuesday 24 April 2012

Logical Operators : OR Operator

Advertisement

OR is the logical addition operator and is denoted by the plus (+) symbol. Suppose there are two variables a and b; since each variable can have values of either 1 or 0 a total of four combinations of inputs are possible. An OR operation shows the output as 1 or HIGH when either of the inputs is 1 or HIGH, and also when both of the inputs are 1. So a OR b can be shown through a truth table as follows:
Here we say
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 1

Here 1 + 1 = 1. That is why the OR operator is different from the normal addition operator
The OR operation can be shown through a Venn diagram as shown in the figure below:




EmoticonEmoticon