0% found this document useful (0 votes)
26 views1 page

TOC3

A CFG is converted to Greibach Normal Form through a series of steps: 1) Non-terminals replaced with terminals on the right side 2) Removal of epsilon productions and unit productions 3) Removal of direct and indirect left recursion 4) Proper substitutions of productions to convert it to GNF A Mealy machine is converted to a Moore machine by: 1) Calculating distinct outputs for each state 2) Copying states with the same output 3) Breaking states into multiple states for different outputs 4) Adding a new initial state if the original output is not 0

Uploaded by

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

TOC3

A CFG is converted to Greibach Normal Form through a series of steps: 1) Non-terminals replaced with terminals on the right side 2) Removal of epsilon productions and unit productions 3) Removal of direct and indirect left recursion 4) Proper substitutions of productions to convert it to GNF A Mealy machine is converted to a Moore machine by: 1) Calculating distinct outputs for each state 2) Copying states with the same output 3) Breaking states into multiple states for different outputs 4) Adding a new initial state if the original output is not 0

Uploaded by

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

A CFG is in Greibach Normal or a machine or control every new output symbol and

Form if the Productions are in mechanism according to incoming and


the following forms − designed to automatically outgoing edges are
A→b follow a predetermined distributed.
A → bD1…Dn sequence of operations, The following steps are used
S→ε or respond to for converting Mealy machine
where A, D1,....,Dn are non- predetermined instructions to the Moore machine:
terminals and b is a terminal. Step 1: For each state(Qi),
Steps to Convert a CFG into calculate the number of
Greibach Normal Form 12. What is a moore machine? different outputs that are
Step 1 − If the start symbol S Moore machines are finite state available
occurs on some right side, machines with output value and in the transition table of the
create a new start symbol S’ its output depends Mealy machine.
and a only on present state. It can be Step 2: Copy state Qi, if all the
new production S’ → S. defined as (Q, q0, ∑, O, δ, λ) outputs of Qi are the same.
Step 2 − Remove Null A Moore machine can be Break qi into n states as
productions. (Using the Null described by a 6 tuple (Q, ∑, O, Qin, if it has n distinct outputs
production removal δ, X, q0) where − where n = 0, 1, 2...
algorithm discussed • Q is a finite set of states. Step 3: If the output of initial
earlier)Step 3 − Remove unit • ∑ is a finite set of symbols state is 0, insert a new initial
productions. (Using the Unit called the input alphabet. state at the starting which
production removal • O is a finite set of symbols gives 1 output.
algorithm discussed earlier) called the output alphabet. Example: Convert the
Step 4 − Remove all direct and • δ is the input transition following Mealy machine into
indirect left-recursion. function where δ: Q × ∑ → Q equivalent Moore machine.
Step 5 − Do proper • X is the output transition
substitutions of productions to function where X: Q → O
convert it into the • q0 is the initial state from
proper form of GNF. where any input is processed
(q0 ∈ Q).
Binary Tree
Tree represents the nodes connected
13. What is Mealy Machine?
by edges. Explain it.
 Binary Tree is a special data 14. A Mealy machine is a finite-
structure used for data storage state machine whose output
purposes. values are determined both
 A binary tree has a special
condition that each node can
by its current state and the
have a maximum of two current inputs. A Mealy
children. machine is a deterministic
finite
state transducer: for each state
and input, at most one
transition is possible.
It can be described by a 6 tuple
(Q, ∑, O, δ, X, q0) where

There are four types of binary tree:


 Full Binary Tree
 Complete Binary Tree
 Skewed Binary Tree
 Extended Binary Tree
15. Explain the procedure for
transforming a Mealy machine
to Moore.
converting the Mealy machine
1. What is an automaton? to Moore machine, we will
An automaton is a relatively create a separate state for
self-operating machine,

You might also like