Course 10.1Lesson 3 of 3
An OR gate gives 1 when at least one input is 1. You learn its symbol and truth table, and then join two gates into a small circuit. A middle column in the truth table holds the output of the first gate, so you can work out the circuit one gate at a time.
This lesson is free to read. Enroll free to keep your place and take the tests.
Try the code and the simulations beside the lesson.
A car beeps when the driver's door is open or the seat belt is not fastened. Either one is enough to start the beep. Both together also make it beep. That is the rule of the OR gate.
The OR gate gives 1 when input A is 1, or input B is 1, or both are 1. It gives 0 only when both inputs are 0.
| A B | X = A OR B |
|---|---|
| 0 0 | 0 |
| 0 1 | 1 |
| 1 0 | 1 |
| 1 1 | 1 |
The logic expression is X = A OR B. The symbol has a curved back and a pointed front. Compare it with AND: AND has a flat back.
Both counts. In everyday speech, "tea or coffee" often means one but not both. In logic, OR includes the row where both inputs are 1. The gate that leaves out that row is XOR, in the next course.
A logic circuit joins gates together. The output of one gate becomes an input of the next. Here is a circuit with two gates. B goes into a NOT gate. Its output and A go into an OR gate, whose output is X.
We call the output of the NOT gate P. The circuit is X = A OR (NOT B). The brackets show that NOT B is worked out first.
To fill in the truth table, add a middle column for P. Work out P in every row first. Then use A and P to find X.
| A B | P = NOT B | X = A OR P |
|---|---|---|
| 0 0 | 1 | 1 |
| 0 1 | 0 | 0 |
| 1 0 | 1 | 1 |
| 1 1 | 0 | 1 |
Check one row. In the row A = 0, B = 1, we get P = NOT 1 = 0, and X = 0 OR 0 = 0. That is the only row where X is 0.
An example. A door alarm sounds when the door is open (D = 1) and the system is not switched off (S = 0). The alarm is X = D AND (NOT S).
S goes into a NOT gate. Its output and D go into an AND gate. The output column, in row order, is 0, 0, 1, 0. The alarm sounds in one row only: the door is open and the switch is at 0.
The program works out X = A OR (NOT B) one gate at a time, just like the middle column. Then it counts the rows that give 1.
X = A OR B.Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
A = 0 and B = 1. What is the output?X = NOT (A AND B). Work out X when A = 1 and B = 1.D = 1) or the timer says it is morning (M = 1). Write the expression for the waterer W.X = A OR (NOT B), which row gives X = 0?Every lesson is open to read. Enrolling also lets you:
Log in to join the discussion.
Loading…