1-2. Computer components

Computer components

The CPU

Central Processing Unit

The Central Processing Unit (CPU) is what drives the fetch, execute, decode cycle. It consists of two principle parts: ?

  • Datapath

    The datapath consists of an [[Arithmetic Logic Unit]] and [[Register|registers]] that are connected to each other, and to memory, by a **data bus**.

    Link to original
  • Control Unit

    The control unit sends timing and control signals to activate various components within the CPU to perform sequenced operations.

    A control unit determines what actions should be carried out according to the values in the [[Program Counter (register)|Program Counter]] and a [[Status (register)]].

    Link to original
Link to original

Memory

Computer Memory

Computer memory consists of a linear array of addressable storage cells.

Word (Memory)

The storage cells of memory are of a regular and fixed size known as a word. In exams, take a word to be .

Link to original

  • Word-addressable memory

    Memory is commonly word-addressable: processor identifies a particular [[Word (Memory)|word]] when it needs to read and write data

    Link to original
  • Byte-addressable memory

    Memory can be byte-addressable: processor is able to address different sizes of memory compared to the word size

    Link to original
  • Modern PC architectures have a word size of 32-bit or 64-bit.

Random Access Memory

Random Access Memory (RAM) stores actively running programs and any data currently in use.

RAM chips are often referred to in terms of length $\times$ width.

  • If the word size is , then a RAM chip gives us 16-bit memory locations.
Link to original

Link to original

I/O

IO Subsystem

The I/O (input/output) subsystem is used by a computer to interact with the outside world.

I/O devices can be connected to the CPU through various interfaces: ?

  • Memory mapped: the device behaves like main memory from the point of view of the CPU
  • Instruction mapped: where the CPU has specific instructions for controlling the device
Link to original

System Bus

System Bus

A bus is an array of wires, that simultaenously convery convey a single bit along each line.

Two types of buses are commonly found in computer systems: ?

  • Point-to-point: bus is connected to just two components
  • Multi-point: many components can access the one bus

The system bus consists of: ?

  • Data lines: Convey bits from one device to another.
  • Control lines: Determine the direction of data flow and when each device can access the bus.
  • Address lines: Determine the data source or destination location.

A typical multi-point bus configuration looks like:

Link to original

Clock

System clock

A system clock is used to synchronise all internal components, the clock outputs a steady high-frequency signal.

  • A fixed number of clock cycles are required to carry each data movement or computational operation.
  • Clock frequency

    The clock frequency, measured in Hertz, determines the speed with which all operations are carried out. Clock cycle time is the reciprocal of frequency.

    A clock has a cycle time of .

    Link to original
  • The CPU time required to run a program is given by the general performance equation: We can improve CPU throughput if we reduce:
    1. Number of instructions per program.
    2. Number of cycles per instruction.
    3. Number of seconds per clock cycle.
Link to original

Interrupts

Interrupt

An interrupt allows us to alter the normal flow of execution of a program when an event of higher priority occurs. They can be triggered by different sources:

  • I/O requests
  • Arithmetic errors (e.g. div 0)
  • Encountering invalid instructions

Each interrupt is associated with a procedure (Interrupt Service Routine) that directs the actions of the CPU to handle the events.

Link to original

Link to original

3-4. MARIE

MARIE

Machine Architecture that is Really Intuitive and Easy

Specification

  • Binary, two’s complement data representation
  • Stored program, fixed word length data and instructions
  • words of word-addressable main memory
  • word size
  • instructions ( for op code, for address)
  • ALU
  • Seven registers for control and data movement

Architecture

Below is an overview of the MARIE architecture.

The ratio of address, control and data lines varies between computer systems.

  • More devices on the bus mean we want more control lines.
  • More addresses in memory mean we want more address lines.
  • Larger word size, means more data lines.

Bus

All of MARIE’s registers are connected with each other and with main memory through a common data bus.

  • Each device on the bus is identified by a unique number. This number is set on the control lines whenever the corresponding device is required to carry out an operation.
  • Separate connections are also provided between the following registers:

MARIE ISA

Instruction Set Architecture

A computer’s instruction set architecture (ISA) specifies the format of its instructions and the primitive operations that the machine can perform.

  • The ISA is an interface between a computer’s hardware and its software.
  • Some ISAs include hundreds of different instructions for processing data and controlling program execution.
Link to original

MARIE ISA

MARIE’s ISA contains thirteen instructions.

HexBinaryInstructionMeaning
JnS XJump and Store: Stores PC at address and jumps to .
Load XLoad contents of address X into ACC
Store XStore the contents of the ACC at address X
Add XAdd the contents of address X to the ACC
Subt XSubtract the contents of address X from the ACC
InputInput a value from input device into the ACC
OutputOutput the value in the ACC to output device
HaltTerminate the program
Skipcond CSkip the next instruction on condition (C), if is:
- : Skips if
- : Skips if
- : Skips if
Jump XLoad the value of X into PC
ClearSet the value of ACC to .
AddI XUse the value at as the actual address of the data operand to add to ACC
JumpI XUses the value at as the address to jump to
LoadI XLoads value from indirect address to ACC.
StoreI XStores value in ACC at the indirect address.
Link to original

Register Transfer Language

Register Transfer Language

Each of MARIE’s instructions consist of a sequence of micro-operations: data movements between registers as well as arithmetic & logical operations.

The exact sequence of micro-operations that are carried out by an instruction can be specified using the register transfer language (RTL).

We use the notation to indicate the actual data value stored in a memory location , and to indicate the transfer of bytes to a register or memory location.

Example RTL for the LOAD X instruction:

Example RTL for the ADD X instruction:

Example RTL for the JUMP X instruction:

Link to original

Link to original