ICS 10 • David G. Kay • UC Irvine

Third Homework

As usual, you'll do parts of this assignment with a partner, preferably someone you haven't worked with on a previous ssignment. Please do what it takes to get partnered up early in the week; it's awkward when people come to us at the end of the week saying they never bothered to find a partner. This is part of each assignment; not doing it will lower your score. Completely apart from that, this assignment is probably the most technically detailed one we'll have; you're sure to have some questions, so you'll want to leave plenty of time to get them answered. (If you haven't used Piazza.com yet, it's a good place to ask questions about the homework.)

Be sure to use the Partner App so your partnership is recorded.

Part (a)

[This is repeated from last week's assignment; we'll be touching on some of these issues this week.] Read Chapter 4 of Blown to Bits, which talks about internet searching.

Part (b)

With your partner, solve the two Deus X problems at http://www.ics.uci.edu/~kay/courses/10/hw/DeusXercises.pdf. A copy of the Deus X Instruction Set is available on line, as are the Deus X examples we worked on in class.

Read the problems carefully, stepping through the fetch-decode-execute cycle for the programs given. Here are two hints/reminders: (a) Draw a box for each of the registers and for the comparison indicators; as your program makes comparisons and changes values in the registers, reflect those changes on your drawing. It's just about impossible to keep those values in your head (and if you find it easy, you may have a future as a software developer). (b) Remember that each input instruction reads a whole line from the input file; each subsequent input instruction reads the next line (the system keeps track of how much of the file you've already read). (c) When you're doing comparisons, remember that the Deus X instructions 50 and 51 compare the register to the memory address (i.e., the register's value is on the left side of the comparison) and that blanks are less than letters or numbers (although in these problems, when we compare with blanks, we only check for equality or not, so if you happen to treat blanks as greater than text, it won't matter).

Even though you'll do these problems with pencil and paper, (a) it's important to start early because it involves intricate technical details and it's possible you will have some misconceptions that need to be resolved before you can finish, and (b) you and your partner should follow the "pair programming" model, with one person holding the pencil and the other raising issues and helping guide the process.

Do not fall into the trap of thinking that getting the answer is what's important. In fact, we'll tell you the answer to the first part of the first question right here: 0, 7, and 9. The important part is knowing how to get the answer. That's what you're supposed to be learning (and that's the skill that you'll need to answer test questions). You can only learn this by actually doing it; you can't learn it by asking your classmate for the answer and just writing it down. (It's like physical exercise. If you need to get in shape, you can't make it happen by asking your roommate to run a couple of miles for you every day.)

Any Deus X problems on the midterm or final will require skills and knowledge similar to what these problems require. We may give you a Deus X program and ask you what it does, or we may ask you other questions about the Deus X machine. We will not ask you to write any Deus X code. And for any Deus X problem, we will provide you with a copy of the instruction set reference sheet; it would be insane to have to memorize it.

When you're done, type your solutions into a simple document (in Word or plain text) that includes this information:

  1. Both partners' names and UCInet IDs
  2. The solutions to the two problems

Save this document using a file name that includes the problem number and both partners' UCInet IDs (e.g., hw3b-lee27-sam14). Submit this document via Checkmate. Just one partner should submit one copy; the file name will let us give both partners credit.

Part (c)

Don't forget your Snap/BYOB. We'll be back to it soon. Keep working on your pong game if you like.

The TAs will be available in the third-floor ICS lab, room 364 ICS, at times to be announced. Remember too that Piazza is a good forum for getting questions answered.


David G. Kay, kay@uci.edu
Sunday, April 15, 2018 6:00 PM