0% found this document useful (0 votes)
9 views32 pages

FC Lecture 08

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views32 pages

FC Lecture 08

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Sri Lanka Institute of Information Technology

Faculty of Computing

Fundamentals of Computing

Dr.Sanvitha Kasturiarachchi

Year 01 and Semester 01

Year 01 and Semester 01 1 / 32


Lecture 9

Processor and Memory


Architecture

Year 01 and Semester 01 2 / 32


Lecture Learning Objectives

Understand and explain the Von Neumann Architecture


Understand and explain the Harvard Architecture
Understand and explain the Modified Harvard Architecture
Understand the Memory Virtualization

Year 01 and Semester 01 3 / 32


Outline

1 Von Neumann Architecture

2 Harvard Architecture

3 Modified Harvard Architecture

4 Memory Virtualization

Year 01 and Semester 01 4 / 32


Computer system Architectures

There are three fundamental types of computer system architectures


that describe how a computer’s memory and data paths are organized.
They are;
Von Neumann Architecture
Harvard Architecture
Modified Harvard Architecture

Year 01 and Semester 01 5 / 32


Von Neumann architecture

The von Neumann architecture was introduced by John von Neumann


in 1945.
This processor configuration consists of a control unit, an arithmetic
logic unit, a register set, and a memory region containing program
instructions and data.
The Von Neumann architecture is a design model for a
stored-program computer where both program instructions and data
share the same memory space.

Year 01 and Semester 01 6 / 32


Von Neumann architecture

Application: general-purpose computers (desktops, laptops).

Year 01 and Semester 01 7 / 32


Features of Von Neumann architecture

Unified Memory: Instructions (program code) and data are stored in


the same memory (RAM). There is no distinction between instruction
memory and data memory.
Single Data Bus: A single data bus is used for both instructions and
data, which means that only one can be accessed at a time (causing a
bottleneck known as the ”Von Neumann bottleneck”).
Control Unit and Arithmetic Logic Unit (ALU): The control unit
fetches instructions from memory, and the ALU executes them.
Sequential Execution: Instructions are processed sequentially, one
at a time.

Year 01 and Semester 01 8 / 32


Von Neumann Bottleneck

The instructions and data in the system are stored in the same RAM space
and are accessed over a single shared bus. This design creates a
bottleneck because of:
Single Data Path: The CPU can either fetch an instruction from
memory or fetch/write data, but it cannot do both at the same
time because they share the same bus and memory.
Sequential Access: The control unit must fetch instructions
sequentially, execute them, and then access the necessary data. This
slows down performance, when there are large amounts of data to be
processed.

Year 01 and Semester 01 9 / 32


Von Neumann Bottleneck

Limited Bandwidth: The shared memory bus has a limited


bandwidth, meaning that the rate at which data and instructions can
be transferred to the CPU is restricted. If the CPU is faster than the
memory, the memory access becomes the limiting factor for system
performance.

Year 01 and Semester 01 10 / 32


Von Neumann Security Considerations

In Von Neumann architecture due to it stores both program


instructions and data in the same memory space, there can be
potential security vulnerabilities that are relevant even in modern
computing.

Year 01 and Semester 01 11 / 32


Buffer Overflow in Von Neumann

Buffer overflow occurs when a program requests input and stores that
input in a fixed-length data buffer.
If the code is not careful to check the length of the input provided by
the user, it is possible for the user to enter an input sequence longer
than the available storage space. When this happens, the additional
data overwrites memory intended for other purposes.

Year 01 and Semester 01 12 / 32


Advantages and Disadvantages

Advantages:
Simple design.
Easier to implement.
Flexibility due to shared memory for both code and data.
Disadvantages:
The Von Neumann bottleneck limits performance because the CPU
cannot read instructions and data simultaneously.
Slower compared to other architectures due to shared bus access.

Year 01 and Semester 01 13 / 32


Harvard Architecture

The Harvard architecture was originally implemented in the Harvard


Mark I computer in 1944.
A strict Harvard architecture uses one address space and memory bus
for program instructions and a separate address space and memory
bus for data.
This configuration has the immediate benefit of enabling
simultaneous access to instructions and data, thereby implementing a
form of parallelism.

Year 01 and Semester 01 14 / 32


Harvard Architecture

Application: embedded systems and digital signal processing


applications.

Year 01 and Semester 01 15 / 32


Features of Harvard Architecture

Separate Memories: There are two physically separate memories,


one for instructions (program memory) and one for data (data
memory).
Separate Buses: Instructions and data are accessed using different
buses, allowing the CPU to fetch instructions and data simultaneously.
Faster Execution: Since instruction and data fetches can happen in
parallel, the system can execute more efficiently compared to Von
Neumann architecture.

Year 01 and Semester 01 16 / 32


Advantages and Disadvantages

Advantages:
Increased throughput because instruction fetch and data read/write
can happen at the same time.
No risk of instruction corruption by data errors.
More efficient use of CPU resources.
Disadvantages:
More complex hardware design because of separate buses and memory.
Difficult to optimize memory utilization since program and data
memory sizes are fixed and separate.

Year 01 and Semester 01 17 / 32


Modified Harvard Architecture

The Modified Harvard Architecture is a hybrid approach that


combines features of both the Von Neumann and Harvard
architectures.
It separates instruction and data memory as the Harvard architecture
but allows both memories to be accessed through a shared address
space or allows data to be accessed from instruction memory when
needed.
This reduces the effects of the von Neumann bottleneck and
mitigates the security issues.

Year 01 and Semester 01 18 / 32


Modified Harvard Architecture

Application: modern high-performance CPUs and microcontrollers

Year 01 and Semester 01 19 / 32


Features of modified Harvard Architecture

Separate Memory Spaces: Similar to Harvard, the program


instructions and data can be stored in different physical memory
regions, but the CPU can access both types of data more flexibly.
Unified Address Space: The CPU might be able to access
instruction memory as if it were data memory, allowing for more
efficient handling of certain operations.
Cache Memory: Frequently used data and instructions may share
the same cache, which improves speed while maintaining a
Harvard-like separation for certain operations.

Year 01 and Semester 01 20 / 32


Advantages and Disadvantages

Advantages:
Greater flexibility than strict Harvard architecture.
Instruction and data memories can be optimized for performance
while still allowing some data to be fetched from instruction memory
when needed.
Avoids the bottlenecks of Von Neumann while not being as complex
as a full Harvard system.
Disadvantages:
More complex than the Von Neumann architecture.

Year 01 and Semester 01 21 / 32


Summary

Year 01 and Semester 01 22 / 32


Memory virtualization

Main Memory (RAM) and virtual memory (VM) are crucial concepts
in computer architecture, and they help manage how data is stored
and accessed by the CPU for efficient performance.
Main memory usually separated into two partitions:
Resident operating system, usually held in low memory with interrupt
vector
User processes then held in high memory
Each process contained in single contiguous section of memory

Year 01 and Semester 01 23 / 32


Swapping

A process can be swapped temporarily out of memory to a backing


store, and then brought back into memory for continued execution.
There are two operations;
Swap in
Swap out

Year 01 and Semester 01 24 / 32


Contiguous Allocation

The resource must be allocated efficiently based on Contiguous


allocation method.
The main memory must support both OS and user processes and
thereby, the memory space is limited.
If the memory space is not sufficient for contiguous allocation,
External Fragmentation will occur.
External Fragmentation: total memory space exists to satisfy a
request, but it is not contiguous.

Year 01 and Semester 01 25 / 32


Paging

Separate the process into an equal sized pages and store the pages in
the virtual memory.

Year 01 and Semester 01 26 / 32


Virtual Memory

Virtual memory is a memory management technique that allows a


computer to compensate for shortages of physical memory by
temporarily transferring data from RAM to a swap space on the hard
drive.
This allows the system to run larger programs or multiple applications
simultaneously, even if the system’s physical memory (RAM) is full.

Year 01 and Semester 01 27 / 32


Benefits of Virtual Memory

Efficient Use of Physical Memory: By loading only the active parts


of a program into RAM and swapping out inactive parts, virtual
memory optimizes the use of available physical memory.
Running Large Applications: Programs that require more memory
than is physically available can still run by using virtual memory.
Improved Stability: Virtual memory provides memory isolation,
which ensures that one program cannot directly access or corrupt the
memory of another program.
Simplified Programming: Programmers do not need to worry about
the limitations of physical memory, as the operating system manages
memory allocation dynamically.

Year 01 and Semester 01 28 / 32


Summary

Year 01 and Semester 01 29 / 32


End of lecture 9

Year 01 and Semester 01 30 / 32


Weekly Plan

Practical: Simulation of electronic circuits - III


Workshop: Progress evaluation

Year 01 and Semester 01 31 / 32


Thank You!

Year 01 and Semester 01 32 / 32

You might also like