"Thinking" Like a Computer
You use them to tell a friend a joke, for doing your homework and for playing a game. Your life would not be the same without them. But how does a computer really work?
Just like you, a computer must be able to remember, think and say what it thinks. A computer therefore needs a brain, a memory, and the ability to communicate and receive orders.
The central processing unit (CPU) is the "brain" in any of these computers.
The computer’s brain is its processor, which gives it its thinking power. The faster the processor, the faster the computer thinks. In our busy lives, we demand a computer that can do things for us as quickly as possible. Just as you would not be happy with a telephone that takes 10 minutes to dial, you also would not like a Web page that takes several hours to load.
A computer makes several billion simple calculations in a second. Whereas you and I would need 32 years, counting one number per second continuously, to count to a billion, a computer does that in a snapping of fingers.
Computers have surpassed us in thinking quickly, but the comparison between people and machines only goes so far. While a human being counts more slowly, the brain has 10 billion neurons which are small, very effective processors. We may be slow counters, but we are very good at quickly making complex "calculations" such as recognizing a face, inventing a story or running, things that are very difficult for computers to do.
A computer also has a memory. In fact, it has several of them. Just as humans have short-term memory, which lets us remember the last time we sat down, and long-term memory, which lets us recite our name and address, the computer also has these memories. Its "short-term" memory is called RAM or Random Access Memory.
RAM is used to keep track of what you are working on at the moment: the letter you’re writing, the Web page you’re looking at or the progress of the video game you’re playing. RAM is erased when the computer is turned off, so if you want your letter, Web page or game state to be remembered it must be saved in long-term memory.
Most computers use a disk called a "hard disk" for long term memory. Microscopic spots on the surface of the disk are magnetized in one direction or the other in a pattern that is a code for the information you are saving. This magnetic pattern remains when the computer is turned off and can be read the next time it is turned on.
The First Computer Bug
An actual moth was discovered inside the Mark II or "relay calculator" at Harvard University in 1947. The computer had been experiencing problems. The moth was found by a team headed by renowned computer scientist, mathematician, and naval officer (ultimately Rear Admiral), Grace Murray Hopper. After the moth was removed, the term "de-bugging" came into use. The moth was preserved, taped into Hopper's log book, and exhibited for some time in the Naval Museum in Dahlgren, Virginia.
Image courtesy oNaval Musem, Dahlgren, Virginia
Another type of long-term memory is called Read Only Memory, or ROM for short. These chips contain basic information that the computers needs in order to get started and to perform other basic functions that will not change even as you add and change programs, applications and documents.
There are many devices that can remember information. In addition to the chips used for RAM and ROM, and the magnetic disk used for long –term storage there are CD and DVD disks, flash memory, magnetic stripes on the backs of credit cards and others. What they all have in common is that they store information in "bits."
A bit is something that has two states: a switch that is on or off, a spot of magnetic material that is oriented one way or the other, a microscopic area of a plastic CD that either does or doesn’t have a tiny pit dug out of it. Whatever the medium of storage, these bits with their two possible states, often represented as 0 and 1, can be used to code pretty much any information.
Although increasingly complex computers are capable of more thorough reasoning, a computer only does what it is asked to do. That’s where software comes in. A software program is a succession of instructions. A program can be as simple as helping you calculate your allowance for the year or as complicated as predicting where to drill in the earth for oil.
Sometimes, a bug in the computer program yields an unexpected—and usually unpleasant—result. Writing a perfect program is extremely difficult for a software engineer. That’s why most programs initially contain errors and debugging is a fact of daily life for programmers.
Debugging is normally a cumbersome and tiring task. The biggest factor in the ability to debug a problem is the debugging skill of the programmer. However, the difficulty of software debugging varies greatly with the programming language used such tools as debuggers.
Debuggers are software tools which enable the programmer to monitor the execution of a program, stop it, re-start it, run it in slow motion, change values in memory and even, in some cases, go back in time.
Finally, a computer must know how to communicate. For that, you need to connect a peripheral. In today’s digital world, along with the basics—keyboard, mouse and screen—a computer gets outfitted with a modem, camera and printer.
Then all the peripherals are connected by a wire into the motherboard, which is placed into the PC’s box with a plug attached (a cooling ventilator inside the box is what makes a soft white noise sound).
Many, in fact, probably most computers do not have keyboards or screens. They are imbedded into various devices. So in a car, there is a computer that is sensing engine functions and conditions and controlling various functions. The input devices are sensors and the output devices are actuators.