Wednesday, 17 September 2008

Punch cards?

I dunno why, but I suddenly thought of the wonderful punch card. But what's a punch card? Last time when, transistors have not existed yet, and they have many machines to operate, the people wanna find out a way to automate the machines. You can say that the modern computers were based on that. Machines were made to read punch cards, which were cards with holes representing data. So, the machines can be reprogrammed. The awful thing about punch cards is that to operate a complex machine, you'll need 1 humongous bundle of punch cards.
Here's an image of a punch card I got from wikipedia:


Okay, I know this sounds kinda weird. I thought of implementing the punch card thingie on my comp. But instead of punch cards, I'll use the objective answer sheet that I can get from my school. Then I can scan it into the computer, then make a program to read that scanned image and decide what to do with the data. Hmm... making a computer do something by shading a paper... sounds kinda cool to me. I should start doing it!!

Because the options for the answers range from A to D, one line of ABCD can represent 4 different data. 2 rows can represent 16 different data. 4 rows of ABCD is equivalent to 1 byte of data on the computer (256 different values). And since there are 80 rows that can be used, 1 objective answer sheet can represent 20 bytes of data! If you were to make a 1 MB program just from that objective paper, you'll need around 52 429 pieces of it. It's a very impractical way of developing a program for a computer in this modern era. Obviously, I won't even try to make 1 very complex program. I'm just gonna do it for fun. Hmm... 20 bytes on 1 paper, what can you do with it anyway?

I'll to fit as many data as possible into 1 sheet of paper. This is how I'm gonna do it:
  1. I won't be making 256 different instructions, so, I don't need to use 4 lines of ABCD. Maybe 2 is enough. 16 different instructions, including addition, subtraction, multiplication and division.
  2. A byte can have values ranging from 0 to 255. A small part of it consists of the usual alphabets and numbers. So, it won't be necessary to use 4 lines of ABCD to represent the letters of Alphabets and numbers. There are a total of 26 alphabets and 10 numbers (0 to 9). I think 3 lines of ABCD would be enough to suffice that amount of alphabets and numbers. Let's see, 4x4x4=64. I can even throw in another 26 alphabets! 26 for small letters, another 26 for capital letters. 64-(52+10)=2. I guess I can add the comma and the full stop punctuations for the extra space.
  3. But for real numbers, I don't need 3 lines at all! 2 lines would be enough. 2 lines represents 16 different values, and that's more than enough to hold all the values between 0 to 9.

0 comments: