Boolean Algebra and Logic Circuits

Computer Science A2 · Hardware and Virtual Machines. The idea in plain words, the rules to remember, the mistake to avoid and a worked example, written and checked by Mega Lecture.

Test this topic freeAll Computer Science A2 topics

The idea

Logic circuits can add and can store. A half adder adds two bits and gives a sum and a carry. A full adder adds two bits and a carry-in, so full adders can be joined to add whole binary numbers.

A flip-flop is a circuit with feedback that holds its output until it is changed, so it stores one bit. The SR and JK types are the ones to know.

A Boolean expression can be made simpler, which means fewer gates. This is done with the laws of Boolean algebra, including De Morgan's laws, or with a Karnaugh map, where 1s in adjacent cells are grouped and the variable that changes inside a group is removed.

In simpler words

Logic circuits can add and store bits. A half adder adds two bits and gives a sum and a carry. A full adder also adds a carry-in, so many can be joined to add big numbers. A flip-flop stores one bit. You can make a Boolean expression simpler so it needs fewer gates. You use Boolean laws or a Karnaugh map to do this.

An everyday comparison

A flip-flop is like a light switch on a wall. Press it once and the light stays on until someone presses the other way. It remembers its last state without you holding it. The comparison stops working because an SR flip-flop has a forbidden input (both S and R at 1), and a JK flip-flop can toggle, which a simple switch cannot describe.

Rules to remember

Common mistake

With De Morgan's laws students put NOT on each term but forget to change the operator. Breaking the bar always swaps AND with OR: NOT (A AND B) becomes (NOT A) OR (NOT B), never (NOT A) AND (NOT B).

In the exam

For adders, write the expressions: half adder sum = A XOR B and carry = A AND B. Complete truth tables row by row in binary order. For flip-flops, state what each input pair does and name the invalid state for SR. To simplify, show each law you use, one line at a time. With De Morgan's laws, break the bar and swap AND with OR. For a Karnaugh map, label in the order 00, 01, 11, 10, draw the largest groups, then write one term for each group.

Worked example

Simplify X = NOT (A OR B) OR ((NOT A) AND B).

  1. De Morgan: NOT (A OR B) = (NOT A) AND (NOT B).
  2. So X = ((NOT A) AND (NOT B)) OR ((NOT A) AND B).
  3. Take out the common term: X = (NOT A) AND ((NOT B) OR B).
  4. (NOT B) OR B = 1, and (NOT A) AND 1 = NOT A.

Answer: X = NOT A (check: X is 1 for A = 0 with B = 0 or 1, and 0 for A = 1).

Ask about this

Type what you are stuck on. The helper finds the explanation, worked examples and the notes to read, free and instant.

Keep going

← Processors, Parallel Processing and Virtual MachinesPurposes of an Operating System (OS) →Take a Computer Science A2 test