4CS015 Week 3 Lecture Notes
4CS015 Week 3 Lecture Notes
In a logic system, a variable can have one of two variable states. Single capital letters are used to
represent variables. The bits ‘1’ and ‘0’ are also used as constants.
Logic States
If a switch is closed, the light will be on. This can represent Logic ‘TRUE’.
If a switch is open, the light will be off. This can represent Logic ‘FALSE’.
Digital Logic
For this module, ‘1’ is equivalent to ‘TRUE’, and ‘0’ is equivalent to ‘FALSE’.
Boole fully defined his algebra using postulates and theorems. Applying these to computers is the
closest we can get to formally proving that computers work.
Boole defined three basic operations that could be used with these Boolean variables. These are:
‘AND’, ‘OR’, and ‘NOT’. All logical expressions can be built from these three.
Logical OR:
Logical ‘AND’
Gate Diagram:
0 0 0
0 1 0
1 0 0
1 1 1
Truth Table:
If ‘F’,’A’ and ‘B’ are Boolean variables. Then the expression ‘F = A∙B’ means ‘F’ is only true when ‘A’
‘AND’ ‘B’ are both true. As ‘A’ is capable of being ‘1’ or ‘0’ and ‘B’ is capable of being ‘1’ or ‘0’ there
are 4 possible states. ‘00, 01, 10 or 11’.
Logical ‘OR’
Gate Diagram:
0 0 0
0 1 1
1 0 1
1 1 1
Truth Table:
The Boolean representation for ‘OR’ is ‘+ ‘. If ‘F’,’A’ and ‘B’ are Boolean variables. Then the
expression ‘F’ = ‘A’+’B’ means, ‘F’ is only true when ‘A’ ‘OR’ ‘B’, ‘OR’ both, are true. As ‘A’ is capable
of being ‘1’ or ‘0’ and ‘B’ is capable of being ‘1’ or ‘0’ there are 4 possible states. ‘00, 01, 10 or 11’.
Logical ‘NOT’
Gate Diagram:
Input A Output F
0 1
1 0
Truth Table:
The NOT relationship reverses the value. NOT TRUE is FALSE and NOT FALSE is TRUE. The symbol is
usually a bar above the variable or expression to be reversed. However, in some circumstances we
use ‘!’. E.g., if B=TRUE, !B=FALSE.
Precedence of Operators
As with normal mathematics when working out the value of a function it is very important to do it in
the right order. ‘NOT’, ‘AND’, ‘OR’. Parenthesis (brackets) override in the normal way. When a bar
goes above more than 1 symbol it becomes a bracket that reverses.