Name _________________________

CS 60

Acceptors and Registers Worksheet

(worth up to 20 points if submitted by Friday, May 1)

1. Assuming the classes are the same as the names of the states, into what classes does the classifier below classify the following input sequences?

0 1 1

1 1 0 1

1 0 0 0

1 0 0 1 1 1

(the empty sequence)

2. Which of the following sequences are accepted by the acceptor below?

1

1 0 0 1 0

0 0 0 0 0 0 0 1

(the empty sequence)

 

3. Construct the state diagram for an acceptor which accepts all arithmetic expressions over the constants 0, 1, and the operator +, e.g. 0, 1, 0+0, 0+1, etc.

 

 

 

4. Construct the state diagram for an acceptor representing a combination lock which opens with the combination 10100. That is, regardless of what digits were entered before, if 10100 were the last 5 digits, the lock will open. If additional input occurs when the machine is in the accepting state, the lock may close again rather than stay open.

 

 

 

5. Articulate in English the meaning of the following regular expressions:

(0 | 1)*

(01)*

(00 | 11)*

(00)* | (11)*

0* 1*

 

6. Construct a finite-state acceptor for each regular expression in the preceding problem.

 

 

 

7. Give regular expressions for the following languages over alphabet {0, 1}:

a. The set of all strings beginning with 0101.

b. The set of all strings ending with 1010.

c. The set of all strings containing 10101.

d. The set of all strings containing a multiple of 3 1's.

e. The set of all strings not containing a multiple of 3 1's.

 

8. Construct a regular expression for the language accepted by the following acceptor:

 

9. Construct a deterministic finite-state acceptor from the following non-deterministic one:

 

 

 

 

 

10. Construct a sequential logic device using flip-flops for the combination lock in problem number 4.

 

 

 

 

11. Using the idea of parallel composition, design an acceptor which accepts the set of sequences which both:

a. end in 011.

and

b. contain an even number of occurrences of the sequence 01.

 

 

 

 

12. A 3-bit register implements the functions clear, shift-right, and add 1. Show the state diagram.

 

 

 

 

13. A register is used to contain information which causes a transfer the contents of any one of eight registers to any other. What is the minimum number of bits needed in the register? Show how the register contents would be used to drive the transfer using a single bus and 3-state buffers.