CIT 314 Module 1
CIT 314 Module 1
GUIDE
CIT314
COMPUTER ARCHITECTURE AND ORGANIZATION II
Lagos Office
14/16 Ahmadu Bello Way
Victoria Island, Lagos
Departmental email: computersciencedepartment@noun.edu.ng
NOUN e-mail: centralinfo@noun.edu.ng
URL: www.nou.edu.ng
First Printed 2022
ISBN: 978-058-557-5
ii
CIT 314 COURSE GUIDE
CONTENTS PAGE
Introduction…………………………………………………iv
Summary ..............................................................................xvi
iii
CIT 314 COURSE GUIDE
COURSE GUIDE
INTRODUCTION
This book is about the structure and function of Computers. Its purpose
is to present as clearly and completely as possible, the nature and
characteristics of modern-day computer systems.
In spite of the variety, and pace of change in the computer field, certain
fundamental concepts apply consistently throughout. The application of
these concepts depends on the current state of the technology and the
price, performance, objectives of the designer. The intent of this book is
to provide a thorough discussion of the fundamentals of computer
organization and architecture and to relate these to contemporary design
issues.
This course is divided into four modules. The first module deals with an
overview of the memory system. The second module covers, memory
addressing, elements of memory hierarchy, and virtual memory control
systems. The third module discusses various forms of control including
hardware, asynchronous, microprogrammed and asynchronous forms.
The fourth and last module takes on fault tolerant computing and
methods for fault-tolerant computing.
This course guide gives you a brief overview of the course contents,
course duration, and course materials.
COURSE COMPETENCIES
First, students will learn about the basics of computers and what they are
made up of. Second, they will be able to judge certain functionalities in
computer systems dependent on the type of architectures they are
operating on. This in turn will give them a deeper understanding on how
to manage computer faults.
COURSE OBJECTIVES
Certain objectives have been set out for the achievement of the course
aims. And apart from the course objectives, each unit of this course has
its objectives, which you need to confirm if are met, at the end of each
unit. So, upon the completion of this course, you should be able to:
STUDY UNITS
MODULE ONE
MODULE TWO
MODULE THREE
MODULE FOUR
vii
CIT 314 COURSE GUIDE
You should make use of the course materials, and do the exercises to
enhance your learning.
Ailamaki AG, DeWitt DJ., Hill MD, Wood DA. DBMSs on a modern
processor: where does time go? In: Proceedings of the 25th
International Conference on Very Large Data Bases; 1999. p. 266–
77. URL: https://www.semanticscholar.org/paper/DBMSs-on-a-
Modern-Processor%3A-Where-Does-Time-Go-Ailamaki-
DeWitt/54b92179ede08158e2cf605f5e9f264ca06c01ff
Denning PJ. The working set model for program behaviour. Commun
ACM. 1968;11(5):323–33. URL:
https://denninginstitute.com/pjd/PUBS/WSModel_1968.pdf
https://books.google.com/books/about/Fundamentals_of_Computer
_Organization_an.html?id=m6uFlL41TlIC
https://books.google.com/books/about/Interconnection_Networks_
for_Multiproces.html?id=-1u7QgAACAAJ
Walton G. H., Long Taff T.A. and R. C. Linder, (1997) “Computational
Evaluation of Software Security attributes”, IEEE.
PRESENTATION SCHEDULE
ASSESSMENT
There are two aspects to the assessment of the course. First are the tutor
–marked assignments; second, is a written examination. In tackling the
assignments, you are expected to apply the information and knowledge
you acquired during this course. The assignments must be submitted to
xii
CIT 314 COURSE GUIDE
your tutor for formal assessment in accordance with the deadlines stated
in the Assignment File. The work you submit to your tutor for
assessment will count for 30% of your total course mark. At the end of
the course, you will need to sit for a final three-hour examination.
This will also count for 70% of your total course mark.
TUTOR-MARKED ASSIGNMENT
There are eight tutor- marked assignments in this course. You need to
submit all the assignments. The total marks for the best four (4)
assignments will be 30% of your total course mark.
Assignment questions for the units in this course are contained in the
Assignment
When you have completed each assignment, send it together with a form
to your tutor. Make sure that each assignment reaches your tutor on or
before the deadline given. If, however you cannot complete your work
on time, contact your tutor before the assignment is done to discuss the
possibility of an extension.
The final examination for the course will carry 70% percentage of the
total mark available for this course. The examination will cover every
aspect of the course, so you are advised to revise all your corrected
assignments before the examination.
This course endows you with the status of a teacher and that of a learner.
This means that you teach yourself and that you learn, as your learning
capabilities would allow. It also means that you are in a better position
to determine and to ascertain the what, the how, and the when of your
language learning. No teacher imposes any method of learning on you.
The course units are similarly designed with the introduction following
the table of contents, then a set of objectives and then the discourse and
so on. The objectives guide you as you go through the units to ascertain
your knowledge of the required terms and expressions.
xiii
CIT 314 COURSE GUIDE
Assessment Marks
Assignment 1- 4 Four assignments, best three marks of the four count at
30% of course marks
Final Examination 70% of overall course marks
Total 100% of course marks
In distance learning the study units replace the university lecturer. This is
one of the great advantages of distance learning; you can read and work
through specially designed study materials at your own pace, and at a time
and place that suit you best. Think of it as reading the lecture instead of
listening to a lecturer. In the same way that a lecturer might set you some
reading to do, the study units tell you when to read your set books or other
material. Just as a lecturer might give you an in-class exercise, your study
units provide exercises for you to do at appropriate points.
Each of the study units follows a common format. The first item is an
introduction to the subject matter of the unit and how a particular unit is
integrated with the other units and the course as a whole. Next is a set of
learning objectives. These objectives enable you know what you should be
able to do by the time you have completed the unit. You should use these
objectives to guide your study. When you have finished the units you
must go back and check whether you have achieved the objectives. If you
make a habit of doing this, you will significantly improve your chances of
passing the course.
Remember that your tutor’s job is to assist you. When you need help, don’t
hesitate to call and ask your tutor to provide it.
5. Assemble the study materials. Information about what you need for
a unit is given in the overview at the beginning of each unit. You
will almost always need both the study unit you are working on and
one of your set of books on your desk at the same time.
6. Work through the unit. The content of the unit itself has been
arranged to provide a sequence for you to follow. As you work
through the unit you will be instructed to read sections from your
set books or other articles. Use the unit to guide your reading.
7. Review the objectives for each study unit to confirm that you have
achieved them. If you feel unsure about any of the objectives,
review the study material or consult your tutor.
8. When you are confident that you have achieved a unit’s
objectives, you can then start on the next unit. Proceed unit by
unit through the course and try to pace your study so that you
keep yourself on schedule.
9. When you have submitted an assignment to your tutor for marking,
do not wait for its return before starting on the next unit. Keep to
your schedule. When the assignment is returned, pay particular
attention to your tutor’s comments, both on the tutor-marked
assignment form and on the assignment. Consult your tutor as
soon as possible if you have any questions or problems.
10. After completing the last unit, review the course and prepare
yourself for the final examination. Check that you have achieved
the unit objectives (listed at the beginning of each unit) and the
course objectives (listed in this Course Guide).
Your tutor will mark and comment on your assignments, keep a close
watch on your progress and on any difficulties you might encounter and
provide assistance for you during the course. You must mail or submit
your tutor-marked assignments to your tutor well before the due date (at
least two working days are required). They will be marked by your tutor
and returned to you as soon as possible.
• you do not understand any part of the study units or the assigned
readings,
xv
CIT 314 COURSE GUIDE
You should try your best to attend the tutorials. This is the only chance to
a have face to face contact with your tutor and to ask questions which are
answered instantly. You can raise any problem encountered in the course
of your study. To gain the maximum benefit from course tutorials, prepare
a question list before attending them. You will learn a lot from
participating in discussions actively.
SUMMARY
We wish you success with the course and hope that you will find it
interesting and useful.
xvi
MAIN
COURSE
CONTENT PAGE
MODULE 1………………………………………. 1
MODULE 2………………………………………… 41
MODULE 3………………………………………………. 69
INTRODUCTION
1
CIT314 COMPUTER ARCHITECTURE AND ORGANIZATION II
CONTENTS
1.0 Introduction
2.0 Intended Learning Outcomes (ILOS)
3.0 Main Contents
UNIT ONE: Memory Systems
3.1 Main Memories
3.2 Auxiliary Memories
3.3 Memory Access Methods
3.4 Memory Mapping and Virtual Memories
3.5 Replacement Algorithms
3.6 Data Transfer Modes
3.7 Parallel Processing
3.8 Pipelining
4.0 Self-Assessment Exercises
5.0 Conclusion
6.0 Summary
7.0 References/Further Reading
1.0 INTRODUCTION
A related concept is the unit of transfer, for internal memory, the unit
of transfer is equal to the number of data lines into and out of the
memory module. This may be equal to the word length, but is often
larger. such as 64. 128, or 256 bits. From a user's point of view, the two
most important characteristics of memory are capacity and
performance. Three performance parameters arc used: a. second access
can commence. This additional time may be required for transients to
die out on signal lines or to regenerate data if they are read destructively.
Now that memory cycle time is concerned with the system bus, not the
processor.
3
CIT314 COMPUTER ARCHITECTURE AND ORGANIZATION II
At the end of this module, the user should be able to discuss elaborately
on;
Magnetic tape
Magnetic Disks
Floppy Disks
Hard Disks and Drives
These high-speed storage devices are very expensive and hence the cost
per bit of storage is also very high. Again, the storage capacity of the
main memory is also very limited. Often it is necessary to store
hundreds of millions of bytes of data for the CPU to process. Therefore,
additional memory is required in all the computer systems. This memory
is called auxiliary memory or secondary storage. In this type of memory,
the cost per bit of storage is low. However, the operating speed is slower
than that of the primary memory. Most widely used secondary storage
devices are magnetic tapes, magnetic disks and floppy disks.
5
CIT314 COMPUTER ARCHITECTURE AND ORGANIZATION II
Magnetic tape is wound on reels (or spools). These may be used on their
own, as open-reel tape, or they may be contained in some sort of
magnetic tape cartridge for protection and ease of handling. Early
computers used open-reel tape, and this is still sometimes used on large
computer systems although it has been widely superseded by cartridge
tape. On smaller systems, if tape is used at all it is normally cartridge
tape.
Magnetic tape is used in a tape transport (also called a tape drive, tape
deck, tape unit, or MTU), a device that moves the tape over one or more
magnetic heads. An electrical signal is applied to the write head to
record data as a magnetic pattern on the tape; as the recorded tape passes
over the read head it generates an electrical signal from which the stored
6
CIT 314 MODULE 1
data can be reconstructed. The two heads may be combined into a single
read/write head. There may also be a separate erase head to erase the
magnetic pattern remaining from previous use of the tape. Most
magnetic-tape formats have several separate data tracks running the
length of the tape. These may be recorded simultaneously, in which
case, for example, a byte of data may be recorded with one bit in each
track (parallel recording); alternatively, tracks may be recorded one at a
time (serial recording) with the byte written serially along one track.
Magnetic tape has been used for offline data storage, backup,
archiving, data interchange, and software distribution, and in the
early days (before disk storage was available) also as online
backing store. For many of these purposes it has been superseded
by magnetic or optical disk or by online communications. For
example, although tape is a non-volatile medium, it tends to
deteriorate in long-term storage and so needs regular attention
(typically an annual rewinding and inspection) as well as a
controlled environment. It is therefore being superseded for
archival purposes by optical disk.
Magnetic tape is still extensively used for backup; for this
purpose, interchange standards are of minor importance, so
proprietary cartridge-tape formats are widely used.
Magnetic tapes are used for large computers like mainframe
computers where large volume of data is stored for a longer time.
In PCs also you can use tapes in the form of cassettes.
The cost of storing data in tapes is inexpensive. Tapes consist of
magnetic materials that store data permanently. It can be 12.5
mm to 25 mm wide plastic film-type and 500 meter to 1200-
meter-long which is coated with magnetic material. The deck is
connected to the central processor and information is fed into or
read from the tape through the processor. It is similar to cassette
tape recorder.
7
CIT314 COMPUTER ARCHITECTURE AND ORGANIZATION II
You might have seen the gramophone record, which is circular like a
disk and coated with magnetic material. Magnetic disks used in
computer are made on the same principle. It rotates with very high speed
inside the disk drive. Data are stored on both the surface of the disk.
Magnetic disks are most popular for direct access storage. Each disk
consists of a number of invisible concentric circles called tracks.
Information is recorded on tracks of a disk surface in the form of tiny
magnetic sports. The presence of a magnetic sport represents one bit (1)
and its absence represents zero bit (0). The information stored in a disk
can be read many times without affecting the stored data. So the reading
operation is non-destructive. But if you want to write a new data, then
the existing data is erased from the disk and new data is recorded.
The data capacity of magnetic disk memories ranges from several tens
of thousands up to several billion bits, and the average access time is 10-
100 milliseconds. The two main types are the hard disk and the floppy
disk.
individual bits due to the variability of motor speed. High speed disks
have an access time of 28 milliseconds or less, and low speed disk s,
65milliseconds or more. The higher
speed disks also transfer their data faster than the slower speed units.
The disks are usually aluminum with a magnetic coating. The heads
"float" just above the disk's surface on a current of air, sometimes at
lower than atmospheric pressure in an air tight enclosure. The head has
an aerodynamic shape so the current pushes it away from the disk. A
small spring pushes the head towards the disk at the same time keeping
the he a data constant distance from the disk (about two microns). Disk
drives are commonly characterized by the kind of interface used to
connect to the computer
These are small removable disks that are plastic coated with magnetic
recording material. Floppy disks are typically 3.5″ in size (diameter) and
can hold 1.44 MB of data. This portable storage device is a rewritable
media and can be reused a number of times. Floppy disks are commonly
used to move files between different computers. The main disadvantage
of floppy disks is that they can be damaged easily and, therefore, are not
very reliable. The following figure shows an example of the floppy disk.
It is similar to magnetic
9
CIT314 COMPUTER ARCHITECTURE AND ORGANIZATION II
Tunnel Erasure: As the track is laid down by the R/W heads, the
trailing tunnel erasure heads force the data to be present only
within a specified narrow tunnel on each track. This process
prevents the signals from reaching adjacent track and making
cross talk.
10
CIT 314 MODULE 1
Straddle Erasure: In this method, the R/W and the erasure heads
do recording and erasing at the same time. The erasure head is
not used to erase data stored in the diskette. It trims the top and
bottom fringes of recorded flux reversals. The erasure heads
reduce the effect of cross-talk between tracks and minimize the
errors induced by minor run out problems on the diskette or
diskette drive.
Head alignment: Alignment is the process of placement of the
heads with respect to the track that they must read and write.
Head alignment can be checked only against some sort of
reference- standard disk recorded by perfectly aligned machine.
These types of disks are available and one can use one to check
the drive alignment.
A hard disk drive (HDD), hard disk, hard drive or fixed disk is a data
storage device that uses magnetic storage to store and retrieve digital
information using one or more rigid rapidly rotating disks (platters)
coated with magnetic material. The platters are paired with magnetic
heads, usually arranged on a moving actuator arm, which read and write
data to the platter surfaces. Data is accessed in a random-access manner,
meaning that individual blocks of data can be stored or retrieved in any
order and not only sequentially.
As can be seen in the picture below, the desktop hard drive consists of
the following components: the head actuator, read/write actuator arm,
read/write head, spindle, and platter. On the back of a hard drive is a
11
CIT314 COMPUTER ARCHITECTURE AND ORGANIZATION II
circuit board called the disk controller or interface board and is what
allows the hard drive to communicate with the computer.
Although most hard drives are internal, there are also stand-alone
devices called external hard drives, which can backup data on computers
and expand the available disk space. External drives are often stored in
an enclosure that helps protect the drive and allows it to interface with
the computer, usually over USB or eSATA.
The first hard drive was introduced to the market by IBM on September
13, 1956. The hard drive was first used in the RAMAC 305 system, with
a storage capacity of 5 MB and a cost of about $50,000 ($10,000 per
megabyte). The hard drive was built-in to the computer and was not
removable. The first hard drive to have a storage capacity of one
gigabyte was also developed by IBM in 1980. It weighed 550 pounds
12
CIT 314 MODULE 1
and cost $40,000. 1983 marked the introduction of the first 3.5-inch size
hard drive, developed by Rodime. It had a storage capacity of 10 MB.
Seagate was the first company to introduce a 7200 RPM hard drive in
1992. Seagate also introduced the first 10,000 RPM hard drive in 1996
and the first 15,000 RPM hard drive in 2000. The first solid-state drive
(SSD) as we know them today was developed by SanDisk Corporation
in 1991, with a storage capacity of 20 MB. However, this was not a
flash-based SSD, which were introduced later in 1995 by M-Systems.
These drives did not require a battery to keep data stored on the memory
chips, making them a non-volatile storage medium.
Advantages
Disadvantages
metal coating along the tracks. When data stored on the optical disk is to
be read, a less powerful laser beam is focused on the disk surface. The
storage capacity of these devices is tremendous; the Optical disk access
time is relatively fast. The biggest drawback of the optical disk is that it
is a permanent storage device. Data once written cannot be erased.
Therefore it is a read only storage medium. A typical example of the
optical disk is the CD-ROM.
1. Read-only memory (ROM) disks, like the audio CD, are used
for the distribution of standard program and data files. These are
mass-produced by mechanical pressing from a master die. The
information is actually stored as physical indentations on the
surface of the CD. Recently low-cost equipment has been
introduced in the market to make one-off CD-ROMs, putting
them into the next category.
2. Write-once read-many (WORM) disks: Some optical disks can
be recorded once. The information stored on the disk cannot be
changed or erased. Generally the disk has a thin reflective film
deposited on the surface. A strong laser beam is focused on
selected spots on the surface and pulsed. The energy melts the
film at that point, producing a nonreflective void. In the read
mode, a low power laser is directed at the disk and the bit
information is recovered by sensing the presence or absence of a
reflected beam from the disk.
3. Re-writeable, write-many read-many (WMRM) disks, just like
the magnetic storage disks, allows information to be recorded and
erased many times. Usually, there is a separate erase cycle
although this may be transparent to the user. Some modern
devices have this accomplished with one over-write cycle. These
devices are also called direct read-after-write (DRAW) disks.
4. WORM (write once, read many) is a data storage technology
that allows information to be written to a disc a single time and
prevents the drive from erasing the data. The discs are
intentionally not rewritable, because they are especially intended
to store data that the user does not want to erase accidentally.
Because of this feature, WORM devices have long been used for
the archival purposes of organizations such as government
agencies or large enterprises. A type of optical media, WORM
devices were developed in the late 1970s and have been adapted
to a number of different media. The discs have varied in size
from 5.25 to 14 inches wide, in varying formats ranging from
140MB to more than 3 GB per side of the (usually) double-sided
medium. Data is written to a WORM disc with a low- powered
laser that makes permanent marks on the surface. WORM (Write
Once, Read Many) storage had emerged in the late 1980s and
was popular with large institutions for the archiving of high
15
CIT314 COMPUTER ARCHITECTURE AND ORGANIZATION II
Data need to be accessed from the memory for various purposes. There
are several methods to access memory as listed below:
Sequential access
Direct access
Random access
Associative access
17
18
CIT 314 MODULE 1
Accessing files via memory map is faster than using I/O functions such
as fread and fwrite. Data are read and written using the virtual memory
capabilities that are built in to the operating system rather than having to
allocate, copy into, and then deallocate data buffers owned by the
process does not access data from the disk when the map is first
constructed. It only reads or writes the file on disk when a specified part
of the memory map is accessed, and then it only reads that specific part.
This provides faster random access to the mapped data.
19
CIT314 COMPUTER ARCHITECTURE AND ORGANIZATION II
3.4.1.2 Efficiency
Mapping a file into memory allows access to data in the file as if that
data had been read into an array in the application's address space.
Initially, MATLAB only allocates address space for the array; it
does not actually read data from the file until you access the mapped region. As
a result, memory-mapped files provide a mechanism by which
applications can access data segments in an extremely large file without
having toread the entire file into memory first. Efficient Coding Style
Memory-mapping in your MATLAB application enables you to access file
data using standard MATLAB indexing operations.
Processes in a system share the CPU and main memory with other
processes. However, sharing the main memory poses some special
challenges. As demand on the CPU increases, processes slowdown in
some reasonably smooth way. But if too many processes need too much
memory, then some of them will simply not be able to run. When a
program is out of space, it is out of luck. Memory is also vulnerable to
corruption. If some process inadvertently writes to the memory used by
another process, that process might fail in some bewildering fashion
totally unrelated to the program logic. In order to manage memory more
efficiently and with fewer errors, modern systems provide an abstraction
of main memory known as virtual memory (VM). Virtual memory is an
elegant interaction of hardware exceptions, hardware address translation,
main memory, disk files, and kernel software that provides each process
with a large, uniform, and private address space. With one clean
mechanism, virtual memory provides three important capabilities.
21
CIT314 COMPUTER ARCHITECTURE AND ORGANIZATION II
As with any cache, the VM system must have some way to determine if
a virtual page is cached somewhere in DRAM. If so, the system must
determine which physical page it is cached in. If there is a miss, the
system must determine where the virtual page is stored on disk, select a
victim page in physical memory, and copy the virtual page from disk to
DRAM, replacing the victim page. These capabilities are provided by a
combination of operating system software, address translation hardware
in the MMU (memory management unit), and a data structure stored in
physical memory known as a page table that maps virtual pages to
physical pages. The address translation hardware reads the page table
each time it converts a virtual address to a physical address. The
operating system is responsible for maintaining the contents of the page
table and transferring pages back and forth between disk and DRAM
Virtual memory was invented in the early 1960s, long before the
widening CPU-memory gap spawned SRAM caches. As a result, virtual
memory systems use a different terminology from SRAM caches, even
though many of the ideas are similar. In virtual memory parlance, blocks
are known as pages. The activity of transferring a page between disk and
memory is known as swapping or paging. Pages are swapped in (paged
in) from disk to DRAM, and swapped out (paged out) from DRAM to
disk. The strategy of waiting until the last moment to swap in a page,
when a miss occurs, is known as demand paging. Other approaches,
such as trying to predict misses and swap pages in before they are
actually referenced, are possible. However, all modern systems use
demand paging.
22
CIT 314 MODULE 1
Any modern computer system must provide the means for the operating
system to control access to the memory system. A user process should
not be allowed to modify its read-only text section. Nor should it be
allowed to read or modify any of the code and data structures in the
kernel. It should not be allowed to read or write the private memory of
other processes, and it should not be allowed to modify any virtual pages
that are shared with other processes, unless all parties explicitly allow it
(via calls to explicit inter-process communication system calls).
In any system that uses both virtual memory and SRAM caches, there is
the issue of whether to use virtual or physical addresses to access the
SRAM cache. Although a detailed discussion of the trade-offs is beyond
our scope here, most systems opt for physical addressing. With physical
addressing, it is straightforward for multiple processes to have blocks in
the cache at the same time and to share blocks from the same virtual
pages. Further, the cache does not have to deal with protection issues
because access rights are checked as part of the address translation
process.
As we have seen, every time the CPU generates a virtual address, the
MMU must refer to a PTE in order to translate the virtual address into a
physical address. In the worst case, this requires an additional fetch from
memory, at a cost of tens to hundreds of cycles. If the PTE happens to
be cached in L1, then the cost goes down to one or two cycles. However,
many systems try to eliminate even this cost by including a small cache
of PTEs in the MMU called a translation lookaside buffer (TLB). A
TLB is a small, virtually addressed cache where each line holds a block
consisting of a single PTE. A TLB usually has a high degree of
associativity
When a page fault occurs, the operating system has to choose a page to
remove from memory to make room for the page that has to be brought
in. If the page to be removed has been modified while in memory, it
must be rewritten to the disk to bring the disk copy up to date. If,
however, the page has not been changed (e.g., it contains program text),
the disk copy is already up to date, so no rewrite is needed. The page to
be read in just overwrites the page being evicted. While it would be
23
CIT314 COMPUTER ARCHITECTURE AND ORGANIZATION II
with virtual memory have two status bits associated with each page. R is
set whenever the page is referenced (read or written). M is set when the
page is written to (i.e., modified). The bits are contained in each page
table entry. It is important to realize that these bits must be updated on
every memory reference, so it is essential that they be set by the
hardware. Once a bit has been set to 1, it stays 1 until the operating
system resets it to 0 in software. If the hardware does not have these
bits, they can be simulated as follows. When a process is started up, all
of its page table entries are marked as not in memory. As soon as any
page is referenced, a page fault will occur. The operating system then
sets the R bit (in its internal tables), changes the page table entry to point
to the correct page, with mode READ ONLY, and restarts the
instruction. If the page is subsequently written on, another page fault
will occur, allowing the operating system to set the M bit and change the
page’s mode to READ/WRITE. The R and M bits can be used to build a
simple paging algorithm as follows. When a process is started up, both
page bits for all its pages are set to 0 by the operating system.
Periodically (e.g., on each clock interrupt), the R bit is cleared, to
distinguish pages that have not been referenced recently from those that
have been. When a page fault occurs, the operating system inspects all
the pages and divides them into four categories based on the current
values of their R and M bits:
the most recent arrival. On a page fault, the page at the head is removed
and the new page added to the tail of the list. When applied to stores,
FIFO might remove mustache wax, but it might also remove flour, salt,
or butter. When applied to computers the same problem arises. For this
reason, FIFO in its pure form is rarely used.
When a page fault occurs, the page being pointed to by the hand is
inspected. If its R bit is 0, the page is evicted, the new page is inserted
into the clock in its place, and the hand is advanced one position. If R is
1, it is cleared and the hand is advanced to the next page. This process is
repeated until a page is found with R = 0. Not surprisingly, this
algorithm is called clock. It differs from second chance only in the
implementation.
26
CIT 314 MODULE 1
The IOP can fetch and execute its own instructions that are specifically
designed to characterize I/O transfers. In addition to the I/O – related
27
CIT314 COMPUTER ARCHITECTURE AND ORGANIZATION II
tasks, it can perform other processing tasks like arithmetic, logic, and
branching and code translation. The main memory unit takes the pivotal
role. It communicates with processor by the means of DMA.
3.6.1 Advantages
• The I/O devices can directly access the main memory without the
intervention by the processor in I/O processor-based systems.
• It is used to address the problems that are arises in Direct memory
access method.
Data transfer to and from the peripherals may be done in any of the
three possible ways.
Programmed I/O.
Interrupt- initiated I/O.
Direct memory access (DMA).
Example of Programmed I/O: In this case, the I/O device does not
have direct access to the memory unit. A transfer from I/O device to
memory requires the execution of several instructions by the CPU,
including an input instruction to transfer the data from device to the CPU
and store instruction to transfer the data from CPU to memory. In
programmed I/O, the CPU stays in the program loop until the I/O unit
28
CIT 314 MODULE 1
• The I/O transfer rate is limited by the speed with which the
processor can test and service a device.
Example
Consider the problem of constructing the list of all prime numbers in the
interval [1, n] for a given integer n > 0. A simple algorithm that can be
used for this computation is the sieve of Eratosthenes. Start with the list
of numbers 1, 2, 3, 4, ... , n represented as a “mark” bit-vector initialized
to 1000 . . . 00. In each step, the next unmarked number m (associated
with a 0 in element m of the mark bit-vector) is a prime. Find this
element m and mark all multiples of m beginning with m². When m² > n,
the computation stops and all unmarked elements are prime numbers.
The computation steps for n = 30 are shown in the figure below
31
CIT314 COMPUTER ARCHITECTURE AND ORGANIZATION II
Imagine a large hall like a theater. The walls of this chamber are
painted to form a map of the globe. A myriad of computers at work upon
the weather on the part of the map where each sits, but each computer
attends to only one equation or part of an equation. The work of each
region is coordinated by an official of higher rank. Numerous little
‘night signs’ display the instantaneous values so that neighbouring
computers can read them. One of [the conductor’s] duties is to maintain
a uniform speed of progress in all parts of the globe. But instead of
waving a baton, he turns a beam of rosy light upon any region that is
running ahead of the rest, and a beam of blue light upon those that are
behindhand.
The MIMD category includes a wide class of computers. For this reason,
in 1988, E. E. Johnson proposed a further classification of such
machines based on their memory structure (global or distributed) and the
mechanism used for communication/synchronization (shared variables
or message passing). Again, one of the four categories (GMMP) is not
widely used. The GMSV class is what is loosely referred to as (shared-
memory) multiprocessors.
33
CIT314 COMPUTER ARCHITECTURE AND ORGANIZATION II
3.8 PIPELINING
Pipeline system is like the modern day assembly line setup in factories.
For example in a car manufacturing industry, huge assembly lines are
setup and at each point, there are robotic arms to perform a certain task,
and then the car moves on ahead to the next arm.
36
CIT 314 MODULE 1
Types of Pipeline:
It is divided into 2 categories:
Pipeline Conflicts
There are some factors that cause the pipeline to deviate its normal
performance. Some of these factors are given below:
37
CIT314 COMPUTER ARCHITECTURE AND ORGANIZATION II
Advantages of Pipelining
Disadvantages of Pipelining
It is clear from the figure that the total time required to process three
instructions (I1, I2, I3) is only six time units if four-stage pipelining is
used as compared to 12 time units if sequential processing is used. A
possible saving of up to 50% in the execution time of these three
instructions is obtained. In order to formulate some performance
measures for the goodness of a pipeline in processing a series of tasks, a
space time chart (called the Gantt’s chart) is used.
As can be seen from the figure 3.20, 13 time units are needed to finish
executing 10 instructions (I1 to I10). This is to be compared to 40 time
units if sequential processing is used (ten instructions each requiring
four time units).
38
CIT 314 MODULE 1
4.0 CONCLUSION
5.0 SUMMARY
This unit studied the memory system of a computer, starting with the
organisation of its main memory, which, in some simple systems, is the
only form of data storage to the understanding of more complex systems
and the additional components they carry. Cache systems, which aim at
speeding up access to the primary storage were also studied, and there
was a greater focus on virtual memory systems, which make possible the
transparent use of secondary storage as if it was main memory, by the
processor.