Functional Killers of Bool John

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

Boolean Algebra and Boolean

functions (Ch. 2 of Digital Design)


Ramanathan Subramanian,
CVIT, IIIT (Room A3-214)
Email: s.ramanathan@iiit.ac.in

Boolean Algebra- Introduction


Algebra- the science of linking parts and equating
like with like. Mathematical system for describing
relationships between variables.
For formulating mathematical arguments, start with
a set of elements (objects with common property)
set of operators (which act on these elements)
set of axioms/postulates (assumed true/unproven)

Boolean Algebra- Introduction


Binary operator B defined on S such that
B(x, y S)->z S, meaning: B operates on two elements
(x, y) in S to return another element (z) in S.
Boolean (developed by computer pioneer and
mathematician George Boole) denotes a system of
logical propositions (typically) using the set of binary
digits S = {0,1}.
Boolean operations on boolean variables will return a
boolean value!

Algebra- Postulates
Postulates for formulating algebraic arguments:
Closure: Set S is closed with respect to a binary
operator if for every pair of elements in S, binary
operator generates a unique element in S.
Example: Set of natural numbers N = {1,2,3,}. N
is closed with respect to binary operator +, but
not closed with respect to as 2-3 = -1 .

Algebra- Postulates
Binary operator (Bin op) B commutative if
xBy=yBx
Bin op B associative if (x B y) B z = x B (y B z)
(Order of operation does not matter).

Is matrix multiplication commutative?


Example where operator is commutative but not
associative: x B y = xy (x+y), where x, y

Algebra- Postulates
Bin ops B,C. B is distributive over C if
x B (y C z) = (x B y) C (x B z).
Question: Is * distributive over + and - ?
Are +/- distributive over * ?
Set S has an identity element e with respect to
binary operator B if x B e = e B x = x x S
1 and 0 are identity elements with respect to
operators * and + respectively.

Algebra- Postulates
Set S having an identity element e with respect
to bin op B has an inverse when x S, y: x B y
= e (read: for all x in S, there exists a y such that x
B y equals e).
For ordinary algebra, the following are true:
For a 0, 1/a is the multiplicative inverse
For a , -a (subtraction) represents additive
inverse.

Boolean Algebra
Mathematical system/structure defined by a
boolean set B and binary operators +,. is
defined as Boolean algebra, when following
postulates hold:
Set B is closed with respect to operators +,.
0 is the identity element for B w.r.t. + operator
1 is the identity element for B w.r.t. . operator
Structure commutative w.r.t. + and . (x+y = y+x,
x.y = y.x)

Boolean Algebra
Operator . distributive over +: x.(y+z) = x.y + x.z
Oprtr + distributive over . : x+(y.z) = (x+y). ( x+z)not true for ordinary algebra
Complement: x B, x: x+x = 1, x.x = 0 (x
read as x-bar or x-complement)
There are at least two x, y B: x y
Associativity holds for both +, .
No additive or multiplicative inverses exist.
Conversely, no complement in ordinary algebra.

Two-valued Boolean Algebra


Defined with a binary set B = {0,1} and
operators +, .
Truth tables for
Complement ( or -)
x

Two-valued Boolean Algebra


and operator x.y (n boolean variables, 2n
combinations)
x

x.y

Two-valued Boolean Algebra


or operator x+y
x

x+y

Two-valued Boolean Algebra


Nand operator

x.y

(x.y)

Two-valued Boolean Algebra


Nor operator (x+y)
x

(x+y)

(x+y)

Two-valued Boolean Algebra


Xor operator x y = xy+xy
x

xy

xy

xy

(xy)

XNor operator x y = xy+xy

Go to

Two-valued Boolean Algebra


DUALITY PRINCIPLE: Every algebraic expression
deducible from Boolean postulates/algebra
remains valid if the operators and identity
elements are interchanged.
Recap: additive (and) and multiplicative (or)
identities?
Interchange or identity 0
to and identity 1

Example: If x+0 = x, then x.1 = x.


Interchange
or to and

Boolean Algebra- Distributivity


x.(y+z) = x.y+x.z (follows from ordinary algebra)
Recall + is also distributive over . for Boolean
algebra, i.e., x+y.z = (x+y).(x+z)
x

y.z

x+y.z

x+z

x+y

(x+y). (x+z)

Two-valued Boolean AlgebraTheorems from postulates

Theorem 1: x+x = x
Dual x. x = x
Proof: x+x = (x+x).1 = (x+x).(x+x)=(x+x.x)=x+0 = x
Th 2:
x+1 = 1
Dual x.0 = 0
Proof: x+1 = x+ (x+x) = (x+x) +x = x+x = 1
Involution (x) = x
Th 3: DeMorgans theorem:
(NOR) (x+y) = x.y
(x.y)=x+y (NAND)
(HW: Prove)
Th 4: Absorption: x+x.y=x
x.(x+y)=x

Boolean functions
Act over boolean variables to return boolean
(logical) outputs. E.g., F1 = x+yz
x
0

y
0

z
0

y
1

x+y.z
0

yz

F1

Why simplify Boolean functions?


F2 = xyz+xyz+xy
= xz(y+y) = xz+xy
x
y

x
y
z

x yz

x
y

x yz

VERSUS

x
z
x

F2

xz
F2

xy
2 terms with 4 literals

z
x
y

xy
y
3 terms with 8 literals

Which is a more efficient design?

64-bit Windows- Billions and Billions of gates..

Simplifying Boolean functions


When Boolean function implemented with logic
gates, each term requires a gate, and each variable
within term is an input to a gate.
Literal- variable within a term in complemented or
original form. Aim of circuit minimization is to
reduce the number of terms or variables or both.

Boolean Simplification- Examples

x(x+y) = x.y
x+x.y = (x+x).(x+y) = x+y (Distributivity)
(x+y)(x+y) = x.x+x.y+x.y+y.y = x+x(1+y) = x
xy+xz+yz = xy+xz+xyz+xyz = xy+xz(1+y)+xyz
= xy+xz+xyz = xy(1+z)+xz = xy+xz
(x+y).(x+z).(y+z) = (x+y).(x+z) (by duality)
Complement of a function: (A+B+C) = ABC
(change . to + and complement every literal.

Function Complements
Application of Demorgans laws:
o F1 = xyz+xyz; F1= (xyz+ xyz) = (xyz).(xyz)
= (x+y+z).(x+y+z) (Equivalent to taking function
dual and complementing literals)
o F2 = x(yz+yz); F2 =(xyz+xyz)
= (x+y+z).(x+y+z) = x+xy+xz+xy+xz+yz+zy
= x+yz+yz (alternatively of the form a+b.c,
where a=x, b = (y+z) and c = (y+z)
Hw: XNOR from XOR

Canonical & Standard Forms


Canonical- Reduced to the simplest form
possible without loss of generality (dictionary).
Minterms and Maxterms: n boolean variables
combined via AND gates, give rise to 2n
minterms (standard product).
Similarly, 2n maxterms (standard sum) on
combining via OR gates.

Minterms and Maxterms


x y z

Term

Minterm
Designation

Term

Maxterm
Designation

xyz

m0

(x+y+z)

M0

xyz

m1

(x+y+z)

M1

xyz

m2

(x+y+z)

M2

xyz

m3

(x+y+z)

M3

xyz

m4

(x+y+z)

M4

xyz

m5

(x+y+z)

M5

xyz

m6

(x+y+z)

M6

xyz

m7

(x+y+z)

M7

Minterm: Bit 1 => variable in original form, 0 => variable in complemented form
Maxterm: Bit 0 => variable in original form, 1 => variable in complemented form
Minterms and Maxterms are function complements

Minterms and Maxterms


Minterm representation (Consider 1s):
x y z

F1

F2

F1=xyz+xyz+xyz

= m1+m4+m7 = (1,4,7)

F2=xyz+xyz+xyz+xyz = m3+m5+m6+m7
= (3,5,6,7)

- Summation/ORing of minterms
Equivalent

Maxterm representation (Consider 0S):


F1=(x+y+z).(x+y+z).(x+y+z).(x+y+z).(x+y+z)
= M0.M2.M3.M5.M6 = (0,2,3,5,6)

F2=(x+y+z).(x+y+z).(x+y+z).(x+y+z)
=M0.M1.M2.M4 = (0,1,2,4)

- product/ANDing of MAXterms

RECAP
Boolean algebra- postulates (Distibutivity of +
over . ) , complementarity
Two-valued Boolean algebra- gates and logic
circuits- Duality, DeMorgans laws and
Function Complements

Canonical forms, Minterms, Maxterms

You might also like