• about
  • f.a.q
  • contact
Home

Exploring Computers

icekin — Tue, 2003/09/16 - 12:34

This is an attempt to explain the basics behind the working of a compuer. Its meant for laymen who are seeking the answer to the question "Just what is a computer, anyway?"

 

Contents

1. Basics

2. Boolean

3. Switches

4. Logic Gates

5. Today's Machines

6. Hard & Soft - The Fine Line

7. Interpretors vs Compilers

8. Evolving Language

9. Future Development Patterns

10. AI - A Learning Computer

 

1. Basics

Machines to do work. Very much like any other machine that does work, just like a Washing Machine or Lawnmower. Commonly perceived to be a machine with a monitor, Tower casing that houses the Main board and CPU, keyboard, mouse etc. But technically, a computer is a machine/tool/item that computes. By computes, simply means to process data and do something. Of course, what needs to be done when is all pre-programmed.

To understand what we mean here, think about the word computation or compute while reading the below example taken from the pattern on the stone:

Recall a Tic-Tac-Toe board. It is a simple game and you need two players to play. Now, imagine that there is only one person. A paper board game obviously cannot counter its opponent's moves. When you put a piece in a slot, nothing happens. This is because the Tic-Tac-Toe board has no mechanical parts or switches that trigger any response to your move. Now imagine that I use string and levers to build a mechanical machine. There boards top surface has now been replaced by a set of pop up buttons in a square set of 3 rows and columns. At the start, all the buttons are pushed down. You start by pulling one button up. Each button is connected to a lever and that to more levers and finally to another button. So, when you pull one button up, automatically another button is also popped up. That is the machine's response to your move.

Of course, the machine's response for every possible move has already been built into the levers and switches when the machine was made. The person who made the machine sat down and thought out the steps about what to do for all the possible cases to the end of the game.

This machine is a computer. The manufacturer has pre determined all its moves under every possible scenario and built the levers and buttons accordingly. These set of pre determined instructions is called a program. In computing terms, we say that the program allows the computer to 'think'. Of course, this is not the same as human thinking, because it is not so vast. Also, the machine can only think according to its instructions. This 'thinking' ability is called computation.

You may have seen many toys with flashing lights before. You notice that even when the battery is in, they bulbs on the toy don't light up immediately. Often, you have to turn the toy on or press a trigger before the flashing lights come on and the doll begins to 'sing' or whatever. That is computation right there. In most cases, they top will start to do a sort of a sequence. It may flash lights for 5 seconds, then sing a tune for 5 seconds and then flash light again. Those are pre-determined instructions that have been programmed into the toy.

Thus, to briefly summarize here, a computer is anything that can compute. Anything that can trigger a pre programmed response to an action. It may be quite confusing at this stage on how to classify a computer. Many natural things around us seem to be pre determined. An object that is dropped falls to the ground. If we know the mass of the object and the gravitational acceleration of the place where it is dropped, we can determine its time of fall. Does this mean that this is also computed and pre determined? Maybe, but for the sake of explaining the common computers in the world, let us assume that anything that uses switches and connectors is a computer.

 

2. Boolean

There reason for choosing such an explanation is related to the Boolean theory. If everything is pre-determined and pre-programmed, then the entire program is just a sequence of "yes"s and "no"s. The Boolean theory states just this. George Boole believed that there was a pattern that governed everything, even the way we think. Every decision and step of our life is because of a series of yes and no statements. These statements can represent on a flow chart or diagram. Such diagrams are almost always drawn with the root at the top. In Boolean theory, we call the yes as on (or 1) and the no as off (or 0). This is purely a convention. You can call it A and B or cat and mouse to make it easier to understand. But, all engineers use the 1 and 0 convention.

E.g. Tic-Tac-Toe - first step process diagram

Computer moves first

| |

Yes No

| |

Player Computer

moves moves

next next

 

3. Switches

So, where do switches come in? Switches are what control the decision between the steps. A switch being on is a 1 and a switch being off is a 0. A switch is anything that has 2 states. That's all it should have. Look at the light switch on the wall for example. It can be on or off. It cannot be anything else. It cannot also be in between. The light that is controlled by the switch is the same. It can only be on or off.

Switches are thus used to represent the yes and no of every step in the program flow chart. The buttons on the Tic-Tac-Toe board are switches. By looking at which button got pushed up, we can know what move the computer has made. Connectors are meant to connect the switches. 2 switches are joined by connectors. The connector could be anything. It could be rope if the system was made of mechanical switches, or it could be wires if the computer ran on electricity and used electric switches. It could even be pipes and the entire system could be made of valves for switches. So, to build any computer all that is needed is a huge amount of connectors and switches.

 

4. Logic Gates

When switches and connectors are put together in a certain sequence, a program is formed. The entire device is a computer and does something according to the program. Now after building a lot of such machines, it became quite obvious to engineers that certain combinations of switches were used over and over again in many cases. Thus, to simplify the task, engineers decided to group these similar recurring patterns of switches and connectors into groups called logic gates. As larger, powerful machines were made, more types of logic gates were formed. Many of these later logic gates were simply built using previous logic gates. This system of grouping similar patterns into logic gates is not something new. It is done almost everywhere, even outside computers. When a math problem is too large to solve, we factorize and regroup it. When we have too much spare change to count, we group it as pennies, nickels, dimes before counting. Thus, logic gates ARE NOT only applicable to computers. They were first suggested by George Boole himself in the same book where he talked about patterns of thought. The advantage of this is obvious. Once we group something, we don't have to worry about what's inside the group. All we need to know is what the group does and then we can simply work with different groups to form a larger group or system.

 

Microprocessors of the 80s

Microprocessors in the 80s, each of which could contain several thousand  transistors, logic gates and switches.

 

5. Today's Machines

Today's computers are also made completely of switches and connectors. Even the keyboard and mouse and other input devices can be represented by a system of switches and connectors. Though computers can be made out of anything, we still make them out of copper, wires and run them using electricity because we have found that it is the best way to make them smaller. Everyone likes smaller computers. To further decrease the size of computers, all modern computers (including calculators, watches) use printed circuit boards. Each circuit board contains a complex pattern of switches and connectors. Even transistors and operational amplifiers found within the boards are made of switches and connectors.

There are advantages and disadvantages of using pre built and molded sets of switches and connectors. While they make the overall size of the machine small, they also made it less upgradeable. If we wanted to replace a certain sequence of switches and connectors on the circuit board, we can't. Even if we used a cutter and a soldering machine, some inbuilt components cannot be changed. Thus, the smaller the computer, the less it can be changed. Another advantage is that small computers are cheap and easy to build, since they use lesser resources and raw materials such as plastic and metal. In the future is we can find another affordable material that can make computers even smaller than those made of plastic and metal, we will probably use that material.

 

Integrated Circuit Boards

Today we find integrated circuits on boards like this which have brought down the cost significantly.

 

6. Hard and Soft - The Fine Line

If you ever asked a technician what is hardware and software, he would have probably told you that everything you can see, touch and feel is hardware and everything else, such as programs etc. are software. This is a practical explanation, but not a descriptive one. The truth is that software runs on the hardware. It is like an extension of it and is very much part of it. All software is basically made of programs or functions. Recall the explanation of a program above in the Tic Tac Toe example. The program is built into the hardware. It can be changed by changing the positions of the switches and levers. Although this is possible, it is difficult. Imagine having to work through a maze of Mechanical switches and connectors and changing them by hand every time we have to make a new program.

This is where the software comes in. At some point engineers realized that building the program into the very hardware by levers and switches was cumbersome. Thus, they made a system whereby the hardware; made of switches and connectors could be used in a multipurpose manner. They made a system where the hardware would be fixed. This meaning that it would require no tinkering or changing manually. No one would have to solder or weld the circuit board, cut or join new wires every time they had to do something. Instead the hardware would take instructions in the form of binary code (1s and 0s). The binary code would "instruct" the hardware which switches to turn on and which to turn off etc. If we recall from earlier, 1s and 0s of binary code themselves correspond to on and off positions as per the convention engineers use. So, by using this system, different series of 1s and 0s could be written and "fed" into the hardware to tell it to do different things. The mechanism that turns the switches on and off also operates on electricity and receives the instructions via machine code. Thus, by using a fixed set of switches and connectors, various combinations of switch on/off arrangements are possible. If we increase the number of switches and connectors, even more number of combinations could arise. Each combination is different and does something new. Thus, each combination is a different program. Today's computers contain several hundred thousand (probably millions of switches and connectors all welded permanently onto a circuit board. The number of different combinations in this case is probably almost endless. You can write a program to do almost anything.

Although computers understand instructions in the form of binary code, with the millions of switches even on a desktop PC, it is obviously very hard for any human to be able to write the program in binary code. When engineers realized the difficulty of this, they decided to make programming languages. The idea behind this is very simple. Computers still instructions in binary code only. But, humans would write it in another simpler, easier to understand format called a language. Just like spoken languages like English, mandarin, Spanish, French etc. the programming language too has its own grammar, vocabulary and method of writing (called syntax).

After the human finishes writing the program in this language, it will be converted to binary code and "fed" into the computer for testing. The conversion process is called as compilation and it is done, obviously by another program, called a compiler. The first language that engineers made to help them escape from having to program in binary code was called assembly language. Later on, as computers became larger and had more switches and connectors, assembly language encountered the same problems that binary code has encountered earlier. It became too tedious to code in assembly language, so more new languages were invented. The compilers for these languages were written in assembly language.

 

7. Interpretors versus Compilers

Only some languages use compilers. This means that the program, written by humans will first be compiled into binary code. The binary code is then executed by a separate command and "fed" into the computer for testing. Interpreted languages are not compiled. Instead, the program is written and fed into an interpreter. The interpreter then compiles each line of code and runs/executes it. This way, it compiles and runs the entire program, line by line. Some languages, especially the newer ones, use both a compiler and interpreter separately. This method has some advantages, as we will see with Java later on.

The process of language development is very similar to the idea of logic gates I said earlier. When engineers saw that certain combinations of binary codes were used repeatedly, they grouped them into functions. Whenever someone wanted to use that particular function, all he had to do was to write the name of the function (like and, or, not, if, else etc.) and it would be translated into that particular set of binary code upon compilation. When certain larger functions were also used repeatedly, they were also grouped and given a name so that they too could be called upon for use easily without having to rewrite them constantly. The list of all these functions associated with a particular language was kept in a place called the language library, reference or manual pages. The reference was also included along with the compiler so that whenever someone needed help in writing a program, they could simply refer to it. This reference is often called the man pages and can be found in the help section or by pressing F1. On UNIX machines, typing man will bring up the reference.

The process of language development is a constantly ongoing one. In spoken languages, even the old ones like Sanskrit and mandarin, people decided to group certain commonly spoken sounds into alphabets. They agreed upon a certain convention that whenever a certain letter was written a certain sound would be verbally made. Almost everything develops by this system of grouping as seen in the logic gates example. Similarly, as computers keep growing larger in terms of number of switches and connectors, out current programming languages will soon become harder to program in and face the same problem as binary coders once did. Then, by further grouping of common functions and programs, a new programming language will be made to make programming easier. In this fashion, new languages like PHP, PHP-GTK, and Java and C # have been formed and compilers have been written for them. When these languages become outdated, more new languages will similarly be formed and people will have to learn the syntax of these new languages.

 

8. Evolving Language

Now, if people had to always keep learning new languages and their syntax, life would become very difficult indeed. In order to reduce the impact of this problem, newer languages are increased in functionality while still retaining a similar syntax structure of existing languages as much as possible. In order to also reduce the need to have to constantly make newer languages, companies making languages like Java always release newer compilers all the time. In the new compilers, more new programs and functions are included and the corresponding reference library of these functions (called API in Java's case) are updated to include the list of these new functions. This way, it is hoped that the need for too many new languages can be eliminated. If existing languages keep constantly evolving to keep up with the increasing numbers of switches and transistors on new machines, then fewer new languages may be needed. Other languages that are in similar constant development like Java include PHP, PHP-GTK, C# and C++.

 

9. Future Development Patterns

This section is to mainly give an idea of future developments on programming languages.

In the future cross compatibility is a major factor for a successful language or even a piece of hardware. The idea behind technologies like USB (Universal Serial Bus) is cross compatibility. Since computers are so diverse in model, make and Operating Systems, a language that can be written and compiled on any piece of hardware and be used on any other piece of hardware is important.

Java is a good example of a cross compatible language. It is special since it uses both an interpreter and compiler separately. Sun, the company making Java compilers, wrote different compilers and interpreters for various Operating Systems and hardware. When the program is compiled, it is translated into byte/machine code. This machine code can then be read, understood and executed by any of the Java Interpreters on any OS or hardware. Of course, the compiler of one operating system is not the same as the compiler of another OS. But when given a particular program to run; all the compilers will produce the same byte code.

This means one could write the program anywhere and run it somewhere else. The only requirement is that both the machines have their respective compilers and interpreters installed. As long as compilers and interpreters are written for most of the common OSes and hardware, owners shouldn't have a problem getting the correct version for their machines. The byte/machine code is the cross compatible piece of code that can be read by any machine. Flash and Shockwave are 2 other technologies that also rely on a similar compiler/interpreter system.

Obviously, cross compatibility also has its limits. After a certain point in time, supporting outdated OSes and hardware would be of little use unless many people are still using those technologies. The other problem is that for a technology like Java to be truly cross compatible, every machine must have its corresponding interpreter and compiler (if possible) installed. Even if the compiler and interpreter are freely distributed, this is unfeasible for people who don't have access to them. However, since large networks like the internet are spreading rapidly, soon almost everyone will probably have access to these interpreters. In the far future where everyone has an internet connection, the idea of compiled and interpreted languages will probably be more successful. This is more successful technology in the future than it is now.

 

10. AI – The Learning Computer

Artificial intelligence is an area that has attracted much research. AI is also just like any other program, but it is far more complex. AI is fascinating because in many ways it mimics humans. AI has already been deployed in many phone line systems where automated machines can carry out tasks requested by customers at the other end of the receiver. The AI in this case knows how to recognize common voice patterns and sounds. Engineers have even managed to improve some of these phone systems by adding a learning component to the AI. This way the computer can learn to recognize and understand new voice patterns over time.

AI website attendants called site bots have also been deployed widely across many corporate sites. By storing a cookie in the browser, the AI can learn to remember names of people who visit the website as well as what they bought the last time they were there. These AI systems too have a learning program that allows them to recognize commonly asked questions and top selling products.

While all this is indeed interesting, one should remember that AI cannot really replace humans, at least not presently. While some may argue that the learning components allow the AI to become better with time, the fact is that the learning program too is pre-programmed. Behind every computer, at the most fundamental level, there lies a program that cannot be changed, whether it is the basic hardware switches and connectors or the software. Thus, it is never really possible to build an entirely dynamic machine that changes and grows the way humans do. This is where AI fails against the human brain. However, if we follow George Boole's theory, we will see that literally everything, including many things in nature can be broken down into yes and no states. This in turn means that everything, including the human brain works like a computer at the most basic level and can be represented in binary code. The entire human body too is just a machine and works like a computer at the most basic level. However, medical science estimates that we know hardly 7 to 8% of the entire human body so far. That is why no current computer is of any match to the human brain which has been formed over thousands of years of evolution. However, in the future, if we should ever discover the entire structure and makeup of the human body and the way this giant naturally formed machine functions, we may be able to represent it as a program. Then, at that stage we will probably be able to make AI almost as clever as humans themselves. However, we will have to first find out far more about the human body before we can achieve that.

  • Computers
  • Printer-friendly version
  • PDF version

Navigation

  • Freelinks

Tags in Writings

Internet Miscellaneous DIY Ideas Research Computers Opinions
more tags

Links

Hacker Glider

Verified AttentionTrust Member

DonationCoder

  • about
  • f.a.q
  • contact

Copyright 2006 - 2008 icekin.com. All contents on this site are licenced under a Creative Commons Attribution-NonCommercial-ShareAlike2.5 License.

 

About | Writings | Contact | Disclaimer | Privacy