Boolean Expressions

Like arithmetic expressions, Boolean expressions are generally formed from "triplets" (in the case of AND and OR) of operands and operators, or "diadics" (in the case of NOT), where each simple expression can be used as the operand for a larger expression:

TRIPLETS:

A AND B, C OR D

DIADICS:

NOT H


Hierarchy of Evaluation

The order of evaluation in compound expressions is interpreted according to the hierarchy (priority) of operators:

Order of evaluation
(Top to bottom)
Parenthesized Expressions
NOT
AND
OR

We can use parentheses to force the early evaluation of sub-expressions.

EXAMPLES

A AND B OR NOT C AND D

is equivalent to:

((A AND B) OR ((NOT C) AND D))

DIFFERING NOTATIONS

EXAMPLES USING PROGRAMMING NOTATION

EXAMPLES USING BOOLEAN NOTATION


Multiple Representations

In general computer memory contains "fields" or "words" that are more than one bit in length. So we can contain several "truth values" in one field/word and perform similar operations on all the bits (Truth values) at one time. Thi is useful if an object being represented in a variable has several T/F properties.

Consider a word or 8-bits. It can contain 8 truth values. So two words of truth values can be "ANDed", "ORed" or "NOTted" in one operation. Using this representation we can also perform normal (binary) arithmetic using logical operations that are simpler for the computer to execute.

EXAMPLES

EXERCISE

[Prev][TOC][Next]


Last updated 2000/02/10
© J.A.N. Lee, 2000.