0% found this document useful (0 votes)
117 views7 pages

Note 5 PDF

The document discusses normal forms and converting logical expressions into conjunctive normal form (CNF). It defines CNF as a conjunction of disjunctions of literals. An algorithm is provided to convert expressions into CNF by eliminating equivalences and conditionals, reducing the scope of negations, and converting the expression into a conjunctive of disjunctions. Examples are given of converting expressions to CNF and of CNF being used in the design of computer components like logic gates.

Uploaded by

Prodipto Orcho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
117 views7 pages

Note 5 PDF

The document discusses normal forms and converting logical expressions into conjunctive normal form (CNF). It defines CNF as a conjunction of disjunctions of literals. An algorithm is provided to convert expressions into CNF by eliminating equivalences and conditionals, reducing the scope of negations, and converting the expression into a conjunctive of disjunctions. Examples are given of converting expressions to CNF and of CNF being used in the design of computer components like logic gates.

Uploaded by

Prodipto Orcho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Normal Forms

A proposition is a literal if it is of the form P or ¬P, where P is a propositional variable. P and ¬P


are called complementary literals.

A logical expression is in Conjunctive Normal Form if it is written as a conjunction of


disjunction of literals, such as (¬P ⋁ Q) ⋀ (Q⋁R⋁S)⋀(¬R⋁P)

Later when we discuss the resolution inference we have to convert logic expressions into the
Conjunctive Normal Forms.

Algorithm to convert a propositional expression to its Conjunctive Normal form:

1. Eliminate equivalence ≡, e.g., instead of P≡Q use (P⋀Q) ⋁ (¬P⋀¬Q )

2. Eliminate conditionals →, use the equivalence

P → Q ≡ ¬P ⋁ Q

3. Eliminate negations or reduce the scope of negation to one atom.

e.g., ¬¬P=P

¬(P ⋁ Q) = ¬P ⋀ ¬Q

¬(P ⋀Q) = ¬P ⋁ ¬Q

4. Convert it to conjunctive normal form, which is a conjunctive of disjunctions.

For example:

Convert (¬(P → Q) ⋀ R) to conjunctive normal form.

(¬(P → Q) ⋀ R) = ¬(¬P ⋁ Q) ⋀ R = P⋀¬Q⋀ R

Another normal form of a logical expression is Disjunctive Normal Form. It is a disjunction of


conjunctions of literals.

e.g., (P⋀ ¬Q)⋁ (Q⋀R) ⋁ (𝑃⋀ S)

Both of Conjunctive Normal Forms and Disjunctive Normal Forms are used for design of
computer components.

COMP 1002 Class Notes #5, Edited by John Shieh, Fall of 2018 Page 1
Apply Propositional Calculus for Design of Computer Components.

A gate is an electronic device with one or more inputs, each of which can assumeeitherthe value
0 or 1. A gate usually has one output, which is a function of its inputs, and which is also either 0
or 1.Logic and bit operations
Computers represent information by bits.

A bit has two possible values, namely zero and one. This meaning of the word comes from
binary digit, since zeroes and ones are the digits used in binary representations of numbers

We can extend bit operations to bit strings. We define bitwise OR, bitwise AND and bitwise
XOR of two strings of the same length to be the strings that have as theirbits the OR, AND and
XOR of the corresponding bits in the two strings.

Example:Find the bitwise OR, bitwise AND and bitwise XOR of the
bit strings
01101 10110
11000 11101
Logic

The bitwise OR is 11101 11111


The bitwise AND is 01000 10100
The bitwise XOR is 10101 01011

The operation of a circuit is defined by a Booleanfunction that specifies the value of an output
for eachset of inputs.

The first step in constructing a circuit is to represent itsBoolean function by an expression built
up using thebasic operations of Boolean algebra.

The expression that we obtain may contain many moreoperations than are necessary to represent
the function.

We will describe later methods for finding an expressionwith the minimum number of sums and
products thatrepresents a Boolean function.

The procedures that we will develop are important in thedesign of efficient circuits.
Logic in Computer Science: Logic Gates CS2209, App

Boolean algebra provides the operations and the rulesfor working with the set {0, 1}.
The three most used operations in Boolean algebra arecomplementation, the Boolean sum and
the Booleanproduct. They correspond to the logical connectives ¬,⋁and ⋀.
The complement of an element, denoted by bar, isdefined by 0̅ = 1 and 1̅ = 0.
The Boolean sum, denoted by + or OR has thefollowing values
1 + 1 = 1; 1 + 0 = 1; 0 + 1 = 1; 0 + 0 = 0:
The Boolean product, denoted by ·or by AND, has thefollowing values:
1 ·1 = 1; 1 · 0 = 0; 0 · 1 = 0; 0 · 0 = 0: lied

COMP 1002 Class Notes #5, Edited by John Shieh, Fall of 2018 Page 2
Let B = {0, 1}. The variable x is called a Booleanvariable if it assumes only values from B.
A function from
Bn= {(x1; x2; ..;xi, ..;xn)| xi ϵ B; 1 <= i <= n}
to B is called a Boolean function of degree n. L

The NAND operator is defined by 1|1 = 0 and


1|0 = 0|1 = 0|0 = 1.
The NOR operator is defined by
1 ↓ 1 = 1 ↓ 0 = 0 ↓ 1 = 0 and 0 ↓ 0 = 1.

We will define several types of gates. Using these gateswe will apply the rules of Boolean
algebra to designcircuits that perform a variety of tasks.

The inverter accepts a Boolean value as input andproduces the complement of this value as its
output.

The second type gate is the OR gate.The inputs to this gate are the values of two or more
Boolean variables.

The third type of gate is the AND gate.The inputs to this gate are the values of two or more
Boolean variables.

COMP 1002 Class Notes #5, Edited by John Shieh, Fall of 2018 Page 3
We will permit multiple inputs to AND and OR gates, as below.

The circuits that we study give output that depends onlyon the inputs, and not the current state of
the circuit.
In other words, these circuits have no memory abilities.Such circuits are called combinatorial
circuits.

Combinatorial circuits can be constructed using acombination of inverters, OR gates and AND
gates.

When combinations of circuits are formed, some gatesmay share inputs. This is shown in one of
two ways indepictions of circuits.Both drawings below depict the circuit with output xy + x̅y.

Logic

COMP 1002 Class Notes #5, Edited by John Shieh, Fall of 2018 Page 4
Example 1: Construct the circuits that produce thefollowing outputs:
(a) (x + y)x̅
(b) x̅ (y+z̅)̅
(c) (x + y + z)(x̅ y̅ z̅ )

Example 2.A committee of three individuals decides issues for anorganization. Each individual
votes either yes or no for each proposalthat arises. A proposal is passed if it receives at least two
yes votes.Design a circuit that determines whether a proposal passes.

Solution:Let x = 1 if the first individual says yes and x = 0 ifthis individual says no. Similarly
for y and z.Then a circuit must be designed that produces output 1 from theinputs x; y; z when
two or more of x; y; z are 1.One representation of the Boolean function that has these output
values is xy + xz + yz.

COMP 1002 Class Notes #5, Edited by John Shieh, Fall of 2018 Page 5
Logic

Example 3.Sometimes light fixtures are controlled by more than oneswitch. Circuits need to be
designed so that flipping any one of theswitches for the fixture turns the light on when it is off
and turns thelight off when it is on. Design circuits that accomplish this whenthere are two
switches and when there are three switches.

Solution:
The two-switch case.
Let x = 1 when the first switch is closed and 0 when it is open, and
let y = 1 when the second switch is closed and 0 when it is open.

Let F(x, y) = 1 when the light is on and F(x, y) = 0 when the lightis off.
We can arbitrarily decide that the light will be on when both switchesare closed, so that F(1, 1) =
1.
This determines all the other values of F(x, y).
When one of the two switches is opened, the light goes off, so F(0, 1) = F(1, 0) = 0. When the
other switch is opened the lightgoes on, so that F(0, 0) = 1.
We see that F(x, y) = xy + x̅ y̅.

Example 4:The three-switch case.


In this case we have three variables, x, y, z that take value 1 (switchclosed) or 0 (switch open).
Let F(x, y, z) = 1 when the light is on and 0 when it is off.
We can arbitrarily specify that the light be on when all three switchesare closed, so that F(1, 1, 1)
= 1.
This determines all the other values of F.The function F can be represented as
xyz + xy̅ z̅ + x̅yz̅ + x̅ y̅ z:

COMP 1002 Class Notes #5, Edited by John Shieh, Fall of 2018 Page 6
COMP 1002 Class Notes #5, Edited by John Shieh, Fall of 2018 Page 7

You might also like