Computer Science 5641
Compiler Design
Homework Assignment 1 (10 points)
Due September 28, 2004

  1. Consider a definition of strings as follows:
    1. Draw a DFA that recognizes this language
    2. Write a regular expression that defines this language
    3. Convert your regular expression into an NFA using the algorithm that was discussed in class
    4. Run the algorithm we discussed in class to convert your NFA to a DFA
  2. Some programming languages allow integer constants to be written in other bases (e.g., base 8, 10, 16). Consider a language of integer constants where base 8 numbers start with a 0 and may contain digits from 0 to 7, base 10 integer constants start with any digit other than zero and can include digits from 0 to 9, and base 16 numbers start with an X and can include digits 0 through 9 as well as letters A through F -- 10 (A), 11 (B), 12 (C), 13 (D), 14 (E), 15 (F).
    1. Draw a DFA that recognizes this language
    2. Write a regular expression that defines this language