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

Ch6 - Computer Architecture (1)

Chapter 6 discusses computer architecture, focusing on primary memory types such as RAM and ROM, and the concept of virtual memory which extends RAM capacity. It explains the Von Neumann architecture, detailing components like the CPU, registers, buses, and the fetch-decode-execute cycle. Additionally, it covers interrupts, factors affecting CPU performance, and the definition and examples of embedded systems.

Uploaded by

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

Ch6 - Computer Architecture (1)

Chapter 6 discusses computer architecture, focusing on primary memory types such as RAM and ROM, and the concept of virtual memory which extends RAM capacity. It explains the Von Neumann architecture, detailing components like the CPU, registers, buses, and the fetch-decode-execute cycle. Additionally, it covers interrupts, factors affecting CPU performance, and the definition and examples of embedded systems.

Uploaded by

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

Ch.6: Computer Architecture Eng.

Omar El Safty

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

1.1 RAM (Random Access Memory)


Definition:

• Volatile memory
• Can read from and written to
• Used to store:
- Instructions that are currently in use
- Data that is currently in use
- Parts of the operating system that are currently in use

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:


• Data on the secondary storage is split into pages
• Pages are copied from the secondary storage to the RAM when needed

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

Importance of using virtual memory:

• To extend RAM capacity


- So it reduces the need to buy and install more expensive physical RAM memory
• To allow computer to process large amount of data
• Stops programs from crashing when physical RAM is full

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:

• ROM is non-volatile
• Can only be read from but no written to
• Stores the firmware

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) ROM is non-volatile (permanent)

Used to store data, programs or parts of the


Stores the firmware
operating system that are currently in use

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

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

Application where RAM and ROM are both used


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

ROM function:

• Stores the factory settings


• Stores the start-up routines when the toy car is first switched on

RAM function:

• Stores the instructions received from the remote-control unit

2. Von Neumann Architecture


The Von Neumann architecture is often referred to as 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 and executed one after another

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

The following components related to Von Neumann Architecture:


2.1 Secondary Storage
Role:
Secondary storage stores data and programs that can be used.

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

Role:
Used to store:
• Instructions that are currently in use
• Data that is currently in use
• Parts of the operating system that are currently in use

2.3 Central Processing Unit (CPU)


Definition and role:
A CPU is a type of integrated circuit on a single chip. It processes the instructions.

Structure
CPU contains the Arithmetic and Logic Unit (ALU) and the Control Unit.

Control Unit
Roles:

• Controls the flow of data through CPU


• Controls the interactions between the different parts of the CPU
• Responsible for decoding instructions

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

Arithmetic and Logic Unit (ALU)


Roles:
• Carries out arithmetic calculations
• Carries out logic operations
• Holds temporary values during calculations in a register called accumulator

IMPORTANT

A central processing unit can also be called microprocessor or processor.

2.4 Registers
Definition and Role:
They are small fast memory locations within the CPU that stores data and instructions during
processing.

Examples of registers and their roles:


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

Current Instruction Register (CIR)


Temporarily stores the current instruction during processing.

Accumulator (ACC)
Temporarily stores data that is currently being used in a calculation.

Memory Address Register (MAR)


Temporarily stores address of the instruction to be fetched.

Memory Data Register (MDR)


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

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

2.6 Buses
Definition and Role:
Pathways to transport data, addresses and control signals between the internal components
of the computer.

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

Type of bus Description of bus Signal direction

Transports data between the CPU, memory


Data bus Bidirectional
unit and input/output devices

Transports signals relating to addresses


Address bus Unidirectional
between the CPU and the RAM

Transports signals relating to the control and Can be Unidirectional


Control bus
coordination of activities within the computer or Bidirectional

2.7 Input/Output Devices


Roles:
They are the main method of entering data into and getting the data out of computer
systems.

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

3. Fetch-Decode-Execute Cycle
Fetch:
1 PC contains the address of 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 CPU interprets and decodes the instruction

Execute:
7 The CPU then executes the instruction
− Signals are sent using control bus to different components of the computer
− If there is an arithmetic operation, the result is stored in the accumulator

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

4. Interrupt
Definition:

• A signal sent from a device or software that informs the CPU that its attention is
required
• Interrupts have different priorities
• Interrupts are handled by the ISR (Interrupt Service Routine)

Roles:

• Informs the CPU that its attention is required


• Pauses current process until the interrupt is serviced by CPU
• Allows vital tasks to be dealt with 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

Interrupt Service Routine (ISR)


Definition:
A piece of software that handles the interrupt.

Steps of handling an interrupt:


1 Interrupt is generated from a device / software, and given a priority
2 Operating system detects an interrupt has been received
3 … so it pauses the current process
4 … and calls the ISR
5 The ISR contains the code that handles the interrupt and executed by the CPU
6 Once the interrupt is fully serviced, the operating system resumes the interrupted
process

74
Ch.6: Computer Architecture Eng. Omar El Safty

5. Factors that determine CPU performance


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

Effect of increasing the number of cores on CPU performance:


• Allows the CPU to process multiple instructions at the same time..
• .. which will increase 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:
A signal that synchronizes all the CPU operations.

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


• Increasing the processing speed of the CPU ..
• .. which will increase the CPU performance

5.3 CPU Cache


Definition:
A temporary memory inside the CPU that is used to quickly access frequently used data.

Effect on CPU performance:


• Allows the CPU to fetch frequently used data/instructions faster ..
• .. which will increase the CPU performance

75
Ch.6: Computer Architecture Eng. Omar El Safty

6. Embedded Systems
Definition:
An embedded system is a combination of hardware and software which is designed to carry
out a specific set of functions.

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

IMPORTANT

An embedded system is not a general-purpose computer, a general-purpose computer is


used to perform many different functions

Note That

An embedded system would typically have low processing power


and small RAM capacity compared to a general-purpose computer.

76

You might also like