0% found this document useful (0 votes)
187 views

1 Tcs Tutorial

This document contains tutorial questions on finite state machines (FSM), including designing FSMs, converting regular expressions to non-deterministic finite automata (NFA) and NFAs to deterministic finite automata (DFA), and designing Moore and Mealy machines. The questions cover topics such as checking for divisibility by 3 in binary, validating string endings, converting regular expressions to NFAs and NFAs to DFAs, designing DFAs to recognize certain languages, and implementing arithmetic operations using finite state machines.

Uploaded by

Prashant Yadav
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)
187 views

1 Tcs Tutorial

This document contains tutorial questions on finite state machines (FSM), including designing FSMs, converting regular expressions to non-deterministic finite automata (NFA) and NFAs to deterministic finite automata (DFA), and designing Moore and Mealy machines. The questions cover topics such as checking for divisibility by 3 in binary, validating string endings, converting regular expressions to NFAs and NFAs to DFAs, designing DFAs to recognize certain languages, and implementing arithmetic operations using finite state machines.

Uploaded by

Prashant Yadav
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/ 2

TCS TUTORIAL QUESTIONS FOR PRACTICE

FSM
1. Design FSM to check whether the given binary number is divisible by 3.
2. Design FSM in which the input is valid if it ends in “100” over the Ʃ={0,1}.
3. Design FSM in which the input is valid if it ends either in “100” or “110” over the
Ʃ={0,1}.
4. Design FSM in which the input is valid if it does not contains any occurrences of 3
consecutive b’s over the Ʃ={a,b}.
5. Design FSM in which the input is valid if it ends in “babb” over the Ʃ={a,b}.
6. Design FSM in which the input is valid if it either ends in “xyy” or “yxx” over the
Ʃ={x,y}.

NFA - DFA
I. Convert the following Regular Expressions into NFA:
1. r = (11+110)*.0
2. r = aa.(a+b)*.b
3. r = aba.(a+b)*
4. r = (ab|ba)*|(aa|bb)*
5. r = (ab)*
6. r = (a*b*+(ab)*)
7. For the language which ends in either “01” or “101” over the Ʃ={0,1}.
II. Convert the following NFA to an equivalent DFA:

State A B ε
→ q0 {q0,q1} {q1} {}
q1 {q2} {q1,q2} {}
q2* {q0} {q2} {q1}

III Convert (0+ε).(10)*.(ε+1) into NFA with ε-moves and hence obtain a DFA.moves and hence obtain a DFA.
IV Design DFA for recognizing the strings that contains “010” as substring over the
Ʃ={0,1}.
V Design DFA which accepts set of strings which contains “00” as substring but does not
contain “000” as substring.
VI Design DFA that accepts the language represented by 0*1*2* over the Ʃ={0,1}..
VII Design DFA which is used to recognize the language in which every “a” is followed by
“b” over the Ʃ={a,b}.
VIII Design minimized DFA for accepting strings ending in “100” over the Ʃ={0,1}.
IX Design DFA to accept strings over the Ʃ={a,b} such that it begins with “aa” but not ends
in “aa”.
X Design DFA for the following language:
L = {w | every odd position of w is 1}.
MOORE – MEALY
1. Design Moore Machine to change each occurrences of “aba” to “abb” over the Ʃ={a,b}.
2. Design Moore and Mealy Machine to find the 1’s Complement of a binary number.
3. Design Mealy Machine to find 2’s Complement of a binary number and convert it to
Moore Machine.
4. Design Mealy Machine to implement the increment of a binary number and convert it to
Moore Machine.
5. Design Mealy Machine to implement the decrement of a binary number and convert it to
Moore Machine.
6. Design Mealy Machine to implement the binary adder and convert it to Moore Machine.
7. Design Moore Machine for the input from (0+1+2)* which prints the residue modulo 5 of
the input treated as ternary number.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy