You are on page 1of 1

Problem sheet 2 for 21/2/2024

I. Regular Expressions over the set ∑ = {0, 1} that


1. contains strings with at least three 1s
2. contains strings with at least three consecutive 1s
3. doesn't contain strings with the substring 110
4. contains strings with at least two 0s but not consecutive 0s
5. contains strings with at least 3 characters, the third character is 0,
6. contains strings where the number of 0s is a multiple of 3
7. contains strings that starts and ends with the same character
8. contains strings that starts with 0 and has odd length, or starts with 1 and has even length,
9. contains strings of binary numbers divisible by 4

II. Moore machine


1. Design a Moore machine to generate 1's complement of a given binary number.
2. Design a Moore machine for a binary input sequence such that if it has a substring 101, the
machine output A, if the input has substring 110, it outputs B otherwise it outputs C.
3. Construct a Moore machine that determines whether an input string contains an even or
odd number of 1's. The machine should give E as output if an even number of 1's are in the
string and O otherwise.

III. Mealy machine


1. Design a Mealy machine for a binary input sequence such that if it has a substring 101, the
machine output A, if the input has substring 110, it outputs B otherwise it outputs C.
2. Design a mealy machine that scans sequence of input of 0 and 1 and generates output 'A' if
the input string terminates in 00, output 'B' if the string terminates in 11, and output 'C'
otherwise.
3. Design a mealy machine for the sequence detector for 01 or 10

******

You might also like