☰ Year plan · Communication Technology

The OR gate

Week 11 · Unit 2 Topic 4: the OR gate: parallel switches, symbol, number of forms, truth table, Boolean formula · 3 lessons
2

The OR truth table, symbol and formula

ICT Secondary 3 Term 1, Unit 2, Topic 4: pp. 40–47
GoalWrite the truth table of the OR gate, describe its symbol, and read the formula Y = A + B.
New words
truth table · a table with one row for each combination of inputs and the output for eachsymbol · the standard drawing of a gate, with the inputs on the left and the output on the rightlogical addition · another name for OR; the plus sign here means ORY = A + B · the formula of OR, read “Y equals A OR B”
Explanation

The OR table has the same four rows as the AND table, in counting order 00, 01, 10, 11, with the columns A, B and then the output. This time only the first row, 00, has the output 0. All the other rows have the output 1. With three inputs there are 2³ = 8 rows, and only 000 gives 0; the count of rows is 2ⁿ, as in Week 8. The symbol of the gate has the inputs on the left and the output on the right. The OR symbol has a curved back and a pointed front, like a shield; the AND symbol has a flat back. We cannot draw it here, so remember the difference by touch: curved back, OR. The formula is Y = A + B, read “Y equals A OR B”. It is called logical addition because it looks like adding, but it is not ordinary adding. The values are only 0 and 1, so 1 + 1 gives 1, not 2: a lamp that is lit cannot be “more lit”. In this unit the plus sign means OR, and 1 + 1 = 1. For three inputs the formula is Y = A + B + C.

ABA∨B
000
011
101
111
Worked examples
ABCA∨B∨C
0000
0011
0101
0111
1001
1011
1101
1111
Three inputs make 8 rows. Only the row 000 has the output 0.
Php
1for ($a = 0; $a <= 1; $a++) {
2    for ($b = 0; $b <= 1; $b++) {
3        echo $a, " ", $b, "   ", $a | $b, "\n";
4    }
5}
Output
0 0   0
0 1   1
1 0   1
1 1   1
A program can print the same table. The operator | works on 0 and 1 like OR (the better PHP operator || for conditions comes in Week 12). The output lines come from running it.
A, BOrdinary additionOR (logical addition)
0, 000
0, 111
1, 011
1, 121
Ordinary addition and OR agree on three rows and differ on one. The difference is the reason why the formula needs care.
Class activity

Work out on paper the truth table of an OR gate with four inputs. How many rows has it? Write the first six rows in counting order and say which single row has the output 0.

Practice
1
How many rows has the truth table of a three-input OR gate, and how many of them have the output 0?
2
What is 1 + 1 in the OR formula?
3
Read Y = A + B in words.
4
In which order are the columns of a truth table written?