Major Components of a computer system:
In general a computer system consist of four major components-
CPU
Input unit
Output unit
Storage unit
MEMORY
UNIT
CPU
REGISTERS
INPUT
UNIT OUTPUT
CONTROL UNIT
UNIT ALU
FIG: COMPONENTS OF A COMPUTER SYSTEM
Central Processing Unit (CPU): The CPU is also called the processor and is the brain of a
computer system that processes data (input) and converts them into meaningful information as
output. It generally interprets the data and instructions, Co-ordinates the operations and
supervises the instructions. The CPU works with data in discrete form, i.e. either 1 or 0.
The CPU itself consists 3 parts-
Arithmetic and Logic unit (ALU): This unit performs the arithmetic operations like addition,
subtraction etc and logical operations like AND, OR etc. on data available to it. For these kinds
of operations the required data are transferred from the memory unit to the ALU and after the
operation the result is returned to the memory unit. This kind of transfer of data may be needed
many times during any operation between ALU and memory unit.
Control unit: The control unit controls the sequence of operations. It fetches the program
instructions from the memory unit, decodes them and ensures correct execution of the program.
It also controls the 1/0 devices and directs the over all functioning of the other units of the
computer.
Registers: These are the special purpose, high speed temporary memory units that can hold
different types of data, instructions, address and intermediate results of calculations. Mostly,
they hold the information that the CPU is currently working on. We can also consider the
registers as the working memory of the CPU.
Input-Output Unit: To perform any operation, the computer system must get any data or
instruction from the user and this is possible through the input unit. On the other hand after
processing any operation the computer system gives us the result through the out put unit.
In general, a computer system accepts the user instructions and data through the input
devices like keyboard, mouse, light pen etc. The input unit also converts the different signals
received from the different input devices into the form that the computer can understand.
1
Again the output unit performs just opposite to that of input unit. The output unit accepts the
output produced by the computer (machine-coded form) and then converts them into the user
understandable form. After then the result is supplied to the user through an output device like
printer, monitor, plotter etc.
Storage unit: Another important unit of computer system is the memory unit. The storage unit of
computer system consists of two type’s memory- primary and secondary. The primary memory
is also called the main memory, which holds the instructions and data currently being processed
by the CPU. It also holds any intermediate results produced during any operation and the
recently processed data. If the data needed by the CPU remains in the main memory it can be
accessed directly and very quickly. However it is very expensive and limited storage capacity.
Eg. RAM, ROM.
On the other hand the secondary memory is mainly used for storing data and instructions
permanently. It is quiet slow compare with the primary memory. However secondary memory
has very high storage capacity and less expensive. Some commonly used secondary storage
devices are hard disk, tape devices, floppy disks etc.
The secondary memory is also called Auxiliary memory.
Memory Hierarchy: Depending upon the access speed and storage capacity the memory system
in a computer has following types which is arranged according to the diagram shown below-
Internal processor memory
Primary memory
Secondary memory
RESISTERS,
CACHE
MEMORY
INTERNAL
PROCESSOR
RAM,
ROM
Primary
Hard disk, memory
Magnetic
tapes
Secondary
Memory
FIG: MEMORY HIERARCHY IN A COMPUTER SYSYEM
Random Access Memory (RAM): RAM is the physical memory of a computer system. It allows
the computer to store data for immediate manipulation and keep track of what is currently being
processed. It’s the Primary place where the OS, application programs and data in current use
are kept so that they can be accessed quickly by the CPU. RAM is a volatile memory, i.e. when
2
the computer is turned off, it losses all its contents. Once the data is loaded into the memory
(RAM), the CPU is able to access them very quickly as because it is much faster than
Secondary memory.
RAM
DATA LOCATED INTO Memory
HARD DISK
DATA BROUGHT TO THE CPU
CPU INSTRUCTS HD TO LOAD DATA CPU
FIG: INTERACTION OF MEMORY AND STORAGE WITH CPU
Types of RAM: In general we have two types of RAM
1. Static RAM (S RAM)
2. Dynamic RAM (D RAM)
Static RAM: Static RAM does not need to be refreshed periodically, i.e. as long as the power
is supplied to it, data remain in the memory cell. It is very fast and very much expensive then D
RAM; hence it is often used as cache memory.
Dynamic RAM: D RAM is very unstable. Its memory must be continuously refreshed in order
to maintain the data in it. This is done by rewriting the data several hundred times per second in
the D RAM chip. D RAM is mainly used as system memory because of its small size and less
expensive than S RAM.
Differences between Static RAM and Dynamic RAM:
SRAM DRAM
1. SRAM does not need to be 1. But in DRAM, it must be refreshed at
refreshed, so it can hold the data a particular interval of time, even if
as long as the power is supplied to power is continuously supplied to it.
it. 2. But DRAM chip are high dense than
2. SRAM chip are less dense and SRAM. It has more memory cells.
hence its size is larger 3. But DRAM is less faster than SRAM
3. SRAM is more fast and has low and has longer latency time.
latency.(time difference between 4. But DRAM is less expensive, needs
Request and Response) less power to operate and also
4. It is more expensive, requires smaller in size.
more power to operate and
produces more heat.
Read Only Memory (ROM):
ROM is a special kind of memory where we can only read its contents but can not overwrite or
delete. This is required because during the start up operation, the main memory of a computer is
empty (as it is volatile in nature), so there have some instructions (called booting program)
3
stored in a special chip which enable the computer system to perform the start up operations
and transfer the control to the OS . This kind of special chip where the start up instructions is
stored is called ROM. The ROM is non-volatile in nature. ROM chip is not only used in computer
system but also in other electronic items like washing machine, mobile phone, air conditions etc.
Generally, designers program a ROM chip at the time of manufacturing circuits. Once a
ROM chip is programmed, it can not be reprogrammed or rewritten. A ROM chip consumes very
little power and extremely reliable.
Types of ROM:
Masked ROM
Programmable ROM(PROM)
Erasable Programmable ROM(EROM)
Electrically Erasable Programmable ROM(EEROM)
Flash ROM
Secondary Storage Devices:
A secondary storage device is used to store data and instructions permanently. The data stored
on a secondary storage device can be accessed in two ways depending on how it is stored in it.
The two ways are-
1. Sequential Access: In this type of access the computer system must search the storage
device from the beginning until the desired data is found. E.g.- Magnetic
tape
2. Direct Access: This type of access is also called the random access. Here the computer
can go directly to the location where the data that the user want, is
stored. E.g.- optical dick, hard disk.
Classification of secondary storage devices:
Secondary Storage
Sequential Direct Access
Access Devices Devices
Magnetic tape
Magneto Optical disk
Magnetic disk Optical disk Memory Stick
Floppy disk Zip disk Hard disk
DVD
CD
Blue- Ray disk
4
Hard disk:
The hard disk is the primary storage unit of a computer system. It consists of round flat disks
(platters) made up of glass or metals which are coated on both sides with a special material to
store information. Each platter is further divided into tracks, which are again broken into
sectors. Special Read/ Write head is placed over the platter surface which slide over the
tracks and sectors to either record data onto the disk or read data from it. The device which
controls the movement of the head in each surface is called ‘actuator’. Each platter has tow
heads, one on each surface.
Generally, the ‘actuator’ moves the R/W head to the exact location of a hard disk accordingly
to the command received from the OS. A hard disk can either be external or internal, which
can hold large amount of data. Now a day a typical hard disk in a computer system comes
with 80GB to 1TB.
SPINDLE
R/W HEAD
PLATTER
DISK
R/W HEAD
SPINDLE
ACTUATOR
ACTUATOR
ARM
Fig: Typical parts of hard disk
Optical Disk:
An optical disk is a flat, circular, plastic disk coated with material like aluminum, gold or silver
that acts as a reflective surface. A read/write head, which is a laser beam, is used for
recording data onto it.
Optical disks come with various sizes and capacities. In general, a compact disk (CD) is
a 12 cm diameter disk having capacity 700 MB is the most common means of optical storage.
An optical disk consists of a single long track in spiral shape. This track is further divided into
small sectors of the same length.
5
FIG: TRACKS ON A MAGNETIC DISK
Types of optical disks:
Now a day’s optical disk comes with 3 varieties, which are made for some special purposes.
1. Compact disk (CD): It is the most popular and least expensive type of optical
disk. It can record about 80 minute of playing time. The various formatives of CD are CD-
ROM, CD-R, and CD-RW.
2. Digital Versatile Disk (DVD): DVD is also called the digital video disk, which has high
storage capacity than a CD. DVD is available in many formats-
Single sided single layer (4.7 GB)
Double sided single layer (9.4 GB)
Single sided double layer (8.5 GB)
Double sided double layer (17 GB)
3. Blue–ray disk: It is used to record high definition (HD) video and high equality audio as
well as pictures. It is the latest technology developed by many companies like Apple,
Sony, Samsung, Panasonic, etc. It has high capacity of storage (10 times more than
DVD). A single layer Blue-ray can store 25 GB and double layer can store 50 GB of data.
Keyboard:
Keyboard is one of the most common input devices of a computer system. It is generally used to
input of textual information. Keyboard is initially introduced by IBM which was having 101 keys
arranged in four groups. They are
Numeric keys (digits 0 to 9 & operators +,-,*,/)
Alphanumeric keys (A to Z, 0-9 and some function marks)
Function keys (F1 to F12)
Cursor movement keys.
Cache Memory:
Cache memory is a high speed semi conductor memory. It consists of static RAM s. It is very
faster than main memory and is placed between the CPU and the main memory. Its access time
is about 10 ns which is much less than that of main memory. The capacity of cache memory is 2
to 3 percent of that of main memory.
Since the CPU is very much factor than main memory, during any data processing there is a
speed mismatch occurs between both of them while data transfer is needed. For this reason a
high speed cache memory is used to supply currently needed data and instructions to the CPU.
This reduces the speed mismatch of CPU and main memory. The main memory stores the
program and data which is to be processed by the CPU and the cache memory contains the
data and instructions that is currently needed by the CPU which is loaded from main memory.
There are two types of cache scheme is used
WRITE THROUGH
WRITE BACK
In WRITE THROUGH cache the main memory is updated each time the CPU writes into cache.
In this method advantage is that the main memory contains always the same data as the cache.
Again in WRITE BACK scheme, only the cache memory is updated during a write operation.
The updated locations in the cache are marked by a flag so that later on when the word is
6
removed from the cache, it is copied into the main memory. In general, set-associative cache
memory is used in a computer system.
Various types of Resisters in the CPU:
1. Accumulator: It is the most frequently used resister in a CPU. Depending on the CPU
structure number of accumulator may be different. It generally in side the ALU and store the
results of all arithmetic and Logic operations.
2. General purpose Register: A CPU contains a number of general purpose registers which are
used to store data and intermediate results temporarily during the execution of a program.
Accumulator is also one of its kinds. Number of these resisters may vary processor to
processor.
3. Special purpose resister: A CPU also contains a number of special purpose resisters which
are used for some specific tasks. Generally following special purpose resisters are used-
Program counter (PC): This resister contains the address of the memory location from
where the next instruction is to be taken for execution.
Memory Address Resisters (MAR): It contains the address of the memory location from
where the instruction or data are to be taken.
Memory Data Resister (MDR): It contains the data which is to be written into or read from
the location specified by the MDR.
Instruction Resisters (IR): It contains the instruction that is currently being executed.
Stack Pointer (SP): It is a pointer which indicates the present status of the memory
locations, i.e. up to which the Stack of memory location is filled up.
Computer Hardware and Software:
Every computer consists of two basic parts-
Hardware
Software
Computer hardware is the physical components which we can see or touch. It may be
electronic, electrical, mechanical or optical. For example-Microprocessor, hard disk,
Motherboard, Floppy disk, Mouse, Keyboard, printer etc.
On the other hand the sequence of instructions given to a computer to perform a particular task
is called a program. Where as a set of programs grouped together are called software. Software
consists of set of instructions which enable the computer hardware to perform various arithmetic
and logical operations. So software tells the computer what to do and how to do it.
Classification of computer software:
System software
Application software
System software consists of set of instructions which directly controls the hardware and also
interpret and execute the application software.
E.g.- Assembler, compiler, operating system (OS).
Generally System software is responsible for controlling, integrating and managing the hardware
components of a computer. System software acts as an interface between the hardware of the
computer and the software applications. Here we can say it makes a computer functional. It
provides basic functionality like file management, visual display, keyboard, input etc.
7
USER
APPLICATION SOFTWARE
SYSTEM SOFTWARE
COMPUTER
HARDWARE
FIG: INTERACTION of SS, AS, HW and the USER
Again Application software is deigned to fulfill the needs of a user. It acts as an interface
between the operating system and the user. It is most common to a user as it is used to
perform specific tasks rather than just managing a computer system. That means a computer
system will not be useful for a user without the application software.
E.g. - Microsoft notepad, point, MS office package etc.
USER HW
INPUT AS SS HW OUTPUT
Levels of processing
Difference between system software & Application software:
AS is dependent on OS, SS is the interface between the user and the HW.
AS performs tasks for the user, SS is deigned to help the computer to operate perfectly.
Without of AS, the computer will not be helpful in meeting user requirements, where as
SS directly controls the hardware, so without of it, computer system will not run.
Assembler: It is system software which translates the source programs written in assembly
language into machine code (or object code). Assembly language program are machine
dependent, i.e. assembly language program written in one machine may not run in another
machine.
Compiler and Interpreter: These are system software which translates the source
programs written high level language like C, C++, COBOL, java etc, into object code (Machine
Code). These two system software are machine independent.
The main different between computer and interpreter is that----
While translating a source program in to object code by a compiler, it reads the entire source
code and convents it to machine code taking all the statements at a time.
On the other hand , an interpreter convents only one statement of the program into object code
and then execute it and again goes on to the next statement convent it , execute it and so on till
the end of the program or an error occurred.
Hence we can say, an interpreter is an efficient tool for error checking then a compiler. But the
over all execution time of a compiler is much faster then the interpreter.
8
Cache Memory:
MAIN
CPU CACHE MEMORY
FIG: INTERACTION OF CPU, CACHE& MAIN MEMORY
Cache memory is a high speed semi conductor memory. It consists of static RAM s. It is
very faster than Main memory and is placed between the CPU and the main memory. Its access
time is about 10 ns which is much less than that of main memory. The capacity of cache
memory is 2 to 3 percent of that of main memory.
Since the CPU is very much faster than main memory, during any data processing there
is a speed mismatch occurs between both of them while data transfer is needed. For this reason
a high-speed cache memory is used to supply currently needed data and instructions to the
CPU. This reduces the speed mismatch of CPU and main memory. The main memory stores
the program and data which is to be processed by the CPU and the cache memory contains the
data and instructions that are currently needed by the CPU which is loaded from main memory.
There are two types of cache scheme is used-
Write-through
Write –back
In Write-through cache the main memory is updated each time the CPU wait is into cache. In
this method advantage is that the main memory contains always the same data as the cache.
Again in write-back scheme, only the cache memory is updated during a write operation.
The updated location in the cache is marked by a flag so that later on when the word is removed
from the cache, it is copied into the main memory. In general, set-association cache memory is
used in a computer system.
What is Flash Memory?
Flash memory is a non-volatile memory chip used for storage and for transfering data between a
personal computer (PC) and digital devices. It has the ability to be electronically reprogrammed
and erased. It is often found in USB flash drives, MP3 players, digital cameras and solid-state
drives.
Flash memory is a type of electronically erasable programmable read only memory (EEPROM),
but may also be a standalone memory storage device such as a USB drive. EEPROM is a type
of data memory device using an electronic device to erase or write digital data. Flash memory is
a distinct type of EEPROM, which is programmed and erased in large blocks.
9
Binary Codes:
A code is a symbol or group of symbols that are mean for something. Various types of
codes are used to communicate information to the digital computer correctly and properly. Using
various coding system an operator can feed data into the computer directly in decimal numbers,
alphabets and special characters. Certain binary codes are also used for arithmetic operation.
Binary coding system is divided into following groups-
Weighted binary codes
Non-weighted codes
Error detecting codes
Error correcting codes
Alphanumeric codes
Weighted Binary codes:
Here each position of a number represents a specific weight.
Eg: 8421 BCD code.
BCD (Binary Coded Decimal): It is composed of 4 bit, representing decimal digits 0 to 9. In
standard BCD, each decimal digit is represented by a binary code of 4 bits. It does not us the
numbers 1010, 1011,1100,1101,1110 and 1111.
Eg: Decimal number 901 is converted to BCD as
90110 =1001 0000 0001BCD
Non-weighted codes:
In this type of code each position is not assigned a fixed value. That means they are not
positional weighted.
Eg: Gray code, Excess 3 etc.
Excess-3 code (XS-3):
In XS-3 code, each decimal is increased by 3 and then converting the result into 4 bit
binary. It is like BCD representation.
Eg: 261 can be represented as-
BCD Representation Excess-3 Representation
2 6 1 2 6 1
0010 0110 0001 +3 +3 +3
5 9 4
0101 1001 0100
It is also written as XS3
GRAY CODE:
The Gray code belongs to a class of code known as “minimum change code”, in which only one
bit in the code group changes on one step to the next. It is not an arithmetic code and is mainly
used to reduce errors.
10
Eg.
Decimal Gray
0 0000
1 0001
2 0011
3 0010
4 0110
5 0111
6 0101
7 0100
8 1100
9 1101
10 1111
11 1110
12 1010
13 1011
14 1001
15 1000
Alphanumeric codes:
This type of codes that represents alphabetic characters (A-Z, a-z), numeric digits (0-9),
punctuation marks and other special characters.
Eg. ASCII code, EBCDIC code.
ASCII CODE (American Standard Code for Information Interchange):
It is a 7-bit code used in transferring coded information from keyboards and to computer
displays and also printers. Micro computers having 8-bit word length use seven bit code to
represent the basic codes. The 8th bit is used for parity.
EBCDIC CODE (Extended Binary Coded Decimal Interchange Code):
It is a standard character code for large computers. It is an 8-bit code, which provides a
more extensive character set than ASCII. Here no parity bit is available.
11