Lecture 5: A Look Inside the Machine: Hardware & Software

So what happens when you first turn on a computer?

It boots. Or if your computer crashes, then it reboots. Why is it called that? Where did such a strange word come from? There is an idiom about lifting oneself by one's own bootstraps that has the idea of being able to get going without any external help. That is precisely what a computer must do when you turn it on.

Inside the computer is a silicon chip that is the permanent storage place of what is called the boot program. (This chip is called an EPROM, for Erasable, Programmable, Read-Only Memory.) The computer is wired in such a way that when it is first turned on, the boot program begins executing automatically. It has two primary functions: first it verifies that all the hardware components of the computer are working properly, and then it loads the operating system. The OS is stored on the hard disk (or sometimes on a floppy) and must be copied into the computer's RAM (Random Access Memory). Then the CPU needs to be informed of its location in RAM and instructed to begin executing it rather than the boot program. At this point the baton has been handed off to the OS and the boot program terminates. From this point on all software applications are run by making requests of the OS through its user interface.

Let's examine the hardware of a personal computer. A computer consists of a system unit (usually either a desktop unit or a tower model) along with all the peripheral devices such as monitor, keyboard, mouse, speakers, printers, etc. The system unit contains a variety of components in addition to the CPU. The power supply is usually the largest of these and regulates power flowing into all of the other components. There are usually several bays in the front of the unit which house the various disk drives (floppy, hard, CD-ROM, DVD, etc.). The CPU, RAM, and internal drives are all plugged into a motherboard which also houses other supporting circuitry. Also plugged into the motherboard are expansion cards which provide an interface and circuitry for peripherals (e.g., fax/modems, sound cards, video adapters, network cards, etc.). The photograph below is of a motherboard with nothing plugged into it. Some of the ports have been labeled to indicate where things go.


The CPU itself is rather small compared to the system unit, yet it is the seat of power. A schematic representation of the CPU divides it into three smaller components, shown below as the control unit (CU), the arithmetic/logic unit (ALU), and the registers. The control unit serves as the central manager and traffic controller in the CPU. It is responsible for deciding what gets done when and in what order, as well as controlling the interaction of the ALU with the registers and RAM. The ALU is the brain of the CPU. It contains all the circuitry representing what the CPU can compute. Each machine language instruction has a corresponding circuit hardwired into the ALU that "knows" how to perform that instruction's task. Finally, the registers are a form of very fast memory that reside in the CPU for short term storage of data and information that is being processed. Some of the registers have specific purposes, like the program counter (PC) or the instruction register (IR), but most are usually general purpose (e.g., for storing operands of an addition or the product of a multiplication).


These components of the CPU work together in a tightly coupled cycle of activity, called the fetch/execute cycle, in order to execute programs. When a user double-clicks on an icon or selects a program from a menu in Windows 95 the operating system is responsible for launching the application. Programs are generally stored on disk (hard or floppy) when they are not being used. In order to run an application, the OS copies (loads) the binary executable program file into RAM. RAM is organized so that each byte of memory has an address, much like P.O. boxes at the post office. The operating system stores the address of the first instruction of the program in the PC register, signalling to the control unit that this is the program to be executed next.

In first phase of the fetch/execute (F/E) cycle the control unit uses the address stored in the PC to fetch the next instruction to be executed from RAM and copy it into the IR register. This instruction is a sequence of bits that serve as a code for which ALU circuit should be activated. So in the second phase, the control unit decodes this instruction. This is followed by the execute phase, where the appropriate ALU circuit is activated, along with the appropriate data or information stored in registers. Finally, the ALU may have produced some result while executing the instruction that needs to be saved for later use. This is done in the final store phase. This cycle is performed continuously from the first moment the computer is powered up until it is shut down. Modern PCs are capable of executing literally hundreds of millions of instructions per second (MIPS).

To see a simulation of this process, look at the CD-ROM that came with your text. There are two simulations of the fetch/execute cycle, as well as simulations that describe how various disk media work.

I have an assortment of hardware devices, from disk drives, to mother boards, to RAM, that we will pass around the class and discuss. The topics we may touch on along the way include:

  1. Sequential versus random access storage.
  2. Volatile versus non-volatile memory.
  3. Relative cost and speed characteristics of different storage devices.
  4. Drives versus media.
  5. RAM, ROM, PROM, EPROM, EEPROM, etc.
  6. Bus width and word size.
  7. A variety of expansion cards from fax/modems to video adapters.
  8. Mother boards, CPUs, and co-processors.