☰ Year plan · Communication Technology

Gates in decisions: NAND, NOR and XOR

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.

JobQuestion it answersA trip example
1 Inputs and outputWhat 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 wordsWhen is the result yes?Yes only if the slip is signed and a seat is free.
3 The gateWhich gate has this table?AND (next lesson)
Worked examples
DecisionInputsOutput
A library fine is waivedA: was the book returned on time? B: is the card gold?Y: is the fine waived?
A night lampA: is it daylight?Y: is the lamp on?
A lab doorA: is the card valid? B: is the code right?Y: does the door open?
Three invented decisions with their inputs and output.
WeakGood
the weatherIs it raining?
the keyHas the key been turned?
the timerHas 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?
2
In gate language, what is a condition?
3
Rewrite “the timer” as a yes-or-no question.
4
A gate has how many outputs, so what must the result of a decision be?