nonlinear & neural networks lab. chapter 2 boolean algebra 2.1introduction 2.2 basic operation...

24
Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1 Introduction 2.2 Basic Operation 2.3 Boolean Expression and Truth Table 2.4 Basic Theorem 2.5 Commutative, Associative and Distributiv e Laws 2.6 Simplification Theorem 2.7 Multiplying Out and Factoring 2.8 DeMorgan’s Laws

Upload: annabella-quinn

Post on 26-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

CHAPTER 2

Boolean Algebra

2.1 Introduction2.2 Basic Operation2.3 Boolean Expression and Truth Table2.4 Basic Theorem2.5 Commutative, Associative and Distributive Laws2.6 Simplification Theorem2.7 Multiplying Out and Factoring2.8 DeMorgan’s Laws

Page 2: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

Objectives

Topics introduced in this chapter:

• Understand the basic operations and laws of Boolean algebra

• Relate these operations and laws to AND, OR, NOT gates and switches

• Prove these laws using a truth table

• Manipulation of algebraic expression using

- Multiplying out

- Factoring

- Simplifying

- Finding the complement of an expression

Page 3: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

2.1 Introduction

• Basic mathematics for logic design: Boolean algebra

• Restrict to switching circuits( Two state values 0, 1) – Switching algebra

• Boolean Variable : X, Y, … can only have two state values (0, 1)

- representing True(1) False (0)

Page 4: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

2.2 Basic Operations

1X if 0X' and 0X if 1X'

01' and 1'0

NOT(Inverter)

Gate Symbol

Page 5: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

2.2 Basic Operations

A B C = A · B

0 0

0 1

1 0

1 1

0

0

0

1

111 001 010 000

AND

Truth Table

Gate Symbol

Page 6: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

2.2 Basic Operations

A B C = A + B

0 0

0 1

1 0

1 1

0

1

1

1

111 101 110 000 OR

Truth Table

Gate Symbol

Page 7: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

2.2 Basic Operations

BAT

Apply to Switch

AND

OR BAT

Page 8: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

2.3 Boolean Expressions and Truth Tables

BEDCA )]'([Logic Expression :

Circuit of logic gates :

Page 9: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

2.3 Boolean Expressions and Truth Tables

0000)]'1(1[01)]01(1[)]'([ BEDCA

'''''' cbbcabacab

BEDCA )]'([Logic Expression :

Circuit of logic gates :

Logic Evaluation : A=B=C=1, D=E=0

Literal : a variable or its complement in a logic expression

10 literals

Page 10: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

2.3 Boolean Expressions and Truth Tables

2-Input Circuit and Truth Table

A B A’ F = A’ + B

0 0

0 1

1 0

1 1

1

1

0

0

1

1

0

1

Page 11: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

n variable needs rows

2.3 Boolean Expressions and Truth Tables

n

CBCACAB

2222

)')(('

n times

A B C B’ AB’ AB’ + C A + C B’ + C (A + C) (B’ + C)

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

1

1

0

0

1

1

0

0

0

0

0

0

1

1

0

0

0

1

0

1

1

1

0

1

0

1

0

1

1

1

1

1

1

1

0

1

1

1

0

1

0

1

0

1

1

1

0

1

TABLE 2.1

Proof using Truth Table

Page 12: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

2.4 Basic Theorems

0' 1'

)''(

00 11

1 0

XXXX

XX

XXXXXX

XX

XXXX

101'11 ,1 if and ,10'00 ,0 XX

11)'( EDAB

0)'')('( DABDAB

Idempotent Laws

Involution Laws

Complementary Laws

Operations with 0, 1

Proof

Example

Page 13: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

AA

=

=

2.4 Basic Theorems with Switch Circuits

Page 14: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

=

(A+1=1)

=A’

(A+A’=1)

2.4 Basic Theorems with Switch Circuits

=(A A’=0)

Page 15: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

2.5 Commutative, Associative, and Distributive Laws

XYYXYXXY

ZYXZYXZYX

XYZYZXZXY

)()(

)()(

Commutative Laws:

Associative Laws:

X Y Z XY YZ (XY)Z X(YZ)

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

0 0

0 0

0 0

0 1

0 0

0 0

1 0

1 1

0 0

0 0

0 0

0 0

0 0

0 0

0 0

1 1

Proof of Associate Law for AND

Page 16: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

C

(AB)C=ABC

=AB

C

Associative Laws for AND and OR

A

BC

=

A

C

B +

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

Page 17: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

1 iff 1 ZYXXYZ

XZXYZYX )(

YZXYZXYZYZX

YZXYXZXYZXYXZX

YZYXXZXXZXYZXXZXYX

1)1(

1

)()())((

0 iff 0 ZYXZYX

))(( ZXYXYZX

2.5 Commutative, Associative, and Distributive Laws

AND

OR

Distributive Laws:

Valid only Boolean algebra not for ordinary algebra

Proof

Page 18: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

2.6 Simplification Theorems

XYXYYYXYXYY 1)()')(('XXYXXYXXYXX )(

XXYXXYXXYX 1)1(1

YXYXYXYYYX

XYXXXXYX

XYXYXXXYXY

' )'(

)(

)')(( 'Useful Theorems for Simplification

Proof

Y

X

Y

XY’

Proof with Switch

Page 19: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

Equivalent Gate Circuits

A

A

B F

ABBAAF )'(

===

2.6 Simplification Theorems

Page 20: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

2.7 Multiplying Out and Factoring

EFCDBA )(

EDCBA '' HDEFGABC '

EACECDAB '''

To obtain a sum-of-product form Multiplying out using distributive laws

Sum of product form:

Still considered to be in sum of product form:

Not in Sum of product form:

BCEBCDA

BCEBCDBCEDA

BCEBCDABCAEADAEDABCA

)1(

))((

Multiplying out and eliminating redundant terms

Page 21: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

)'('

))((

EDCAB

FEDCBA

)'')('('( ECAEDCBA

To obtain a product of sum form all sums are the sum of single variable

Product of sum form:

Still considered to be in product of sum form:

2.7 Multiplying Out and Factoring

Page 22: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

CD’E

+

AC'

E’

C

E

D' +

A

E’

C’ +

A

B’

D’

EAB’C

D’

E

AB’C

Circuits for SOP and POS form

Sum of product form:

Product of sum form:

Page 23: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

2.8 DeMorgan’s Laws

'''')'()'( 321321321 XXXXXXXXX

'...''')'...(

''...'')'...(

321321

321321

nn

nn

XXXXXXXX

XXXXXXXX

'')'(

'')'(

YXXY

YXYX

X Y X’ Y’ X + Y ( X + Y )’ X’ Y’ XY ( XY )’ X’ + Y’

0 0

0 1

1 0

1 1

1 1

1 0

0 1

0 0

0

1

1

1

1

0

0

0

1

0

0

0

0

0

0

1

1

1

1

0

1

1

1

0

DeMorgan’s Laws

Proof

DeMorgan’s Laws for n variables

Example

Page 24: Nonlinear & Neural Networks LAB. CHAPTER 2 Boolean Algebra 2.1Introduction 2.2 Basic Operation 2.3Boolean Expression and Truth Table 2.4Basic Theorem 2.5Commutative,

Nonlinear & Neural Networks LAB.

A B A’ B A B’ F = A’B+AB’ A’ B’ A B F’ = A’B’ + AB

0 0

0 1

1 0

1 1

0

1

0

0

0

0

1

0

0

1

1

0

1

0

0

0

0

0

0

1

1

0

0

1

CBACABCBACABCAB D )'()'( so ,')'(')''()''(

......)( ......)( XYZZYXZYXXYZ DD

ABBABBABABAA

BABAABBAABBAF

''''''

)')('()''()''()'''(' Inverse of A’B=AB’

2.8 DeMorgan’s Laws

Dual: ‘dual’ is formed by replacing AND with OR, OR with AND, 0 with 1, 1 with 0