4. computer maths and logic 4.2 boolean logic 4.2.3 simplifying boolean expressions

16
4. Computer Maths and Logic 4.2 Boolean Logic 4.2.3 Simplifying Boolean Expressions

Upload: shana-dean

Post on 05-Jan-2016

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 4. Computer Maths and Logic 4.2 Boolean Logic 4.2.3 Simplifying Boolean Expressions

4. Computer Maths and Logic

4.2 Boolean Logic

4.2.3 Simplifying Boolean Expressions

Page 2: 4. Computer Maths and Logic 4.2 Boolean Logic 4.2.3 Simplifying Boolean Expressions

Complex expressions can be constructed using the operators e.g. (A B) • (C + D), which is equivalent to writing (A xor not B) and (neither C nor D nor both).

In the exam, you will not have to consider more than 3 inputs

Complex Expressions

Page 3: 4. Computer Maths and Logic 4.2 Boolean Logic 4.2.3 Simplifying Boolean Expressions

To evaluate a complex Boolean expression, break it down to smaller parts then use a truth table e.g. firstly (A B):

Complex Expressions

Page 4: 4. Computer Maths and Logic 4.2 Boolean Logic 4.2.3 Simplifying Boolean Expressions

1011

0101

0010

1100

(A B)BBA

OutputIntermediate

Inputs

Complex Expressions

Page 5: 4. Computer Maths and Logic 4.2 Boolean Logic 4.2.3 Simplifying Boolean Expressions

There’s a worksheet to help you evaluate the rest of the expression

Draw similar truth tables for A + B and A • B.

Truth tables can be used as a means of checking if two expressions are equivalent.

Complex Expressions

Page 6: 4. Computer Maths and Logic 4.2 Boolean Logic 4.2.3 Simplifying Boolean Expressions

Complex expressions can often be reduced to simpler ones

This is similar to work you have done in algebra in maths

Look out for the following expressions which are always true

Simplifying Expressions

Page 7: 4. Computer Maths and Logic 4.2 Boolean Logic 4.2.3 Simplifying Boolean Expressions

A • 0 = 0 A + 1 = 1

Simplifying Expressions

Page 8: 4. Computer Maths and Logic 4.2 Boolean Logic 4.2.3 Simplifying Boolean Expressions

A • 1 = A A + 0 = A

Simplifying Expressions

Page 9: 4. Computer Maths and Logic 4.2 Boolean Logic 4.2.3 Simplifying Boolean Expressions

A + A = A A • A = A

Simplifying Expressions

Page 10: 4. Computer Maths and Logic 4.2 Boolean Logic 4.2.3 Simplifying Boolean Expressions

A • B = B • A A + B = B + A (the commutative law)

Simplifying Expressions

Page 11: 4. Computer Maths and Logic 4.2 Boolean Logic 4.2.3 Simplifying Boolean Expressions

A • (B • C) = (A • B) • C = A • B • C

(the associative law)

Simplifying Expressions

Page 12: 4. Computer Maths and Logic 4.2 Boolean Logic 4.2.3 Simplifying Boolean Expressions

A + (B + C) = (A + B) + C = A + B + C

(the associative law)

Simplifying Expressions

Page 13: 4. Computer Maths and Logic 4.2 Boolean Logic 4.2.3 Simplifying Boolean Expressions

A • (B + C) = A•B + A•C

(A + B) • (A + C) = A•A + A•C + B•A + B•C

(the distributive law) Verify these with truth tables

Simplifying Expressions

Page 14: 4. Computer Maths and Logic 4.2 Boolean Logic 4.2.3 Simplifying Boolean Expressions

A + A = 1 A • A = 0

(De Max's laws)

Simplifying Expressions

Page 15: 4. Computer Maths and Logic 4.2 Boolean Logic 4.2.3 Simplifying Boolean Expressions

A + B = A • B A + B = A • B

De Morgen's lawVerify these with truth tables

Simplifying Expressions

Page 16: 4. Computer Maths and Logic 4.2 Boolean Logic 4.2.3 Simplifying Boolean Expressions

anything in brackets is done first

• is done before +

Simplifying Expressions