1 of 54

Chapter 2:

2 of 54

Basic Definitions

  • Binary Operators
    • AND

z = x • y = x y z=1 if x=1 AND y=1

    • OR

z = x + y z=1 if x=1 OR y=1

    • NOT

z = x = x’ z=1 if x=0

  • Boolean Algebra
    • Binary Variables: only ‘0’ and ‘1’ values
    • Algebraic Manipulation

*

1

3 of 54

Single Variable Theorem

    • ( x’ )’ = x
    • A • A = A A + A = A
    • A • 0 = 0 A + 1 = 1
    • A • A= 0 A+A= 1

Two and Three Variable Laws

  • Theorem: DeMorgan
    • ( A • B )’ = A’ + B’ ( A + B )’ = A’ • B’

​

*

2

4 of 54

Boolean Algebra

  • Commutative Law (قانون التبادل)

AB = BA

A+B = B +A

  • Associative (التجميع)

A(BC) = (AB)C

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

  • Distributive (التوزيع)

A ( B + C ) = AB + AC

A + BC = ( A + B ) • ( A + C ) You can check out using a truth table

*

3

5 of 54

*

4

6 of 54

*

5

A NAND gate can be used as a NOT gate using either of the following wiring configurations.

7 of 54

Logic Operators

  • AND

​

​

​

  • NAND (Not AND)

*

6

x

y

NAND

0

0

1

0

1

1

1

0

1

1

1

0

x

y

AND

0

0

0

0

1

0

1

0

0

1

1

1

8 of 54

Logic Operators

  • OR

​

​

​

  • NOR (Not OR)

*

7

x

y

OR

0

0

0

0

1

1

1

0

1

1

1

1

x

y

NOR

0

0

1

0

1

0

1

0

0

1

1

0

9 of 54

Logic Operators

  • XOR (Exclusive-OR)

​

​

​

  • XNOR (Exclusive-NOR)� (Equivalence)

*

8

x

y

XOR

0

0

0

0

1

1

1

0

1

1

1

0

x

y

XNOR

0

0

1

0

1

0

1

0

0

1

1

1

10 of 54

Logic Operators

  • NOT (Inverter)

​

​

​

  • Buffer

*

9

x

NOT

0

1

1

0

x

Buffer

0

0

1

1

11 of 54

Boolean Functions

  • Boolean Expression

Example: F = x + y’ z

  • Truth Table

All possible combinations�of input variables

  • Logic Circuit

*

10

x

y

z

F

0

0

0

0

0

0

1

1

0

1

0

0

0

1

1

0

1

0

0

1

1

0

1

1

1

1

0

1

1

1

1

1

12 of 54

Algebraic Manipulation

  • Literal:

A single variable within a term that may be complemented or not.

  • Use Boolean Algebra to simplify Boolean functions to produce simpler circuits

Example: Simplify to a minimum number of literals

F = x + x’ y ( 3 Literals)

= x + ( x’ y )

= ( x + x’ ) ( x + y )

= ( 1 ) ( x + y ) = x + y ( 2 Literals)

*

11

Distributive law

13 of 54

Complement of a Function

  • DeMorgan’s Theorm

​

​

​

*

12

14 of 54

Standard Forms

  • Minterm
    • Product (AND function)
    • Contains all variables
    • Evaluates to ‘1’ for a�specific combination

Example

A = 0 A B C

B = 0 (0) • (0) • (0)

C = 0

*

13

1 • 1 • 1 = 1

​

A B C

Minterm

0

0 0 0

m0

​

1

0 0 1

m1

​

2

0 1 0

m2

​

3

0 1 1

m3

​

4

1 0 0

m4

​

5

1 0 1

m5

​

6

1 1 0

m6

​

7

1 1 1

m7

​

15 of 54

Standard Forms

  • Maxterm
    • Sum (OR function)
    • Contains all variables
    • Evaluates to ‘0’ for a�specific combination

Example

A = 1 A B C

B = 1 (1) + (1) + (1)

C = 1

*

14

0 + 0 + 0 = 0

​

A B C

Maxterm

0

0 0 0

M0

​

1

0 0 1

M1

​

2

0 1 0

M2

​

3

0 1 1

M3

​

4

1 0 0

M4

​

5

1 0 1

M5

​

6

1 1 0

M6

​

7

1 1 1

M7

​

16 of 54

Standard Forms

  • Truth Table to Boolean Function

*

15

A B C

F

0 0 0

0

0 0 1

1

0 1 0

0

0 1 1

0

1 0 0

1

1 0 1

1

1 1 0

0

1 1 1

1

17 of 54

Standard Forms

  • Minterms

​

​

​

​

*

16

​

A B C

F

0

0 0 0

0

1

0 0 1

1

2

0 1 0

0

3

0 1 1

0

4

1 0 0

1

5

1 0 1

1

6

1 1 0

0

7

1 1 1

1

  • Maxterms
  • Sum of Products (SOP)
  • Product of Sums (POS)

18 of 54

*

17

​

A B C

F

0

0 0 0

1

1

0 0 1

0

2

0 1 0

0

3

0 1 1

1

4

1 0 0

0

5

1 0 1

1

6

1 1 0

1

7

1 1 1

0

  • Give the standard form using (SOP)?
  • Give the standard form using (POS)?

19 of 54

Chapter 3:

20 of 54

Karnaugh Map

  • Adjacent Squares
    • Number of squares = number of combinations
      • Each square represents a minterm
      • 2 Variables ⇨ 4 squares
      • 3 Variables ⇨ 8 squares
      • 4 Variables ⇨ 16 squares
    • Each two adjacent squares differ in one variable
      • Two adjacent minterms can be combined together

Example: F = x y + x y’

= x ( y + y’ )

= x

*

19

​

​

​

​

21 of 54

Two-variable Map

*

20

m0

m1

m2

m3

​

x y

Minterm

0

0 0

m0

​

1

0 1

m1

​

2

1 0

m2

​

3

1 1

m3

​

​

y

​

​

x

​

0

1

​

0

​

​

​

1

​

​

Note: adjacent squares horizontally and vertically NOT diagonally

22 of 54

Two-variable Map

  • Example

*

21

​

x y

F

Minterm

0

0 0

0

m0

​

1

0 1

1

m1

​

2

1 0

1

m2

​

3

1 1

1

m3

​

​

y

​

​

x

​

0

1

​

0

​

​

​

1

​

​

m0

m1

m2

m3

​

​

y

​

​

​

0

1

x

1

1

23 of 54

Three-variable Map

*

22

m0

m1

m3

m2

m4

m5

m7

m6

​

x y z

Minterm

0

0 0 0

m0

​

1

0 0 1

m1

​

2

0 1 0

m2

​

3

0 1 1

m3

​

4

1 0 0

m4

​

5

1 0 1

m5

​

6

1 1 0

m6

​

7

1 1 1

m7

​

​

y z

​

​

​

​

x

​

00

01

11

10

​

0

​

​

​

​

​

1

​

​

​

​

24 of 54

Three-variable Map

  • Example

*

23

m0

m1

m3

m2

m4

m5

m7

m6

​

x y z

F

Minterm

0

0 0 0

0

m0

​

1

0 0 1

0

m1

​

2

0 1 0

1

m2

​

3

0 1 1

1

m3

​

4

1 0 0

1

m4

​

5

1 0 1

1

m5

​

6

1 1 0

0

m6

​

7

1 1 1

0

m7

​

​

y z

​

​

​

​

x

​

00

01

11

10

​

0

​

​

​

​

​

1

​

​

​

​

​

​

​

y

​

​

​

​

​

1

1

x

1

1

​

​

​

​

z

​

​

​

25 of 54

Three-variable Map

  • Example

*

24

m0

m1

m3

m2

m4

m5

m7

m6

​

x y z

F

Minterm

0

0 0 0

0

m0

​

1

0 0 1

0

m1

​

2

0 1 0

0

m2

​

3

0 1 1

1

m3

​

4

1 0 0

1

m4

​

5

1 0 1

0

m5

​

6

1 1 0

1

m6

​

7

1 1 1

1

m7

​

​

y z

​

​

​

​

x

​

00

01

11

10

​

0

​

​

​

​

​

1

​

​

​

​

​

​

​

y

​

​

​

​

​

1

​

x

1

​

1

1

​

​

z

​

​

​

26 of 54

Three-variable Map

  • Example

*

25

​

x y z

F

Minterm

0

0 0 0

0

m0

​

1

0 0 1

1

m1

​

2

0 1 0

0

m2

​

3

0 1 1

1

m3

​

4

1 0 0

0

m4

​

5

1 0 1

1

m5

​

6

1 1 0

0

m6

​

7

1 1 1

1

m7

​

​

​

​

y

​

​

​

0

1

1

0

x

0

1

1

0

​

​

z

​

​

​

​

​

​

y

​

​

​

0

1

1

0

x

0

1

1

0

​

​

z

​

​

​

27 of 54

Three-variable Map

  • Example

*

26

m0

m1

m3

m2

m4

m5

m7

m6

​

x y z

F

Minterm

0

0 0 0

1

m0

​

1

0 0 1

0

m1

​

2

0 1 0

1

m2

​

3

0 1 1

0

m3

​

4

1 0 0

1

m4

​

5

1 0 1

1

m5

​

6

1 1 0

1

m6

​

7

1 1 1

0

m7

​

​

y z

​

​

​

​

x

​

00

01

11

10

​

0

​

​

​

​

​

1

​

​

​

​

​

​

​

y

​

​

​

1

0

0

1

x

1

1

0

1

​

​

z

​

​

​

28 of 54

Four-variable Map

*

27

m0

m1

m3

m2

m4

m5

m7

m6

m12

m13

m15

m14

m8

m9

m11

m10

​

w x y z

Minterm

0

0 0 0 0

m0

​

1

0 0 0 1

m1

​

2

0 0 1 0

m2

​

3

0 0 1 1

m3

​

4

0 1 0 0

m4

​

5

0 1 0 1

m5

​

6

0 1 1 0

m6

​

7

0 1 1 1

m7

​

8

1 0 0 0

m8

​

9

1 0 0 1

m9

​

10

1 0 1 0

m10

​

11

1 0 1 1

m11

​

12

1 1 0 0

m12

​

13

1 1 0 1

m13

​

14

1 1 1 0

m14

​

15

1 1 1 1

m15

​

​

y z

​

​

​

​

wx

​

00

01

11

10

​

00

​

​

​

​

​

01

​

​

​

​

​

11

​

​

​

​

​

10

​

​

​

​

29 of 54

Four-variable Map

  • Example

*

28

​

w x y z

F

Minterm

0

0 0 0 0

1

m0

​

1

0 0 0 1

1

m1

​

2

0 0 1 0

1

m2

​

3

0 0 1 1

0

m3

​

4

0 1 0 0

1

m4

​

5

0 1 0 1

1

m5

​

6

0 1 1 0

1

m6

​

7

0 1 1 1

0

m7

​

8

1 0 0 0

1

m8

​

9

1 0 0 1

1

m9

​

10

1 0 1 0

0

m10

​

11

1 0 1 1

0

m11

​

12

1 1 0 0

1

m12

​

13

1 1 0 1

1

m13

​

14

1 1 1 0

1

m14

​

15

1 1 1 1

0

m15

​

​

y z

​

​

​

​

wx

​

00

01

11

10

​

00

​

​

​

​

​

01

​

​

​

​

​

11

​

​

​

​

​

10

​

​

​

​

​

​

​

y

​

​

​

1

1

0

1

​

​

​

​

1

1

0

1

x

w

1

1

0

1

1

1

0

0

​

​

​

​

z

​

​

​

​

30 of 54

Four-variable Map

  • Exercise 1: Simplify? Given the Boolean function

F = A’C + A’B + A B’C + BC

*

29

​

​

​

C

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

B

A

​

​

​

​

​

​

​

​

​

​

​

​

D

​

​

​

​

  • Exercise 2: Simplify? Given the Boolean function

F = A’ B’ C’ + B’ C D’ + A’ B C D’ + A B’ C’

31 of 54

Four-variable Map

  • Example

Simplify: F = A’ B’ C’ + B’ C D’ + A’ B C D’ + A B’ C’

*

30

​

​

​

C

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

B

A

​

​

​

​

​

​

​

​

​

​

​

​

D

​

​

​

​

​

1

1

​

​

32 of 54

Four-variable Map

  • Example

Simplify: F = A’ B’ C’ + B’ C D’ + A’ B C D’ + A B’ C’

*

31

​

​

​

C

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

B

A

​

​

​

​

​

​

​

​

​

​

​

​

D

​

​

​

​

​

1

​

​

1

​

​

33 of 54

Four-variable Map

  • Example

Simplify: F = A’ B’ C’ + B’ C D’ + A’ B C D’ + A B’ C’

*

32

​

​

​

C

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

B

A

​

​

​

​

​

​

​

​

​

​

​

​

D

​

​

​

​

​

1

​

​

​

​

34 of 54

Four-variable Map

  • Example

Simplify: F = A’ B’ C’ + B’ C D’ + A’ B C D’ + A B’ C’

*

33

​

​

​

C

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

B

A

​

​

​

​

​

​

​

​

​

​

​

​

D

​

​

​

​

​

1

1

​

​

35 of 54

Four-variable Map

  • Example

Simplify: F = A’ B’ C’ + B’ C D’ + A’ B C D’ + A B’ C’

*

34

​

​

​

C

​

​

​

1

1

​

1

​

​

​

​

​

​

​

1

B

A

​

​

​

​

1

1

​

1

​

​

​

​

D

​

​

​

​

36 of 54

Product of Sums Simplification

*

35

​

w x y z

F

F

0

0 0 0 0

1

0

1

0 0 0 1

1

0

2

0 0 1 0

1

0

3

0 0 1 1

0

1

4

0 1 0 0

1

0

5

0 1 0 1

1

0

6

0 1 1 0

1

0

7

0 1 1 1

0

1

8

1 0 0 0

1

0

9

1 0 0 1

1

0

10

1 0 1 0

0

1

11

1 0 1 1

0

1

12

1 1 0 0

1

0

13

1 1 0 1

1

0

14

1 1 1 0

1

0

15

1 1 1 1

0

1

​

​

​

y

​

​

​

1

1

0

1

​

​

​

​

1

1

0

1

x

w

1

1

0

1

1

1

0

0

​

​

​

​

z

​

​

​

​

​

​

​

y

​

​

​

1

1

0

1

​

​

​

​

1

1

0

1

x

w

1

1

0

1

1

1

0

0

​

​

​

​

z

​

​

​

​

37 of 54

Don’t-Care Condition

  • Example

*

36

A B C

F

0 0 0

0

0 0 1

1

0 1 0

0

0 1 1

x

1 0 0

1

1 0 1

x

1 1 0

x

1 1 1

x

F

Don’t care what value F may take

Logic�Circuit

A

B

C

38 of 54

Don’t-Care Condition

  • Example

*

37

F

​

​

​

B

​

​

​

0

1

x

0

A

1

x

x

x

​

​

C

​

​

​

A

B

C

39 of 54

Don’t-Care Condition

  • Example

*

38

​

​

​

y

​

​

​

x

1

1

x

​

​

​

​

​

x

1

​

x

w

​

​

1

​

​

​

1

​

​

​

​

​

z

​

​

​

​

F (w, x, y, z) = ∑(1, 3, 7, 11, 15)

d (w, x, y, z) = ∑(0, 2, 5)

x = 0

x = 1

​

​

​

y

​

​

​

x

​

​

x

​

​

​

​

0

x

​

0

x

w

0

0

​

0

0

0

​

0

​

​

​

​

z

​

​

​

​

x = 0

x = 1

40 of 54

Map Simplification with Don’t Cares

*

39

F=A′C′D+B+AC

0

AB

x

x

1

00

01

00

01

CD

0

x

1

0

11

10

1

x

0

1

11

10

1

1

1

x

0

AB

x

x

1

00

01

00

01

CD

0

x

1

0

11

10

1

x

0

1

11

10

1

1

1

x

F=A′B′C′D+ABC′+BC+AC

41 of 54

*

40

Karnaugh Maps

42 of 54

Universal Gates

  • One Type
    • Use as many as you need (quantity), but one type only.
  • Perform Basic Operations
    • AND, OR, and NOT
  • NAND Gate
    • NOT-AND functions
    • OR function can be obtained from AND by Demorgan’s
  • NOR Gate
    • NOT-OR functions (AND by Demorgan’s)

*

41

43 of 54

*

42

44 of 54

*

43

45 of 54

Universal Gates

  • NAND Gate
    • NOT:

​

    • AND:

​

    • OR:

*

44

DeMorgan’s

46 of 54

*

45

  • NAND Implementation

NAND & NOR Implementation

47 of 54

*

46

48 of 54

*

47

  • NAND Implementation

49 of 54

*

48

50 of 54

Universal Gates

  • NOR Gate
    • NOT:

​

    • OR:

​

    • AND:

*

49

DeMorgan’s

51 of 54

NAND & NOR Implementation

  • NOR Implementation

*

50

52 of 54

NAND & NOR Implementation

  • Two-Level Implementation

*

51

53 of 54

NAND & NOR Implementation

  • Multilevel NAND Implementation

*

52

54 of 54

NAND & NOR Implementation

  • Multilevel NOR Implementation

*

53