Informatics 1 Computation and Logic Karnaugh Maps Michael Fourman - - PowerPoint PPT Presentation

informatics 1
SMART_READER_LITE
LIVE PREVIEW

Informatics 1 Computation and Logic Karnaugh Maps Michael Fourman - - PowerPoint PPT Presentation

B A R G Informatics 1 Computation and Logic Karnaugh Maps Michael Fourman InfPals web.inf.ed.ac.uk/infweb/student-services/ito/students/year1/student-support/infpals Action : Make a commitment and sign up ASAP and before 5pm on Wednesday


slide-1
SLIDE 1

Informatics 1

Computation and Logic

Karnaugh Maps Michael Fourman

1

B R A G

Action: Make a commitment and sign up ASAP and before 5pm on Wednesday the 4th of October, using your First Name and your Student Number at tinyurl.com/infpals2017

InfPals

web.inf.ed.ac.uk/infweb/student-services/ito/students/year1/student-support/infpals

slide-2
SLIDE 2

2

R A G R ⋏ A 1 1 1 1 1 1 1 1 1 1 1 1 1 1

slide-3
SLIDE 3

3

R A G ?? 1 1 1 1 1 1 1 1 1 1 1 1

slide-4
SLIDE 4

4

R A G ?? 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

slide-5
SLIDE 5

5

R A G ?? 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

(¬R ∧ ¬A ∧ ¬G) ∨ (¬R ∧ A ∧ ¬G) ∨ (¬R ∧ A ∧ G) ∨ (R ∧ ¬A ∧ ¬G) ∨ (R ∧ A ∧ G) RʹAʹGʹ + RʹAGʹ + RʹAG + RAʹGʹ + RAG disjunctive normal form DNF engineers write + for ∨, × for ∧, Aʹ for ¬A and call this a sum of products SOP

slide-6
SLIDE 6

6

R A G ?? 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

¬         (¬R ∧ ¬A ∧ G) ∨ (R ∧ ¬A ∧ G) ∨ (R ∧ A ∧ ¬G)         we can also look at the states that do not satisfy the property Then we apply de Morgan…

slide-7
SLIDE 7

7

R A G ?? 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

¬         (¬R ∧ ¬A ∧ G) ∨ (R ∧ ¬A ∧ G) ∨ (R ∧ A ∧ ¬G)         = ¬(¬R ∧ ¬A ∧ G) ∧ ¬(R ∧ ¬A ∧ G) ∧ ¬(R ∧ A ∧ ¬G) = (R ∨ A ∨ ¬G) ∧ (¬R ∨ A ∨ ¬G) ∧ (¬R ∨ ¬A ∨ G) = ∧ ∧

slide-8
SLIDE 8

8

R A G ?? 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

¬         (¬R ∧ ¬A ∧ G) ∨ (R ∧ ¬A ∧ G) ∨ (R ∧ A ∧ ¬G)         = (R ∨ A ∨ ¬G) ∧ (¬R ∨ A ∨ ¬G) ∧ (¬R ∨ ¬A ∨ G) = ∧ ∧ = ∧ = (A ∨ ¬G) ∧ (¬R ∨ ¬A ∨ G)

=

slide-9
SLIDE 9

(A ∨ ¬G) ∧ (¬R ∨ ¬A ∨ G)

=

conjunctive normal form CNF engineers write this as (A + Gʹ).(Rʹ + Aʹ + G) a product of sums POS

slide-10
SLIDE 10

¬(R ∧ A) = ¬R ∨ ¬A

slide-11
SLIDE 11

¬(G ∧ ¬A) = ¬G ∨ A

slide-12
SLIDE 12

Boolean Algebra

x ∨ (y ∨ z) = (x ∨ y) ∨ z x ∧ (y ∧ z) = (x ∧ y) ∧ z associative x ∨ (y ∧ z) = (x ∨ y) ∧ (x ∨ z) x ∧ (y ∨ z) = (x ∧ y) ∨ (x ∧ z) distributive x ∨ y = y ∨ x x ∧ y = y ∧ x commutative x ∨ 0 = x x ∧ 1 = x identity x ∨ 1 = 1 x ∧ 0 = 0 annihilation x ∨ x = x x ∧ x = x idempotent x ∨ ¬x = 1 ¬x ∧ x = 0 complements x ∨ (x ∧ y) = x x ∧ (x ∨ y) = x absorbtion ¬(x ∨ y) = ¬x ∧ ¬y ¬(x ∧ y) = ¬x ∨ ¬y de Morgan ¬¬x = x x → y = ¬x ← ¬y

12

slide-13
SLIDE 13

R A G

{x | G(x) ↔ R(x) ↔ A(x)}

13

Lewis Carroll (The Rev. C.L. Dodgson)

slide-14
SLIDE 14

R AG {x | G(x) ↔ R(x) ↔ A(x)}

14

00 01 11 10 1

slide-15
SLIDE 15

R AG

15

00 01 11 10 1

(¬A ∧ ¬G) ∨ (A ∧ G) ∨ (A ∧ ¬R)

slide-16
SLIDE 16

R AG

16

00 01 11 10 1

¬ ∧ ¬ ∨ ∧ ∨ ∧ ¬ (¬G ∨ A) ∧ (¬R ∨ G ∨ ¬A)

slide-17
SLIDE 17

RB AG

17

00 01 11 10 00 01 11 10 4 atoms:16 states: 64K subsets Karnaugh Maps B R A G

slide-18
SLIDE 18

1 1 1 1

RB AG

18

00 01 11 10 00 01 11 10 4 atoms:16 states: 64K subsets Karnaugh Maps

G ∧ B

B

R A G

slide-19
SLIDE 19

1 1 1 1

RB AG

19

00 01 11 10 00 01 11 10 4 atoms:16 states: 64K subsets Karnaugh Maps

¬A ∧ B

B

R A G

slide-20
SLIDE 20

1 1 1 1

RB AG

20

00 01 11 10 00 01 11 10 4 atoms:16 states: 64K subsets Karnaugh Maps B R A G

¬A ∧ ¬R

slide-21
SLIDE 21

1 1 1 1

RB AG

21

00 01 11 10 00 01 11 10 4 atoms:16 states: 64K subsets Karnaugh Maps B R A G

¬B ∧ ¬R

slide-22
SLIDE 22

1 1 1 1

AG

22

00 01 11 10 Karnaugh Maps B R A G RB 00 01 11 10

¬G ∧ ¬R

slide-23
SLIDE 23

1 1 1 1

AG

23

Karnaugh Maps B R A G RB 00 01 11 10 00 01 11 10

¬G ∧ ¬B

slide-24
SLIDE 24

1 1 1 1

RB AG

24

00 01 11 10 00 01 11 10 4 atoms:16 states: 64K subsets Karnaugh Maps

G ∧ B

B

R A G

slide-25
SLIDE 25

1 1 1 1 1 1 1 1 1 1 1 1

RB AG

25

00 01 11 10 00 01 11 10 4 atoms:16 states: 64K subsets Karnaugh Maps B R A G

¬B ∨ ¬G

slide-26
SLIDE 26

1 1 1 1 1 1 1 1

RB AG

26

00 01 11 10 00 01 11 10 4 atoms:16 states: 64K subsets Karnaugh Maps B R A G

(¬A ∧ ¬R) ∨ (A ∧ R)

slide-27
SLIDE 27

1 1 1 1 1 1 1 1

RB AG

27

00 01 11 10 00 01 11 10 4 atoms:16 states: 64K subsets Karnaugh Maps B R A G

(¬R ∨ A) ∧ (¬A ∨ R)

slide-28
SLIDE 28

1 1 1 1 1 1 1 1

RB AG

28

00 01 11 10 00 01 11 10 4 atoms:16 states: 64K subsets Karnaugh Maps to produce a DNF / SOP identify blocks of 1s and write a product for each

B R A G
slide-29
SLIDE 29

1 1 1 1 1 1 1 1

RB AG

29

00 01 11 10 00 01 11 10 4 atoms:16 states: 64K subsets Karnaugh Maps to produce a DNF / SOP identify blocks of 1s and write a product for each RA + BAʹG + RʹAʹGʹ (R ∧ A) ∨ (B ∧ ¬A ∧ G) ∨ (¬R ∧ ¬A ∧ ¬G)

B R A G
slide-30
SLIDE 30

1 1 1 1 1 1 1 1

RB AG

30

00 01 11 10 Karnaugh Maps to produce a CNF / POS identify blocks of 0s and write a sum for each 00 01 11 10

B R A G
slide-31
SLIDE 31

1 1 1 1 1 1 1 1

RB AG

31

00 01 11 10 4 atoms:16 states: 64K subsets Karnaugh Maps to produce a CNF / POS identify blocks of 0s and write a sum for each (Rʹ+A+G)(B+A+Gʹ)(R+Aʹ) 00 01 11 10

(¬R ∨ A ∨ G) ∧ (B ∨ A ∨ ¬G) ∧ (R ∨ ¬A)

B R A G