Computer Organization
Computer Organization
COMPUTER ORGANIZATION
Computer is an electronic device i.e. used to work with information or compute. It is derived
from the Latin word "computare" which means to calculate.
History of Computers
The first counting device was used by the primitive people. They used sticks, stones and bones as
counting tools. As human mind and technology improved with time more computing devices
were developed. Some of the popular computing devices starting with the first to recent ones are
described below;
Abacus
The history of computer begins with the birth of abacus which is believed to be the first
computer. It is said that Chinese invented Abacus around 4,000 years ago.
It was a wooden rack which has metal rods with beads mounted on them. The beads were moved
by the abacus operator according to some rules to perform arithmetic calculations. Abacus is still
used in some countries like China, Russia and Japan. An image of this tool is shown below;
Pascaline
Pascaline is also known as Arithmetic Machine or Adding Machine. It was invented between
1642 and 1644 by a French mathematician-philosopher Biaise Pascal. It is believed that it was
the first mechanical and automatic calculator.
Pascal invented this machine to help his father, a tax accountant. It could only perform addition
and subtraction. It was a wooden box with a series of gears and wheels. When a wheel is rotated
one revolution, it rotates the neighboring wheel. A series of windows is given on the top of the
wheels to read the totals. An image of this tool is shown below;
Difference Engine
In the early 1820s, it was designed by Charles Babbage who is known as "Father of Modern
Computer". It was a mechanical computer which could perform simple calculations. It was a
steam driven calculating machine designed to solve tables of numbers like logarithm tables.
Analytical Engine
This calculating machine was also developed by Charles Babbage in 1830. It was a mechanical
computer that used punch-cards as input. It was capable of solving any mathematical problem
and storing information as a permanent memory.
Tabulating Machine
It was invented in 1890, by Herman Hollerith, an American statistician. It was a mechanical
tabulator based on punch cards. It could tabulate statistics and record or sort data or information.
This machine was used in the 1890 U.S. Census. Hollerith also started the Hollerith?s Tabulating
Machine Company which later became International Business Machine (IBM) in 1924.
4
Differential Analyzer
It was the first electronic computer introduced in the United States in 1930. It was an analog
device invented by Vannevar Bush. This machine has vacuum tubes to switch electrical signals
to perform calculations. It could do 25 calculations in few minutes.
Mark I
The next major changes in the history of computer began in 1937 when Howard Aiken planned
to develop a machine that could perform calculations involving large numbers. In 1944, Mark I
computer was built as a partnership between IBM and Harvard. It was the first programmable
digital computer.
Generations of Computers
A generation of computers refers to the specific improvements in computer technology with
time. In 1946, electronic pathways called circuits were developed to perform the counting. It
replaced the gears and other mechanical parts used for counting in previous computing machines.
In each new generation, the circuits became smaller and more advanced than the previous
generation circuits. The miniaturization helped increase the speed, memory and power of
computers. There are five generations of computers which are described below;
5
In this generation, magnetic cores were used as the primary memory and magnetic disc and tapes
were used as the secondary storage. Assembly language and programming languages like
COBOL and FORTRAN, and Batch processing and multiprogramming operating systems were
used in these computers.
o IBM 1620
o IBM 7094
o CDC 1604
o CDC 3600
o UNIVAC 1108
o IBM-360 series
o Honeywell-6000 series
o PDP(Personal Data Processor)
o IBM-370/168
o TDC-316
o DEC 10
o STAR 1000
o PDP 11
o CRAY-1(Super Computer)
o CRAY-X-MP(Super Computer)
o Desktop
o Laptop
o NoteBook
o UltraBook
o ChromeBook
7
Types of Computer
We can categorize computer by two ways: data handling capabilities and size.
o Analogue Computer
o Digital Computer
o Hybrid Computer
1) Analogue Computer
Analogue computers are designed to process the analogue data. Analogue data is continuous data
that changes continuously and cannot have discrete values such as speed, temperature, pressure
and current.
The analogue computers measure the continuous changes in physical quantity and generally
render output as a reading on a dial or scale.
Analogue computers directly accept the data from the measuring device without first converting
it into numbers and codes.
2) Digital Computer
Digital computer is designed to perform calculations and logical operations at high speed. It
accepts the raw data as digits or numbers and processes it with programs stored in its memory to
produce output. All modern computers like laptops and desktops that we use at home or office
are digital computers.
3) Hybrid Computer
Hybrid computer has features of both analogue and digital computer. It is fast like analogue
computer and has memory and accuracy like digital computers. It can process both continuous
and discrete data. So it is widely used in specialized applications where both analogue and digital
data is processed. For example, a processor is used in petrol pumps that converts the
measurements of fuel flow into quantity and price.
1) Supercomputer
8
Supercomputers are the biggest and fastest computers. They are designed to process huge
amount of data. A supercomputer can process trillions of instructions in a second. It has
thousands of interconnected processors.
Supercomputers are particularly used in scientific and engineering applications such as weather
forecasting, scientific simulations and nuclear energy research. First supercomputer was
developed by Roger Cray in 1976.
2) Mainframe computer
3) Miniframe computer
It is a midsize multiprocessing computer. It consists of two or more processors and can support 4
to 200 users at one time. Miniframe computers are used in institutes and departments for the
tasks such as billing, accounting and inventory management.
4) Workstation
Workstation is a single user computer that is designed for technical or scientific applications. It
has faster microprocessor, large amount of RAM and high speed graphic adapters. It generally
performs a specific job with great expertise; accordingly, they are of different types such as
graphics workstation, music workstation and engineering design workstation.
5) Microcomputer
Computer Components
There are 5 main computer components that are given below:
o Input Devices
o CPU
o Output Devices
o Primary Memory
o Secondary Memory
1) Inputting: It is the process of entering raw data, instructions and information into the
computer. It is performed with the help of input devices.
2) Storing: The computer has primary memory and secondary storage to store data and
instructions. It stores the data before sending it to CPU for processing and also stores the
processed data before displaying it as output.
3) Processing: It is the process of converting the raw data into useful information. This process
is performed by the CPU of the computer. It takes the raw data from storage, processes it and
then sends back the processed data to storage.
4) Outputting: It is the process of presenting the processed data through output devices like
monitor, printer and speakers.
5) Controlling: This operation is performed by the control unit that is part of CPU. The control
unit ensures that all basic operations are executed in a right manner and sequence.
10
next →← prev
Input Devices
Input device enables the user to send data, information, or control signals to a computer. The
Central Processing Unit (CPU) of a computer receives the input and processes it to produce
the output.
1. Keyboard
2. Mouse
3. Scanner
4. Joystick
5. Light Pen
6. Digitizer
7. Microphone
8. Magnetic Ink Character Recognition (MICR)
9. Optical Character Reader (OCR)
Output Devices
The output device displays the result of the processing of raw data that is entered in the computer
through an input device. There are a number of output devices that display output in different
ways such as text, images, hard copies, and audio or video.
1. Monitor
o CRT Monitor
o LCD Monitor
o LED Monitor
o Plasma Monitor
2. Printer
o Impact Printers
A. Character Printers
i. Dot Matrix printers
ii. Daisy Wheel printers
B. Line printers
i. Drum printers
ii. Chain printers
o Non-impact printers
A. Laser printers
11
B. Inkjet printers
3. Projector
Memory: It is called Random access memory (RAM). It temporarily stores data, programs and
intermediate and final results of processing.
Control Unit: It controls and coordinates the functioning of all parts of computer. It does not
involve in processing and storing data.
ALU: It performs arithmetic and logical functions. Arithmetic functions include addition,
subtraction, multiplication and division. Logical functions mainly include selecting, comparing
and merging the data.
12
Hardware
All tangible physical components of computer and the devices connected to it are hardware.
Some of the popular examples of computer hardware are CPU, motherboard, monitor, mouse and
keyboard.
Software
It is a set of programs that enables the hardware to perform a specific task. All the programs that
run the computer are software. Software is of two types; system software and application
software.
1) System Software
System software is the main software that runs the computer. When you turn on the computer it
activates the hardware and controls and coordinates their functioning. The application programs
are also controlled by system software. Operating system is an example of system software.
Operating System
Operating system is the system software that works as an interface to enable the user
communicate with the computer. It manages and coordinates the functioning of hardware and
software of the computer. The commonly used operating systems are Microsoft Windows, Linux
and Apple Mac OS X
2) Application Software
Applications software is a set of programs designed to perform a specific task. It does not control
or coordinate the working of computer. A computer can run without application software.
Application software can be easily installed or uninstalled as required. Microsoft Office Suite,
Adobe Photoshop and any other software like payroll software or income tax software are
application software.
TYPES OF SOFTWARES
System software coordinates the activities and functions of hardware and software, and it
controls the operations of computer hardware. Learn about different types of system software,
including utility software, device drivers and firmware.
System Software
Software is a generic term for an organized collection of computer data and instructions. There
are two types of software: application software and system software. Application software helps
users solve a particular problem or carry out a specific task. A word processor is an example of
application software.
System software coordinates the activities and functions of hardware and software, and it
controls the operations of computer hardware. A computer's operating system is an example of
system software. Operating systems control the computer hardware and act as an interface with
application programs. System software also includes utility software, device drivers and
firmware, which we will be looking at in this lesson.
Utility Software
Utility software helps to manage, maintain and control computer resources. Operating systems
typically contain the necessary tools for this, but separate utility programs can provide improved
functionality. Utility software is often somewhat technical and targeted at users with a solid
knowledge of computers. If you use a computer mostly for e-mail, some Internet browsing and
typing up a report, you may not have much need for these utilities. However, if you are an avid
computer user, these utilities can help make sure your computer stays in tip-top shape.
Examples of utility programs are antivirus software, backup software and disk tools. Let's look at
each of these in a bit more detail.
Antivirus software, as the name suggests, helps to protect a computer system from viruses and
other harmful programs. A computer virus is a computer program that can cause damage to a
computer's software, hardware or data. It is referred to as a virus because it has the capability to
replicate itself and hide inside other computer files.
One of the most common ways to get a virus is to download a file from the Internet. Antivirus
software scans your online activity to make sure you are not downloading infected files. New
viruses are coming out all the time, so antivirus software needs to be updated very frequently.
Backup software helps in the creation of a backup of the files on your computer. Most computer
systems use a hard disk drive for storage. While these are generally very robust, they can fail or
crash, resulting in costly data loss. Backup software helps you copy the most important files to
another storage device, such as an external hard disk. You can also make an exact copy of your
hard disk.
Increasingly, backup software uses cloud storage to create backups. This typically means you
pay a fee to use the storage space of a third party and use their backup software to manage which
files are going to be backed up.
16
Disk tools include a range of different tools to manage hard disk drives and other storage
devices. This includes utilities to scan the hard disks for any potential problems, disk cleaners to
remove any unnecessary files, and disk defragmenters to re-organize file fragments on a hard
disk drive to increase performance. Disk tools are important because a failure of a hard disk
drive can have disastrous consequences. Keeping disks running efficiently is an important part of
overall computer maintenance
17
Memory Hierarchy
In the Computer System Design, Memory Hierarchy is an enhancement to organize the memory
such that it can minimize the access time. The Memory Hierarchy was developed based on a
program behavior known as locality of references.The figure below clearly demonstrates the
different levels of memory hierarchy :
1. Capacity:
It is the global volume of information the memory can store. As we move from top to bottom
in the Hierarchy, the capacity increases.
2. Access Time:
It is the time interval between the read/write request and the availability of the data. As we
move from top to bottom in the Hierarchy, the access time increases.
3. Performance:
Earlier when the computer system was designed without Memory Hierarchy design, the
speed gap increases between the CPU registers and Main Memory due to large difference in
access time. This results in lower performance of the system and thus, enhancement was
required. This enhancement was made in the form of Memory Hierarchy Design because of
which the performance of the system increases. One of the most significant ways to increase
system performance is minimizing how far down the memory hierarchy one has to go to
manipulate data.
4. Cost per bit:
As we move from bottom to top in the Hierarchy, the cost per bit increases i.e. Internal
Memory is costlier than External Memory.
19
Characteristics of Memory
The key characteristics of memory devices or memory system are as follows:
1. Location
2. Capacity
3. Unit of Transfer
4. Access Method
5. Performance
6. Physical type
7. Physical characteristics
8. Organization
1. Location:
It deals with the location of the memory device in the computer system. There are three possible
locations:
CPU : This is often in the form of CPU registers and small amount of cache
Internal or main: This is the main memory like RAM or ROM. The CPU can directly
access the main memory.
External or secondary: It comprises of secondary storage devices like hard disks,
magnetic tapes. The CPU doesn’t access these devices directly. It uses device controllers
to access secondary storage devices.
2. Capacity:
The capacity of any memory device is expressed in terms of: i)word size ii)Number of words
Word size: Words are expressed in bytes (8 bits). A word can however mean any number
of bytes. Commonly used word sizes are 1 byte (8 bits), 2bytes (16 bits) and 4 bytes (32
bits).
Number of words: This specifies the number of words available in the particular
memory device. For example, if a memory device is given as 4K x 16.This means the
device has a word size of 16 bits and a total of 4096(4K) words in memory.
3. Unit of Transfer:
It is the maximum number of bits that can be read or written into the memory at a time. In case
of main memory, it is mostly equal to word size. In case of external memory, unit of transfer is
not limited to the word size; it is often larger and is referred to as blocks.
4. Access Methods:
It is a fundamental characteristic of memory devices. It is the sequence or order in which
memory can be accessed. There are three types of access methods:
20
Volatile/Non- Volatile: If a memory devices continues hold data even if power is turned
off. The memory device is non-volatile else it is volatile.
8. Organization:
Erasable/Non-erasable: The memories in which data once programmed cannot be
erased are called Non-erasable memories. Memory devices in which data in the memory
can be erased is called erasable memory.
E.g. RAM(erasable), ROM(non-erasable)
21
Locality of Reference
Locality of reference refers to a phenomenon in which a computer program tends to access same
set of memory locations for a particular time period. In other words, Locality of
Reference refers to the tendency of the computer program to access instructions whose
addresses are near one another. The property of locality of reference is mainly shown by loops
and subroutine calls in a program.
1. In case of loops in program control processing unit repeatedly refers to the set of instructions
that constitute the loop.
2. In case of subroutine calls, everytime the set of instructions are fetched from memory.
3. References to data items also get localized that means same data item is referenced again
and again.
22
In the above figure, you can see that the CPU wants to read or fetch the data or instruction. First,
it will access the cache memory as it is near to it and provides very fast access. If the required
data or instruction is found, it will be fetched. This situation is known as a cache hit. But if the
required data or instruction is not found in the cache memory then this situation is known as a
cache miss. Now the main memory will be searched for the required data or instruction that was
being searched and if found will go through one of the two ways:
1. First way is that the CPU should fetch the required data or instruction and use it and that’s it
but what, when the same data or instruction is required again.CPU again has to access the
same main memory location for it and we already know that main memory is the slowest to
access.
2. The second way is to store the data or instruction in the cache memory so that if it is needed
soon again in the near future it could be fetched in a much faster way.
Cache Operation:
It is based on the principle of locality of reference. There are two ways with which data or
instruction is fetched from main memory and get stored in cache memory. These two ways are
the following:
1. Temporal Locality –
Temporal locality means current data or instruction that is being fetched may be needed
soon. So we should store that data or instruction in the cache memory so that we can avoid
again searching in main memory for the same data.
23
When CPU accesses the current main memory location for reading required data or
instruction, it also gets stored in the cache memory which is based on the fact that same data
or instruction may be needed in near future. This is known as temporal locality. If some data
is referenced, then there is a high probability that it will be referenced again in the near
future.
2. Spatial Locality –
Spatial locality means instruction or data near to the current memory location that is being
fetched, may be needed soon in the near future. This is slightly different from the temporal
locality. Here we are talking about nearly located memory locations while in temporal
locality we were talking about the actual memory location that was being fetched.
24
Cache Performance:
The performance of the cache is measured in terms of hit ratio. When CPU refers to memory and
find the data or instruction within the Cache Memory, it is known as cache hit. If the desired data
or instruction is not found in the cache memory and CPU refers to the main memory to find that
data or instruction, it is known as a cache miss.
Hit + Miss = Total CPU Reference
Hit Ratio(h) = Hit / (Hit+Miss)
Average access time of any memory system consists of two levels: Cache and Main Memory.
If Tc is time to access cache memory and Tm is the time to access main memory then we can
write:
Tavg = Average time to access memory
Tavg = h * Tc + (1-h)*(Tm +
\
25
External memory
External storage, in computing terms, refers to all of the addressable data that is not stored on a
drive internal to the system. It can be used as a backup, to store achieved information or to
transport data. External storage is not part of a computer's main memory or storage, hence it is
called secondary or auxiliary storage
External storage devices are commonly available in the form of flash drives, USB drives, CDs
and DVDs. External storage is often used as a form of a backup or for transportation of data from
one system to another. External storage allows the user to store information, especially data that
is not used frequently, outside the computer’s main memory without much additional cost, since
the cost per bit of semiconductors is higher than any external storage device’s price.
What is RAID?
RAID is an acronym for Redundant Array of Independent (or Inexpensive) Disks. In fact, RAID
is the way of combining several independent and relatively small disks into a single storage of a
large size. The disks included into the array are called array members. The disks can be
combined into the array in different ways which are known as RAID levels. Each of RAID
levels has its own characteristics of:
1. The organization of data in the array (RAID storage techniques: striping, mirroring,
parity, combination of them).
2. Implementation of each particular RAID installation - hardware or software.
Striping - splitting the flow of data into blocks of a certain size (called "block size") then
writing of these blocks across the RAID one by one. This way of data storage affects on
the performance.
Mirroring is a storage technique in which the identical copies of data are stored on the
RAID members simultaneously. This type of data placement affects the fault tolerance as
well as the performance.
Parity is a storage technique which is utilized striping and checksum methods. In parity
technique, a certain parity function is calculated for the data blocks. If a drive fails, the
missing block are recalculated from the checksum, providing the RAID fault tolerance.
All the existing RAID types are based on striping, mirroring, parity, or combination of these
storage techniques.
RAID levels
RAID 0 - based on striping. This RAID level doesn't provide fault tolerance but increases
the system performance (high read and write speed).
RAID 1 - utilizes mirroring technique, increases read speed in some cases, and provides
fault tolerance in the loss of no more than one member disk.
RAID 0+1 - based on the combination of striping and mirroring techniques. This RAID
level inherits RAID 0 performance and RAID 1 fault tolerance.
RAID1E - uses both striping and mirroring techniques, can survive a failure of one
member disk or any number of nonadjacent disks. There are three subtypes of RAID 1E
layout: near, interleaved, and far. More information and diagrams on the RAID 1E page.
RAID 5 - utilizes both striping and parity techniques. Provides the read speed
improvement as in RAID 0 approximately, survives the loss of one RAID member disk.
RAID 5E - a variation of RAID 5 layout the only difference of which is an integrated
spare space allowing to rebuild a failed array immediately in case of a disk failure. Read
more on the RAID5E page.
RAID 5 with delayed parity - pretty similar to basic RAID 5 layout, but uses
nonstandard scheme of striping. More information about RAID5 with delayed parity.
RAID 6 - similar to RAID 5 but uses two different parity functions. The read speed is the
same as in RAID 5.
RAID implementations
Software RAID
Nowadays, almost any of the operating systems has a built-in capability to create RAID, though
not for all RAID levels. Thus, Windows home editions allow user to create only RAID 0, while
RAID 1 and RAID 5 can be created only using Windows server editions. RAID layout created
by means of Windows is inseparably linked with the host operating system and so its partitions
cannot be used, for example, in dual boot.
Software RAID is created based on the user's computer and therefore it uses the host system
CPU for implementation. It should be noted, that in case of RAID levels 0 and 1, CPU load is
negligible, but for the RAID types based on parity, CPU load can vary from 1 to 5 percent
depending on CPU power and the number of the disks, which is also negligible for practical
purposes.
There are certain limitations on the use of the software RAID to boot the system. Only RAID 1
can contain boot partition, while system boot is impossible with a software RAID 5 and RAID
0.
Keep in mind that in most cases software RAID doesn't implement the hot-swapping and so it
cannot be used where continuous availability is required.
Hardware RAID
Hardware RAID is created using separate hardware. Basically there are two options:
A hardware RAID has some advantages over a software RAID, such as:
Programmed I/O is implicated to data transfers that are initiated by a CPU, under driver
software control to access Registers or Memory on a device.
With programmed I/O, data are exchanged between the processor and the I/O module.
The processor executes a program that gives it direct control of the I/O operation,
including sensing device status, sending a read or write command, and transferring the
data. When the processor issues a command to the I/O module, it must wait until the I/O
operation is complete.
If the processor is faster than the I/O module, this is wasteful of processor time. With
interrupt-driven I/O, the processor issues an I/O command, continues to execute other
instructions, and is interrupted by the I/O module when the latter has completed its work.
With both programmed and interrupt I/O, the processor is responsible for extracting data
from main memory for output and storing data in main memory for input. The alternative
is known as direct memory access. In this mode, the I/O module and main memory
exchange data directly, without processor involvement.
With programmed I/O, the I/O module will perform the requested action and then set the
appropriate bits in the I/O status register. The I/O module takes no further action to alert
the processor.
29
Interrupt:
An interrupt or exception causes CPU to transfer the control temporarily from its current
program to another program i.e. interrupt handler.
Block Diagram for Interrupt Driven I/O
1. It is also referred to as cycle stealing, because the DMA module in effect steals a bus
cycle. When the processor wishes to read or write a block of data, it issues a command to
the DMA module, by sending to the DMA module the following information:
i. Whether a read or write is requested, using the read or write control line between the
processor and the DMA module
ii. The address of the I/O device involved, communicated on the data lines
iii. The starting location in memory to read from or write to, communicated on the data
lines and stored by the DMA module in its address register
iv. The number of words to be read or written, again communicated via the data lines and
stored in the data count register
2. The Control Logic in the DMA module is responsible for the generation of control
signals.
3. The processor then continues with other work. It has delegated this I/O operation to the
DMA module. The DMA module transfers the entire block of data, one word at a time,
directly to or from memory, without going through the processor. When the transfer is
complete, the DMA module sends an interrupt signal to the processor.
4. Thus, the processor is involved only at the beginning and end of the transfer. In the
instruction cycle the processor may be suspended. In each case, the processor is
suspended just before it needs to use the bus. The DMA module then transfers one word
and returns control to the processor.
5. Note that this is not an interrupt; the processor does not save a context and do something
else. Rather, the processor pauses for one bus cycle. The overall effect is to cause the
processor to execute more slowly. Nevertheless, for a multiple-word I/O transfer, DMA
is far more efficient than interrupt-driven or programmed I/O.
32
1. The DMA logic may actually be a part of an I/O module, or it may be a separate module
that controls one or more I/O modules. This concept can be taken one step further by
connecting I/O modules to the DMA module using an I/O bus; this is shown in Figure
5(c). This reduces the number of I/O interfaces in the DMA module to one and provides
for an easily expandable configuration.
2. In both cases Figure 5(b) and Figure5(c), the system bus that the DMA module shares
with the processor and memory is used by the DMA module only to exchange data with
memory. The exchange of data between the DMA and I/O modules takes place off the
system bus.
33