Rough Book

random musings of just another computer nerd

Tag: intel

The State of Computer Engineering

I was having a conversation with a few good friends (old college buddies, and fellow nerds) over a couple of beers a little while ago. We mainly reminisced about certain key classes we took while we were at ASU, and also about the state of CS and CSE graduates today. Indeed, the very nature of the degree. First, a little bit about those key classes that we took and still think about. These classes are CSE 225, CSE 421, CSE 423/438, and CSE 521. I wasn’t able to take CSE 423 and 438 because they were discontinued by the time I had completed the required prerequisites. But I was able to take the other three. All three classes deal with assembly programming. Assembly programming is the lowest level of programming there is. You directly control the CPU by sending it instructions. These instructions are actually decoded into a bit-pattern, which essentially translate into a series of on and off signals that travel to various places within the CPU (or even associated memory, I/O, etc.) and make it do cool stuff. At this level, you don’t have any of the niceties of higher-level programming-languages. There are no variables. There are no function parameters. There is no easy way to do I/O. Data can sometimes be program code and program code can sometimes be data, depending on your point of view. It’s a highly restrictive and immensely liberating and powerful environment at the same time. It takes a lot of effort to code in assembly, and much more effort to code well.

My introduction to assembly programming began with CSE 225. The class was taught by Lance Johnson and dealt with the Motorola 68HC11 (now produced by Freescale Semiconductor). I was pretty nervous about the class because I had heard how hard it was. As it turned out, yes, the class was hard. I put a lot of time into the class, and in the end it paid off. I got an A. The next class after CSE 225, was CSE 421 and this was taught by Dr. David Pheanis, one of the best professors I’ve ever had. Lance taught CSE 225 the same way Dr. Pheanis taught CSE 421, although it wasn’t as difficult. Both classes had “shotguns” (unannounced quizzes) and lab demos. In both classes you had to document your code thoroughly. In addition, you had to demo your code to the TA’s and every time you failed a demo, you would have 5 points knocked off your score for that lab. Oh, and in addition you were also graded on the efficiency of your lab solution. Embedded environments are usually sparse when it comes to resources, so getting your program to be small and fast is very important. Your efficiency score was calculated against the professor’s score. For every byte that you were over the optimal solution, you get one point taken off your lab score. If you ever beat the optimal solution, you got additional points. Pretty exacting standards.

In CSE 421, it was even harder. Dr. Pheanis would grade you on time on some of the labs as well. You also wrote code on the Motorola 6800, which was the predecessor of the 6811. As a result you were limited on the number of registers you had, which made it harder to write code (well, efficient code). You also had to have a very good amount of documentation. Each lab had a General Overview, User’s Guide, and Internal Overview. Any subroutines in your lab had to have its own User’s Guide and Internal Overview. Stack usage had to be properly documented. Logical groups of your assembly code had to be extensively documented and you had to explain the what, how, and why of your code. So if your program wasn’t adequately documented, you lost points. Our final lab involved implementing an Asynchronous RS-232 receiver and transmitter driver for the 6800. At the end of CSE 421, I learnt a lot of useful things. For one, I learnt how to write efficient code (something that has carried over into my high-level programming) and I learnt how to document my code really well. I also learnt how to be a good programmer.

The last class I took with Dr. Pheanis was CSE 521. You could register for this class, but more often than not, Dr. Pheanis invited you to take the class if he thought that you were a good student, and that you could handle the course load. I was privileged enough to be invited by Dr. Pheanis. In CSE 521, you write assembly code for the Motorola 68000. The 68k is a beautifully designed processor. The instruction set is almost completely orthogonal, and in general, it was a complete delight writing code on it. On a side note, writing on the 68k spoiled me to the point where it was impossible for me to pick up x86 assembly. The design is just atrocious. Anyway, the class was hard. I took it during my final semester at ASU, and I had two other classes (that I actually needed to graduate), but I spent the most time on CSE 521. In addition to the usual stuff you got graded on in CSE 421 (demo-passing code, efficieny (time and speed), and documentation) you were also graded on English grammar. I remember getting my first lab back and finding red marks all over it. Granted, I had done a little better than my classmates. I’ve always been comfortable with the written aspect of the English language and I thought I had a decent grasp of the language. Well, it wasn’t as decent a grasp as I had thought. I was introduced to problems such as “it or this without proper antecedent”, “the scope of ‘only'”, and “proper hyphenation”. Oh, there was also the infamous “Avoid ugly passive voice” stamp. Examples of such problems:

An “it or this without proper antecedent” grammatical error occurs when there is ambiguity in a sentence about exactly what “this” or “it” is referring to. For example, “Susan bought a dress and a hat. It was green.” In this example, we can’t say what “it” is referring to; it could be the dress or the hat. The sentence should be rewritten: “Susan bought a dress and a hat. The hat was green.” The “scope of only” is an interesting one. Consider the following sentence: “John only drinks water.” You might think it means that John only drinks water and not any other kind of drink. Actually, the only restricts the scope much more than that. What the sentence actually means is that John only drinks water and does nothing else. He doesn’t eat, sleep, sit, stand or do anything else for that matter. He only drinks water. The correct version of the sentence is “John drinks only water.” In general, you want to use “only” as late in the sentence as possible. Hence, the “scope of only”. Then there’s “proper hyphenation”. You generally want to use hyphens with compound nouns and adjectives. For example, “dining table”, “fish tank” and “operating system” are compound nouns whereas “black and blue” and “extremely hot” are compound adjectives. When you use an adjective to describe a compound noun (or vice versa), you need to properly hyphenative. Otherwise, the meaning of the sentence will be ambiguous or nonsensical. For example, consider the colloquial expression “It was a cold ass day”, meaning “It was a really cold day”. Does it mean it was a “cold-ass day” (compound adjective “cold-ass” with noun “day”), or does it mean it was “cold ass-day” (adjective “cold” with nonsensical compound noun “ass-day”)? Properly hyphenated, the sentence should read “It was a cold-ass day”.

You might wonder why English grammar is so important in an assembly programming class. Programming is more than just writing code. Once you write something, you (or someone else) needs to maintain it. So it is generally helpful if you can tell what your code is doing. This is especially important in assembly programming where it is not immediately obvious what the code is doing. I remember how Dr. Pheanis used to say that Engineers generally have terrible documentation skill. This is very true. I cannot count the times I have scratched my head looking at code I only wrote a few months ago, trying to figure out what exactly I was trying to do.

Now to the original point of my post. Larry Wall (creator of Perl) along with Randall L. Schwartz and Tom Christiansen outlined the three virtues of a greate programmer:

  • Laziness – The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful, and document what you wrote so you don’t have to answer so many questions about it. Hence, the first great virtue of a programmer. Also hence, this book. See also impatience and hubris.
  • Impatience – The anger you feel when the computer is being lazy. This makes you write programs that don’t just react to your needs, but actually anticipate them. Or at least pretend to. Hence, the second great virtue of a programmer. See also laziness and hubris.
  • Hubris – Excessive pride, the sort of thing Zeus zaps you for. Also the quality that makes you write (and maintain) programs that other people won’t want to say bad things about. Hence, the third great virtue of a programmer. See also laziness and impatience.

In addition to the three listed above, I’d like to add another one: Passion. This is the virtue that makes you like writing code. This is the virtue that makes you sit up till 3 A. M. in the morning hacking out a Mandelbrot-Fractal Generator or an artificial-life simulator just because you think it’s a cool thing to do. This is the virtue that makes you crash your box because you decided to do something bleeding-edge and incredibly unstable and dangerous just because you wanted to. This is also the virtue that gives you the desire to learn; the urge to acquire newer and better skills and to be a better programmer. Passion, is unfortunately in short supply these days among most programmers that come from college (or at least, ASU). In part, I blame the administration itself. When I was in college, the department tried very hard to force Dr. Pheanis out of his class, ostensibly to “modernize” the curriculum. Their rationale was that the processors used in Dr. Pheanis’ classes were “outdated”. Apparently they weren’t able to grasp the concept that assembly programming is not about using the latest and greatest processors, it is about learning the fundamentals. Dr. Pheanis’ last class was in spring of 2004. He’s a professor emeritus, and no longer teaching at ASU. ASU’s current computer engineering curriculum doesn’t have many interesting courses, for example, as I found out from Marc, ASU isn’t offering a compiler-design course anymore. In an urge to make the course more “modern”, I think a lot of soul has gone out of the program. Just taking all the classes doesn’t turn you into a Computer Engineer or programmer. It’s true that I learnt a lot of theory and a lot of other useful stuff from the classes at ASU, but a lot of times I went out of my way to learn things on my own. When I started college, I didn’t know the first thing about Unix. I knew how to write code (I wasn’t great… yet 😉 heh), but that was it. During my first semester I taught myself how to work on a Unix system. I learnt how to use vi and how to write shell-scripts. Over the years I started teaching myself more and more stuff – I taught myself Perl and PHP, and picked up the finer points of web development. I taught myself how to set up and administer a FreeBSD server. What also helped me a lot was that I was around people who found these kinds of things as interesting as I did. The classes and professors fostered the type of environment where you felt inclined to learn more than just what the curriculum offered. There are graduates these days who don’t think there are other development environments besides the GUI. I was writing code on a Solaris system when I was in college. My development environment consisted of the commandline and vi. It’s actually only recently that I’ve been using IDE’s (I hadn’t really used an IDE since Borland’s IDE for C++, and that was during my junior and senior years of highschool), and while I definitely find that they enhance productivity (especially for large projects), I feel equally at home hacking on the commandline. There are graduates today who don’t know anything more than what they’re taught at college (I like to call them “cookie-cutter programmers”). They know Java and/or C++ (and perhaps Lisp, and C). They know data structures, and maybe they’ve heard of Linux. But they really don’t know anything besides what they’ve been taught (I don’t think all is lost, however, there still are graduates who do more than just the curriculum – who are passionate about the field).

I guess what I’m trying to get at, is that I think CS programs at should should foster an environment of self-discovery, self-learning, and exploration. Unfortunately, I find that this is not the case with ASU’s CS program these days. Compared to what it was when I’ve gone through, it just contains a bunch of stock classes that have replaced the older ones. The reason? Supposedly “accreditation”. In fact, I remember feeling extremely disappointed when Google closed their doors in Tempe. The Google office was very close to the ASU campus. Their closing told me that they weren’t able to attract good talent from ASU, and that’s just disheartening. Perhaps the heads of the CSE department at ASU should be more concerned about giving students good, practical knowledge, and teach them how to be better Computer Engineers and Programmers than just being concerned about accreditation.

Work, Moving, Halloween, Unknown Girlfriend

So it’s October. I should be moving to my house this month if everything goes well. I am not looking forward to moving. I hate moving. I really wish we had Star Trek transporters. I could just transport all my stuff over there. Seriously.

What else? Work is cool. I am writing some neat perl scripts and pretty soon I think I might get to do some C. Sometimes I feel that I shouldn’t enjoy my job so much. Most people don’t. What if this means I will hate it a lot later? I really should stop being so paranoid and suspicious. Yeah so that’s pretty much what’s happening at work. It’s fun and I work with a great bunch of people.

I can’t wait for Halloween. I don’t know if I posted this before, but I got myself a Halloween costume. It’s a DS9 Star Trek Costume. Captain Sisko’s, so it’s the command uniform (red shoulder). I even got a communicator that beeps and says “Bridge Here, Status Report” when you press it. It sounds like Worf, or some dude who’s voice has been slowed down, or maybe the battery on the thing is dying. Yeah, so this whole thing screams “NERD!”. I don’t care. Hey, I enjoy it and it’s fun for me. If it pisses you off, then I don’t give a crap.

I have an unknown girlfriend. I have no idea who this girl is. If any of you see her, please tell her to call me. Or maybe she expects me to call her seeing as I have never called her. Everyone seems to think I have a girlfriend. They keep asking me about my “girlfriend” or “girlfriends”. I can only give them a blank look and go “Uhhh… girl… who?”.

That’s pretty much it.

Lost Badge

Talk about a crazy way to lose my Intel badge. I was walking into the elevator when it fell down and into the crack between the external elevator doors and the elevator car. What are the odds?

Intel and Artificial Life

This is my fourth day at Intel. I think I will enjoy working here. I haven’t done much yet though, and I still don’t know exactly what it is I am supposed to be doing. I tested some 140 chips yesterday, but that wasn’t too much work. My supervisor is out until Tuesday, so until then I am doing some odd jobs and reading up some documentation about the platforms and tools we use. I am excited to be working here. It looks like it’s going to be hard work, but I think it will also be fun.

Now about the Artificial Life. I have written up some specs on an Artificial Life program. This is different from earlier ones. I am implementing the “creatures” like assembly programs. This code is their “DNA”. It describes how they behave. A “God Program” executes one instruction of each “creature” and moves on to the next. Sort of like a pre-emptive multitasking operating system. The creatures all live in a two-dimensional area of memory. They can reproduce, and there is chance of error during reproduction.

I think I was going about it the wrong way earlier. I was trying to describe behaviour through variables and through discrete quantities. Now, I represent each creature as a bit-pattern – exactly like an assembly program. I have instructions for moving, eating, moving and attacking, reproducing, and sleeping. In addition, I have some very basic branches and loops. So based on the bit pattern, the creature has a certain behaviour. Also, changes in the bit-pattern can cause changes in behaviour. They can be subtle, or drastic. At least, that is what I believe. I need to actually implement my idea before I can find out! My God program is essentially an operating system, and the “creatures” are tasks. There’s a little more to all of this, but I can’t write it all here. If and when I finish the program, I will make a separate page for it and describe it in detail.

I am thinking of calling this program “Eden”. Anyway, that’s all for now!

Intel, Lab 9

Just got a call from Intel today. Found out that I’ve been selected for an interview there. I’ll be doing the interview… and if I get both (!) then I’ll have to decide which one I want. It feels good to know that I’ve been selected…

Lab 9 is pretty interesting! It’s gonna be hella hard… but… interesting!

All original content on these pages is fingerprinted and certified by Digiprove
%d bloggers like this: