Hello World done better.

Most programming books and lectures begin with treating the computer as if it were a magical box that should be taken for granted. Eventually, a good student will discover that a computer is no more logically complicated and a series of strings and switches, but making this step is nearly impossible with most readily available equipment. For that we need two years of courses at a university.

What if this weren’t the case? What if the computer were treated with even less deference than we would give Hello World?

Of course, computer languages are complicated monsters. Let’s take a look at HelloWorld written in Java.

package net.saga.tutorial.helloWorld
class HellowWorld {
public static void main(String args[]) {
System.out.println("Hello World!");

Holy shit that is a lot of code. Worse, how do you even begin to explain what it actually means? Now let’s look at MIPS Assembly instead.

add $2, 1, 1

This code adds one and one and stores it in register 2. This is much simpler than the Java example, and it brings us closer to demystifying the computer. Maybe, however, we can make this even simpler. What if we remove the computer all together?

Let’s say we have a battery, two switches, and a light. Let’s call the first switch A, the second B, and the light bulb $2. When a switch or light is off we will give it a value of 0. When one is on, it will have the value one. So, we have two switches turned off, and the light is off; in other words, zero plus zero is zero. If we turn on switch A the light comes on, and we have 1 + 0 = 1. If instead of A, we switch on B, we have 0 + 1 = 1. So with out a computer we have implemented our MIPS instruction.

What happens when we turn both switches on in a three way switch? The light goes out. Since we all know that 1 + 1 = 2 our analogy must be broken. This is wrong. Our analogy and the thought experiment is still how computers work; the mistake we made was assuming that 1 + 1 = 2. Modern computers use binary counting not decimal. Therefore, one plus one does not equal two. One plus one, in binary, equals ten. Since we only have one digit in our display (the light), we see only the least significant number, zero. The tens digit, one, is simply lost. What our switch and light example is is an implementation of a one bit adder.

From here we can explore the binary number system as well as the circuitry of an adder. This will of course be a future lesson.


Last week I participated in the Bike Ride Across Georgia, otherwise known as BRAG. I have been commuting by bike for about two years now, and my friend Brian has been suggesting that I take the trip. I left Saturday July 7 for Oxford College with he and Bill. Sunday morning we left for Griffin, followed by Macon on Monday (103 in the shade), then Dublin on Tuesday, the Fighting Irish Century on Wednesday, Hazelhurst on Thursday, Jesup on Friday, and terminated in St. Simons on Friday.

I actually got to spend Thursday night with my parents as well as Saturday. I returned to Atlanta June 15 in time for my tooth extraction June 16.

Pictures will be coming shortly.


This year I am participating in the Bike Ride Across Georgia (BRAG). This yer there should be around 2000 participants and it will go from Oxford to St. Simons for a total of 373 miles, according to the official website www.brag.org. I will be going with Brian and Bill. Actually, right now I am waiting to be picked up by both of them.

Also, I have started working on a few random, small project. So much to do, so little time.

See you next week with pictures.