© Nancy E. Reed, 1997 -- ECS 15 -- Fall 1997

Lecture 3 Notes
Computer Hardware Components
The Central Processing Unit (CPU) and Main Memory

Visual Aids

Readings

Chapter 2 in the Computers text.

Computer Components (Hardware)

This lecture introduces some of the key components of computers, so that you will understand them a little better and know how they interact with each other. There are a number of terms needed to describe computers; these terms are frequently used and probably should be understood, at least in a superficial way, if you are going to be making frequent use of computers in your daily lives.

The most common way of describing a general purpose computer is to say that it consists of the following five components:

I/O (Input/Output)

There are a great many I/O devices, some of which we will consider in more detail in a little while. For now, remember that the purpose of an Input device is to accept data from the outside world (humans interacting with computers) and convert the data to an internal form (represented in bytes) for storage and manipulation inside the computer. The most common input devices are the Keyboard and Mouse.

The purpose of Output devices is the opposite: the data stored inside a computer must be converted to some form of representation that is human-readable, and output devices perform this function. Typical output devices are Displays and Printers. Typical names for displays are Cathode Ray Tube (CRT), Video Display Unit (VDU), Liquid Crystal Display (LCD), or even Video Display Terminal. Printers come in many different types, including dot matrix, ink jet, and laser printers, the kind available in your computer classroom.

Central Processing Unit (CPU)

The CPU is the heart of a computer. It is the component that does calculations, operates on text data, accepts controls input and output to I/O devices as well as to auxiliary storage, and in fact is in control of all operations that are performed on computers. CPUs are very complex. In the early days, they were room-sized devices that had thousands of separate components (vacuum tubes, resistors, wires, and more). Nowadays, the same results can be obtained from very small Chips, some no larger that your little fingernail, which contain the equivalent of thousands of transistors interconnected in complex ways. We saw an example of the basic design of such a CPU in class.

CPUs contain Registers, storage areas which can hold Data or Instructions. You can think of a register as being similar to a scratch piece of paper on your desk when you are balancing your checkbook. You use the paper to add figures, transfer the results to your checkbook, and maybe write a note on your bank statement. The register is that piece of scrap paper you used for checking numbers. Typically, a computer will have a register that contains the current instruction (instruction register), another register that tells the computer where to find the next instruction (program counter), and several data registers. All of these registers consist of one, two or more bytes capacity. The number of bytes in a register is usually referred to as the Word Size of that particular computer. Computer Words are NOT related to human words; they are just a convenient way of grouping sets of bytes to visualize how a particular computer manipulates data. Typical word sizes for early PCs are 1 or 2 bytes (8 or 16 bits) and for the newer, faster PCs, 4 bytes or even 8 bytes (32 or 64 bits). Larger workstations and "mainframe" computers have word sizes of 8 bytes or more. The larger the word size, the more information can be processed at once in the CPU.

Memory (main memory, fast memory, etc.)

There are two basic kinds of information that can be used by a computer: instructions and data; and both types of information can be stored in memory. In either case, the information is stored as groups of bytes. The data stored might be numbers, text, or even a representation of graphic images, since computers are capable of doing remarkable things with visual images as well as with numbers and words.

The memory of a computer is described in terms of the number of bytes available. Typical memory sizes are approximately 640,000 bytes, which is called 640KB, 1 million bytes (1MB), and, in newer systems, 2MB, 4MB, 16MB and even more. If we consider how much data can be stored in 1MB of memory, it is convenient to think that one character of the English alphabet requires one byte of storage. If we were storing a report, then 1 MB of memory might hold about 200,000 English words (assuming 5 characters per word average). Computer memory comes in two basic types: Random Access Memory (RAM), which is used to manipulate instructions and data; and Read-Only Memory (ROM) which is used to store basic instructions that come with the computer (such as the diagnostics of the Boot program).

An important point to remember about the memory of a computer: whereas ROM never changes, RAM is volatile, (sometimes called dynamic), which means that, when the computer is turned off, all data and instructions currently in memory are erased for ever. You need to know this, because often, when you have worked with something important, like a term paper, if you forget to save the paper on auxiliary storage (usually a floppy disk), it is gone, vanished, not there, and you may be very sorry to have lost it.

One other important fact to remember about the main memory of a computer: it is much faster for the CPU to access data stored in memory than data stored in Auxiliary Storage devices. Therefore, in order to work with data, the computer almost always loads it into memory, works on it, and then files it away on auxiliary storage for more permanent safekeeping.

The Bus: The Link Between Computer Components

How do these components talk to each other? For that matter, what would they want to say to each other? There are several types of messages that might be sent, typical ones would include:

Look at these operations. In each case, there is some instruction, there is a set of data, and there is a need to address some location in memory. Communication between devices always requires these three components, and the message constructed to perform these operations must go on the Bus. It stands to reason, therefore, that the Bus will have a set of lines used to transmit instructions (these are called Control lines), one set to identify memory addresses (Address lines), and a third set to move data between components (Data lines). You will have a chance to study a chip and see how it must use tiny wires to connect from the chip itself to the outside world via the pins on the outside of the ceramic housing of the chip.

Summary

These, then, are the main components of a general purpose computer. When you open up a computer, you will be able to see different parts, and perhaps add new components to your system if you are upgrading it. Understanding a little about what these components are and how they talk to each other will help you become more knowledgeable about the care and feeding of the system that is destined to play an important role in your career.

Note: A video of this information is available for viewing in the media center in 1101 Hart Hall under ECS015, Title: Video 2 - Computer components.

The Hardware Processing Components - CPU and Main Memory

The CPU is where the processing of data occurs in a computer. The CPU is physically located on the motherboard in the system unit of the computer.

The Four Primary Hardware Components of Computers are Input, Output, Processing, and Storage (Fig 1-4 in Long & Long). This lecture describes the hardware components in the processing category - main memory and the central processing unit.

Where does the CPU fit in?

The CPU is the processor, the calculating part, or the brain in a computer. Main memory is the fast storage part of the computer, similar to short-term memory in humans. Whatever people are working on or thinking about must be in short-term memory. In computers, (copies of) all programs and data that a computer is working on must be in main memory. We will talk about secondary storage, like disks and CDROMs later on. They are more like books in that they are much slower than main memory.

What are the components of the CPU?

The CPU is shown in Figs 2-5 and 2-6 of the Computers (Long & Long) text. The Central Processing Unit (CPU) contains:

  1. Registers - fast access, temporary storage areas immediately available within the CPU for saving values and computations. The size of the (typical) registers in a CPU is called a word.
  2. Control unit - directs the execution of stored programs and communicates with the Arithmetic Logic Unit and Memory. The control unit contains two special registers, the program counter that holds the address of the next instruction to obtain, and the instruction register that holds the current instruction for decoding and execution.
  3. Arithmetic logic unit (ALU) - executes all arithmetic and logic instructions. The ALU also contains registers. One register in the ALU is called the accumulator where the results of many computations are stored, at least temporarily.
  4. (optional) A Floating-point unit (FPU) can quickly perform mathematical operations on floating-point numbers (numbers with a decimal point and/or an exponent, as opposed to integers) and it is an optional part of the CPU. The FPU, if present, will also have registers.

The machine cycle - Executing instructions in the CPU

See Fig 2-6, the machine cycle, in your computers text.

The machine cycle has 4 steps:

  1. Fetch the next instruction - access the memory location specified in the program counter and copy the instruction found there to the instruction register.
  2. Decode the instruction in the instruction register.
  3. Process the instruction in the ALU or FPU.
  4. Store any results (information) necessary.

Speed - how fast?

Data moves within computers at speeds measured in fractions of seconds.
A millisecond is 1/1000 of a second, or (10^-3) seconds.
A microsecond is 1/1000 of a millisecond, or (10^-6) seconds.
A nanosecond is 1/1000 of a microsecond, or (10^-9) seconds.
A picosecond is 1/1000 of a nanosecond, or (10^-12) seconds.

Computer processing speeds are measured in Megahertz (MHz) which equals one million machine cycles per second (also called the clock speed of the computer), and MIPS, which equals one million instructions per second. Some instructions may take more than one machine (clock) cycle to execute on a CPU.

The speed of CPUs

In 1981, the original IBM PC with an Intel 8088 CPU had a clock speed of 4.67 MHz. In 1991-1993, the current PCs (known as 486s) had an Intel 80486 CPU with a clock speed of 25-100 MHz. The new PCs have Pentium processors with a clock speed of 66-200 MHz.

Processor design - CISC vs. RISC CPUs

Two types of CPU designs are common.

CISC stands for Complex Instruction Set Computer. A CISC CPU has many complex instructions built in (in its instruction set). Some of the complex instructions may take longer than 1 clock cycle to execute.

RISC stands for Reduced Instruction Set Computer. A RISK CPU has a simplified instruction set (fewer instructions). All instructions execute quickly. RISC chips run at speeds typically 4-10 times faster than CISC chips. However, a RISC chip may need to execute multiple instructions for complex actions that can be done in one instruction by a CISC chip.

The Intel series of chips (including the Pentium and Pentium Pro) are all CISC.

Many workstations use RISC CPUs, for example the Sun SPARC and the Digital Equipment Corporation (DEC) ALPHA.

Some PCs, like Macintosh powerbooks, are using the PowerPC chip (made by group of companies including Motorola) that is a RISC design.

Increasing processing speeds - Buffers and caches

Buffers are used to store data to even out input, output, and access times with various storage devices.

A cache is a buffer area that is used to the amortize the overhead of accessing a slower device. Extra data is read from the slower device into the cache where it can be accessed more quickly.

As an analogy, if you are sitting on your couch watching TV, a cooler by your side with a beverage in it would be a cache for the refrigerator in the kitchen. You would fill the cooler (small, but fast to access) as needed from the refrigerator (large, but slower to access). The special storage places within the CPU called registers are analogous to having an open can in your hand - it is fastest to get a drink from there.

Main Memory

The main memory of personal computers currently uses RAM. RAM stands for Random Access Memory. RAM can be read and and also can store new data (be modified). RAM is volatile, it loses all data when the power goes off.

ROM stands for Read Only Memory. ROM cannot be changed, but can be read many times. ROM is non-volatile, meaning that it does not lose its data when the power goes off. ROM is present on the motherboard of the computer to store information used during the boot process. Reference the lecture notes on the boot process for more details.

Measuring Information Capacity: How much?

A bit is a binary digit (a 0 or 1).
A byte is 8 bits (in a row) and usually encodes a single character (in languages with small character sets).
A kilobyte (KB) is 1024 bytes (2^10) or approximately 1,000 bytes.
A megabyte (MB) is 1024 KB, or approximately 1,000,000 bytes.
A gigabyte (GB) is 1024 MB, or approximately 1,000,000,000 bytes.
A terabyte (TB) is 1024 GB, or approximately 1,000,000,000,000 bytes.

Information is measured in bits and bytes, similar to measuring the size of rooms in a house using square feet. Each room is different, but each room can be measured and described by its size. In the same manner, main memory and secondary storage can be described by how much information they hold and the other properties we will see shortly.

Main memory in personal computers

In 1981, the original IBM PC with an Intel 8088 CPU had about 512 KB of main memory. In 1985, the IBM AT with the Intel 8086 CPU typically had 1 MB of RAM. In 1988, the IBM PCs with the Intel 80396 CPU typically had 2 MB of RAM. In 1991-1993, the current PCs (known as 486s) had an Intel 80486 CPU with 4-8 MB of RAM . The new PCs have Pentium processors (80586) or Pentium Pro processors (80686) and typically have 16-24 MB of RAM.

Go to the index of lectures for ECS15 - Fall 1997 .

Go to the homepage for ECS15 - Fall 1997 .

© Nancy E. Reed, 1997 -- nereed@ucdavis.edu