الأسبوع 8 · الوحدة ٢ «البوابات المنطقية» (١): الدوائر المنطقية وقائمة البوابات وبوابة AND: المفاتيح والرمز وعدد الاحتمالات وجدول الحقيقة والصيغة البولية · 3 دروس
1
Logic circuits and gates: decisions made by switches
ICT Secondary 3 Term 1, Unit 2, Topic 1: pp. 6–18
GoalSay what a logic gate is, name the three basic gates, and show how a switch and a lamp make a yes-or-no decision.
New words
logic circuit · a circuit built from gates that makes decisions from 0s and 1sgate · a small circuit with one or more inputs and exactly one outputinput · a value that goes into a gateoutput · the value that comes out of a gate, decided by its inputs
Explanation
Remember Week 2: a computer works with two states, off and on, written 0 and 1. A logic circuit uses those two states to make decisions, and it is built from gates. A gate is a small circuit with one or more inputs and exactly one output; the output follows a fixed rule and depends only on the inputs it has right now. The three basic gates are AND, OR and NOT. Others exist, such as NAND, NOR and XOR, and they are built from the same ideas. A switch and a lamp show the picture: the switch is an input (closed is 1, open is 0) and the lamp is the output (lit is 1, unlit is 0). Nothing here needs a device. Every gate in this week can be understood with a pencil and a table.
Part
In a simple circuit
Values
input
a switch
closed = 1, open = 0
gate
the wiring between switches and lamp
a fixed rule
output
the lamp
lit = 1, unlit = 0
Worked examples
Rule
Inputs
Output
The garden gate opens when the key is turned and the button is pressed
key turned, button pressed
the gate opens
The reading lamp is on when the desk switch is closed
the desk switch
the lamp
The alarm sounds when the cupboard door is open
the cupboard door
the alarm
The first job with any rule is to find its inputs and its output. Here are three invented rules.
Gate
Inputs
Rule in words
AND
two or more
the output is 1 only if every input is 1
OR
two or more
the output is 1 if at least one input is 1
NOT
one
the output is the opposite of the input
The three basic gates differ in how the output follows the inputs. Next weeks study each one.
Class activity
Write three rules from your own day (invent them; use no real names). For each one, name the inputs and the output, and say whether it has one input or more than one.
Practice
1
How many outputs does a gate have?
Exactly one.
2
What do 1 and 0 mean for a switch and for a lamp?
A closed switch and a lit lamp are 1; an open switch and an unlit lamp are 0.
3
Name the three basic gates.
AND, OR and NOT.
4
A fan runs when the heater is on and the window is shut. Name the inputs and the output.
Inputs: the heater (on or off) and the window (shut or open). Output: the fan.