Boolean Operation

To understand how individual bits are stored and manipulated inside a computer, it is convenient to imagine that the bit 0 represents the value false and the bit 1 represents the value true because that allows us to think of manipulating bits as manipulating true/false values. Operations that manipulate true/false values are called Boolean operations, in honour of the mathematician George Boole (1815 – 1846), who was a pioneer in the field of mathematics called logic. Three of the basic Boolean operations are AND, OR, and XOR (exclusive or). These operations are similar to the arithmetic operations Times ( * ) and Plus ( + ) because they combine a pair of values (input) to produce a third value (output). In contrast to arithmetic operations, however, Boolean operations combine true/false values rather than numerical values.

The Boolean operation AND is designed to reflect the truth or falseness of a statement formed by combining two smaller, or simpler, statements with conjunction and. Such statement have the generic form

P AND Q

where P represents one statement and Q represents another; for example,

Kermit is a frog AND Miss Piggy is an actress

The inputs to the AND operation represent the truth or falseness of the compound statement’s components; the output represents the truth or falseness of the compound statement itself. Since a statement of the form P AND Q is true only when both of its components are true, we conclude that 1 AND 1 should be 1, whereas all other cases should produce an output of 0.

In a similar manner, the OR operation is based on compound statements of the form

P OR Q

where, again, P represents one statement and Q represents another. Such statements are true when at least one of their components is true, which agrees with OR operation.

There is not a single conjunction in the English language that captures the meaning of the XOR operation. XOR produces an output 1 (true) when one of its input is 1 (true) and other is 0 (false). For example, a statement of the form P XOR Q means “either P OR Q but not both”.

The operation NOT is another Boolean operation. It differs from AND, OR, and XOR because it has only one input. Its output is the opposite of that input; if the input of the operation NOT is true, then output is false, and vice versa. This, if the input of NOT operation is the truth or falseness of the statement

Fozzie is a bear

then the output would represent the truth or falseness of the statement

Fozzie is not a bear

Related entries:

  1. Gates and Flip-flops
  2. Bits
  3. The Role of Algorithms

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>