This action might not be possible to undo. Are you sure you want to continue?

# MC9211 Computer Organization

**Unit 1 : Digital Fundamentals
**

Lesson2 : Boolean Algebra and Simplification

(KSB) (MCA) (2009- 12/ODD) (2009 - 10/1 A&B)

Coverage – Lesson2

Introduces the basic postulates of Boolean Algebra and shows the correlation between Boolean expressions and their corresponding logic diagrams. All possible logic operations for two variables are investigated and from that, the most useful logic gates used in the design of digital systems are determined.

KSB-1601-07 2

**Lesson2 – Digital Logic Circuits
**

1. Basic definitions 2. Basic theorems and properties of Boolean algebra 3. Boolean Functions 4. Canonical and standard forms 5. Other logic operations 6. Digital Logic Gates

KSB-1601-07 3

1.Basic Definitions

Boolean Algebra deals with binary variables and logic operations Binary variables are represented by A, B, x, y etc

Logic Operations are AND , OR , NOT etc A Boolean function can be expressed algebraically with binary variables, the logic operation symbols, parentheses and equal sign ( ex: F = x + y’z ) For a given value of variables the function can be either 0 or 1 The relationship between a function and its binary variables can be represented in a truth table

KSB-1601-07 4

**Boolean Algebra (contd..)
**

From truth table a Boolean function can be obtained (and vice versa) A Boolean function can be transformed from an algebraic expression in to a logic diagram composed of AND, OR, NOT etc gates

KSB-1601-07

5

**Boolean Algebra (contd..)
**

Truth Table x 0 0 0 0 1 1 1 1 y 0 0 1 1 0 0 1 1 z 0 1 0 1 0 1 0 1 F 0 1 0 0 1 1 1 1

Boolean Function

F = x + y’z

Logic Diagram

x y z

KSB-1601-07

F

6

**Boolean Algebra (contd..)
**

The purpose of Boolean Algebra is to facilitate the analysis and design of digital circuits It provides a convenient tool to 1.Express in algebraic form a truth table relationship between binary variables 2.Express in algebraic form the input-output relationship of logic diagrams 3.Find simpler circuits for the same function

KSB-1601-07

7

**2.Basic Theorems of Boolean Algebra
**

1.Different letters in Boolean expressions are called variables Example: A.B’ + A’.C +A.(D+E) has 5 variables 2.Each occurrence of a variable or its complement is called a literal Example: in the above expression there are 7 literals 3.Two expressions are equivalent if one expression equals 1 only when the other equals 1, and one equals 0 only when the other equals 0 KSB-1601-07 8

**Basic Definitions (contd..)
**

4.Two expressions are complements of each other if one expression equals 1 only when the other equals 0, and vice versa The complement of a Boolean expression is obtained by changing all .’s to +’s changing all +’s to .’s changing all 1’s to 0’s changing all 0’s to 1’s and complementing each literal KSB-1601-07 9 Example: 1.A + B’C + 0 ?

**Basic Definitions (contd..)
**

5.The dual of a Boolean expression is obtained by changing all .’s to +’s changing all +’s to .’s changing all 1’s to 0’s changing all 0’s to 1’s but not complementing any literal Example: 1.A + B’C + 0 ?

KSB-1601-07

10

Postulates

1. X = 1 or else X = 0 2. AND represented by . 3. OR represented by +

X Y X.Y 1.1 = 1 1.0= 0 0.1= 0 0.0= 0

KSB-1601-07

X Y X+Y 1+1 = 1 1+0= 1 0+1= 1 0+0= 0

11

Basic Theorems

1a. 0 . X = 0 2a. 1 . X = X 3a. X X = X 4a. X X’ = 0 5a. X Y = Y X 1b. 1 + X = 1 2b. 0 + X = X 3b.X + X = X 4b. X + X’ = 1 5b. X + Y = Y + X

**6a.XYZ=X(YZ)=(XY)Z 6b.X+Y+Z= X+(Y+Z)= (X+Y)+Z DeMorgan’s Theorem 7a. (X Y . . . Z)’ = X’ + Y’ + ……+Z’ 7b. (X + Y+ ……+Z) = X’ Y’ …..Z’
**

KSB-1601-07 12

**Basic Theorems (contd..)
**

8a.XY + XZ = X(Y+Z) 8b. (X+Y)(X+Z) = X + YZ 9a. XY + XY’ = X 9b. (X+Y)(X+Y’) = X 10a. X + XY = X 10b. X(X+Y) = X 12a. X + X’Y = X + Y 12b. X (X’+Y) = XY 13a. XY + X’Z + YZ = XY + X’Z 13b. (X+Y)(X’+Z)(Y+Z) = (X+Y)(X’+Z) 14a. XY + X’Z = (X+Z)(X’+Y) 14b. (X+Y)(X’+Z) = XZ + X’Y 15.a. X(Y+Z) = XY + XZ Distributive Law 15b. X + YZ = (X+Y)(X+Z) KSB-1601-07 13

Exercise 1

1.Determine by means of a truth table the validity of DeMorgan’s theorem for three variables: (ABC)’ = A’ + B’ + C’ 2.Simplify the following expressions using Boolean algebra a) A + AB b) AB + AB’ c) A’BC + AC d) A’B + ABC’ + ABC 3.Simplify the following expressions using Boolean algebra a) AB + A(CD + CD’) b) (BC’ + A’D)(AB’ + CD’)

KSB-1601-07 14

Exercise 1 (contd..)

2c) Solution: A’BC + AC = A’BC + AC(B + B’) = A’BC + ABC + AB’C = A’BC + ABC + ABC + AB’C = BC(A’ + A) + AC(B + B’) = BC + AC = C(A + B)

KSB-1601-07

15

Exercise 1 (contd..)

4.Using DeMorgan’s theorem , show that: a) (A + B )’(A’ + B’)’ = 0 b) A + A’B + A’B’ = 1 5.Given the Boolean function F = x’y + xyz’ : a) Derive an algebraic expression for the complement F’ b) Show that F.F’ = 0 c) Show that F + F’ = 1

KSB-1601-07

16

Exercise 1 (contd..)

6.Given the Boolean function F = xy’z + x’y’z + xyz a) List the truth table of the function b) Draw the logic diagram using the original Boolean expression c) Simplify the algebraic expression using Boolean algebra d) List the truth table of the function from the simplified expression and show that it is the same as the truth table in part a) e) Draw the logic diagram from the simplified expression and compare the total number of gates with 17 the diagram of part b) KSB-1601-07

3. Boolean Functions

A Binary variable can take value of 1 or 0 A Boolean Function is an expression formed with - Binary variables - Two binary operators OR and AND - A unary operator NOT - Parentheses and - An equal (=) sign For a given value of the variables the function can be either 1 or 0 Example: F1 = xyz’

KSB-1601-07 18

**Boolean Functions (contd..)
**

Any Boolean function can be represented by a TRUTH TABLE The number of rows in the table is 2n where n is the number of binary variables in the function The 1 and 0 combinations for each row is obtained from binary numbers by counting from 0 to 2n -1 For each row of the table there is a value for the function equal to either 1 or 0

KSB-1601-07 19

**Boolean Functions (contd..)
**

Truth tables for Boolean functions F1 = XYZ’ F2 = X+Y’Z F3 = X’Y’Z F4 = XY’+X’Z Is given on the next slide

KSB-1601-07

20

**Boolean Functions (contd..)
**

X 0 0 0 0 1 1 1 1 Y 0 0 1 1 0 0 1 1 Z 0 1 0 1 0 1 0 1 F1 0 0 0 0 0 0 1

KSB-1601-07

F2 0 1 0 0 1 1 1 1

F3 0 1 0 0 0 0 0 0

F4 0 1 0 1 1 1 0 0

21

0

**Boolean Functions (contd..)
**

A Boolean Function may be transformed from algebraic expression in to a logic diagram composed of AND, OR, and NOT gates Exercise: Convert the four functions given previously in to logic gates Algebraic manipulation: The minimization of number of literals and the number of terms results in a circuit with minimum equipment

KSB-1601-07 22

**4. Canonical and Standard Forms
**

There are two canonical or standard forms by which we can express any combinational logic network: - The SUM of PRODUCTs form (SOP) - The PRODUCT of SUMs form (POS) Before studying SOP and POS we have to study MINTERM and MAXTERM

KSB-1601-07

23

MINTERM

A MINTERM of n variables is a product of the variables in which each variable appears exactly once in true or complemented form Each MINTERM is obtained from an AND term of the n variables , with each variable being - primed if the corresponding bit of the binary number is 0 and - unprimed if it is a 1 The symbol for each MINTERM is of the form mj, where j denotes the decimal equivalent of the binary number of the minterm designated 24 KSB-1601-07

MINTERM (contd..)

A MINTERM of n variables is a product of the variables in which each variable appears exactly once in true or complemented form Each MINTERM is obtained from an AND term of the n variables , with each variable being - primed if the corresponding bit of the binary number is 0 and - unprimed if it is a 1 The symbol for each MINTERM is of the form mj, where j denotes the decimal equivalent of the binary number of the minterm designated 25 KSB-1601-07

MINTERM (contd..)

X 0 0 0 0 1 1 1 1 Y 0 0 1 1 0 0 1 1 Z 0 1 0 1 0 1 0 1

KSB-1601-07

TERM X’Y’Z’ X’Y’Z X’YZ’ X’YZ XY’Z’ XY’Z XYZ’ XYZ

Designation

m0 m1 m2 m3 m4 m5 m6 m7

26

MINTERM (CONTD..)

A Boolean function may be expressed algebraically from a given truth table by - forming a minterm for each combination of the variables that produces a 1 in the function - and then taking OR of all those terms

KSB-1601-07

27

MINTERM Example

X 0 0 0 0 1 1 1 1 Y 0 0 1 1 0 0 1 1 Z 0 1 0 1 0 1 0 1 f1 0 1 0 0 1 0 0 1 f2 0 0 0 1 0 1 1 1

f1 = X’Y’Z + XY’Z’ + XYZ = m1 + m4 + m7

f f1(X,Y,Z) 2

= ∑ ( 1, 4 , 7)

f2 = X’YZ + XY’Z + XYZ’ + XYZ = m3 + m5 + m6 + m7 f2(X,Y,Z) = ∑ ( 3, 5 , 6, 7)

**Note: Any Boolean function can be expressed as a sum of MITERM s
**

KSB-1601-07 28

MINTERM (contd..)

Examples: 1.Express Boolean Function F = A+B’C in a sum of MINTERMs

KSB-1601-07

29

MAXTERM

A MAXTERM of n variables is a sum of the variables in which each variable appears exactly once in true or complemented form Each MAXTERM is obtained from an OR term of the n variables , with each variable being - unprimed if the corresponding bit of the binary number is 0 and - primed if it is a 1 The symbol for each MAXTERM is of the form Mj, where j denotes the decimal equivalent of the binary number of the maxterm designated KSB-1601-07 30

MAXTERM (contd..)

X 0 0 0 0 1 1 1 1 Y 0 0 1 1 0 0 1 1 Z 0 1 0 1 0 1 0 1

KSB-1601-07

TERM X+Y+Z X+Y+Z’ X+Y’+Z X+Y’+Z’ X’+Y+Z X’+Y+Z’ X’+Y’+Z X’+Y’+Z’

Designation

M0 M1 M2 M3 M4 M5 M6 M7

31

MAXTERM ( contd..)

A Boolean function may be expressed algebraically from a given truth table by - forming a maxterm for each combination of the variables that produces a 0 in the function - and then taking AND of all those terms

KSB-1601-07

32

MAXTERM Example

X 0 0 0 0 1 1 1 1 Y 0 0 1 1 0 0 1 1 Z 0 1 0 1 0 1 0 1 f1 0 1 0 0 1 0 0 1 f2 0 0 0 1 0 1 1 1

f1 = (X+Y+Z)( X+Y’+Z)(X+Y’+Z’) (X’+Y+Z’)(X’+Y’+Z) = M0 + M2 +M3+M5+M6 f1(X,Y,Z) = π ( 0,2,3,5,6)

f2 = ?

**Note: Any Boolean function can be expressed as a product of MAXTERM s
**

KSB-1601-07 33

MAXTERM (contd..)

Examples: 1.Express Boolean Function F = XY+X’Z in a product of of MAXTERMs

KSB-1601-07

34

**Conversion between canonical forms
**

To convert from canonical form to another - interchange the symbols ∑ and π and - list those numbers missing from the original form Example: F(X,Y,Z) = ∑ (1,3,6,7) = π ( 0,2,4,5) Standard Form : The terms that form the function may contain one, two, or any number of literals in sum of product form or product of sum form Ex: F=Y’+XY+X’YZ’ (SoP) or KSB-1601-07 35 F =X(X’+Y)(X’Y’Z) (PoS)

**5 Other Logic Operations
**

X Y F F F F F F F F F F F F F F F F

0 1 2 3 4 5 6 7 8 9 10 11 12 13

14 15

0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

KSB-1601-07

36

KSB-1601-07

37

**6. Digital Logic Gates
**

A gate is a circuit with one or more input signals but only one output signal Gates are two-state digital circuits because the input and output signals are either low (0 Volts) or high (+5 Volts) Gates are usually called logic circuits because they can be analyzed with Boolean algebra

KSB-1601-07

38

**BASIC LOGIC GATE
**

Binary Digital Input Signal . . . Gate Binary Digital Output Signal

Types of Basic Logic Gates Combinational Logic Gates Logic Gates whose output logic value depends only on the input logic values Sequential Logic Gates Logic Gates whose output logic value depends on the input values and the state (stored information) of the Gates Functions of Gates can be described by Truth Table Boolean Function Karnaugh Map There are two types of Combinational Logic Gates Basic gates – NOT , OR and AND Derived gates – NOR, NAND, XOR, XNOR

KSB-1601-07

39

**Basic Gates - AND Gate
**

Definition: An AND gate has two or more input signals but only one output signal: all inputs must be high to get a high output Truth table Three Input

Two Input A 0 0 1 1 B 0 1 0 1 x 0 0 0 1

A 0 0 0 0 1 1 1 1

B 0 0 1 1 0 0 1 1

C 0 1 0 1 0 1 0 1

x 0 0 0 0 0 0 0 1

**Algebraic Function : x = A . B Symbol
**

A B

x

KSB-1601-07

40

**Basic Gates - OR Gate
**

Definition: An OR gate has two or more input signals but only one output signal: if any input signal is high , the output signal is high Truth table Three Input

Two Input A 0 0 1 1 B 0 1 0 1 X 0 1 1 1

A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 X 0 1 1 1 1 1 1 1

**Algebraic Function : x = A + B Symbol
**

A B

x

KSB-1601-07

41

Definition:

**Basic gates – NOT or Inverter
**

Symbol

A x

An Inverter (NOT) is a gate with only one input signal and one output signal the output state is always the opposite of the input state

Truth Table

A

Algebraic Function : x = A’

x 1 0

0 1

KSB-1601-07

42

**Basic gates – Buffer
**

Definition:

A Buffer is gate with only one input signal and one output signal the output state is always the same as the input state the circuit is used only for power amplification

Symbol

A x

Truth Table

A 0

x 0 1

Algebraic Function : x = A

1

KSB-1601-07

43

Exercise 1

1. The following register has an output of 100101. Show how to complement each bit.

1 0 0 6-Bit Register 1 0 1

**2.Show the truth table of a 4-input OR gate
**

KSB-1601-07 44

3.What are the values of Y3 Y2 Y1 Y0 when each of the switches is pressed ?

KSB-1601-07

45

4. What does the following circuit do?

Y5

Y4

Y3

Y2

Y1

Y0

KSB-1601-07

46

5.Write down the truth table for the following circuit

KSB-1601-07

47

6. BCD Decoder: For each of the combinations of ABCD which output line is high

KSB-1601-07

48

**Derived Gates - NOR Gate
**

Definition: A NOR gate has two or more input signals but only

one output signal: all input signals must be low to get a high output

Truth table

Two Input A 0 0 1 1 B 0 1 0 1 X 1 0 0 0

A 0 0 0 0 1 1 1 1

Three Input B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 X 1 0 0 0 0 0 0 0

**Algebraic Function : x = (A + B)’=A’.B’ Symbol
**

A B

x

KSB-1601-07

49

**NOR Gate Application
**

Control = 0 A 0 1 x 1 0 A

x

Control = 1 A 0 1 x 0 0

Control

Observations: 1.When Control is 0, the output is the complement of input 2.When Control is 1, the output is always 0

KSB-1601-07

50

**Derived Gates - NAND Gate
**

Definition: A NAND gate has two or more input signals but only one output signal: all input signals must be high to get a low output Truth table

Two Input A 0 0 1 1 B 0 1 0 1 X 1 1 1 0

A 0 0 0 0 1 1 1 1 Three Input B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 X 1 1 1 1 1 1 1 0

**Algebraic Function : Symbol
**

A B

x = (A . B)’=A’+B’

x

KSB-1601-07 51

**NAND Gate Application
**

A x Control = 1 A 0 1 x 1 0

Control = 0 A 0 1 x 1 1

Control

Observations: 1.When Control is 0, the output is always 1 2.When Control is 1, the output is the complement of input

KSB-1601-07

52

**Derived Gates – XOR (Exclusive OR) Gate
**

Definition: An XOR gate has two or more input signals but only one output signal: it recognizes words that have odd number of 1’s Truth table

Three Input B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1

Two Input A 0 0 1 1 B 0 1 0 1 X 0 1 1 0

A 0 0 0 0 1 1 1 1

X 0 1 1 0 1 0 0 1

**Algebraic Function : x = A Symbol
**

A B

+

B = AB’+A’B

53

x

KSB-1601-07

**XOR Gate Application
**

A INVERT INVERT = 0 A 0 1 x 0 1 INVERT = 1 A 0 1 x 1 0

x

Observations: 1.When INVERT is 0, the output is same as input 2.When Control is 1, the output is the complement of input

KSB-1601-07

54

**XOR Application (contd..)
**

Odd Parity Generator

KSB-1601-07

55

**XOR Application (contd..)
**

INVERTER

KSB-1601-07

56

**Derived Gates - XNOR (Exclusive NOR) Gate
**

Definition: An XNOR gate has two or more input signals but only one output signal: it recognizes words that have even number of 1’s (also number with all 0’s) Truth table

Two Input A 0 0 1 1 B 0 1 0 1 X 1 0 0 1

Three Input A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 X 1 0 0 1 0 1 1 0

**Algebraic Function X = (A ⊕ B)’ Symbol
**

A B

x

KSB-1601-07

57

**Digital Logic Gates - Summary
**

Name AND OR NOT Buffer NAND NOR XOR

A B A B A A A B A B A B A B

Symbol

X

Function

X=A•B or X = AB

Truth Table

A 0 0 1 1 A 0 0 1 1 B 0 1 0 1 B 0 1 0 1 X 0 0 0 1 X 0 1 1 1 X 1 0 X 0 1 X 1 1 1 0 X 1 0 0 0 X 0 1 1 0 X 1 0 0 1

X

X=A+B

X X

X=A X=A A 0 0 1 1 A 0 0 1 1 A 0 0 1 1 A 0 0 1 1

X

X = (AB)’

X

X = (A + B)’ X=A⊕B or X = A’B + AB’ X = (A ⊕ B)’ or X = A’B’+ AB

Exclusive OR

X

Exclusive NOR or Equivalence

XNOR

X

A 0 1 A 0 1 B 0 1 0 1 B 0 1 0 1 B 0 1 0 1 B 0 1 0 1

KSB-1601-07

58