IMADA
IMADA

DAT101: Supplementary Lab Assignments

  1. Labs 2 through 6. You need to click on Reset before chosing a new algorithm.
  2. The algorithm for Lab 4 is not perfect, but it is the same as in the textbook. It demonstrates how a correct algorithm can be programmed inefficiently. (The bug is that "right" is compared to "upper", not "legit". Why should it be "legit" instead? You can try to also figure out what the answers would be if the algorithm had been programmed correctly.)
  3. Lab 6. There is a minor bug in the Sort Timer. In the Sort Timer, with Insertion Sort, it occasionally runs and times and then right at the end substitutes **** for the time. If this happens, just restart and try again.
  4. Labs 7 and 8. Consider skipping these unless you are informed that new software without the bugs is installed. If you do them anyway, beware that there can be problems making connections. The following are the problems you might discover (not all are bugs - some were intended to be that way):
    1. There is no status pane at the bottom of the window, so you will never get the messages "Connection to output area," etc.
    2. It can be difficult to make the connections, and under some circumstances it becomes impossible to make connections. For example, I never could connect the new OR gate from Exercise 7.3 to the new AND gate from 7.2.
    3. You can delete gates or switches. Any input or output lines connected to these objects will also be deleted. However, you cannot delete lines by themselves. So the penultimate sentence in 7.4 is misleading, you must delete the gates and reinsert them to reconnect them.
    4. When drawing lines, the program sometimes puts them through other gates, so it looks as if the output of that second gate is used. This is not a big problem since it still functions fine, but it is hard to understand.
  5. Lab 9 and 10. There are three problems with the program.
    1. In the program for the von Neuman Machine, the R and IR labels are switched.
    2. Exercise 9.3 says you can input decimal digits, but the program demands binary.
    3. Try skipping the parts which involve negative numbers - the end of Exercise 9.5, all of 9.6, and the modification in 10.4. Setting the leftmost bit of an input doesn't seem to make it negative - just a very large positive number. When the program computes a negative number, it puts a negative sign in the value in memory. But when the program tries to read that number and compare to zero, for example, the program just halts right there. So basically, there's a problem handling negative numbers.
  6. Lab 11. In the file Example1.java, there is a typo: "sum" is missing the "m" one place. So the file doesn't compile. Just put the "m" in.
    In exercise 11.5, the height and base are declared double, but they are read in as integers, so there is an error if a number with a decimal point is input.
    In Exercise 11.9, it looks as if there should be "then"s in Java syntax, but there shouldn't.
  7. Lab 12. There are some problems here, too.
    1. In Exercise 12.5, Example10.java should be used instead of Example9.java.
    2. Skip Exercise 12.4 if you think it's too hard to find a gcd algorithm.
    3. In Exercise 12.7, the & before "length" is a typo.
    4. In Exercise 12.8, the minus part of the -1 doesn't look like it's part of that number; it is.
  8. Lab 13.
    1. In line 4 in the section Background, it should say "right and to the bottom" instead of "left and to the bottom".
    2. In Exercise 13.3, there should be a pair of parentheses after "getGraphics".
    3. In Exercise 13.5, current machines are so fast that one can't really see the circle move, so you can try to slow it down. One way is to add
      try {
      Thread.sleep(10);
      }
      catch(InterruptedException e){
      }
      in some appropriate places.
  9. Lab 16. There are some problems here, too.
    1. In Exercise 16.1, the Tape menu has Open, rather than Load Tape, and the file is called "example.tap", rather than "Example.tap".
    2. The Reset button does not reset the position of the read head.
    3. In the Symbol menu within the Tape menu, Add does not seem to work.
    4. In the Add option in the Instruction menu, there is no menu for the "next state". I discovered this in Exercise 16.3. There seems to be a problem when the read head finds the blank to the left of its original start position. It doesn't notice that it's a blank, and seems to use the value in the original start position.
  10. Lab 21. In Exercise 21.1, it wrote 1, instead of 24 iterations, when I clicked on TRAIN. When training on A, B, and O, the number of iterations was 60, not 28.
  11. I have not tried labs 14, 15, 17, 19 or 20, so let me know if there are problems with them. (Try the other labs first. Lab 20 is probably fine. Lab 19 is designed for Mathematica, which we do not have. You could try to do it in Maple.)
SDU IMADA
Last modified: September 29, 2000.
Joan Boyar (joan@imada.sdu.dk)

 


   Data protection at SDUDatabeskyttelse på SDU