{"base":{"id":"cs9-30","subject":"Systems","title":"Logic circuits from Boolean expressions","scene":"sys9","steps":[{"mode":"gates","eyebrow":"A circuit from an expression","title":"(A AND B) OR NOT C","body":"Each operation in a Boolean expression becomes a gate. This circuit uses AND, NOT and OR. Toggle the inputs and follow the green wires (1) to the output.","actions":[{"id":"a","label":"Toggle A"},{"id":"b","label":"Toggle B"},{"id":"c","label":"Toggle C"}]},{"mode":"truth","eyebrow":"Truth table","title":"Every combination","body":"A truth table tests the circuit with every combination of inputs. Three inputs give 8 rows. Toggle the switches and the matching row lights up.","actions":[{"id":"a","label":"Toggle A"},{"id":"b","label":"Toggle B"},{"id":"c","label":"Toggle C"}]},{"mode":"build","eyebrow":"Build more circuits","title":"Brackets come first","body":"Choose an expression to see its circuit. The operation inside brackets (or NOT on a single input) gets its gate first. Press the last button to try every combination of inputs.","actions":[{"id":"e0","label":"NOT A AND B"},{"id":"e1","label":"A OR (B AND C)"},{"id":"e2","label":"NOT (A OR B)"},{"id":"inp","label":"Change the inputs"}]},{"mode":"quiz","eyebrow":"Check yourself","title":"Work it out","body":"Q = (A AND B) OR NOT C, with A = 1, B = 0, C = 1.","question":"What is Q?","options":["0","1","It depends"],"answer":0,"right":"Correct. A AND B = 0; NOT C = 0; 0 OR 0 = 0.","wrong":"Not quite. Work out each gate in turn.","look":"truth"}],"more":[{"type":"cards","id":"ideas","eyebrow":"Popular idea vs science","title":"Common mix-ups","items":[{"tag":"Popular idea","title":"\"OR means only one input can be 1.\"","body":"OR gives 1 when at least one input is 1, including both."},{"tag":"Popular idea","title":"\"NOT needs two inputs.\"","body":"NOT has one input and flips it."},{"tag":"Popular idea","title":"\"NOT A AND B is the same as NOT (A AND B).\"","body":"Brackets change the order: they give different truth tables."}]},{"type":"cards","id":"code","eyebrow":"Truth tables","title":"The three gates","items":[{"tag":"AND","title":"Both","body":"A B | Q\n0 0 | 0\n0 1 | 0\n1 0 | 0\n1 1 | 1","code":true},{"tag":"OR","title":"Either","body":"A B | Q\n0 0 | 0\n0 1 | 1\n1 0 | 1\n1 1 | 1","code":true},{"tag":"NOT","title":"Flip","body":"A | Q\n0 | 1\n1 | 0","code":true}]},{"type":"activities","id":"try","eyebrow":"Try it at home","title":"Light switch logic","items":[{"title":"Real-life logic","time":"15 minutes","need":["Paper"],"steps":["A car's alarm sounds if the door is open AND the engine is on. Write this as a Boolean expression.","A light comes on if the switch is on OR motion is detected. Write it.","Draw a circuit diagram for each.","Make a truth table for each."],"why":"Logic gates control everyday devices, from alarms to lifts.","safety":"No safety risks."}]},{"type":"quiz","id":"quiz","eyebrow":"Quiz","title":"Six more questions","questions":[{"question":"AND gate: A = 1, B = 0. Output?","options":["0","1","2"],"answer":0,"right":"Correct. Both must be 1.","wrong":"Not quite. Are both 1?"},{"question":"OR gate: A = 0, B = 1. Output?","options":["0","2","1"],"answer":2,"right":"Correct. At least one is 1.","wrong":"Not quite. Is either 1?"},{"question":"NOT gate: input 1. Output?","options":["1","Both","0"],"answer":2,"right":"Correct. It flips.","wrong":"Not quite. Opposite."},{"question":"How many rows in a truth table with 3 inputs?","options":["6","8","3"],"answer":1,"right":"Correct. 2³ = 8.","wrong":"Not quite. Double for each input."},{"question":"Which expression needs an AND gate whose output feeds an OR gate?","options":["NOT A","A OR B","(A AND B) OR C"],"answer":2,"right":"Correct. Brackets first.","wrong":"Not quite. Follow the brackets."},{"question":"NOT (A OR B) with A = 0, B = 0 gives…","options":["0","1","2"],"answer":1,"right":"Correct. A OR B = 0; NOT 0 = 1.","wrong":"Not quite. Inside the brackets first."}]},{"type":"checklist","id":"check","eyebrow":"Self-check","title":"I can explain…","items":["what AND, OR and NOT do","how to turn a Boolean expression into a circuit","how to complete a truth table","how brackets change the order of gates"]},{"type":"keywords","id":"words","eyebrow":"Key words","title":"Words to know","items":[{"word":"logic gate","meaning":"A circuit component that performs a Boolean operation."},{"word":"Boolean expression","meaning":"A statement using AND, OR and NOT."},{"word":"truth table","meaning":"A table of every input combination and its output."},{"word":"input","meaning":"A signal going into a gate (0 or 1)."},{"word":"output","meaning":"The result coming out of a gate."}]},{"type":"sources","id":"sources","title":"Sources","items":["BBC Bitesize KS3 Computer Science","Raspberry Pi Foundation, Computing curriculum resources"]}]},"overlay":null}