# lect04 number system, gates, boolean algebra cs221

21
Lect 04 Number System, Gates, Boolean Algebra Algebra CS221: Digital Design Dr. A. Sahu Dept of Comp. Sc. & Engg. Dept of Comp. Sc. & Engg. Indian Institute of Technology Guwahati 1

Post on 09-Feb-2022

11 views

Category:

## Documents

TRANSCRIPT

Lect 04Number System, Gates, Boolean

AlgebraAlgebra

CS221: Digital Design

Dr. A. SahuDept of Comp. Sc. & Engg.Dept of Comp. Sc. & Engg.

Indian Institute of Technology Guwahati

1

Outline• Gates in Digital System

Basic Gates (AND OR & NOT)– Basic Gates  (AND, OR  &  NOT)– Universal  Gates (NAND & NOR)Others : XOR XNOR– Others : XOR, XNOR

• Boolean Algebra–Axioms

B l F ti• Boolean Functions

2

Boolean AlgebraBoolean Algebra

How to prove 2+2=5?

29 9 9 92 2 4 ( 4 )2 2 2 2

+ = − + = − +

We know 2+2=4

2

2 2 2 29 9 91 6 2 . 4 . ( )2 2 2

= − + +

2 2

2 2 29 9 9 92 0 ( ) 2 5 4 5 ( )2 2 2 2

= − + + = − + +

2 2 2

2 2 2 29 9 9 9 95 2 . 4 . ( ) ( 5 )2 2 2 2 2

= − + + = − +2 2 2 2 2

9 95 52 2

= − + = Where is the mistake?4√x2=x  is true only when x≥0

Boolean Algebra• Computer hardware using binary circuit

greatly simply designg y p y g• George Boole (1813-1864): developed a

th ti l t t i 1847mathematical structure in 1847– To deal with binary operations with just two

values • Binary circuits: To have a conceptual y p

framework to manipulate the circuits algebraicallyalgebraically– Claude Shannon : 1937, Master Thesis

Basic Gates in Binary CircuitBasic Gates in Binary Circuit• Element 0 : “FALSE”. Element 1 : “TRUE”.• ‘+’ operation “OR”,‘*’ operation “AND” and ’

operation “NOT”.

OROR 00 11 ANDAND 00 11 NOTNOT

00 00 11 00 00 00 00 11

6

11 11 11 11 00 11 11 00

OR GateOR Gate• ‘+’ operation “OR”

X Y R=X OR YR= X + YR  X + Y

0 0 0X

Y

R=X+Y

OROR 00 11

0 1 1

1 0 1OROR 00 1100 00 11 1 1 1

7

11 11 11 1 + Y = 1

AND GateAND Gate• ‘*’ operation “AND”

X Y R=X AND YR= X * Y

0 0 0

0 1 0

X

Y

R=X*Y

0 1 0

1 0 0ANDAND 00 111 1 100 00 00

8

11 00 11 0 * Y = 0

NOT GateNOT Gate• ‘ operation “NOT” or use BAR• R= X R=X’

R= NOT XX R  NOT X0 1X

R=X’

1 0

9

Boolean Algebra Defined

• Boolean Algebra B : 5-tuple

{B + * ’ 0 1}{B, +, *, ’, 0, 1}• + and * are bi operators• + and * are binary operators,

• ‘ is a unary operator• is a unary operator.

Boolean Algebra Defined• Axiom #1: Closure

If a and b are BooleanIf a and b are Boolean

(a + b) and (a * b) are Boolean.( ) ( )• Axiom #2: Cardinality/Inverse

if a is Boolean then a’ is Boolean

• Axiom #3: CommutativeAxiom #3: Commutative(a + b) = (b + a)(a * b) = (b * a)

Boolean Algebra DefinedA i #4 A i i If d b B l•Axiom #4: Associative : If a and b are Boolean

(a + b) + c = a + (b + c)( ) ( )(a * b) * c = a * (b * c)

•Axiom #6: Distributive a * (b + c) = (a * b) + (a * c)a + (b * c) = (a + b) * (a + c)a + (b c) = (a + b) (a + c)2nd one is Not True for Decimal numbers System5+(2*3)   ≠ (5+2)*(5+3)11 ≠   56

Boolean Algebra DefinedBoolean Algebra Defined

•Axiom #5: Identity Element :•Axiom #5: Identity Element : • B has identity to + and *

00 is identity element for + : a + 0 = a 1 is identity element for * : a * 1 = a1 is identity element for : a 1 a

•Axiom #7: Complement ElementAxiom #7: Complement Elementa + a' = 1a * a' = 0

Terminology• Juxtaposition implies *

operation:operation:ab = a * b

• Operator order of precedence is: ( ) ’ *( ) > ’ > * > +

+b +(b* ) ≠ ( +b)*a+bc = a+(b*c) ≠ (a+b)*cab’ = a(b’) ≠ (a*b)’ab a(b ) ≠ (a b)

Named TheoremsIdempotentIdempotent a + a = aa + a = a a * a = aa * a = aB d dB d d + 1 1+ 1 1 * 0 0* 0 0BoundednessBoundedness a + 1 = 1a + 1 = 1 a * 0 = 0a * 0 = 0AbsorptionAbsorption a + (a*b) = a a*(a+b) = a( ) ( )AssociativeAssociative ((a+ba+b)+c=)+c=

((bb ))(a*b)*c=(a*b)*c=*(b* )*(b* )a+(a+(b+cb+c)) a*(b*c)a*(b*c)

InvolutionInvolution (a’)’ = a(a’)’ = aInvolutionInvolution (a )  = a(a )  = a

DeMorgan’sDeMorgan’s (a+b)’ = a’ * b’(a+b)’ = a’ * b’ (a*b)’=a’ + b’(a*b)’=a’ + b’DeMorgan sDeMorgan s (a+b)    a    b(a+b)    a    b (a b) a  + b(a b) a  + b

Simplification Theorem • Uniting : XY XY' XXY + XY' = X X(Y+Y’)=X.1=X

(X + Y)(X + Y') = X   XX+XY’+YX+YY’=X+X(Y+Y’)+0=X( )( )

• Absorption:  X + XY = X        X(1+Y)=X.1=X

X(X + Y) = X XX+XY X+XY XX(X + Y) = X XX+XY=X+XY=X

• Adsorptionp(X + Y')Y = XY,  XY' + Y = X + Y  XY+YY’=XY+0=XY

16

Principle of Duality• Dual of a statement S is obtained

B i h i * d

Principle of Duality

• By interchanging * and + • By interchanging 0  and 1

• Dual of (a*1)*(0+a’) = 0 is (a+0)+(1*a’) = 1

Duality examplesDuality examples• x + 0 = x               x.1=x• z + x’=1 x.x’=0

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

18

Consensus TheoremConsensus Theorem• XY + X'Z + YZ = XY + X'ZXY + X Z + YZ   XY + X Z

XY + X'Z + YZ     = xy + x'z + (x + x')yz xy + x z + (x + x )yz= xy + x'z + xyz + x'yz= xy + xyz + x'z + x'yz xy  xyz   x z  x yz= xy(1 + z) + x'z(1 + y)= xy + x'zy

Consensus  (collective opinion) of X.Y and X'.Z is Y.Z • (X + Y)(X' + Z)(Y + Z) = (X + Y)(X' + Z)(X   Y)(X    Z)(Y   Z)   (X   Y)(X    Z)

19

Shannon ExpansionShannon Expansion• F(A B)= A’ F(0 B) + A F(1 B)• F(A,B)= A  . F(0,B) + A. F(1,B)Example:     pF(A,B) = A’.B+A.B’

=A’.(1.B+0.B’)+A.(0.B+1B’)=A’B+AB’=A B+AB

20

Shannon ExpansionShannon Expansion• F(X, Y, Z)= X . F(1,Y,Z) + X’. F(0, Y, Z)Example:     XY+X’Z+YZ

=X. ( 1.Y+0.Z+YZ) + X’ ( 0.Y+1.Z+YZ)=X (Y+YZ)+X’(Z+YZ)X.(Y+YZ)+X (Z+YZ)=XY+XYZ+X’Z+X’YZXY+XYZ+X’Z+X’YZ+XYZ=XY+XYZ+X’Z+X’YZ+XYZ= XY(1+Z)+X’Z+YZ(X’+X)=XY+X’Z+YZ

21