1 views

Original Title: DS Q_A

Uploaded by madhunath

- DFA & NFA
- Automata Theory Tutorial
- Chapter 2 (Part a) Finite Automata
- Cs2303 Theory of Computation 2marks
- Kmaps
- Lexical Analysis
- csci3255 HW 3
- Stanford
- MELJUN CORTES Automata Lecture Intro to Finite Automata 2
- Free Video Lectures for MCA
- Computer Science
- Module 3
- On duty China
- Formal Languages and Chomsky Hierarchy
- CS2303 2 Marks
- Induction Proof Onfor Kth Symbol
- PL_Review
- Boolean Algebra
- 10.1.1.37.307
- ECE 551 Homework #1

You are on page 1of 59

applications.

Ans:

In deterministic finite automata, there's exactly one state transition for every input symbol-

state pair. There are also no epsilon transitions, meaning that you're not allowed to change

states without consuming anything from the input.

In non-deterministic finite automata, there can be 0 or more state transitions for every input-

state pair. You can also have epsilon transitions. When there's no state transition for a given

input-state pair, then we say that the automata had crashed, meaning that it can't proceed

processing the input, and therefore it doesn't accept the input. When there's more than one

choice for a state transition for a given input-state pair, then the machine can just follow all

possible paths (think of it as parallel computation), if one of the paths ends up in an accept

state, then we say that the automata accepted the input string.

Both automata are equivalent in terms of power though. It may seem that a non-deterministic

automata is more powerful, but both automata are proven to be equivalent, meaning that they

recognize the same class of languages called regular languages. The proof of equivalence is by

construction in which you show that given a DFA, you can construct an equivalent NFA, and

vice versa. The proof can be found in any textbook on theory of computation.

***********************************

In general, which you probably know, a finite automaton has a set of states, starts in a start

state, and reads an input string character-by-character, each character making it switch states

depending on which character it read and which state it was previously in (state-character

pair); this is called the transition function or transition relation. Some states may also have

ε-transitions, which are states the machine can go to without reading any character. A certain

set of states are designated accept states; whether the finite automaton accepts or rejects

depends on whether it's in an accept state or reject state after reading the entire string. The

description I just gave was, intentionally, vague enough to apply to both deterministic and

nondeterministic finite automata, which I'll refer to as DFAs and NFAs, respectively, from

here on.

including 0, 1, 2, or more, possible states that the NFA can transition to for each state-

character pair. How it decides which one to take is neither defined nor relevant to the abstract

concept, but you can pretend that it chooses uniformly at random. This can produce many

different computation paths for the same input string; and we say that an NFA accepts a

string if at least one of those paths ends in an accept state.

In some sense, we can just say a deterministic finite automaton is one that isn't

nondeterministic - where the transition function specifies only one future state for each state-

character pair, and thus there is only one computation path on any given input string. If it

ends in a designated accept state, the machine accepts. So the key difference is whether the

computation path is determined by the input string, or if there's some additional

nondeterminism involved. But there's another difference, and it has to do with size.

Obviously, any DFA can be made into an "NFA with no nondeterminism", so any language

accepted by a DFA can be accepted by an NFA. Given an NFA, at any point in the string we

can look at all the computation paths up to this point, and the set of states that at least one

computation path is in; and these sets of states can be considered the states of a DFA, since

this transition is deterministic. (If it's not obvious from this explanation, think about it a

bit.) So the languages recognized by DFAs and those recognized by NFAs are

identical. However, if you take an NFA with n states and make a DFA out of it using this

method, that DFA will have 2^n states, and there are some languages where you can't actually

get more efficient than that. It's also proven that the languages that can be described by

regular expressions are the same set as those that can be recognized by DFAs or NFAs, but

given a regular expression of length n, the smallest NFA has O(n) states, while the smallest

DFA in general has O(2^n) states.

Q. Define phrase structure grammar. State and explain different types of phrase structure grammar. How

can you tie up the concept of grammar, languages and FSA together? Give details with examples.

Ans:

productions P. The set V − T is denoted by N. Elements of N are called nonterminal

symbols. Every production in P must contain at least one nonterminal on its left side.

Where V = {a, b, A, B, S},

T = {a, b},

S is the start symbol, and

P = {S → ABa, A → BB, B → ab, AB → b}.

G is an example of a phrase-structure grammar.

that are allowed. The different types of languages defined in this scheme correspond

to the classes of languages that can be recognized using different models of

computing machines.

A type 1 grammar can have productions of the form w1 → w2, where w1 = lAr and

w2 = lwr, where A is a nonterminal symbol, l and r are strings of zero or more

terminal or nonterminal symbols, and w is a nonempty

string of terminal or nonterminal symbols. It can also have the production S → λ as

long as S does not appear on the right-hand side of any other production.

A type 2 grammar can have productions only of the form w1 → w2, where w1 is a

single symbol that is not a terminal symbol.

A type 3 grammar can have productions only of the form w1 → w2 with w1 = A

and either w2 = aB or w2 = a, where A and B are nonterminal symbols and a is a

terminal symbol, or with w1 = S and w2 = λ.

that is the left side of a production can be replaced in a string whenever it occurs, no

matter what else is in the string. A language generated by a type 2 grammar is called

a context-free language.

When there is a production of the form lw1r → lw2r (but not of the form w1 →

w2), the grammar is called type 1 or context-sensitive because w1 can be replaced

by w2 only when it is surrounded by the strings l and r. A language generated by a

type 1 grammar is called a context-sensitive language.

regular grammar is called regular language.

Here, we define some terms that are used when studying the recognition by finite-

state automata of certain sets of strings.

DEFINITION

A string x is said to be recognized or accepted by the machine M = (S, I, f, s0, F) if

it takes the initial state s0 to a final state, that is, f (s0, x) is a state in F. The

language recognized or accepted by the machine M, denoted by L (M), is the set of

all strings that are recognized by M. Two finite-state automata are called equivalent

if they recognize the same language.

EXAMPLE:

Determine the languages recognized by the finite-state automata M1, M2, and M3 in

Figure 1.

FIGURE 1 Some Finite-State Automata.

Solution: The only final state of M1 is s0. The strings that take s0 to itself are those

consisting of zero or more consecutive 1s. Hence, L (M1) = {1n | n = 0, 1, 2, . . . }.

The only final state of M2 is s2. The only strings that take s0 to s2 are 1 and 01. Hence,

L (M2) = {1, 01}.

The final states of M3 are s0 and s3.The only strings that take s0 to itself are λ, 0, 00,

000, . . . , that is, any string of zero or more consecutive 0s. The only strings that

take s0 to s3 are a string of zero or more consecutive 0s, followed by 10, followed by

any string. Hence, L (M3) = {0n, 0n10x | n = 0, 1, 2, . . . , and x is any string}.

Q. a). Construct a phrase structure grammar that generates all signed decimal

numbers, consisting of a sign, either+ or - ; a nonnegative integer; and a decimal

fraction that is either the empty string or a decimal point followed by a positive

integer, where initial zeros in an integer are allowed.

b). Give the BNF form of this grammar.

Ans:

b). Give the BNF form of this grammar.

Ans:

Q. Identify the difference between FSM and FSA. Describe their functional

workings, characteristics and applications.

Ans:

plural: automata), or simply a state machine, is a mathematical model of

computation used to design both computer programs and sequential

logic circuits. It is conceived as an abstract machine that can be in one of a

finite number of states. The machine is in only one state at a time; the state

it is in at any given time is called the current state. It can change from one

state to another when initiated by a triggering event or condition; this is called

a transition. A particular FSM is defined by a list of its states, and the

triggering condition for each transition.

Simple examples are vending machines, which dispense products when the

proper combination of coins is deposited, elevators, which drop riders off at

upper floors before going down, traffic lights, which change sequence when

cars are waiting, and combination locks, which require the input of

combination numbers in the proper order.

Finite-state machines can model a large number of problems, among which

are electronic design automation, communication protocol design,

language parsing and other engineering applications.

Considered as an abstract model of computation, the finite state machine

has less computational power than some other models of computation such

as the Turing machine.

A finite automaton (FA): is a simple idealized machine used to recognize

patterns within input taken from some character set (or alphabet) C. The job

of an FA is to accept or reject an input depending on whether the pattern

defined by the FA occurs in the input.

a special start state

a set of final (or accepting) states

a set of transitions T from one state to another, labeled with chars in C

As noted above, we can represent a FA graphically, with nodes for states, and arcs for

transitions.

If the next input char matches the label on a transition from the current state to

a new state, go to that new state

Continue making transitions on each input char

o If no move is possible, then stop

o If in accepting state, then accept

Application of FA:

Finite automata and its variants are used in formal methods (a field of software

engineering) which deals in proving a software system as mathematically correct. Automata

is used in modelling the system and regular expression and different logic are used to

specify the requirements. Thus the important question now becomes to check whether a

given model satisfies the given logic statement (model checking). Automata are also used for

proving decidability of sat probs.

Q. Define the role of Induction, Recursion and Iteration to describe the behaviour of

a procedure. Give examples of code blocks to define their status. (Hints: Induction

in proving program correctness that arises in recursive programs, recursion in calling

of functions and iteration in different loop status).

Ans:

Mathematical Induction

In general, mathematical induction ∗ can be used to prove statements that assert that

P(n) is true for all positive integers n, where P(n) is a propositional function. A proof

by mathematical induction has two parts, a basis step, where we show that P(1) is

true, and an inductive step, where we show that for all positive integers k, if P(k) is

true, then P(k + 1) is true.

Recursion:

Sometimes it is difficult to define an object explicitly. However, it may be easy to

define this object in terms of itself. This process is called recursion. For instance,

the picture shown in Figure 1 is produced recursively. First, an original picture is

given. Then a process of successively superimposing centered smaller pictures on

top of the previous pictures is carried out.

We can use recursion to define sequences, functions, and sets. In Section 2.4, and in

most beginning mathematics courses, the terms of a sequence are specified using an

explicit formula. For instance, the sequence of powers of 2 is given by an = 2n for

n = 0, 1, 2, . . . . Recall from Section 2.4 that we can also define a sequence

recursively by specifying how terms of the sequence are found from previous terms.

The sequence of powers of 2 can also be defined by giving the first term of the

sequence, namely, a0 = 1, and a rule for finding a term of the sequence from the

previous one, namely, an+1 = 2an for n = 0, 1, 2, . . . . When we define a sequence

recursively by specifying how terms of the sequence are found from previous terms,

we can use induction to prove results about the sequence.

When we define a set recursively, we specify some initial elements in a basis step

and

provide a rule for constructing new elements from those we already have in the

recursive

step. To prove results about recursively defined sets we use a method called

structural

induction.

1. Recurrence Relation

“Recursive Definition of sequences, Solution of linear recurrence, Solution of

Non-linear recurrence, Application to Algorithm Analysis.”

the step or steps that come before it

f (0) = 3,

f (n + 1) = 2f (n) + 3.

Find f (1), f (2), f (3), and f (4).

f (1) = 2f (0) + 3 = 2 · 3 + 3 = 9,

f (2) = 2f (1) + 3 = 2 · 9 + 3 = 21,

f (3) = 2f (2) + 3 = 2 · 21 + 3 = 45,

f (4) = 2f (3) + 3 = 2 · 45 + 3 = 93.

Recursively defined functions are well defined. That is, for every positive integer,

the value of the function at this integer is determined in an unambiguous way. This

means that given any positive integer, we can use the two parts of the definition to

find the value of the function at that integer, and that we obtain the same value no

matter how we apply the two parts of the definition. This is a consequence of the

principle of mathematical induction.

and n is a nonnegative integer.

Solution: The recursive definition contains two parts. First a0 is specified, namely,

a0 = 1. Then the rule for finding an+1 from an, namely, an+1 = a · an, for n = 0,

1, 2, 3, . . . , is given. These two equations uniquely define an for all nonnegative

integers n.

EXAMPLE 3 Give a recursive definition of

▲

In some recursive definitions of functions, the values of the function at the first k

positive integers are specified, and a rule is given for determining the value of the

function at larger integers from its values at some or all of the preceding k integers.

That recursive definitions defined in this way produce well-defined functions

follows from strong induction.

Recall from Section 2.4 that the Fibonacci numbers, f0, f1, f2, . . . , are defined by

the equations f0 = 0, f1 = 1, and

fn = fn− 1 + fn− 2

for n = 2, 3, 4, . . .. [We can think of the Fibonacci number fn either as the nth term

of the sequence of Fibonacci numbers f0, f1, . . . or as the value at the integer n of a

function f (n).] We can use the recursive definition of the Fibonacci numbers to

prove many properties of these numbers. We give one such property in Example 4.

Solution: We can use strong induction to prove this inequality. Let P(n) be the

statement fn > αn− 2.Wewant to showthat P(n) is true whenever n is an integer

greater than or equal to 3.

BASIS STEP: First, note that

α < 2 = f3, α2 = (3 +√ 5)/2 < 3 = f4,

so P(3) and P(4) are true.

Digital System Design

Q. Discuss about the major levels of abstraction for VLSI design process. Explain

and list out the steps for Design abstractions.

Ans:

Karnaugh Maps

Why Do You Need To Know About Karnaugh Maps?

Some Observations

Problems

Karnaugh Maps are used for many small design problems. It's true

that many larger designs are done using computer implementations of

different algorithms. However designs with a small number of variables

occur frequently in interface problems and that makes learning Karnaugh

Maps worthwhile. In addition, if you study Karnaugh Maps you will gain a

great deal of insight into digital logic circuits.

In this section we'll examine some Karnaugh Maps for three and

four variables. As we use them be particularly tuned in to how they are

really being used to simplify Boolean functions.

Draw the Karnaugh Map for the function.

Use the information from a Karnaugh Map to determine the

smallest sum-of-products function.

really just another way of presenting a truth table, but the mode of

presentation gives more insight. A Karnaugh map has zero and one entries

at different positions. Each position in a grid corresponds to a truth

table entry. Here's an example taken from the voting circuit presented

in the lesson on Minterms. The truth table is shown first. The Karnaugh

Map for this truth table is shown after the truth table.

A B C V

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

How Can a Karnaugh Map Help?

At first, it might seem that the Karnaugh Map is just another way of

presenting the information in a truth table. In one way that's

true. However, any time you have the opportunity to use another way of

looking at a problem advantages can accrue to you. In the case of the

Karnaugh Map the advantage is that the Karnaugh Map is designed to

present the information in a way that allows easy grouping of terms that

can be combined.

encountered. Look at two entries side by side. We'll start by focussing

on the ones shown below in gray.

The term on the left in the gray area of the map corresponds to:

o

The term on the right in the gray area of the map corresponds to:

o

These two terms can be combined to give

o

designed so that any two adjacent cells in the map differ by a change in

one variable. It's always a change of one variable any time you cross a

horizontal or vertical cell boundaries. (It's not fair to go through the

corners!)

Notice that the order of terms isn't random. Look across the top

boundary of the Karnaugh Map. Terms go 00, 01, 11, 10. If you think

binary well, you might have ordered terms in order 00, 01, 10, 11. That's

the sequence of binary numbers for 0,1,2,3. However, in a Karnaugh Map

terms are not arranged in numerical sequence! That's done deliberately

to ensure that crossing each horizontal or vertical cell boundary will

reflect a change of only one variable. In the numerical sequence, the

middle two terms, 01, and 10 differ by two variables! Anyhow, when only

one variable changes that means that you can eliminate that variable, as in

the example above for the terms in the gray area.

Let's check the claim made on above. Click on the buttons to shade

groups of terms and to find out what the reduced term is.

groupings of terms that can be combined with a simple visual

inspection. The technique you use is simply to examine the Karnaugh Map

for any groups of ones that occur. Grouping ones into the largest groups

possible and ensuring that all ones in the table have been included are the

first step in using a Karnaugh Map.

In the next section we will examine how you can generate groups

using Karnaugh Maps. First, however, we will look at some of the kinds of

groups that occur in Truth Tables, and how they appear in Karnaugh Maps.

surprise, but it really is correct. In each case, be sure that you

understand the term that the group represents.

There is a small surprise in one grouping above. The lower left and

the lower right 1s actually form a group. They differ only in having B and

its' inverse. Consequently they can be combined. You will have to imagine

that the right end and the left end are connected.

Maps are useful for more than three variables, and we'll look at how to

extend ideas to four variables here. Shown below is a K-map for four

variables.

There are 16 cells in the map. Anytime you have N variables, you

will have 2N possible combinations, and 2N places in a truth table or

Karnaugh Map.

Imagine moving around in the Karnaugh Map. Every time you cross a

horizontal or vertical boundary one - and only one - variable changes

value.

The two pairs of variables - WX and YZ - both change in the same

pattern.

function, you should be able to understand one for a four-variable

function. Remember these basic rules that apply to Karnaugh maps of any

size.

boundary is a change of only one variable - no matter how many

variables there are.

Each single cell that contains a 1 represents a minterm in the

function, and each minterm can be thought of as a "product" term

with N variables.

To combine variables, use groups of 2, 4, 8, etc. A group of 2 in an

N-variable Karnaugh map will give you a "product" term with N-1

variables. A group of 4 will have N-2 variables, etc.

You will never have a group of 3, a group of 5, etc. Don't even think

about it. See the points above.

Example 1 - A Group of 2

Note that Y and Z are 00 and 01 at the top of the two columns in which

you find the two 1s. The variable, Z, changes from a 0 to a 1 as you move

from the left cell to the right cell. Consequently, these two 1s are not

dependent upon the value of Z, and Z will not appear in the product term

that results when we combine the 1s in this group of 2. Conversely, W, X

and Y will be in the product term. Notice that in the row in which the 1s

appear, W = 0 and X = 1. Also, in the two columns in which the 1s appear

we have Y = 0. That means that the term represented by these two cells

is:

Problem

P1. Here is a Karnaugh map with two entries. Determine the product

term represented by this map.

simplification. Let's consider the group shown shaded below. There are

four terms covered by the shaded area.

o

In the upper right;

o

In the lower left;

o

In the lower right;

o

These terms can be combined (assuming they are all ones in the

Karnaugh Map!). The result is

By combining the first two terms above (the two terms at the top of

the Karnaugh Map):-

o

By combining the last two terms above (the two terms at the

bottom of the Karnaugh Map):-

o

Then, these two germs can be combined to give:

variables in the resulting terms. That simplification helps when you start

to connect gates to implement the function represented by a Karnaugh

map.

By now you should have inferred the rules for getting the sum-of-

products form from the Karnaugh map.

If a variable takes on both values (0 and 1) for different entries

(1s) in the Karnaugh Map, that variable will not be in the sum-of-

products form. Note that the variable should be one in half of the

K-Map ones and it should be zero (inverted) in the other half.

If a variable is always 1 or always zero (it appears either inverted

all the time in all entries that are one, or it is always not inverted)

then that variable appears in that form in the sum-of-products

form.

Problem

P2. Here is a Karnaugh Map with four entries. What is the sum-of-

products form for the four ones shown?

P3. Here is a Karnaugh Map with four entries. What is the sum-of-

products form for the four ones shown?

P4. Here is a Karnaugh Map with four entries. What is the sum-of-

products form for the four ones shown?

P5. Here is a Karnaugh Map with eight entries. What is the sum-of-

products form for the four ones shown?

the following.

o Here is an example Karnaugh Map. There are two groups that

are obvious - one in orange, and one in light blue.

o There is still one entry to account for. There is a 1 that can

be joined to either of two other entries to form a

group. There is no best way to go on this. Either way will take

the same number of gates, inputs, etc.

Karnaugh Maps, and you will find larger Karnaugh Maps discussed in

many textbooks. However, as the number of variables increases it

becomes more difficult to see patterns, and computer methods

start to become more attractive.

*****************

An Logic Problem (3.1)

A B C F

0 0 0 1

0 0 1 0

0 1 0 1

0 1 1 1

1 0 0 1

1 0 1 0

1 1 0 0

1 1 1 0

Your Job:

Sketch the Karnaugh Map for this function.

Using the Karnaugh Map, get the simplest sum-of-products form for this function

Draw the circuit diagram using all NANDs.

************************

An Logic Problem (3.2)

Dr. Abner Mallity has been working with a logic circuit. He has a circuit

that works but he suspects that it can be made simpler. Here is the circuit.

Your Job:

Determine the truth table for the function implemented in this circuit. Fill in the truth table

below.

W X Y Z F

0 0 0 0

0 0 0 1

0 0 1 0

0 0 1 1

0 1 0 0

0 1 0 1

0 1 1 0

0 1 1 1

1 0 0 0

1 0 0 1

1 0 1 0

1 0 1 1

1 1 0 0

1 1 0 1

1 1 1 0

1 1 1 1

Using the Karnaugh Map, get the simplest sum-of-products form for this function

Draw the circuit diagram using ANDs, ORs and NOTs.

Draw the circuit diagram using all NANDs.

******************

A Logic Problem (3.3)- The Solar Collector System (Prob 3.3) - Still

Under Construction.

The sun shines out of an intense blue sky onto a solar collector.

The solar collector heats up.

Fans can be used to move the accumulated heat in the collector to

a rock bin - to store heat - or to the house itself.

o Fan A can be used to move air through the solar collector.

o Fan B can be used to move air into the heated space (the

house).

When either fan is OFF, air cannot move through that fan.

When both Fan A and Fan B are ON air moves through the

collector directly into the house.

When Fan B is ON and Fan A is OFF air moves from the rock bin

into the heated space.

When Fan A is ON and Fan B is OFF (heated) air moves from the

collector to the rock bin.

signal H becomes TRUE. This signal is supplied by a temperature

sensor that compares measured temperature to desired

temperature.

When the rock bin is warmer than the heated space - and can

supply heat - a signal RH is TRUE. The measurements from two

temperature sensors is compared to generate this signal, and the

same scheme is used for the two measurements below.

When the collector is warmer than the heated space the

signal CH is TRUE.

When the collector is warmer than the rock bin the

signal CR is TRUE.

Your Problem:

Generate a truth table for all functions. Here is a blank truth table. FA is TRUE when Fan

A is ON, and FB is TRUE when Fan B is ON.

First, we note that when there is no need for heat to the heated space (H = 0), and the

collector is warmer than the rock bin (CR = 1) we should move heat from the collector to

the rock bin. To do that, turn FAN A ON and B OFF. That allows us to fill in four parts of

the truth table.

H RH CH CR FA FB

0 0 0 0

0 0 0 1 1 0

0 0 1 0

0 0 1 1 1 0

0 1 0 0

0 1 0 1 1 0

0 1 1 0

0 1 1 1 1 0

1 0 0 0

1 0 0 1

1 0 1 0

1 0 1 1

1 1 0 0

1 1 0 1

1 1 1 0

1 1 1 1

warmer than the Rock bin), and if RH = 1 (Rock bin warmer than the Heated space.), then it

is clear that CH = 1 (Collecter warmer than the Heated space.) There are places in the truth

table where that is not the case, and when CH = 0 in that situation, it's something that can't

happen. Since it can't happen, we don't care what the function is for that case. That gives

us a new truth table with DON'T CAREs. We'll add DON'T CAREs wherever that happens.

H RH CH CR FA FB

0 0 0 0

0 0 0 1 1 0

0 0 1 0

0 0 1 1 1 0

0 1 0 0

0 1 0 1 X X

0 1 1 0

0 1 1 1 1 0

1 0 0 0

1 0 0 1

1 0 1 0

1 0 1 1

1 1 0 0

1 1 0 1 X X

1 1 1 0

1 1 1 1

o Actually, we can note that anytime heat is needed and either the Collector or Rock

bin can supply it, we need to turn on Fan A. When we don't need heat, Fan A is

OFF. And, if we need heat (H = 1) and nothing can supply heat we won't turn on

Fan A. Let's put that into the truth table.

H RH CH CR FA FB

0 0 0 0 0

0 0 0 1 1 0

0 0 1 0 0

0 0 1 1 1 0

0 1 0 0 0

0 1 0 1 X X

0 1 1 0 0

0 1 1 1 1 0

1 0 0 0 0

1 0 0 1 0

1 0 1 0 1

1 0 1 1 1

1 1 0 0 1

1 1 0 1 X X

1 1 1 0 1

1 1 1 1 1

o Be careful. There may be some Don't Care terms in the truth table. Think about

what conditions are possible carefully.

Show the circuit.

*********************

A Logic Problem (3.4)

a little consulting project. As usual he is going to stiff one of his graduate

students, Willy Nilly and Millie Farad, and get one of them to do the project for

him. They could use some help. They are also working hard to finish a term

project. Here's the story.

You need to do a design for the logic circuit that adds ingredients to an

ice cream sundae. Mallity's client - the NutCase Sundae Company - wants to

develop a product that makes sundaes automatically. They plan to add

ingredients chosen from the following list. The list has 16 different ingredients

1. Avocado Slush

2. Bannanas

3. Chocolate Syrup

4. Dacamania Nuts (Newly discovered in the Fiji Islands, and not

related to macadamia nuts)

5. Something starting with the letter "E", but the only thing they've

thought of so far is Eggplant.

Here is the truth table for the Avacodo Slush used for different sundaes. The

sundaes are numbered from 0 to 15 (in binary numbers) in the truth

tables. They plan to come up with some interesting names later, and will get

rid of the numbers ASAP.

Sundae # W X Y Z A

0 0 0 0 0 0

1 0 0 0 1 0

2 0 0 1 0 0

3 0 0 1 1 1

4 0 1 0 0 1

5 0 1 0 1 1

6 0 1 1 0 1

7 0 1 1 1 0

8 1 0 0 0 1

9 1 0 0 1 0

10 1 0 1 0 1

11 1 0 1 1 0

12 1 1 0 0 1

13 1 1 0 1 0

14 1 1 1 0 1

15 1 1 1 1 1

Determine the Karnaugh map for the Avocado Slush function (A).

From the Karnaugh map determine the smallest sum-of-products form for the Avocado

Slush function.

Show an AND-OR-NOT implementation for the circuit.

Quine-McCluskey Method of Logic Minimization

I. INTRODUCTION

The Quine–McCluskey algorithm or the method of prime implicants is a method

used for minimization of Boolean functions. It was developed by W.V. Quine

and Edward J. McCluskey in 1956. It is functionally identical to Karnaugh

mapping, but the tabular form makes it more efficient for use in computer

algorithms, and it also gives a deterministic way to check that the minimal form

of a Boolean function has been reached. It is sometimes referred to as the

tabulation method. The method involves two steps:

2. Use those prime implicants in a prime implicant chart to find the essential

prime implicants of the function, as well as other prime implicants that are

necessary to cover the function.

In this paper, we intend to discuss the Quine-McCluskey minimization

procedure as well as provide the readers with all the simulation codes which

are available on net in one single paper, highlighting the variations in each of

the given codes implemented using a different computer language. The

procedure which is discussed in the following section 2 and 3 has also been

taken from the net and for that appropriate references have been given.

computer applications. The procedure for optimization as follows:

Step 1: Describe individual minterms of the given expression by their equivalent binary numbers.

Step 2: Form a table by grouping numbers with equivalent number of 1‟s in them, i.e. first numbers with

no 1‟s, then numbers with one 1, and then numbers with two 1‟s, … etc.

Step 3: Compare each number in the top group with each minterm in the next lower group. If the two

numbers are the same in every position but one, place a check sign to the right of both numbers to

show that they have been paired and covered. Then enter the newly formed number in the next column

(a new table). The new number is the old numbers but where the literal differ, an “x” is placed in the

position of that literal.

Step 4: Using (3) above, form a second table and repeat the process again until no further pairing is

possible. (On second repeat, compare numbers to numbers in the next group that have the same “x”

position.

Step 5: Terms which were not covered are the prime implicants and are ORed and ANDed together to

form final function. Note: The procedure above gives you the prime implicant but not essential prime

implicant.

***********************************************

Quine-McCluskey Method

when # variables is large, instead of using Karnaugh map, you can use quine-

McCluskey method (using a CAD tool on a computer)

Quine-McCluskey method reduces the minterm expansion of a function to

obtain minimum sum of products form

procedure has two steps

1. Eliminate as many literals as possible from each term by applying xy +

xy' = x. The resulting terms are called prime implicants.

2. Use a prime implicant chart to select as minimum # of prime implicants

such that when they're OR'd together it equals the function being

simplified and contains a minimum # of literals.

function given as sum of minterms

notation and combine them using xy + xy' = x (two terms combine if they differ

in exactly one variable)

binary minterms are grouped according to # of 1's

o i.e.. binary notation

Group 0,1 ...x (column 1) has 0,1...x number of 1's in the minterm.

The blue column groups minterms from adjacent groups. For example the top

cell groups together minterms from group 0 and group 1 (first two rows). the

next cell groups minterms from group 1 and 2 (i.e.. 0-10 (2,6) formed from

2:0010 and 6: 0110) . The yellow column continues grouping minterms from

the previous (blue column).

groups.

o e.i.

the duplicate terms (0,1 ; 8,9) and (0,8 ; 1,9) were formed by combining the 4

minterms in different order

Finally we compare the minterms from the two groups in last column, but

there's no more reduction so the procedure terminates.

each time a term combines with another term it's checked off

terms which have not been checked off are prime implicants

since every minterm has been included in at least one of the prime implicants

the function is equal to the sum of it's prime implicants

so we get last row of table was reduced using consensus theorem., However

instead of using this theorem to reduce further we can use the prime implicant

chart, to be discussed next.

Definition: given a function F of n variables, a product term P is an implicant of

F iff for every combination of values of n variables for which P=1, F is also 1.

Definition : a prime implicant of a function F is a product term implicant which

is no longer an implicant if any literal is deleted from it.

The quine-mccluskey procedure finds all the prime implicants of a function F

(implicants which are not prime are checked off)

used to select a minimum set of prime implicants

minterms of f are listed across top of chart

prime implicants are listed down the side

a prime implicant is equal to a sum o f minterms and is said to cover these

minterms

if a prime implicant covers a minterm an X is placed

if a minterm is covered by only one prime implicant then that prime implicant

is essential and must be included in minimum sum of products

each time a prime implicant is included in minimum sum of products its row

should be crossed out and columns of its covered minterms should also be

crossed out.

then a minimum set of prime implicants must be chosen to cover the remaining

columns.

in the example, a'bd covers the remaining columns so f = b'c' + cd' + a'bd

note even though a'bd is included in minimum sum of products it is not an

essential prime implicant

we can do this by trial and error (although for large charts there are special

procedures)

simplification of incompletely specified functions:

o treat don't cares as if they were required minterms (so we can eliminate

as many literals as possible) in step(1)

o in step(2) , when form prime implicant chart, do not list these don't care

terms at the top.

**************************************************

Introduction

In order to understand the tabular method of minimization, it is best you understand

the numerical assignment of Karnaugh map cells and the incompletely specified

functions also known as the can't happen conditions. This is because the tabular

method is based on these principles.

particularly useful when minimizing functions having a large number of variables, e.g.

The six-variable functions. Computer programs have been developed employing this

algorithm. The method reduces a function in standard sum of products form to a set

of prime implicants from which as many variables are eliminated as possible.

These prime implicants are then examined to see if some are redundant.

The tabular method makes repeated use of the law A + = 1. Note that Binary notation

is used for the function, although decimal notation is also used for the functions. As

usual a variable in true form is denoted by 1, in inverted form by 0, and the absence of

a variable by a dash ( - ).

Consider a function of three variables f(A, B, C):

combined

Now consider the following:

combined

This is because the FIRST RULE of the Tabular method for two terms to combine, and

thus eliminate one variable, is that they must differ in only one digit position.

Bear in mind that when two terms are combined, one of the combined terms has one

digit more at logic 1 than the other combined term. This indicates that the number of

1's in a term is significant and is referred to as its index.

0000...................Index 0

0010, 1000.............Index 1

1010, 0011, 1001.......Index 2

1110, 1011.............Index 3

1111...................Index 4

The necessary condition for combining two terms is that the indices of the two terms

must differ by one logic variable which must also be the same.

Example 1:

To make things easier, change the function into binary notation with index value and

decimal value.

Tabulate the index groups in a colunm and insert the decimal value alongside.

From the first list, we combine terms that differ by 1 digit only from one index group

to the next. These terms from the first list are then seperated into groups in the second

list. Note that the ticks are just there to show that one term has been combined with

another term. From the second list we can see that the expression is now reduced to: Z

= + + C+A

From the second list note that the term having an index of 0 can be combined with the

terms of index 1. Bear in mind that the dash indicates a missing variable

and must line up in order to get a third list. The final simplified expression is: Z =

Bear in mind that any unticked terms in any list must be included in the final

expression (none occured here except from the last list). Note that the only prime

implicant here is Z = .

Note that the above solution can be derived algebracially. Attempt this in your notes.

Example 2:

in decimal form.

The prime implicants are: + + D + BD + A + AB

The chart is used to remove redundant prime implicants. A grid is prepared having all

the prime implicants listed at the left and all the minterms of the function along the

top. Each minterm covered by a given prime implicant is marked in the appropriate

position.

From the above chart, BD is an essential prime implicant. It is the only prime

implicant that covers the minterm decimal 15 and it also includes 5, 7 and 13. is

also an essential prime implicant. It is the only prime implicant that covers the

minterm denoted by decimal 10 and it also includes the terms 0, 2 and 8. The other

minterms of the function are 1, 3 and 12. Minterm 1 is present in and D.

Similarly for minterm 3. We can therefore use either of these prime implicants for

these minterms. Minterm 12 is present in A and AB , so again either can be used.

Problems

Z = f(A,B,C,D) = + C + A CD + A C + BCD + BC + CD

2. Using the tabular method of simplification, find all equally minimal solutions

for the function below.

Z = f(A,B,C,D) = (1,4,5,10,12,14)

Answere:

+ BCD + BC + CD

equivalent

2.

Another answer is: Z = + AC + AB

**************************************************

Using rules of inferences show that the following hypothesis- (p q) r, r( s

t ), s u, u t leads to the conclusion: p

how can relate nested quantifiers with nested loops. explain with example

loops, especially helpful in understanding of nested quantifiers.

To see if ∀x∀yP(x, y) is true, we loop the values for x, and for each x we loop through

the values for y. If we find P(x, y) is true for all values of x and y, we see that ∀x∀yP(x,

y) is true. If we ever see a value x for which we find a value y for which P(x, y) is false,

we have shown that ∀x∀yP(x, y) is false.

Similarly to determine whether ∀x∃yP(x, y) is true, we loop through the values for x.

For each x we loop through the values for y until we find a y for which P(x, y) is true.

If for every x we hit such a y, then ∀x∃yP(x, y) is true; if for some x we never hit such

a y, then ∀x∃yP(x, y) is false. ∃x∀yP(x, y), ∃x∃y P(x, y) can be checked by loops.

===============

Difference Between NFA and DFA

NFA vs DFA

The theory of computation is a branch of computer science that deals

with how problems are solved using algorithms. It has three branches,

namely; the computational complexity theory, the computability

theory, and the automaton theory.

mathematical machines or systems that can be used to solve

computational problems. An automaton is made up of states and

transitions, and as it sees a symbol or letter of input, it makes a

transition to another state taking the current state and symbol as input.

The automaton or automata theory has several classes that include the

Deterministic Finite Automata (DFA) and the Nondeterministic Finite

Automata (NFA). These two classes are transition functions of

automata or automaton.

as one machine. If the string ends at a state that is not an acceptable

state, DFA will reject it. A DFA machine can be constructed with every

input and output.

DFA only has one state transition for every symbol of the alphabet, and

there is only one final state for its transition which means that for each

character that is read, there is one corresponding state in DFA. It is

easier to check membership in DFA but it is more difficult to construct.

Backtracking is allowed in DFA, and it requires more space than NFA.

cases, in others it is not. It is easier to construct NFA, and it also requires

less space, but it is not possible to construct an NFA machine for every

input and output.

and membership can be harder to check. It uses Empty String

Transition, and there are numerous possible next states for each pair of

state and input symbol. It starts at a specific state and reads the

symbols, and the automaton then determines the next state which

depends on the current input and other consequent events. At its

accepting state, NFA accepts the string and rejects it otherwise.

Summary:

1. “DFA” stands for “Deterministic Finite Automata” while “NFA”

stands for “Nondeterministic Finite Automata.”

state is distinctly set while in NFA each pair of state and input

symbol can have many possible next states.

3. NFA can use empty string transition while DFA cannot use empty

string transition.

allowed.

can be constructed for every input and output,

together, and there is no possibility of constructing an NFA machine

for every input and output.

Converting RE to FA

===========================

Define chomsky hierarchy of grammar with their respective mathematical model.

How can you convert a RE to grammar? Explain with example and drive a string

using the equivalent grammar

d

a young pair of rabbits is placed on an island. the pair of rabbit does not breed until

they are 2-month-old. after they are two-month-old, each pair

=============

number of edge and faces.

===============

if you do every problem in this book, then you will learn discrete mathematics. you

learn discrete mathematics. therefore you did problem in this book.

===============

==============

- DFA & NFAUploaded byAnam Qureshi
- Automata Theory TutorialUploaded byRittika Guha
- Chapter 2 (Part a) Finite AutomataUploaded byFilomeno Silva
- Cs2303 Theory of Computation 2marksUploaded byShanmugasundaram Muthuswamy
- KmapsUploaded bySouvik Das
- Lexical AnalysisUploaded byf22krash
- csci3255 HW 3Uploaded byDK Hassan
- StanfordUploaded byfennec15
- MELJUN CORTES Automata Lecture Intro to Finite Automata 2Uploaded byMELJUN CORTES, MBA,MPA
- Free Video Lectures for MCAUploaded byedholecom
- Computer ScienceUploaded byRaghavendra Gowda
- Module 3Uploaded byarunlalds
- On duty ChinaUploaded byjavert99
- Formal Languages and Chomsky HierarchyUploaded bySaurabh Singh
- CS2303 2 MarksUploaded bysankarwinning
- Induction Proof Onfor Kth SymbolUploaded byKavitha Yogaraj
- PL_ReviewUploaded byLara Jane Lopega
- Boolean AlgebraUploaded byDinesh Nadun
- 10.1.1.37.307Uploaded byOluponmile Adeola
- ECE 551 Homework #1Uploaded byKeri Sawyer
- Reg ExUploaded byBonventure Kipkirui
- SDDUploaded byKarunakar Ella
- drs cUploaded byapi-272643960
- eee21 probset4Uploaded bywafu017
- FZKHTB10 (1)Uploaded bySalemHasnaoui
- DavisPrecisionControlManeuveringDockingInTubeThesis.September1996Uploaded bySiti Aishah Hussien
- GrammarUploaded byAzim Khan
- Interview DigitalUploaded byRoopak Vasa
- overview.pdfUploaded bytheresa.painter
- parsing-120903115324-phpapp02.pptxUploaded byPramod Suthar

- Windows CommandUploaded bymadhunath
- Telecom TechnologyUploaded bymadhunath
- OOSE Q & AUploaded bymadhunath
- Netework Architecture of 5G Mobile Technology..pptxUploaded bymadhunath
- Finite State MachinesUploaded bymadhunath
- Syllabus of MECEUploaded bymadhunath
- Vocabulary.Uploaded bymadhunath
- Vocabulary.Uploaded bymadhunath
- Con CurrencyUploaded bylogu_thalir
- notes (1)Uploaded bymadhunath
- To Collect SFP InfoUploaded bymadhunath
- Ip ConfigUploaded bymadhunath
- Question CGUploaded bymadhunath
- OOSEUploaded bymadhunath
- APSTUploaded bymadhunath
- OpenGL SlidesUploaded bymadhunath
- 04 TransformUploaded byHarsh Sharma
- Bezier SurfaceUploaded bymadhunath
- Question TOCUploaded bymadhunath
- 9783319113937-c1Uploaded byKeerthi Kumar
- 2 Cellular SystemsUploaded bymadhunath
- LTE Tutorial.docxUploaded bymadhunath
- PM Card-20170731_New LatestUploaded bymadhunath
- pgpUploaded bymadhunath
- Channel RoutingUploaded byHarsh Tibrewal
- DDBMS_FRAGMENTATION_1.pdfUploaded bymadhunath
- Erro With SolutionUploaded bymadhunath
- Paper Review on 5GUploaded bymadhunath

- one sim card manualUploaded byUkah Franklin
- Image Information Retrieval From Incomplete Queries Using Color and Shape FeaturesUploaded bysipij
- Dream Weaver CS4 Read MeUploaded byhasanhaiqel
- BDC Interview QuestionsUploaded byajitmca
- 17080916293313993_9_1v100.pdfUploaded bytetrapoltest
- Art Cam ManualUploaded byMX100
- cc_ref_1Uploaded bymgoyal10
- game developmentUploaded byapi-302541769
- TRIANGLE - Mesh Generation and Delaunay TriangulationUploaded byIgor Gjorgjiev
- NRF52 Online Power ProfilerUploaded byzhongkai cheng
- Site Assessment HandbookUploaded byJetesh Devgun
- Simulation of Piezoelectric Devices by Two- And Three-Dimensional Finite ElementsUploaded byzhangcwy1225
- Resume and Cover Letter (BusCor).docxUploaded byplxiades
- Encp Assignment 8Uploaded byAmanda Gaiya
- SREye - Fisheye image dewarping module for NVR and viewer.pdfUploaded byyshim_4
- Honey Pot SlidesUploaded byPriyankShah123
- PowerBuilder 10.5 Launch and Learning EventUploaded byPhạm Tuân
- Automatic Undo for Cloud Management via AI PlanningUploaded byaitel203
- SAP System Directories on UNIXUploaded byDevender5194
- Odd-numbered Review Question AnswersUploaded byEugune Chow Mun Wai
- RSD All Market Segments_Courier Report and Transmittal Slip_v3Uploaded byGlutton Arch
- Creating Workspace and Learning ROSUploaded byAcrux Knight
- ASM Best Practices PresentationUploaded byShahid Mahmud
- ArraysUploaded byjosefalarka
- Lecture Note 1. Introduction to Computer and ProgrammingUploaded byPak Tam
- Tesunradio PL450 English Munual PDF DownloadUploaded byRenato Cruz Salles
- Penetration Testing Methodology - 0DAYsecurityUploaded byKenMiller
- 915G Chipset detailsUploaded byMahesh Abnave
- Canon Pixma MP530 Service Repair ManualUploaded byPaulStaples
- UIMA AbstractUploaded byAbhiraj Pande