Some of the classes here can be singletons (the simulator, for example). They could be asked to develop a process to carry out some task. Some of the instruction classes can be removed from the hand out code and the students asked to implement them. This exercise explores race conditions in a CPU with shared memory as well as the Singleton design pattern. This is because the buffer (one element queue) is shared but not protected from simultaneous access. Note that the program works as expected with one (simple) reader, but misbehaves with more than one. If the Queue from this library isn't used, students could design a queue using Student Design Sprint in 2 or 3 rounds. This can be a Student Design Sprint, in which the first round has teams of 2 students and the second round combines 2 teams so you have 4 students debugging each other's solutions. If some instructions were removed before the handouts were given, they could be asked to implement one of them. (I may write this up as a pedagogical pattern "Reverse Engineering"). They could also develop the Class diagram for this program. In small teams, the students can design a reader process to accompany the given writer. Inheritance and Polymorphism (See the Instruction class hierarchy)Focus on how each Instruction object knows which execute operation to use when told to do so by the simulator in the step method.(perhaps) Queue implementation using a linked list.Note that the conditional jumps use the stacktop as a condition.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |