AQA Computer Science A-Level
4.6.5 Boolean algebra
Advanced Notes
www.pmt.education
Specification:
4.6.5.1 Using Boolean algebra:
Be familiar with the use of Boolean identities and De Morgan’s laws to
manipulate and simplify Boolean expressions.
www.pmt.education
Boolean algebra
Just like algebra in Mathematics, Boolean algebra concerns representing values with
letters and simplifying expressions. Boolean algebra uses the Boolean values TRUEand
FALSEwhich can be represented as 1and 0respectively.
Notation
Expression Meaning
An unknown Boolean value being represented by a letter
A, B, C, etc. just like x or y in conventional algebra.
NOT A . An overline represents the NOToperation being
A applied to what is below the line.
A AND B , said “A dot B” where a dot represents the AND
A•B (multiplication) operation.
An alternative notation for A AND B
. Just like in
AB Mathematics, the product of two algebraic values can be
represented without any symbol.
A OR B , where an addition symbol represents the OR
A + B operation.
Order of precedence
Algebraic operations have an order of precedence, meaning that some operations must be
applied before others. You may have met BODMAS in Mathematics, this is the same idea.
Operator Precedence
Brackets Highest
.
NOT .
.
AND
.
OR Lowest
For example, the expression B OR NOT C AND Awould actually be carried out in the
order B OR ((NOT C) AND A) .
www.pmt.education
Boolean identities
There are a number of useful identities which can be used to simplify Boolean
expressions.
A • 0 = 0 Anything AND 0is always 0.This is because the
ANDoperation represents multiplication.
B • 1 = B Anything AND 1is always the original value. This is
because the ANDoperation represents multiplication.
C • C = C Any Boolean value ANDitself is equivalent to just the
value, as the truth table below shows.
C C•C
1 1 × 1 = 1
0 0 × 0 = 0
D + 0 = D Any Boolean value OR 0is the equivalent of adding
0to the value, which leaves the value unchanged.
E + 1 = 1 Any Boolean value OR 1is the equivalent of adding
1to the value, which will always result in 1
.
F + F = F Any Boolean value ORitself equals the value itself,
as the truth table shows.
F F+F
1 1 + 1 = 1
0 0 + 0 = 0
Any Boolean value with two lines above has had the
G = G NOT operation performed on it twice, meaning the
value has not been changed.
www.pmt.education
De Morgan’s laws
Named after British logician Augustus De Morgan, these two laws of Boolean algebra
come in incredibly useful when simplifying expressions.
De Morgan’s laws can be remembered by recalling the phrase:
“break the bar and change the sign.”
Where “the bar” refers to an overline representing the NOToperation and “the sign” refers
to changing between + (OR) and • (AND ).
For example, the Boolean expression A + B can have De Morgan’s law applied to it as
follows:
Break the bar:
A+ B
Change the sign:
A•B
A + B = A•B
De Morgan’s law can also be applied in reverse, by changing the sign and building the bar.
an be simplified as follows:
For example, the Boolean expression C + D c
Change the sign:
C•D
Build the bar:
C•D
C + D = C•D
www.pmt.education
Distributive rules
Just like expanding brackets in Mathematics, you can use distributive rules in Boolean
algebra as follows:
A • (B + C) = A • B + A • C
Examples
Example 1
Simplify the Boolean expression A + B • A
A + B•A
Use De Morgan’s laws. Break the bar and change the sign.
= A + B + A
Use A + A = 1
= B + 1
Use A + 1 = 1
=1
Example 2
Simplify the Boolean expression C • B + C • B
C•B + C•B
Take out B as a common factor
B • ( C + C)
Use A + A = 1
B • ( 1)
Use A + 1 = A
B
www.pmt.education