Boolean algebra and logic circuits · A level · OCR H446 1.4.3, AQA 7517 4.6.5.1, Eduqas A500QS 1.2 · about 25 min
A method for simplifying by algebra, worked exam-style examples, and checking the result.
[1 mark]Simplify (A ∨ B) ∧ (A ∨ ¬B).
[1 mark]Simplify ¬(A ∨ B) ∨ (¬A ∧ B).
[1 mark]Simplify (A ∧ B ∧ C) ∨ (A ∧ B ∧ ¬C) ∨ (A ∧ ¬B).
[1 mark]Put the steps simplifying A · B + A · B̅ + A̅ · B in order.
Number the lines 1 to 4 to put them in the right order.
A + A̅ · BA · 1 + A̅ · BA + BA · (B + B̅) + A̅ · BA · (B + B̅) + A̅ · B A · 1 + A̅ · B A + A̅ · B A + B
Take out A, use the complement, use AND with 1, then X + X̅ · Y = X + Y.
[1 mark]A student writes ¬A ∨ ¬B = ¬A ∧ ¬B as a step. What is wrong?
The function original(a, b, c) computes Q = ¬(A ∨ ¬B) ∨ (A ∧ B) ∨ (A ∧ ¬B ∧ C). Its inputs are bits (0 or 1) and it returns 0 or 1.
Simplify Q on paper, then write simplified(a, b, c), taking and returning the same, as a single return line that uses at most two of and, or and not in total. It may not call original or use the bitwise operators &, |, ^ or ~.
Print eight lines, one per row in binary order (A outermost, then B, then C), in exactly this form, with every value 0 or 1:
A=0 B=1 C=0 original=1 simplified=1
# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()
def original(a, b, c):
return int((not (a or not b)) or (a and b) or (a and not b and c))
def simplified(a, b, c):
return 0The hint students can ask for: Work on paper first. Apply De Morgan to the bracket with NOT in front, then look for two terms that differ only in one letter being inverted, and for a letter that can absorb or cancel part of the last term. Check your answer against the truth table the program prints.
# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()
def original(a, b, c):
return int((not (a or not b)) or (a and b) or (a and not b and c))
def simplified(a, b, c):
return int(b or (a and c))
for a in [0, 1]:
for b in [0, 1]:
for c in [0, 1]:
print(f"A={a} B={b} C={c} original={original(a, b, c)} simplified={simplified(a, b, c)}")
Any program that meets the task's checks is marked correct in the simulator; this is one way, not the only way.