Department of Computer Science

Introduction to Computing Environments

Computer System Components

To: ICE Course Schedule


Instructions CPU and Memory
ALU, IU and CU
Memory and CPU interaction
Connecting Memory and the CPU together
Bus connectivity


At the end of this unit you will be able to describe how a computer system's CPU and memory subsystem components process program instructions and data.





To Unit Contents

An instruction is designed to perform a simple task, for example a basic arithmetic operation, to move data, to perform input or output (I/O) operations and so on.  A computer program is a set of sequential instructions that describe the steps involved when carrying out a computational task.  The program is stored in memory together with any data that the instructions may operate on.  This has been termed the stored program concept.

To Unit Contents

Instructions CPU and Memory

Instructions are stored in main memory.  During program execution data will be Loaded from memory into the CPU or Stored from the CPU into memory.  Memory can therefore be visualised as a series of contiguous locations.  Each memory location, or address, is used to store an instruction or data. This will be studied in 'Computation'.

Memory is sub-divided into Random Access Memory (RAM) and Read Only Memory (ROM). RAM can be read from and written to and is therefore used for storing application programs and data that can be manipulated and changed.  RAM is often termed volatile memory.  In contrast, ROM is read only memory and cannot be changed.  ROM is used for system programs and data that need to be available when the computer is switched on, booted.  ROM is often termed non-volatile memory.

Central Processing Unit

At the heart of a microcomputer system lies the Central Processing Unit (CPU), or processor.  This is where instructions are operated on.  A CPU is composed of registers, Arithmetic Logic Units (ALU), an Interface Unit (IU) and a Control Unit (CU).  Instructions are executedin the CPU by the movement of data between registers.  This will be studied in more detail in 'Computation'.


Registers are a number of internal memory locations that are used for the temporary storage of binary values that are either manipulated or used for calculations.  Registers are of different sizes from a single bit to several bytes, and are wired into the CPU to perform specific tasks.  Unlike main memory where every address is just like other addresses, each register serves a specific purpose.  Registers are not referenced by addresses, as memory locations are, but are directly manipulated by the CU during instruction execution.

Registers are used for different purposes.  For example, the Memory Address Register (MAR) is used to hold the address of the instruction undergoing processing and the Memory Data Register (MDR) is used to store the binary value of the instruction undergoing processing.  MAR and MDR therefore serve as an interface between the CPU and memory.  An Instruction Register (IR) is used to hold the actual instruction undergoing execution and the Program Counter (PC) is used to hold the address of the current instruction being executed.

To Unit Contents

ALU, IU and CU

Arithmetic Logic Unit - ALU

An ALU is the equivalent of a calculator for arithmetic and Boolean logic operations.  In a real CPU there are more than one ALUs. The registers used by ALUs are often termed general-purpose registers or user-visible registers to indicate that they may be accessed by the instructions in users programs.  An ALU is used for arithmetic operations such as addition or subtraction of binary values. Therefore an ALU operation takes the contents of two general-purpose registers as input (source operands) and outputs the result of the arithmetic operation (operator) to a single register (destination operand).

For example, the instruction ADD R1 R2 R3 would take the binary contents of registers R2 and R3 as source operands.  In this case the operator would be the addition of the binary values that is determined by the operation code, ADD.  The result of the operation would be written to the destination operand register R1.

Interface Unit - IU

The IU is used to move program instructions and data between the CPU and other hardware devices, such as the keyboard, mouse or monitor.  The IU is therefore the I/O interface

between the processor and its peripheral devices.

Control Unit - CU

The CU includes the MAR, MDR, IR and PC and is used to control the processing of instructions and the movement of internal CPU data from part of the CPU to another.  The function of the CU is to provide timing and control signals.  For example, at the end of the fetch-execute cycle the PC is incremented to point to the next instruction for processing, this will be studied in more detail in 'Computation'.

To Unit Contents

Memory and CPU interaction

In Figure 1, instructions are shown in assembly language format.  There are many forms of assembly language, the following is example of one form.  The first instruction is located at memory address $000. A $ symbol is often used to precede a memory address, and the word location is often used instead of address.  In this example, the contents of memory location $00C, a data value of 5, are Loaded into register 1 (R1).  The register R1 is now ready for manipulation within the CPU.  The second instruction located at memory address $001 can now be processed.  In this example, memory references follow this format:

<operation code> <CPU register destination> <memory address content pointer>

Address Memory mnemonic content
$000 LD R1 $00C
$001 LD R2 $00D
$002 ADD R3 R1 R2
$003 MOV R4 R3
$004 SUB R3 R2 R1
$005 MOV R5 R3
$006 ST R4 $00C
$007 ST R5 $00D
$008 HALT
. . . . . .
$00C 5
$00D 8

Figure 1: Memory representation.

The MOV instruction is used for a register to register copy within the CPU.  For example, the MOV instruction at memory address $005 is used to copy the contents of the CPU register R3 to the CPU register R5.  In this example, a MOV instruction has this format:

<operation code> <CPU destination register> <CPU source register>

Arithmetic instructions, such as those at memory addresses $002 and $004 are used for CPU manipulations within a special functional unitcalled the Arithmetic Logic Unit (ALU).  For example, the ADD instruction of memory address $002 has two source operands with a singleoperator.  The source operands are the contents of the CPU registers R1 and R2.  The operator is identified by the instruction mnemonic, in this case ADD.  At the end of the ALU operation the result is written to the destination register, R3.  In this example arithmetic instructions follow the format:

<operation code> <destination> <source operand 1> <source operand 2>


What are the contents of memory locations $00C and $00D after the program has terminated?

Perhaps, you could discuss this task with other distance learning students on the ICE Bulletin Board.

To Unit Contents

Connecting Memory and the CPU together

Main memory and the CPU are physically connected together by an address bus, a data bus and a control bus or path.  The CPU has its own internal path or bus connecting the registers together, as shown in Figure 2.

Figure 2: Connecting memory and the CPU.

To Unit Contents


There is a good description of buses on pages HW 26 - HW 28.  A data path or bus is used to transfer data from one location in a computer to another location.  Movement is between memory and the CPU, within the CPU and peripheral devices, see Figure 3.  A bus is a group of electrical conductors suitable for carrying computer signals from one location to another.  This may be in the form of a wire or a printed circuit board (PCB), where each conductor on the bus is known as a line.

Figure 3: A typical computer system.

The bus that connects the CPU to memory, see Figure 2, needs address lines to pass addresses to the MAR, data lines to transfer data between the MDR and memory and control lines.  Each line of a bus can therefore serve a dedicated purpose, or may alternate between purposes.  For example, a line may transfer the bits representing an address followed by the bits representing data.  When the address is being transferred data cannot be transferred and vice-versa.

To Unit Contents

Bus connectivity

Buses can connect hardware components together in various ways.  A point to point bus, see Figure 4, connects a specific source to a specific destination.  For example a parallel or serial port that connects a microcomputer to a printer.  A multipoint, multidrop, or broadcast bus connects several points together.  Signals produced by a source are broadcast to every other point on the bus.  For example, an Ethernet broadcasts its signals to all other points that are connected together within its network.

Figure 4

Figure 5:Multipoint buses

A bus that connects the CPU, memory, I/O modules and other hardware devices together is termed a backplane, system bus or an external bus.  It is quite common to mount the CPU and its related components onto a PCB known as the motherboard.  The backplane of a motherboard is the printed circuit wiring.

The backplane commonly uses different buses to connect different parts of the computer system together.  Buses communicate together through bus interface units.  Figure 6 shows three different backplane buses, the CPU bus, the peripheral connect interface (PCI) or Video Electronic Standards Association (VESA) and the industry standard architecture (ISA).  The internal CPU bus is not part of the backplane and does not have a name.

Figure 6: Bus interconnectivity.

Last Updated: 12/09/2002 by Mariana, Daniel or Colin

© University of Hertfordshire Higher Education Corporation (2002)