TechTayari

S16 · Computer Studies II · Grade 11 · ages 16–17

Logic Circuits

Combining gates to solve problems

Grade 11 · 1.4 Logic CircuitsCBE strandFree · works offline

▶ Start the interactive lesson

The full lesson adds narration, an interactive mission and a 10-question bank, and the quiz explains any mistakes.

From gates to circuits

A logic circuit joins gates together so the output of one gate becomes the input of another. With a few gates you can describe real rules, like "sound the alarm if the system is armed AND a door OR a window opens".

A burglar alarm circuit

Let A = the alarm is armed, D = a door is open, W = a window is open. The rule is: Alarm = A AND (D OR W), written A · (D + W). An OR gate combines D and W, and its output goes into an AND gate together with A.

Boolean expressions from circuits

To find a circuit's expression, start at the inputs and write each gate's output in turn. An OR gate fed by D and W gives D + W. That goes into an AND gate with A, giving A · (D + W). Brackets show which part is worked out first.

Truth tables for circuits

Evaluate the expression for every input combination. For A · (D + W): with A = 0 the output is always 0, so a disarmed alarm stays quiet. With A = 1 the output is 1 if D or W is 1. Three inputs give 8 rows to check.

The half adder

Gates can also do maths. A half adder adds two bits: Sum = A XOR B, and Carry = A AND B. With A = 1 and B = 1: Sum = 0 and Carry = 1, giving 10, which is 2 in binary. Chain these together and you get the adders inside every CPU.

Key points

  • A logic circuit feeds the output of one gate into another.
  • An alarm rule can be: armed AND, door OR window.
  • That is written A dot, bracket, D plus W.
  • Work out a circuit's expression gate by gate, from the inputs to the output.
  • A truth table checks the circuit for every input combination.
  • A half adder uses XOR for the sum and AND for the carry.
  • Chains of adders are how the CPU does arithmetic.

Try it for real: Design a circuit

  • Use the explainer above: switch the alarm inputs on and off and fill in the 8-row truth table.
  • Design a circuit for a security light: the light turns on when it is dark AND motion is detected. Write its Boolean expression.
▶ Start the interactive lesson