Spring Semester 2008

January 28, 2008 – May 2, 2008

Assignment 5: Theory and Practice

Out on: February 26, 2008
Due by: March 4, 2008, noon (before lecture)
Collaboration: None
Grading: Packaging 10%, Style 10%, Performance 10%, Functionality 70%

Overview

The fifth assignment concentrates on more theoretical material we covered in the fifth week. Note that since there are no programming problems, the breakdown above (and the note about error free code below) don't really apply. :-)

Problem 1: Address Decoder Rings

In lecture we discussed the problem of "decoding" addresses from a CPU (the lines forming the "address bus" as it were) into a number of chip select signals to make sure we talk to the right piece of the motherboard. Read this summary article on memory mapped I/O which recaps the basics, and then design the address decoding logic (out of basic gates) necessary for the memory map given in the article. Assume the processor has an 16-bit address bus (much like the good old 6502 processor) and that the chip select signal for each chip is active-high.

Problem 2: Finite Names

Sketch a finite automaton that accepts all your names: It should accept your first name, your last name, and any "middle names" or "nick names" you might have (and are willing to share). The "alphabet" of this finite automaton is obviously "the usual" English alphabet. For example, the automaton I would have to design for myself should accept the strings Peter, Hans, and Froehlich but nothing else.

Please make sure to clearly mark initial state and final states! If you need "non-standard" characters, make them up. You don't have to show an explicit error state.

Problem 3: Abstract Automata

The alphabet for this problem consists only of the symbols 0 and 1, so we are dealing with strings of 0 and 1 of (in principle) any length. Sketch the following two finite automata:

  1. The automaton that accepts all strings (of at least length 2) that end in "11" (e.g. "00101011" should be accepted, but "0010110" should not be accepted).
  2. The automaton that accepts all strings (of at least length 3) that contain "111" anywhere (i.e. the strings don't have to end in "111", so the string "0111000010000" should be accepted for example).

Please make sure to clearly mark initial state and final states! Again, no need to show an explicit error state.

Problem 4: Removed

See Assignment 6 instead.

Problem 5: Removed

See Assignment 6 instead.

Deliverables

Please turn in a gzip compressed tarball of your assignment; the filename should be cs102-assign-5-login.tar.gz with login replaced by your Unix login name on ugradx.cs.jhu.edu (so I would use cs120-assign-5-phf.tar.gz). The tarball should contain no derived files whatsoever (i.e. no executable files), but allow building all derived files. Include a README file (a plain Unix text file) that contains your answers to written problems, briefly explains what your programs do, and has any other notes you want us to check out before grading.

Grading

For reference, here is a short explanation of the grading criteria. Packaging refers to the proper organization of the stuff you hand in, following the guidelines for Deliverables above. Style refers to programming style, including things like consistent indentation, appropriate identifiers, useful comments, suitable documentation, etc. Simple, clean, readable code is what you should be aiming for. Performance refers to how fast your program can produce the required results compared to other submissions. Design refers to proper modularization and the proper choice of algorithms and data structures. Functionality refers to your programs being able to do what they should according to the specification given above; if the specification is ambiguous and you had to make a certain choice, defend that choice in your README file.

If your programs cannot be built/run you will get no points whatsoever. If your programs fail miserably even once, i.e. terminate with an exception of any kind or dump core, we will take off 10%. Finally, make sure to include your name and email address in every file you turn in!

Bonus Problem: Removed

See Assignment 6 instead.