UNIT – 1
INTRODUCTION OF COMPUTER
SYSTEM AND PROBLEM SOLVING
FYBTECH Subject : Programming and Problem Solving
Unit1Contents
2
Introduction of Computer System and Problem
Solving:
Basics of Computers: Architecture, Processors, Memory,
Number Systems, System Software –Operating system,
Editor, Compiler, Assembler, Linker, Loader.
Introduction to Computer
3
Computer:
The word computer comes from the word “compute”, which means, “to calculate”
Computer is an electronic device that can perform arithmetic and logical operations
at high speed
A computer is also called a data processor because it can store, process, and retrieve
data whenever desired
Data is raw material used as input and information is processed data obtained as
output of data processing
Architecture of Computer system
4
Computer architecture comprises hardware,
software, and communication components.
The operation of a computer system depends on the
central processing unit (CPU), memory, input/output
devices, and storage devices, which is called
computer architecture.
Computer Architecture Design Principles
5
Von Neumann Architecture
Computers built according to the Von Neumann architecture segregate memory
data from the programme instructions and use a single bus to transport data
between the memory and the CPU.
Instruction Set Architectures
A computer’s collection of executable instructions and their format are specified
by Instruction Set Architectures (ISA)
Parallel Processing
The employment of numerous processing components, such as CPUs or GPUs, in
tandem to carry out instructions, is known as parallel processing.
The discipline of computer architecture
subcategories
6
Instruction set architecture (ISA): defines the machine code that
a processor reads and acts upon as well as the word size, memory address
modes, processor registers, and data type.
Microarchitecture: also known as "computer organization", this describes
how a particular processor will implement the ISA. The size of a
computer's CPU cache for instance, is an issue that generally has nothing to
do with the ISA.
Systems design: includes all of the other hardware components within a
computing system, such as data processing other than the CPU (e.g., direct
memory access), virtualization, and multiprocessing.
Architecture of Computer system
7
Components of Computer Architecture
8
Central Processing Unit (CPU)
Since the CPU is the computer’s ” brain, ” it carries out commands. The fetching
and implementation of instructions and various other CPU architectures, such as
RISC and CISC are all covered in this section.
Memory
Memory is the term for the short-term storage area that the computer uses to
store information and commands. The types of memory are RAM and cache and
the memory hierarchy, which governs how data is transferred between different
types of memory.
Input/Output Devices
The computer communicates with itself through input/output (I/O) devices like a
keyboard, mouse, and screen.
Storage Devices
Hard drives and solid-state drives are examples of storage devices used to
permanently store computer data and instructions. Secondary storage unit.
9
Arithmetic logic unit (ALU)
The arithmetic logic unit includes the electrical circuitry that performs any
arithmetic and logical processes on the supplied data. It is used to
execute all arithmetic (additions, subtractions, multiplication, division) and
logical (<, >, AND, OR, etc.) computations. Registers are used by the
ALU to retain the data being processed.
Secondary Storage Devices
Secondary or external storage is inaccessible directly to the CPU. Before
the CPU uses secondary storage data, it must be transferred to the main
storage. Secondary storage permanently retains vast amounts of data.
Examples include hard disk drives (HDDs), solid-state drives (SSDs),
compact disks (CDs), etc.
Generation of Computers
10
“Generation” in computer talk is a step in technology
It provides a framework for the growth of computer industry
Originally it was used to distinguish between various hardware
technologies, but now it has been extended to include both
hardware and software
Till today, there are five computer generations
Generation of Computers
11
Some First Generation Computers
12
ENIAC: Electronic Numerical Integrator EDVAC: Electronic Discrete Variable
and Calculator Automatic Computer
EDSAC: Electronic Delay Storage UNIVAC: Universal Automatic
Automatic Calculator Computer
Generation of Computers
13
Note:
SSI: Small Scale Integration
MSI: Medium Scale Integration
PDP: Programmable Data Processors
CDC: Control Data Corporation
Generation of Computers
14
Note:
VLSI: Very Large Scale Integration VAX: Virtual Address Extension
Generation of Computers
15
Note:
ULSI: Ultra Large Scale Integration SGI: Silicon Graphics Inc.
PVM: Parallel Virtual Machine PARAM: Parallel Machine
Generation of Computers
16
Electronic Devices Used in Computers of Different Generations
Classification of Computer
17
Computers can be classified as follows:
Classification of Computer
18
1. According to Type
i. Digital Computer
A computer that performs calculations and logical
operations with quantities represented as digits,
usually in the binary number system
ii. Analog Computer
An analog computer is a form of computer that
uses continuous physical phenomena such as
electrical, mechanical, or hydraulic quantities to
model the problem being solved
iii. Hybrid Computer
Exhibit features of analog and digital computers
Classification of Computer
19
2. According to Size (capabilities)
i. Mini computer
A midsized computer. In size and power, minicomputers
lie between workstations and mainframes.
ii. Micro computer
Desktop Computer: A personal or micro-mini computer
sufficient to fit on a desk
Laptop Computer: A portable computer complete with
an integrated screen and keyboard. It is generally
smaller in size than a desktop computer and larger
than a notebook computer
Palmtop Computer/Digital Diary /Notebook /PDAs: A
hand-sized computer. Palmtops have no keyboard but
the screen serves both as an input and output device
iii. Mainframes
A very large and expensive computers capable of
supporting hundreds, or even thousands, of users
simultaneously
Classification of Computer
20
2. According to Size (capabilities)
iv. Super Computer
The fastest and most powerful type of computer
Supercomputers are very expensive and are employed for
specialized applications that require immense amounts of
mathematical calculations
For example, weather forecasting requires
a supercomputer
v. Workstations
A terminal or desktop computer in a network
In this context, workstation is just a generic term for a user's
machine (client machine) in contrast to a "server" or
"mainframe"
Classification of Computer
21
3. According to Purpose
i. General Purpose
General purpose computers are
designed to perform a range of tasks
e.g. Personal Computer
ii. Special Purpose
Specific purpose computers are
designed to handle a specific problem
or to perform a specific task
e.g. Computers that control aircraft and
satellites
Types of Processor
22
A processor, or "microprocessor," is a small chip that resides
in computers and other electronic devices
A processor performs arithmetical, logical, input/output (I/O) and other
basic instructions that are passed from an operating system (OS)
Types of processor depends on the architecture of processor
Types of Processor
23
Types of Processor
24
Computer Storage
25
A storage device is any computing hardware that is used for storing and extracting
data
It can hold and store information both temporarily and permanently, and can be
internal or external to a computer, server or any similar computing device
There are two main types of storage devices: Primary and Secondary
Types of Computer Storage
Computer Storage
26
Primary Storage and Secondary Storage
Primary Storage
27
Primary storage (also known as main storage or memory) is the area in a
computer in which data is stored for quick access by the computer's
processor. It consists of Registers, Cache and Main Memory
Primary Storage
28
Main Memory consists of Random Access Memory (RAM) and Read Only
Memory (ROM)
Random Access Memory (RAM)
29
It is a read/write (R/W) memory which is volatile
This means when power is turned off, all the contents are
destroyed
It can be accessed randomly: that is, any byte of memory can
be accessed without touching the preceding bytes
RAM is the most common type of memory found in computers
and other devices such as printers
There are two basic types of RAM:
Dynamic RAM (DRAM)
Static RAM(SRAM)
Types of RAM
30
DRAM:
DRAM needs to be refreshed thousands of times per second
DRAM stores a bit of data using a transistor and capacitor pair, which
together comprise a memory cell
The capacitor holds a high or low charge (1 or 0, respectively), and the
transistor acts as a switch that lets the control circuitry on the chip read the
capacitor's state of charge or change it
As this form of memory is less expensive to produce than SRAM, it is the
predominant form of computer memory used in modern computers.
SRAM:
SRAM does not need to be refreshed, which makes it faster, but it is more
expensive than DRAM
In SRAM, a bit of data is stored using the state of a flip-flop
This form of RAM is more expensive to produce, but is generally faster and
requires less power than DRAM and, in modern computers, is often used as
cache memory for the CPU
Read Only Memory (ROM)
31
ROM is non-volatile which means it retains the stored
information even if power is turned off
It is used to store programs that boot the computer and
perform diagnostics
Different types of ROM as follows:
Programmable ROM (PROM)
Erasable Programmable ROM (EPROM)
Electrically Erasable Programmable ROM (EEPROM)
Types of ROM
32
PROM (Programmable ROM):
A PROM is a memory chip on which data can be written onto only once. Once
a program is written onto a PROM chip, it remains there forever
Unlike RAM, PROM retains its contents when the computer is turned off
The difference between a PROM and a ROM is that a PROM is manufactured as
blank memory and programmed later with a special device called PROM
programmer or the PROM burner, whereas the ROM is programmed during
manufacturing process.
The process of programming a PROM is sometimes called burning a PROM
EPROM (Erasable Programmable ROM) :
An EPROM is a special type of PROM that can be erased by exposing it to
ultraviolet light
Once erased, it can be reprogrammed. An EPROM is similar to a PROM except
that it requires ultraviolet radiation to be erased
Types of ROM
33
EEPROM (Electrically Erasable Programmable ROM):
EEPROM is a special type of PROM that can be erased by exposing it to an
electrical charge
Like other types of PROM, EEPROM retains its contents even when the power is
turned off
Also, like other types of ROM, EEPROM is not as fast as RAM
EEPROM is similar to Flash Memory (sometimes called flash EEPROM)
The principal difference is that EEPROM requires data to be written or erased
one byte at a time whereas flash memory allows data to be written or erased in
blocks
Secondary Storage
34
Secondary Storage is alternatively referred to as
external memory, secondary memory or auxiliary storage
Secondary storage device is a non-volatile device that holds
data until it is deleted or overwritten
Primary storage Secondary storage
Volatile Nonvolatile
Temporary Permanent
It loses all of its contents when Writing : is the process of
power to the system unit is shut
saving information
off
Reading: is the process of
accessing information
Secondary Storage
35
Secondary Storage devices are classified as follows:
Secondary Storage
36
Sequential-access Storage Devices
Arrival at the desired storage location may be preceded by sequencing through other
locations
Data can only be retrieved in the same sequence in which it is stored
Magnetic tape is a typical example of such a storage device
Secondary Storage
37
Direct-access Storage Devices
Devices where any storage location may be selected and accessed at random
Permits access to individual information in a more direct or immediate manner
Magnetic and optical disks are typical examples of such a storage device
Memory Storage
Devices
Magnetic Disks
Number System
38
A number system is a collection of various symbols
which are called digits
Two types of number systems are:
Non-positional Number Systems
Positional Number Systems
Non-positional Number System
39
Characteristics
Use symbols such as I for 1, II for 2, III for 3 etc
Each symbol represents the same value regardless of its position in the
number
The symbols are simply added to find out the value of a particular
number
Difficulty
It is difficult to perform arithmetic with such a number system
Positional Number System
40
Characteristics
Use only a few symbols called digits
These symbols represent different values depending on the position they
occupy in the number
The value of each digit is determined by:
1. The digit itself
2. The position of the digit in the number
3. The base of the number system (Base = total number of digits in the
number system)
The maximum value of a single digit is always equal to one less than
the value of the base
Positional Number System
41
There are four Positional Number Systems: Binary, Decimal, Octal and
Hexadecimal
Decimal 8 4 2 1
00 0 0 0 0
01 0 0 0 1
02 0 0 1 0
03 0 0 1 1
04 0 1 0 0
05 0 1 0 1
06 0 1 1 0
07 0 1 1 1
08 1 0 0 0
09 1 0 0 1
10 1 0 1 0
11 1 0 1 1
12 1 1 0 0
13 1 1 0 1
14 1 1 1 0
15 1 1 1 1
Binary Number System
42
Characteristics:
Has only 2 symbols or digits (0 and 1). Hence its base = 2
The maximum value of a single digit is 1 (one less than the value of the
base)
Each position of a digit represents a specific power of the base (2)
This number system is used in computers
Decimal Number System
43
Characteristics:
Has 10 symbols or digits (0, 1, 2, 3, 4, 5, 6, 7,8, 9). Hence, its base = 10
The maximum value of a single digit is 9 (one less than the value of the base)
Each position of a digit represents a specific power of the base (10)
We use this number system in our day-to-day life
Octal Number System
44
Characteristics:
Has total 8 symbols or digits (0, 1, 2, 3, 4, 5, 6, 7). Hence, its base = 8
The maximum value of a single digit is 7 (one less than the value of the base)
Each position of a digit represents a specific power of the base (8)
Since there are only 8 digits, 3 bits (23 = 8) are sufficient to represent any octal
number in binary
Hexadecimal Number System
45
Characteristics:
Has total 16 symbols or digits (0, 1, 2, 3, 4, 5, 6, 7,8, 9, A, B, C, D, E, F). Hence its
base = 16
The symbols A, B, C, D, E and F represent the decimal values 10, 11, 12, 13, 14
and 15 respectively
The maximum value of a single digit is 15 (one less than the value of the base)
Each position of a digit represents a specific power of the base (16)
Since there are only 16 digits, 4 bits (24 = 16) are sufficient to represent any
hexadecimal number in binary
Conversions
46
Decimal to Binary
Here is an example of using repeated division to convert 1792
decimal to binary:
Reverse the remainders, we get 11100000000
(1792)10 = (11100000000)2
Conversions
47
Decimal to Octal
Here is an example of using repeated division to convert 1792
decimal to octal:
Reverse the remainders, we get 3400
(1792)10 = (3400)8
Conversions
48
Decimal to Hexadecimal
Here is an example of using repeated division to convert 1792
decimal to hexadecimal:
Reverse the remainders, we get 700
(1792)10 = (700)16
Conversions
49
The only addition to the algorithm when converting from decimal to
hexadecimal is that a table must be used to obtain the hexadecimal digit if
the remainder is greater than decimal 9.
For example, 590 decimal converted to hex is:
Hexadecimal
Decimal Number Operation Quotient Remainder
Result
590 ÷ 16 = 36 14 E
36 ÷ 16 = 2 4 4
2 ÷ 16 = 0 2 2
0 done.
Reverse the remainders, we get 24E
(590)10 = (24E)16
Conversion from other to decimal number
system
50
Conversion from Binary to octal
51
Step 1 − Divide the binary digits into groups of three (starting
from the right).
Step 2 − Convert each group of three binary digits to one
octal digit.
Example
Binary Number − 101012
Calculating Octal Equivalent −
Step Binary Number Octal Number
1. 101012 010 101
2. 101012 28 58
3. 101012 258
Binary Number − 101012 = Octal Number − 258
Conversion from Octal to Binary
52
Step 1 − Convert each octal digit to a 3 digit binary number
(the octal digits may be treated as decimal for this conversion).
Step 2 − Combine all the resulting binary groups (of 3 digits
each) into a single binary number.
Example
Binary Number − 101012
Calculating Octal Equivalent −
Step Octal Number Binary Number
1. 258 28 58
2. 258 0102 1012
3. 258 0101012
Octal Number − 258 = Binary Number − 101012
Conversion from binary to Hexadecimal
53
Step 1 − Divide the binary digits into groups of four (starting
from the right).
Step 2 − Convert each group of four binary digits to one
hexadecimal symbol.
Example
Binary Number − 101012
Calculating Octal Equivalent −
Step Binary Number Hexadecimal Number
1. 101012 0001 0101
2. 101012 116 516
3. 101012 1516
Binary Number − 101012 = Hexadecimal Number − 1516
Conversion from Hexadecimal to binary
54
Step 1 − Convert each hexadecimal digit to a 4 digit binary
number (the hexadecimal digits may be treated as decimal for
this conversion).
Step 2 − Combine all the resulting binary groups (of 4 digits
each) into a single binary number.
Example
Binary Number − 101012
Calculating Octal Equivalent −
Step Hexadecimal Number Binary Number
1. 1516 116 516
2. 1516 00012 01012
3. 1516 000101012
Hexadecimal Number − 1516 = Binary Number − 101012
Octal to Hexadecimal
55
When converting from octal to hexadecimal, it is often easier to first
convert the octal number into binary and then from binary into
hexadecimal.
For example, to convert 345 octal into hex:(from the previous example)
Octal =345
Binary =011 100 101
Drop any leading zeros or pad with leading zeros to get groups of four
binary digits (bits):
Binary 011100101 = 1110 0101
Then, look up the groups in a table to convert to hexadecimal digits.
Binary =1110 0101 Hexadecimal =E5= E5 hex
56
Decimal 8 4 2 1
00 0 0 0 0
01 0 0 0 1
02 0 0 1 0
03 0 0 1 1
04 0 1 0 0
05 0 1 0 1
06 0 1 1 0
07 0 1 1 1
08 1 0 0 0
09 1 0 0 1
10 1 0 1 0
11 1 0 1 1
12 1 1 0 0
13 1 1 0 1
14 1 1 1 0
15 1 1 1 1
Hexadecimal to Octal
57
When converting from hexadecimal to octal, it is often easier to first
convert the hexadecimal number into binary and then from binary into
octal.
For example, to convert A2DE hex into octal:
Hexadecimal =A 2 D E
Binary =1010 0010 1101 1110 = 1010001011011110
Add leading zeros or remove leading zeros to group into sets of three
binary digits.
Binary: 1 010 001 011 011 110 = 001 010 001 011 011 110
Then, look up each group in a table:
Binary 000 001 010 011 100 101 110 111
Octal 0 1 2 3 4 5 6 7
Binary =001010001011011110 Octal =121336
Software
58
Software refers to a collection of programs
There are two types of software:
1. System Software
2. Application Software
System software are designed to control the operation and extend the
processing capability of a computer system
e.g. Operating System, Compiler, Assembler, Linker, Loader
Application software are designed to solve a specific problem or to do a
specific task
e.g. MS Word, Paint, Web Browsers (like Chrome, Mozilla Firefox etc.)
Introduction to System Software
59
System Software are programs that are designed specifically for running the
hardware on a personal computer
This means that system software is designed to communicate with the internal parts
of your computer such as the hard drive, RAM, ROM, cache, microprocessors, etc. so
that the user doesn't have to.
System software is a collection of programs that supports computer operations.
System software can be separated into two different categories, Utility Programs
and Operating Systems
The OS boots up the computer and makes sure everything is operational.
Utility programs perform a very specific task, to either enhance or manage your
computer, for example your virus protection program
60
Introduction to System Software
61
Introduction to System Software
62
Editor:
A program that enables you to create and edit text files
Source Code Editor is an standalone application required for writing or
editing the source code. A source code editor checks for syntaxes while
user writes a code and immediately warns of syntax errors.
Text Editor is a simple application required for editing plain text such as
notepad.
Introduction to System Software
63
Compiler:
It is a program which translates a high level language program into a
machine language program.
A compiler is more intelligent than an assembler. It checks all kinds of
limits, ranges, errors etc.
Introduction to System Software
64
Assembler:
A computer will not understand any program written in a language,
other than its machine language
The programs written in other languages must be translated into the
machine language
Such translation is performed with the help of software
A program which translates an assembly language program into a
machine language program is called an assembler
Introduction to System Software
65
Linker:
In high level languages, some built in header files or libraries are stored
These libraries are predefined and these contain basic functions which
are essential for executing the program
These functions are linked to the libraries by a program called Linker
If linker does not find a library of a function then it informs to compiler
and then compiler generates an error
The compiler automatically invokes the linker as the last step in compiling
a program
Introduction to System Software
66
Loader:
Loader is a program that loads machine codes of a program into the
system memory
In Computing, a loader is the part of an Operating System that is
responsible for loading programs
It is one of the essential stages in the process of starting a program,
because it places programs into memory and prepares them for
execution
Loading a program involves reading the contents of executable file into
memory
Once loading is complete, the operating system starts the program by
passing control to the loaded program code
Loader working
67
Steps to execute a High Level Program
68
Example: C Program Execution
References:
69
Fundamentals of Computer Architecture & its
Components | Jaro Education
Computer architecture – Wikipedia
Computer Architecture: Components, Types,
Examples | Spiceworks - Spiceworks