Nov 24, 2007

How Do Computers Work?

The average person who uses a personal computer on a frequent basis doesn't think about what happens inside a personal computer once the electricity is switched on. As long as their version of MS Windows pops up within a few seconds, most people are quite happy to continue on with what they want to do on their personal computer. A personal computer goes through many processes from the moment the electricity is switched on before its operating system (ex. Windows, Linux) is fully loaded and takes over. The operating system is stored on the hard drive of a personal computer. It is stored on the hard drive because this kind of storage is much less costly and an operating system requires a large amount of storage space. So, in order to make personal computers more inexpensive, they are designed to use a mixture of ROM, DRAM, and hard disks. An account of each follows.

Once the electricity switch is switched on, the "boot-up" process begins. To "boot-up" a personal computer merely means to initiate it. Electricity then moves through all of the chips and their circuits. The instructions for what the personal computer is meant to do next are found in the Read Only Memory, Basic Input/Output System (ROM BIOS). ROM is memory that can only be read from and has data that is permanently burned into it. It is nonvolatile and will not be lost or vanish once the electricity is switched off.

ROM BIOS or just BIOS, is intended to begin giving instructions as soon as it receives electricity. The BIOS contains an entire set of instructions, in effect a personal computer program written into the chip that manages the boot-up process. Without the BIOS, the personal computer would'nt know what to do next. The first task that BIOS completes is to make sure that all of the hardware components are working properly (for example: disk drives, external buses, the mouse, the printer). This is called a electricity-on self-test (POST). After the POST is complete, the BIOS activates other chips on different cards installed in the personal computer (SCSI and graphics cards) and provides a set of low-level routines that the operating system uses to interface to different hardware devices such as the keyboard, mouse, printer, etc.

Once the POST is complete, the BIOS hands the next stage in the boot-up process over to the central processing unit (CPU). The central processing unit is a one chip processor or microprocessor that has two distinctive capabilities:

1. The CPU carries out all of the mathematical and logical operations including basic math and comparisons of two or more numbers.

2. The central processing unit has the ability to intelligently manage the flow of instructions and data going into and out of its circuits.

The final instruction that the ROM sends to the CPU is to go to a precise location or address to locate its next instruction. An address is a string of numbers that gives instructions to where something can be found, much like an address on an envelope. Personal computers use addresses to keep track of data much the same way as the post office uses them to locate residences and businesses. The larger the number in an address the more locations it can refer to. Most present personal computers use a 32-bit address space for memory, which indicates that there can be over four billion separate locations to contain data.

The instruction that the ROM BIOS wants the central processing unit to carry out is sent through a chip on a bus (a set of wires) to the address specified. The data bus is able to carry data into and out of the chip inside the CPU. The data isn't available inside the CPU so it has to search elsewhere. The CPU then sends the address on another bus called an address bus. When the CPU does this, it is called a fetch. The address bus is "fetching" data from elsewhere inside the personal computer. The address bus is only able to carry instructions out of the CPU.

The address bus fetches data from the personal computer's memory. Memory is a kind of silicon chip that can contain instructions or data. This kind of memory can be read from or written to by the CPU, but this kind of memory or Dynamic Random Access Memory (DRAM) is volatile. Once the electricity is switched off, the DRAM looses its memory or data. Since the DRAM is basically a blank slate, the CPU has inside, a set of sequential instructions as to where to search for the required data.

Before the address bus can get to memory, it has to pass through a set of chips called a chipset. The chipset refers to a collection of chips that provide an intelligent interface for the core workings of a personal computer - central processing unit, memory, graphics, I/O system, described as core logic or glue logic. If the data that the chipset needs isn't in memory, the chipset then sends or redirects it to the Input/Output (I/O) bus. The I/O bus connects the chipset to supplementary places where the data is stored, such as the hard drive. The hard drive permits the CPU to read from it and to write to it. The hard drive is non-volatile so it keeps its data or data once the electricity is switched off. A hard disk is much slower at retrieving data from than memory but memory is much more costly.

Once the hard drive gets the address (via the I/O bus and chipset), it retrieves the data and sends it back through the chipset and then puts it on the address bus back into the CPU. The chipset functions as a bridge for the two buses; the I/O bus and the address bus.

The central processing unit uses a four step sequence: fetch, decode, execute, and store. Since the CPU does not retain its memory, it has to obtain its data or fetch the data from elsewhere inside the personal computer. To help with the speed of the process of fetching, the CPU has a pre-fetch area to make the data available more readily.

Once the data has been fetched, it has to be decoded. Part of the decoding process of the CPU is to decide which circuits are appropriate to use for executing the instructions. Once that decision has been made, the CPU begins to execute the instructions. The part of the CPU where the actual execution of instructions takes place is called the Arithmetic Logical Unit (ALU). The ALU includes groups of transistors, known as logic gates, which are organized to carry out basic mathematical and logical operations. Logic gates are grouped into electrical circuits that execute the CPU's instructions such as "add" two numbers or "compare" two numbers.

The final step of the central processing unit is to store the data. This final step takes place after the ALU completes its calculations. The results of the calculations are stored on a chip that has an area called a register. Registers can be accessed more quickly than any other kind of memory but are only for temporary containing (storage) of data.

The CPU also has a clock inside it to keep the timing of all of the flow of data and processes of the personal computer. This clock is vital to the synchronization of all of the processes of the personal computer. This CPU clock controls all of the operations on its chip. The processes of the CPU can also be interrupted by an external interrupt controller chip which is part of the chipset. The chipset contains a small database of interrupt vector (numerical table). When an interrupt signal comes onto the chip, the CPU saves what it is doing and goes to the interrupt vector to locate the address of the instruction that the interrupt is telling it to execute instead. Once it is finished with the interrupt, it goes back to what it was doing. The CPU locates what it was doing in a register called a stack. If interrupts were not possible, the CPU would have to complete one task before it could start another causing the speed to be greatly reduced.

Now that the central processing unit has found the operating system, loaded it into memory, the operating system takes over and the personal computer is now ready to be used by its owner. The user can now check email, play a game, or do whatever they wanted to do when they started the personal computer.

By Andrew James

Mr James started My Business Tips Online (Melbourne) in 2006 providing business advice, tips, tutorials etc & regularly writes articles about his industry - full article here

Article Source:

Twitter Delicious Facebook Digg Stumbleupon Favorites More

Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | stopping spam