Showing posts with label finals. Show all posts
Showing posts with label finals. Show all posts

Monday, June 23, 2008

Final exams, part 4: Asynchronous systems

At last, finals are over and the semester is complete! The last final was not really an exam at all. It was a presentation. We all had to do a final project, and then give a talk about it. And because this is my favorite class, I decided to overachieve like a bandit.

Instead of doing a final project, I did five final projects. One of them was writing a paper. One of them was modifying a program from the University of Manchester to work properly with Quartus II. Then I made a random number generator in hardware, and some more hardware for 16-bit cyclic redundancy checking. And a simulator for sets of production rules, which can also use IRSIM to do transistor-level simulations. You might say that I went a little nuts.

The reason I did all this is because this class was actually very, very interesting. It was aimed at graduate students (and I think I'm technically enrolled as a grad student for some reason) and the material was only dumbed down slightly! This has some good points and bad points.

Let's get the bad part out of the way first: a lot of people had trouble. For example, a homework project might have been assigned a week or two in advance, but when it comes due I'm sometimes the only person to have it done. The class included practical work and reading real research papers, and I guess that can be a little intimidating.

The good part is that it's something useful and interesting that you can really sink your teeth into. Some research papers are remarkably accessible, and the practical work is at least manageable. Let me give an example.

Here's a paper on how we might be making computers in five years. It talks about a neat new way of fabricating electronics called a nanowire crossbar array, and while it's stupendously tiny it's also not suitable to the way we design processors today. Imagine electrical signals as water slowly spreading through wires, and you need to ensure that water reaches a thousand faucets at the same time, but you don't control the plumbing. How can you do it? You can't. This is similar to the problem of clock distribution: all conventional processors require that you send a really fast signal to all parts of the chip, keeping it all synchronized like a coxswain on a rowboat. And you can't do that on a crossbar array. But using asynchronous techniques, you can make a processor on it. The processor will just be very different from almost every other processor ever made. Exciting to be on the forefront of a big new thing, isn't it?

When I came here I decided that I would use some of my Copious Free Time to go overboard on something worthwhile. This is it, and I'm glad I put in the extra effort.

Thursday, June 19, 2008

Final exams, part 3: Integrated Circuit Technology

I just finished up the final exam for IC tech. It went okay. On the one hand, I was able to answer most of the questions in a decent way. On the other hand, I forgot my notes on epitaxy! No!


At the beginning of the semester I thought that this class would eat me. It started with a bang, talking about wave functions and Fermi levels and similar quantum crazy stuff. After a lot of very intense studying I managed to get a basic understanding of the early stuff.

And then the learning curve showed its true nature: you start off by banging into a brick wall with the semiconductor physics, and then it's smooth sailing. Later topics were things like oxidation of silicon, or doping. These are complicated subjects in their own right, but much easier to grasp. And to top it off, there aren't really that many formulas that you'll ever have to use, and they're all in the lecture notes, which you can use on exams.

Overall, I think that I now have a much better understanding of how transistors work, how chips are made, and what the big deal is with integrated circuit layout. Nobody learned more than a fraction of the material -- the professor knew a lot, but the information just came too fast and too disjointed to hold on to all of it -- but it was good stuff. I think we were tested not so much on our retention of the material, but on how good we were at understanding the lecture notes well enough to look up the bit of information that we needed. And that's actually a very clever approach to testing.

Three down, one to go.

Tuesday, June 17, 2008

Final exams, part 2: Operating Systems

I've finished the final exam for my Operating Systems class, and I must say, I'm glad to see the end of it. It wasn't a particularly difficult class -- while I probably got my lowest grade in this class, I would describe it as almost comically easy by engineering standards. The problem is that the class was poorly taught and I already knew most of the material in more detail than we were ever given.

I'll tell you an example: filesystems. A hard drive can be thought of as a bunch of blocks of data, and each block can be read sequentially. It can fetch any block for you, but switching to another block is much slower than sequential reading within a block. And since these blocks are small, we need to work out how to divide up files among them. It's as if you had a blackboard divided into small squares, and you needed to compose several essays on this blackboard. How do you use the little squares?

You could just start in the upper-left corner of the blackboard and use each square in order, and write down your essays. This is called contiguous allocation. It has problems, of course. What if you need to add something to the beginning or end of an essay? Maybe there will be extra space at the beginning or end; no such luck if you want to add a paragraph in the middle, and you have to recopy a bunch of words from one block to another -- in the worst case, you might even end up rewriting everything on the whole blackboard just to add a single word.

You could give each block a number and write the number of the next block on it. Then when you want to go to the next part of the essay you can just look to see the number of the next block, and go there. And so on: just follow the chain. This is called linked allocation. It makes adding paragraphs and such much easier: just change a few numbers around and add a new block to the chain. The same goes for deleting data. Finding an arbitrary place in your essays can be a little tricky, though: you have to follow a bunch of links, and each jump from block to block takes time.

Another strategy is to write the order of blocks on its own block -- a table of contents, if you will. This is called indexed allocation, and it's the most practical system of the lot. There are still issues with this, and they can be made faster by using something called a B+ tree. But we never got to that -- we spent too much time obsessing over minute details of broken implementations of things like linked indexing. I'm not kidding.

And if you ever asked a question, you would get an unrelated answer. Always.

So, as I said before, I'm very happy that this class is no longer a part of my life.

Final exams, part 1: Algorithms

I just finished the first of my final exams. This was for Algorithms, which has a reputation as a nasty class. I didn't find it to be particularly nasty, but I'm sure part of that is because I've had a book on algorithms for years and so already knew about half the material.

The really neat thing about spending this semester abroad is the way grades transfer over, or more accurately the way they do not. As long as we get passing grades, we get credit for the class -- and the classes don't affect our GPA. This is very pleasant. While I'm not going to neglect my education (perish the thought!) I love being able to shrug off the work that doesn't teach you anything.

For example, consider optimal matrix parenthesization: you want multiply a bunch of matrices together, calculating something like ABCDEF (where A, B, C, ... are matrices). Matrix multiplication is associative, so you can do the multiplications in any order and get the same result, but how much calculating you need to do depends very much on the order. Maybe A(B(C(D(EF)))) takes five minutes and (A(BC))((DE)F) takes five seconds -- this could be a very valuable thing to know ahead of time.

To simply go through and solve this by brute force and ignorance for n matrices requires going through something proportional to 2^n possibilities -- probably more trouble than it's worth. But there's a key observation you can make: any part of an optimal solution is an optimal solution to a subproblem. So in the example I gave above, A(BC) is going to be the optimal way to parenthesize ABC. The optimal solution for DEF is going to be (DE)F. And at the highest level, we just need to know where to split the multiplication into the product of two subproblems. This leads to a recursive solution, but it repeats a lot of subcalculations, so by remembering the solutions to problems and not recomputing them, we can make it dramatically faster.

Now, that's the high-level understanding. It's also sufficient to actually write a program to solve the problem, and it will be pretty simple and zippy. But for various (mostly historical) reasons, we have to learn to do this calculation using a system of filling in these weird triangle-shaped tables of numbers. This is more efficient if you really want to write a fast program, and I suppose it's easier to do on paper -- but it's completely unnecessary from the standpoint of understanding what's going on. Indeed, I don't think our lectures ever really mentioned that the whole point of the tables was just efficient memoization.

I never did learn exactly how to use those tables. My grades suffered a little because of it, but I understood the algorithm and managed to keep my morale up by avoiding the triangle tables. I consider that a good bargain.


There is too much emphasis, here and everywhere else I've been, on memorizing how to do some particular kind of problem that will be on the test. If you spend too much time focusing on the details of one particular implementation of one variant of the concept, you lose sight of why the textbook even gave you that example in the first place: as something concrete to generalize from. We had quizzes which ostensibly tested our knowledge of Quicksort, but the thing they tested was very different from what computer scientists mean when they say "Quicksort". Quicksort refers to a whole family of related algorithms, and the thing they all have in common is that they pick a pivot element, put everything smaller on one side and everything larger on the other, then recursively sort each side. This can cover everything from a simple textbook quicksort on up through complicated things like randomized median-of-three partitioning adaptive Quicksort that uses insertion sort for small subarrays and can revert to heapsort on perverse inputs. What we were quizzed on was an example program in the book, and we were expected to memorize everything about it, right down to how it rounded an insignificant number and the order of the arguments to the function. Anything slightly different from this was "wrong", even though this criterion would make a lot of other algorithms textbooks "wrong" as well. Such decisions have to be made in any implementation of the algorithm, but for learning how Quicksort works they are useless details.

Complaints aside, this was a pretty good class. The material was interesting, and it's a pity we didn't get to more of it. The textbook was friendly, or at least as friendly as a thousand-page clunker can be. The professor spoke English well and seemed like he would probably feel more at home in an American classroom. (For all the reputation Americans have for being dumb and lazy, engineering students in the US compare very nicely with our Taiwanese counterparts.) The homework assignments were few, although I hear that this is because homework solution copying is utterly rampant here.

In any case, it's nice to have this done. One down, three to go.