Explain any instructions, registers etc. that you cite but are not in our book.
Sunday, June 5, 1:37 p.m.If you have not already submitted your final project, please see the specs for new packaging requirements. Thanks.
Saturday, June 4, 9:37 p.m.Very sorry, but I don't have the midterms graded yet. I've finished all of it but the last problem, and since that one was a full program, it will take me a while to grade. I'll announce when the midterm grades are ready.
Wednesday, June 1, 10:04 a.m.You may find the material on this site to be of value. Nothing new, but seeing the same thing again with a new description should be helpful.
Tuesday, May 31, 9:39 p.m.Remember, our last Quiz will be held this Thursday. Wei will preside, as usual for the Quizzes. You are responsible for the material up through p.235 (with paragraph continued at top of p.236).
Tuesday, May 31, 6:02 p.m.Note that the last section in the JVM chapter gives a list of all the JVM instructions used in that chapter.
Friday, May 27, 10:00 a.m.I've now posted the instructions for our final exam/project, here.
Monday, May 23, 10:35 a.m.Here's yet another statistics prize, "only" $1 million this time.
Sunday, May 22, 10:28 p.m.End of the quarter plan:
Wei just sent me the grade list for all the Quizzes and Homework assignments so far. Things seem to be going well overall, but I noticed that a number of students had a slow start, followed by major improvement. For that reason, I've decided to drop your two lowest Quizzes when I determine your course grade, rather than just the lowest.
Wednesday, May 18, 7:44 p.m.I've gotten a report that someone had trouble killing their program with ctrl-c. If you encounter this, then just use the Linux kill command.
Tuesday, May 17, 9:01 p.m.:I wrote that you should use clock() to get the time, but apparently this counts ONLY the CPU time used by the calling process. Instead, use clock_gettime(). I have an example in the program specs.
Monday, May 16, 9:01 p.m.:My LaTeX link in the homework specs was incorrect, but fixed now.
Monday, May 16, 6:01 p.m.:I was asked if the program in the homework is supposed to run forever, until it is killed (by ctrl-c). The answer is yes.
Saturday, May 14, 9:31 p.m.:I've gotten a couple of queries about the meaning of the variable wwidth in the current programming assignment. Actually, it's a perfect example of what I was talking about on Thursday, in which I urged you to make sure what goal this program is trying to achieve.
The specs say
[The program] will repeatedly cycle through the list, timing how long it takes to access each one. The goal of the program is to gauge the current speed of the network... The report will consist first of the mean and standard deviation of the most recent wwidth ("window width") Web accesses.
Think about this. The speed of the network changes, sometimes faster, sometimes slower, as network congestion and so on change over time. The program will report current speed, so we do NOT want to use ALL of our previous access times in our report--the really old ones are no longer relevant. On the other hand, we don't want to base our report just on the last one or two accesses, as that would not be enough data on which to make a reliable report. So we let the user decide how far back in time to go for the data for our report. The argument wwidth allows the user to set that to his/her liking.
Hopefully the term window makes sense to you too. Do you see why I chose that word? It is used in the sense of the common phrase, "a narrow window of time."
OK, since the report is based on the last wwidth accesses, your program must at all times maintain a record of the last wwidth accesses. Any given observation is discarded wwidth accesses after it arrives.
Wednesday, May 11, 3:21 p.m.:Homework IV is now on the system.
Saturday, May 7, 6:22 p.m.:I've added a section to the revised book in the I/O chapter, titled ``Game Example.'' This will make our discussion of interrupts more concrete. Please make sure to read it.
Saturday, May 7, 10:44 p.m.:We will have our Midterm Exam on Thursday, May 26.
In the next couple of weeks, I'll be formulating the structure of our Final Exam, which consists of a takehome group written project.
Monday, May 2, 9:09 p.m.:Remember that I constantly revise the textbook. If you find something which is unclear, please check the revision to see if I've already clarified it; if not, please let me know, so I can expand the explanation.
Thursday, April 27, 8:33 p.m.:Wei mentioned to me today that many students missed Problem 4 in Quiz 2 only because they did not know how to evaluate the -16 constant; they knew how to use the andl instruction. I really appreciate Wei's bringing this up. He's one of the most conscientious TAs I've had, which is really good. Actually, this problem provides an excellent opportunity for me to review what this class is all about, and what computer science in general involves.
Computer science does not equal programming; the latter is only one of many aspects of the former. This is especially true for ECS 50, which as I've said should NOT be viewed as a programming course; it's a course in which we learn about the machine, with programming serving as a vehicle toward that end.
For that reason, in Problem 4 the -16 is just as important as the andl. And even that statement is a little misleading, as it seems to imply that the -16 is about the machine while the andl is about programming; the fact is that they are BOTH about the machine. The -16 concerns the manner in which the machine stores negative numbers, while the andl is a section of circuitry on the CPU chip. Granted, that circuitry was put there because it was anticipated that programmers would want to use such an instruction, but it is indeed part of the hardware.
Now, a "strategy" point about the -16: When you learn something in any course, you must keep in mind that you may be called to use it later in the course (or for that matter, in a later course). If you are not clear as to how to use that thing, you should make sure you remedy that lack as soon as possible, by talking to me or Wei or both of us, so that you are ready to use it when the need arises.
Thursday, April 27, 2:07 p.m.:I've placed the (corrected) solutions to Quiz 3 on the Web.
Thursday, April 27, 1:35 p.m.:I've just revised the book in the section I covered today with the function sum(). I've put in fuller output, illustrating the points I made today. (As mentioned, compilers evolve over time, so the code now looks considerably different from before.)
Wednesday, April 26, 2:53 p.m.:Assume the denominations are in descending order, e.g. 25 then 10 etc.
Tuesday, April 26, 2:08 p.m.:Hwk III is now up on the Web, due a week from today.
Remember what I said today about taking "baby steps."
Wednesday, April 18, 2:08 p.m.:I've made two clarifications to the specs:
Although the initial roles of some registers are defined in the specs, you may allow the initial values to be overwritten. For example, although ESI will initially contain the address of the multiplier matrix, it can change over time if you wish.
Also, I was asked how large a matrix your code needs to handle. But if you think about the specs carefully, you'll see that such a question is actually irrelevant; your mulsym function code should work no matter what the matrix size is. Of course, in your wrapper code you'll have actual matrices of sizes of your choice, but you should choose these so that they give your mulsym code a reasonable test, and again, your mulsym code should not depend on some upper bound for the matrix size.
Monday, April 18, 3:59 p.m.:In the homework, assume that products will never be larger than 32 bits, and no operation will generate overflow.
Thursday, April 14, 11:24 p.m.:Wei will be handing back Quiz 1 tomorrow. A number of people did very well, but some of you will probably be disappointed. I'm writing this to tell those in this latter group not to get discouraged. I'm actually a rather liberal grader. It does take some students a while to get used to my "test for insight not for syntax" exam style.
Wednesday, April 13, 11:58 p.m.:Homework II is ready.
Friday, April 8, 4:27 a.m.:I am extending the homework deadline to Sunday.
Friday, April 8, 9:39 a.m.:Are there a lot of groups that need more time on the homework? I could extend the deadline somewhat if needed.
Friday, April 8, 9:38 a.m.:Someone asked me if they should use the scrollok() function. You can use whatever functions you like, but it really isn't necessary. I would recommend sticking to the primitive functions.
Friday, April 8, 9:15 a.m.:I've mentioned the notion of taking "baby steps" when you are programming. Here's a case in point.
Someone e-mailed me today and said he was having trouble with the scanw() function, which was causing a seg fault. Since he didn't include his code in his e-mail message, I couldn't say much specific regarding his code, but I suggested that he first try scanw() in isolation, NOT in his program, to make sure he was using it correctly.
For example: Go to the sample program psax in my curses tutorial, and change the line
c = getch();
to
scanw("%c",&c);
(The .tex source file for the curses tutorial is at the same location, so you don't have to type the program by hand.)
Then recompile and run. Note that scanw() reads until the user hits the Enter key, so that for instance instead of simply hitting the u key to go up a line, you must hit u then hit Enter.
Now, how did I know one must hit the Enter key? I checked the "man page" for scanw(), accessed by typing
% man scanw
It told me that scanw() works like wgetstr(), and the man page for the latter told me about the role of the Enter key.
Thursday, April 7, 2:37 p.m.:I was pleased that several students responded to my "Be wary" remarks in class today. It would have been even better if they had done so during class. I thought I would post some followup remarks, as follows.
First, here are some good links for the points I was making:
This is the only mainstream-media report about the new Chinese machine that questioned the huge resources devoted to supercomputer projects, and pointed out that with sufficient fine-tuning (read "money"), one can build ever-faster supercomputers (which I was referring to with my skyscraper analogy).
Concerning the latter point, the article says, "...any organization with enough money and expertise can buy what amount to off-the-shelf components and create a fast machine." Even the reference to the Chinese machine's network beating Infiniband must be viewed in this light; Infiniband, as commercial product, must meet a price/performance tradeoff point, whereas with Infini$ a much faster network could be built.
The quote of Steven Wallach ties to my point today though China, as a developing country, needs the publicity, one may question whether expenditure on supercomputers is right for the U.S.
On the other hand, the article contains several quotes by those who have vested interests in the federal government spending more money on supercomputers, including by Jack Dongarra, arguably the most famous parallel processing researcher in the world.
My phrasing today, "Be wary," meant exactly that--be skeptical. It of course does not mean to go to the other extreme and automatically reject everything you hear or read. But keeping in mind the terms vested interest and hidden agenda will serve you well.
Wednesday, April 6, 9:04 p.m.:Please forgive me for bringing this up again, but please review the rules for Tests in the Syllabus. NO TALKING during the exam, INCLUDING during the time the TA is collecting the exams; KEEP YOUR PAPER COVERED especially when you are consulting your book; NO USE OF ELECTRONIC DEVICES, including iPads, phones, calculators etc.; use the restroom BEFORE the Test, not during the Test. If the TA has to warn a person more than once, I will have the TA notify me.
Sorry to be so harsh in tone here, but we need to have Test run in an orderly manner. Thanks in advance for your cooperation.
Tuesday, April 5, 11:34 p.m.:In case you missed class today, there was a reading assignment: All of Chapter 2, by 4/15 Quiz.
Tuesday, April 5, 9:28 p.m.:I've been asked what format the TA's test file will be in. If you have that question too, please read on, as I fear you may have a fundamental misunderstanding of the problem specs.
The format of the input file (if any!) is delineated fully in the second bullet in the problem specs. It begins with "For simplicity, we'll assume..." and ends with "Initial entries are 0s." This bullet fully specifies the format; there is no wiggle room. Please make sure you understand this, not just for the sake of the homework but also in terms of general principles.
I say "if any!" above, because the first bullet in the specs informs you that the program will either (a) have no input file, and will create a file, or (b) it will have an input file which had been previously saved in a prior run of the program. So, for instance, when you test your program, you do NOT create an input file using Vi or some other text editor; instead, you first run your program to CREATE a test file, then run it again to see if it inputs correctly and to see if your program edits it correctly.
Note that that is still not quite a full test, because your program might be making compensating errors. Say for instance you forget that the file is to be binary, not ASCII. Then you might output the wrong file but then read it in correctly! That's the reason to use the Linux od command to check the file you create.
Please make absolutely sure you understand all of the above. Feel free to ask me any questions you may have.
Tuesday, April 5, 9:26 p.m.:Assume the user hits the Enter key at the end of the mc and ec commands.
Monday, April 4, 10:38 p.m.:Note for those on the waiting list: I cannot predict whether you will get in to the class or not. If you wish to try, please ask the TA to assign you to a Homework group, and work with the group for the time being. You may also take the Quiz on Friday. However, please note carefully that no adds will be allowed after the deadline. If you are not able to add by the deadline, no Homework or Test grades will be recorded for you.
Monday, April 4, 8:18 p.m.:If you do not already know the functions sprintf() and sscanf(), please look them up. You may find them useful.
Sunday, April 3, 6:18 p.m.:Some of you might not be aware of the versatility of formatting in printf(). You may wish to check your C book. What, you sold it back to the bookstore at the end of the course? Then there's lots on the Web.
Sunday, April 3, 12:50 p.m.:Please note that the program specs are indeed specs, i.e. requirements rather than suggestions, except when stated otherwise.
Thursday, March 31, 10:54 p.m.:Wei's office hours will be Tuesdays, 3-6.
Thursday, March 31, 9:04 p.m.:In any programming project, I always strongly recommend taking "baby steps," NOT doing the whole thing at once. In this homework, for instance, I suggest that you first write the program without a scrolling capability.
Thursday, March 31, 7:31 p.m.:Hwk I is ready! Go to the homework section of our Web page.
Tuesday, March 29, 4:31 p.m.:My office hours are on our class Web page. The TA's office hours will be posted soon.
Tuesday, March 29, 4:23 p.m.:Homework group size must be either 3 or 4.
Please note what the Syllabus says about the deadline for forming your Homework groups. If you don't know anyone in the class that you'd like to work with, please notify our TA during discussion section this Friday; he will form groups for such people at that time.
Tuesday, March 29, 4:22 p.m.:We have a new TA assigned, Wei Liu. He took a grad class from me last fall, and I was quite impressed with him. I'm sure he'll do a great job!