Week 14 · Unit 2 Topic 10: employing logic gates in life decisions; the book's conclusion; NAND, NOR and XOR named in the unit introduction · 3 lessons
1
Decisions as gates: inputs, output, rule
ICT Secondary 3 Term 1, Unit 2, Topic 10: pp. 82–86
GoalTurn a rule into a decision with inputs and one output, and say which question each step answers.
New words
decision · a choice of yes or no made from some conditionscondition · a statement that is true or false; in gate language it is an inputrule · the sentence that says how the conditions decide the resultresult · the yes-or-no answer of the decision; in gate language it is the output
Explanation
A decision is a yes-or-no choice made from conditions. In the language of gates each condition is an input (1 if it is true, 0 if not), the result is the output, and the rule is the gate that links them. Turning a rule into a gate takes three jobs. Job 1: find the inputs and the output. Job 2: write the rule in words, saying exactly when the result is yes. Job 3: pick the gate, then write its table and its formula. This lesson does jobs 1 and 2; the next lesson does job 3. Write every condition as a question with the answer yes or no, so that a 1 or a 0 is easy to give. A gate has exactly one output, so the result of a decision is one yes or no, never “maybe”. Use things and situations for your examples (slips, keys, seats, sensors), and never real people or their personal data.
Job
Question it answers
A trip example
1 Inputs and output
What are the conditions? What is the result?
A: is the permission slip signed? B: is a seat free? Y: does the pupil join?
2 The rule in words
When is the result yes?
Yes only if the slip is signed and a seat is free.
3 The gate
Which gate has this table?
AND (next lesson)
Worked examples
Decision
Inputs
Output
A library fine is waived
A: was the book returned on time? B: is the card gold?
Y: is the fine waived?
A night lamp
A: is it daylight?
Y: is the lamp on?
A lab door
A: is the card valid? B: is the code right?
Y: does the door open?
Three invented decisions with their inputs and output.
Weak
Good
the weather
Is it raining?
the key
Has the key been turned?
the timer
Has the timer finished?
Weak and good ways to write a condition. A good condition is a question whose answer is yes or no.
A common mistake is to give a condition three answers, such as low, medium and high. A gate input has only 0 and 1. Split it into two yes-or-no conditions, for example “Is the tank at least half full?” and “Is the tank full?”.
Class activity
Choose two decisions from a school day (invent them, with no real names or personal data). For each one write the inputs as yes-or-no questions, the output, and the rule in words.
Practice
1
What are the three jobs when a rule is turned into a gate?
Find the inputs and the output, write the rule in words, and pick the gate.
2
In gate language, what is a condition?
An input: 1 if the condition is true, 0 if it is not.
3
Rewrite “the timer” as a yes-or-no question.
Has the timer finished?
4
A gate has how many outputs, so what must the result of a decision be?