0% found this document useful (0 votes)
3 views

Ch5 - Computer Architecture

The document provides an overview of computer architecture, focusing on primary memory types such as RAM and ROM, their characteristics, and purposes. It also discusses the Von Neumann architecture, the Fetch-Decode-Execute cycle, interrupts, factors affecting CPU performance, and embedded systems. Key concepts include the roles of the CPU, memory management, and the importance of system components in processing instructions.

Uploaded by

imsoepicccs
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Ch5 - Computer Architecture

The document provides an overview of computer architecture, focusing on primary memory types such as RAM and ROM, their characteristics, and purposes. It also discusses the Von Neumann architecture, the Fetch-Decode-Execute cycle, interrupts, factors affecting CPU performance, and embedded systems. Key concepts include the roles of the CPU, memory management, and the importance of system components in processing instructions.

Uploaded by

imsoepicccs
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

5

Computer Architecture
Ch.5: Computer Architecture Eng. Omar El Safty

1. Primary Memory
Definition and Main Feature/Characteristic:
Main memory inside the computer that is directly accessible by the CPU.

1.1 RAM (Random Access Memory)


Definition/Features/Characteristics:
• Volatile memory
• Can be read from and written to
• Directly accessible by the CPU

Purpose:
• Used to store data/files currently in use
• Used to store software/programs/instructions/parts of OS currently in use
• Used to store data temporarily
• To speed up the fetch stage of the FDE cycle

KEY TERMS

Volatile – The contents of the memory are lost when the power to the RAM is turned off

Virtual Memory
Definition:
A memory management system that makes use of secondary storage and software to extend
RAM capacity.

How virtual memory is created and used:

• The secondary storage is partitioned to create virtual memory


• When RAM is full..
• … pages of data that are not required …
• … are transferred from RAM to virtual memory
• When the data is required again, the pages are transferred back to the RAM

64
Ch.5: Computer Architecture Eng. Omar El Safty

Purpose of using virtual memory:


• To extend RAM capacity when required
• To run programs when there is insufficient RAM to run them
• Reduces the need to buy and install more expensive physical RAM

KEY TERMS

Page – Block of data that can be transferred from virtual memory to RAM or vice versa.

1.2 ROM (Read Only Memory)


Definition/Features/Characteristics:
• Non-volatile
• Can only be read from but not written to
• Directly accessible by the CPU

Purpose:
Stores the firmware and startup instructions permanently.

The following table summarizes the differences between RAM and ROM:

RAM ROM

Can be written to and read from Can only be read from but not written to

RAM is volatile (temporary memory) ROM is non-volatile (permanent memory)

Used to store data, software, instructions or Stores the firmware and startup
parts of the operating system currently in use instructions permanently

RAM tends to have greater storage capacity ROM tends to have smaller storage capacity

65
Ch.5: Computer Architecture Eng. Omar El Safty

Application where RAM and ROM are both used


Example:
A remote-controlled toy car has a circuitry that contains both RAM and ROM chips.
The remote control is a hand-held device.

ROM purpose:
• Stores the factory settings permanently
• Stores permanently the start-up routines when the toy car is first switched on

RAM purpose:
• Stores the running instructions received from the remote control unit

2. Von Neumann Architecture


The Von Neumann architecture is often referred to as the stored program concept.

Stored program concept:

• Programs are stored on a secondary storage device


• Data and instructions are moved to RAM..
• .. and stored in it
• Instructions are fetched, decoded, and executed one after another by the CPU

66
Ch.5: Computer Architecture Eng. Omar El Safty

The following components related to Von Neumann Architecture:


2.1 Secondary Storage
Purpose:
• For permanent/non-volatile storage of data
• To store data that is not currently required by the CPU
• To store data to transfer it to another computer
• To allow software to be installed on the computer
• For the creation of virtual memory

2.2 RAM
RAM is made up of partitions.
Each partition consists of an address and its contents.

Purpose:
• Used to store data/files currently in use
• Used to store software/programs/instructions/parts of OS
currently in use
• Used to store data temporarily
• To speed up the fetch stage of the FDE cycle

2.3 Central Processing Unit (CPU) // Processor // Microprocessor


Definition:
A type of integrated circuit contained on a single chip that is used to process the instructions.

Structure:
Consists of an Arithmetic and Logic Unit (ALU), Control Unit, and registers.

Purpose:
To perform an FDE cycle // To process an instruction.

67
Ch.5: Computer Architecture Eng. Omar El Safty

Control Unit
Purpose:
• Sends control signals that manage the transfer of data and instructions within the CPU
• Responsible for decoding instructions using an instruction set

Arithmetic and Logic Unit (ALU)


Purpose:
• Carries out arithmetic calculations
• Carries out logic operations
• Stores interim results of calculations in a register called accumulator

Registers
Definition:
A small fast memory location within the CPU.

Purpose:
To store data/address/instruction temporarily.

Examples of registers and their purpose:


Program Counter (PC)
Temporarily stores the address of the next instruction to be fetched/executed.

Current Instruction Register (CIR)


Temporarily stores the current instruction during processing.

Memory Address Register (MAR)


Temporarily stores the address of the instruction/data to be fetched from RAM.

Memory Data Register (MDR)

Temporarily stores the instruction/data that is in use from the address in MAR.

Accumulator (ACC)
Temporarily stores interim results during calculations.

68
Ch.5: Computer Architecture Eng. Omar El Safty

2.4 Buses
Definition and Purpose:
Pathways to transmit data, addresses, and control signals between the internal components
of the CPU.

The following table shows three types of buses used in the Von Neumann architecture:

Type of bus Description of bus Signal direction

Transmits data between components in the


Data bus Bidirectional
CPU

Transmits addresses between components


Address bus Unidirectional
in the CPU

Transmits control signals from the control Can be Unidirectional


Control bus
unit to other components in the CPU or Bidirectional

2.5 Input/Output Devices


Purpose:
Main method of entering data into and getting the data out of computer systems.

69
Ch.5: Computer Architecture Eng. Omar El Safty

3. Fetch-Decode-Execute Cycle
Fetch:
1 PC contains the address of the memory location of the next instruction to be fetched
2 This address is copied from the PC to MAR using the address bus
3 The contents (instruction) of the memory location contained in MAR is copied to MDR
4 The instruction in MDR is then copied to CIR using the data bus
5 The value of the PC is incremented by one to point to the next instruction that has to
be fetched

Decode:
6 Control unit decodes the instruction using an instruction set

Execute:
7 The CPU then executes the instruction

70
Ch.5: Computer Architecture Eng. Omar El Safty

Steps of how MDR and ALU are used in the fetch-decode-execute


cycle:
• Data fetched from RAM is stored in the MDR
• Data from MDR is sent to ALU to be executed
• ALU performs calculation and logical operations on data
• ALU has a built-in register ...
• ... where it stores interim results of calculations
• After calculations, ALU sends data to MDR
• Data is sent from MDR to be written to RAM

4. Interrupt
Definition and Main Purpose:
• A signal sent from a device or software that informs the CPU that its attention is
required
• Interrupts have different priorities

Purpose:
• Informs the CPU that its attention is required
• Allows the CPU to pause the current process until the interrupt is serviced
• Allows the CPU to deal with vital tasks immediately based on their priority
• It enables multi-tasking to be carried out on a computer

Examples of hardware interrupts: Examples of Software interrupts:


• A key on a keyboard is pressed • Opening an application
• A mouse button is moved • When switching from one application to
• A device is connected/disconnected another
• A paper has jammed in a printer • Runtime errors (e.g. division by zero)
• A printer runs out of paper • Two processes trying to access the same
• A printer runs out of ink memory location

71
Ch.5: Computer Architecture Eng. Omar El Safty

Steps of handling an interrupt:


1 Interrupt is given a priority (by the operating system) ..
2 .. and placed in the interrupt queue
3 Processor finishes the current FDE cycle for the process..
4 .. and checks the priority of the interrupts in the interrupt queue
5 If all interrupts in the queue have a lower priority than the process, then the processor
runs the next FDE cycle for the process
6 If an interrupt in the queue has a higher priority than the process, the processor
pauses the process
7 Processor checks the source of the interrupt..
8 .. and calls the appropriate ISR to handle the interrupt
9 If there is another higher priority interrupt than the process, then repeat
10 … otherwise, processor resumes the process by running its next FDE cycle

KEY TERMS

Process – A program that is currently being executed by the processor.

Definition and Main Purpose of Interrupt Service Routine (ISR):


• A piece of software that is that contains the code that handles the interrupts
• Part of the operating system

72
Ch.5: Computer Architecture Eng. Omar El Safty

5. Factors that determine CPU performance


5.1 Core
Definition:
A unit on a CPU that is made up of an ALU, control unit, and registers.

Purpose:
To perform an FDE cycle // To process an instruction.

Effect of increasing the number of cores on CPU performance:


• Allows the CPU to process multiple instructions at the same time..
• .. which increases the CPU performance

KEY TERMS

Single Core CPU – a CPU with one core only.


Dual Core CPU – a CPU with two cores.
Quad Core CPU – a CPU with four cores.

5.2 System clock

Definition and purpose of system clock:


A component that regulates the number of FDE cycles the CPU can perform in a second.

Definition of system clock speed:


The maximum number of FDE cycles a CPU can process/execute in a second.

Definition of a 2.4 Ghz system clock:


• The CPU completes 2.4 billion
• … cycles per second

Effect of increasing the speed of the clock on CPU performance:


• Increases the maximum number of FDE cycles the CPU can process/execute in a
second ..
• .. which will increase the CPU performance

73
Ch.5: Computer Architecture Eng. Omar El Safty

5.3 CPU Cache


Definition and purpose:
• It is a type of storage that stores frequently used data/instructions
• To speed up access
• … as it is faster to access than RAM

Effect on CPU performance:


• Allows more frequently used data/instructions to be stored
• .. which allows the CPU to speed up access to more frequently used data/instructions
• .. which increases the CPU performance

6. Embedded Systems
Definition/Features/Characteristics of an embedded system:
• Performs a single/limited function
• It has a microprocessor
• It has dedicated hardware
• Uses firmware
• It is normally built into a larger device
• Users normally cannot reprogram
• It does not require much power
• It is cheap to manufacture
• Works automatically
• It is small in size
• It is a real-time system

Examples:
• Domestic appliances
• Cars
• Security Systems
• Lighting Systems
• Vending Machines

74

You might also like