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: ?
Link to original
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 originalControl 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 originalMemory
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 originalByte-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.
Link to originalRandom 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.
Link to original
- If the word size is , then a RAM chip gives us 16-bit memory locations.
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: ?
Link to original
- 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
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 originalClock
System clock
A system clock is used to synchronise all internal components, the clock outputs a steady high-frequency signal.
Link to original
- 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:
- Number of instructions per program.
- Number of cycles per instruction.
- Number of seconds per clock cycle.
Interrupts
Link to originalInterrupt
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
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.
Link to original
- 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.
MARIE ISA
MARIE’s ISA contains thirteen instructions.
Link to original
Hex Binary Instruction Meaning JnS X Jump and Store: Stores PC at address and jumps to . Load X Load contents of address X into ACC Store X Store the contents of the ACC at address X Add X Add the contents of address X to the ACC Subt X Subtract the contents of address X from the ACC Input Input a value from input device into the ACC Output Output the value in the ACC to output device Halt Terminate the program Skipcond C Skip the next instruction on condition (C), if is:
- : Skips if
- : Skips if
- : Skips ifJump X Load the value of X into PC Clear Set the value of ACC to . AddI X Use the value at as the actual address of the data operand to add to ACC JumpI X Uses the value at as the address to jump to LoadI X Loads value from indirect address to ACC. StoreI X Stores value in ACC at the indirect address. Register Transfer Language
Link to originalRegister 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


