SlideShare a Scribd company logo
Fundamentals of Computers
What is Computer? 
• Derived from word ‘compute’. 
• A computer is an electronic device that takes data and 
instructions as input, processes the data and produces useful 
information as output. 
Data 
Input Output 
Process 
Information 
• So the electronic device is known as hardware and the set of 
instructions is known as software. 
Instructions
Characteristics of Computer 
• Speed 
• Accuracy 
• Diligence 
• Versatile 
• Power of remembering 
• No IQ 
• No feeling
History of Computers 
• First Calculating machine: Abacus means calculating board. 
• Mechanical device Napier Bones for the purpose of multiplication. 
• Slide rule for addition, subtraction, multiplication and division. 
• Pascal’s adding and subtractory machine. 
• Leibniz’s multiplication and dividing machine. 
• Charles babbage’s analytical engine. 
• Mechanical and electrical calculator to perform all type of 
calculation. 
• Modern electronic calculator.
Generations of Computer 
• Each generation is distinguished from others on the basis of the type of 
switching circuits used. 
• Computers can be categorized into 5 generations: 
• First Generation (1940-1956) 
Vacuum tubes used to build circuitry for computer 
Used to perform calculation in milliseconds. 
Very large in size. 
Used machine language to perform operations. 
Used to take inputs from punch cards and output on paper. 
Computers of first generation were: ENIAC, EDVAC and UNIVAC-1. 
ENIAC is the first electronic computer.
Contd.. 
 Second Generation (1956-1963) 
Transistors used to build circuitry for computers. 
Smaller in size and faster than the first generation computers. 
Concept of Central Processing Unit (CPU), memory, 
programming language and input and output units came into 
picture. 
Used assembly language to give instructions. 
Programming languages such as COBOL, FORTRAN were 
developed during this period. 
Computers of second generation were: IBM 1620, CDC1604, 
PDP8 etc.
Contd.. 
 Third generation (1964-1971) 
They used integrated circuits (IC). IC is a silicon chip that 
embeds an electronic circuit. 
Size reduced and speed increased. 
BASIC (Beginners All purpose Symbolic Instruction Code) 
was developed during this period. 
Used keyboard as input device and monitor for output. 
Third generation computer includes IBM 370, PDP11 and 
CDC 7600.
Contd.. 
• Fourth generation (1971-till date): 
Used large scale integrated circuit. 
The concept of microprocessor came. 
Techniques to connect the computers established i.e. LAN, WAN. 
Operating systems came into existence such as: DOS, Windows. 
High level programming languages were introduced. 
Graphical user interface based application. 
High storage capability and cheaper. 
Example of fourth generation computer is Personal Computer.
Contd.. 
• Fifth generation (1980- future) 
Use of ultra large scale integration technology. 
High speed. 
Parallel processing. 
Portable mass storage medium e.g. CD-ROM. 
No requirement of assembling the different components of 
computer. 
Portable computers. 
Based on Artificial intelligence such as voice recognition 
system.
Classification of Computers 
• Computers can be classified in following categories 
based on their computing capability, size, number of 
users and speed: 
1.Microcomputers 
2.Minicomputers 
3.Mainframe Computers 
4.Supercomputers
Microcomputers 
• It has microprocessor as its CPU. 
• It performs the following operations: 
1. Inputting 
2. Storing 
3. Processing 
4. Outputting 
5. Controlling 
• Examples of microcomputers is IBM-PC.
Minicomputers 
• Medium sized computers. 
• Designed to be serve multiple users simultaneously. 
• Used as servers in LAN. 
• It has large storage capacity and operates at higher speed.
Mainframe Computers 
• Very high speed and storage capacity. 
• They are placed in central location and are connected to 
several user terminals. 
• Larger and expensive. 
• Generally used in centralized databases. 
• Can also be used as controlling node in WAN. 
• Example of Mainframe computer is: IBM 3000 series.
Supercomputer 
• Fastest and most expensive machines. 
• It is built by interconnecting hundreds of 
microprocessors. 
• It supports multiprocessing and parallel processing. 
• Mainly used for weather forecasting, biomedical 
research, aircraft design etc. 
• Example of super computer is: CRAY XMP.
Basic Terms of Computer System 
• Computer System is basically divided into 2 parts: 
1. Hardware 
2. Software 
• Hardware refers to physical parts of computer system and 
software refers to set of instructions for computer to perform 
some task.
Computer Organization 
• 4 logical units in every computer: 
• Input unit 
• Obtains information from input devices (keyboard, mouse) 
• Output unit 
• Outputs information (to screen, to printer, to control other devices) 
• Memory unit 
• Rapid access, low capacity, stores input information 
• Central processing unit (CPU) 
• Supervises and coordinates the various components of the computer 
• Performs arithmetic calculations and logic decisions
Anatomy of Computer System 
• Keyboard 
• Mouse 
Input devices 
• Scanner 
• Monitor 
• Printer 
Output Devices 
• Speaker 
• Primary Memory 
• Secondary Memory 
Memory Management 
• Control unit 
• Arithmetic logical unit 
Processing units 
• Motherboard
Keyboard 
• Keypad contains: 
• Alphabets 
• Numbers 
Alphanumeric keys 
• Special Symbols s.a. page up, page down, home, end etc. 
• Function Keys s.a. F1, F2 etc. performs a specific task. 
• Modifier keys s.a. ctrl, shift. 
• Space bar and escape key 
• Numeric keypad 
• qwert Keyboard (Typewriter Keyboard). 
• On key press it sends a code (ASCII Code) to the CPU.
Mouse 
• Known as Pointing & Click Device. 
• Two / Three Buttons 
• Wheel / Optical Mouse 
• Normally Left Click – Select/ Run 
Right Click – Popup Menu
Scanner 
 Input Device, Converts a hard copy into a computer file 
(digitized image). 
 Used to Scan Signatures, Photographs, documents etc. 
 Digitized image can be black & white or colored. 
 For colored images each image is considered as 
collection of dots with each dot representing the 
combination of red, green, blue in different proportion. 
 Nowadays Scanners with OCR produces editable 
documents.
Monitor 
 Output device 
 It produces visual displays generated by the computer. 
 It is connected to some part of the CPU through cables. 
 The monitor can be classified as CRT (Cathode Ray 
Tube) and LCD (Liquid Crystal Display). 
 A monitor is characterized by its monitor size and 
resolution.
Printer 
 Output Device 
 Produces hard copy of the electronic text. 
 Types: 
 Dot Matrix: used in low quality and high volume 
applications. 
 Inkjet: slower than dot matrix but produces high quality 
printouts. 
 Laser: consists of microprocessor, ROM and RAM that can 
store the textual information. 
 Printer and computer is connected using cable, the computer 
converts the document that is understandable by the printer 
using print driver software.
Speaker 
• Output device. 
• It converts an electrical signal into sound. 
• Audio drivers need to be installed to produce the audio 
output. 
• Speakers are either in-built in the computer or attached 
externally to the computer.
Primary Memory 
 Primary memory is the built in unit of the computer. 
 The data is stored in machine understandable binary format in 
the memory. 
 The types of primary memory are: 
ROM 
--permanent memory 
--non-volatile. 
--a chip inserted in motherboard. 
--stores the BIOS which performs POST(power on self test). 
RAM 
--It is read/write memory. 
--volatile.
Contd.. 
Cache Memory 
-- It stores the data and application that was last 
processed by the CPU. 
--When CPU performs processing, it first searches the 
cache and then RAM.
ROM types 
 There are 3 types of ROM: 
PROM: Programmable ROM i.e. a memory chip on 
which data can be written only once. It is manufactured 
as blank memory. 
EPROM: Erasable PROM i.e. a special type of PROM 
that can be erased by exposing it to UV light. 
EEPROM: Electric Erasable PROM i.e. similar to 
PROM but requires electricity to be erased.
RAM types 
• SRAM: It is static RAM. It is faster, expensive and 
consumes less power. SRAM is used in cache memory. 
• DRAM: It is dynamic RAM. It is slower, cheaper and 
consumes less power. DRAM is widely used in main 
memory.
Secondary Memory 
• They represent the external storage devices connected to the 
computer. 
• Non-volatile memory. 
• Stores information that is not in use currently. 
• Classification of secondary storage: 
--Magnetic storage device includes floppy disk, hard disk etc. 
--Optical storage device includes CD-ROM, CD-RW, DVD-ROM 
etc. 
--Magneto-optical storage device includes
Hard Disk 
• Non-removable storage device. 
• Several Circular Magnetic Disks are housed in a single 
case. 
• Data is stored as 1s & 0s. 
• Typical Capacity is 20 GB -80 GB
Floppy Disk 
• Magnetic Memory Device. 
• Removable storage. 
• A single circular mylar plastic disk, coated with magnetic 
material is packed in a protective plastic casing. 
• Typical size is 3.5” & Capacity is 1.44MB
CD-ROM 
• Optical Device. 
• Removable Storage. 
• Read Only Memory. 
• Typical Capacity is 550 Mb – 800MB
Processing in a Computer (Computer 
Architecture)
CPU 
• a central processing unit (CPU) consists of 
• an arithmetic/logic unit (ALU) where math and logic 
operations are performed, 
• a control unit which directs most operations by 
providing timing and control signals, 
• and registers that provide short-term data storage and 
management facilities.
ALU 
• A : The type of operation that the ALU needs to perform 
is determined by signals from the control unit . 
• B: The data can come either from the input unit, or 
• C: from the memory unit. 
• D: Results of the operation can either be transferred back 
to the memory unit or 
• E: directly to the output unit .
Role of RAM in processing 
 stores instructions and/or data. 
 Memory is divided into an array of "boxes" each containing a 
byte of information. 
 A byte consists of 8 bits. 
 A bit (binary digit) is either 0 (OFF) or 1 (ON). 
 The memory unit also serves as a storage for intermediate and 
final results of arithmetic operations. 
 F : Control signal (a read or a write operation). 
 G : A location in memory 
 H : Input to memory data lines when the control signal J is 
enabled. 
 I : Memory to the output unit when the control signal L is 
enabled.
Control Unit 
• CU transfers the data and the instruction of the corresponding 
operation to the ALU stored with it. 
• It fetches an instruction from memory by sending an address 
(G) and 
• a read command (F) to the memory unit. 
• The instruction word(s) stored at the memory location 
specified by the address is then transferred to the control unit 
(K). 
• After decoding this instruction, the control unit transmits the 
appropriate signals to the other units in order to execute the 
specified operation. 
• This sequence of fetch and execute is repeated by the control 
unit until the computer is either powered off or reset.
Motherboard 
• It refers to a device used for connecting the CPU with the 
input and output devices. 
• Some of the components of a motherboard are: 
Buses 
System clock 
Microprocessor
Contd.. 
• Buses: It is an electrical path that transfers data and 
instructions among different parts of computer. The bus 
can be data bus or address bus. 
• System clock: It is a clock used to synchronize the 
activities performed by the computer. 
• Microprocessor: CPU component that performs the 
processing and controls the activities performed by 
different part of computer.
Software 
 Software includes application software and system software. 
 Application software is a program designed for the end users. 
 Example of application softwares are MS word, MS Excel 
etc. 
 System software is designed to operate computer hardware 
and to provide the platform for running application software. 
 Example of system software are: operating system, compilers, 
interpreters, assemblers and other utility programs.
Operating System 
• OS is system software, which may be viewed as 
collection of software consisting of procedures for 
operating the computer. 
• It provides an environment for execution of programs 
(application software). 
• It’s an interface between user & computer.
Contd.. 
Computer Machine/Hardware 
Machine Language (Low 
Level Language) 
Operating System 
Human Understandable 
Language (High Level Language) 
User / Programmer
Types of OS 
 Batch Operating System: 
only one program is allowed to run at a time. 
No modification of data while program is in running state. 
If an error is encountered, start the program from scratch. 
Example: DOS 
 Interactive Operating System: 
It also can run only one program at a time. 
Modification and entry of data allowed while program is 
running. 
Example: Multiplexed Information and Computing Services.
Contd.. 
 Multiuser Operating System: 
Allows multiple user to use the system at the same time or at 
different times. 
Example: Linux, Windows 2000. 
 Multi-Tasking Operating System: 
Allows more than one program to run at the same time. 
Example: Unix and Windows 2000. 
 Multithreading Operating System: 
Allows running of different parts of a program at the same 
time. 
Example: Unix, Linux.
DOS Operating System 
 Short form for Microsoft Disk Operating System. 
 Command line user interface. 
 Now a days it is not used as a stand alone product, it comes as 
an integrated product with Windows. 
 In MS-DOS one need to write the commands to accomplish 
some task. The commands are categorized into 3 classes: 
Environment command: CLS, TIME, DATE, VER etc. 
File Manipulation command: COPY, DEL, TYPE, DIR etc. 
Utilities: FORMAT, EDIT etc.
UNIX Operating System 
• Unix controls all the commands generated from the user 
keyboards as well as the data generated in such a way that 
each user believes that he/she is the only person working on 
the computer. 
• It is written in C language. 
• The properties of Unix are: Multi user and multi tasking 
capability, portability, flexibility, security etc.
Architecture of Unix 
 Hierarchical architecture. 
 Has several layers and each layer provides a unique 
function as well as maintains interaction with lower 
layers. 
 The layers of Unix operating system are: 
Kernel 
Service 
Shell 
User applications
Contd.. 
User Applications 
Shell (Library Routines) 
Service Layer (process, memory, I/O services and file 
management 
Kernel (Scheduler, Device Driver, I/O Buffer) 
Hardware
Kernel 
• Kernel enables a user to access the hardware with the 
help of system call. 
• Other functions of kernel are: 
Initiating and executing different programs at the same 
type. 
Allocating the memory. 
File handling. 
Sending and receiving information on network.
Service layer 
• Requests are received from the shell and they are 
transformed into commands to the kernel. 
• It consists of many programs to provide various services. 
• It provides services such as: 
Access to I/O devices. 
Access to storage devices. 
File manipulation activities.
Shell 
 Interface between the user and computer. 
 Also known as command interpreter and utility layer. 
 Primary function of the shell is to read the data and 
instructions from the terminal, execute the command and 
show the output. 
 Various shells are found in UNIX OS: 
Bourne shell 
C shell 
Korn shell 
Restricted shell
User Applications 
• Used to perform several tasks and communication with 
other users of UNIX. 
• Includes Database management, software development , 
text processing and electronic communication etc.
Networking Concepts 
• Computer network refers to interconnection of group of 
computers. 
• Different types of computer networks are: 
LAN (Local Area Network) 
MAN (Metropolitan Area Network) 
WAN (Wide Area Network)
LAN 
• Privately owned Network. 
• It is limited to few kilometers. 
• It uses twisted pair cable, coaxial cable and optical fiber. 
• It adopts the topologies as: bus, ring and star. 
• Normally it works at the speed of 100-1000 Mbps.
MAN and WAN 
• It connects the computers over a large geographical area 
such as district or city. 
• 2 or more interconnected LANs can be said MAN. 
• A network that spans across a country or across the world 
is called WAN.
Computing Concepts
Introduction 
• How do you communicate data to computers? 
• How do the computers store and process data?
Binary Number System 
• Binary system is a numeral system that represents 
numerical values using only 2 digits: 0 and 1 which are 
known as bits. 
• The base of the binary number system is 2. 
• All decimal numbers that a user enters in a computer 
system are first converted into binary numbers then the 
arithmetic operations are performed on them. The results 
are again converted into its decimal equivalent and are 
displayed to the user.
Contd… 
• In computer system numbers can be represented in two 
ways: 
--signed 
--unsigned 
• In signed number, MSB represents the sign of the 
number. 
• If MSB is 0 then number is positive, if 1 then number is 
negative. 
• For example: 11111111 in unsigned is 255 and in signed 
it is -127.
Binary Codes 
• Various binary codes are used to encode statements that 
consists of letters in numeric and symbol form. 
• Commonly used binary codes are: 
-- Binary Coded Decimal (BCD code) 
-- American Standard Code for Information Interchange 
(ASCII) code.
Contd.. 
• In BCD, each decimal digit is represented by a binary code of 
4 bits. 
• For example: decimal number is 127. 
So in BCD it will be: 0001 0010 0111. 
• ASCII is a standard alphanumeric code that represents 
numbers, alphabetic characters and symbols using a 7 bit code 
format. It consists of 128 decimal numbers ranging from 0 to 
127 assigned to letters, numbers, punctuation marks and some 
special characters.
Conversions
Decimal (base 10) and binary (base 2) 
• Decimal 
• Uses positional representation 
• Each digit corresponds to a power of 10 based on its 
position in the number 
• Binary 
• Two digits: 0, 1 
• To make the binary numbers more readable, the digits are 
often put in groups of 4
Octal (Base 8) and Hexadecimal (Base 
16) 
 Octal 
 8 digits are used-0,1,2,3,4,5,6,7. 
 Each digit corresponds to a power of 8 based on its 
position in the number . 
 Hexadecimal 
 Shorter & easier to read than binary 
 16 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F 
 “0x” often precedes hexadecimal numbers
Decimal to base ‘n’ Conversions 
• Consider the integer and fractional parts separately. 
• For the integer part, 
• Repeatedly divide the given number by base n, and go on 
accumulating the remainders, until the number becomes 
zero. 
• Arrange the remainders in reverse order. 
• For the fractional part, 
• Repeatedly multiply the given fraction by n. 
• Accumulate the integer part. 
• Arrange the integer parts in the order they are obtained.
Decimal to Binary 
 125.35 to binary? 
 125 /2= 62 remainder-1 
62/2=31 remainder-0 
31/2=15 remainder-1 
5/2=7 remainder-1 
7/2=3 remainder-1 
3/2=1 remainder-1 
½=0 exit 
 Now .35 in binary will be: 
.35*2=0.70 keep 0 
.70*2=1.4 keep 1 
.40*2=0.80 keep 0 
 So 125.35 in binary is: 1111101.010
Decimal to Octal 
• 125.35 in base 8? 
• 125/8= 15 remainder-5 
15/8=1 remainder-7 
.35*8= 2.8 keep 2 
.8*8=6.4 keep 6 
.4*8=3.2 keep 3 
.2*8=1.6 keep 1 
• So 125.35 in base 8 is: 175.2631.
Decimal to Hexadecimal 
• 125.35 in hexadecimal? 
• 125/16=7 remainder-13 (D) 
7/16=0 remainder-7 
.35*16=5.6 keep 5 
.6*16=9.6 keep 9 
• 125.35 in hexadecimal is 7D.59.
Binary to Decimal 
• 1010 = 1 * 23 + 0 * 22 + 1 * 21 + 0 * 20 
= 8 + 2 
= 10 
• 1100 1001 = 1 * 27 + 1 * 26 + 1 * 23 + 1 * 20 
= 128 + 64 + 8 + 1 
= 201
Octal to Decimal 
• 563.21 in decimal will be: 
80 *3+ 81 *6+ 82*5+ 8-1 * 2+ 8-2 * 1 
3+ 48 +320+.25+.016 
371.266
Hexadecimal to decimal 
• Shorter & easier to read than binary 
• 16 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F 
• “0x” often precedes hexadecimal numbers 
• 0x123 = 1 * 162 + 2 * 161 + 3 * 160 
= 1 * 256 + 2 * 16 + 3 * 1 
= 256 + 32 + 3 
= 291 
• Another example 
• 0xABC = A * 162 + B * 161 + C * 160 
= 10 * 256 + 11 * 16 + 12 * 1 
= 2560 + 176 + 12 
= 2748
Binary to Octal 
Convert 10001100101001 to octal:- 
STEP ONE: Take the binary number and from right to left, 
group all placeholders in triplets. Add leading zeros, if 
necessary: 
010 001 100 101 001 
71
214510 = 8 
010 001 100 101 0012 
STEP TWO: Convert each triplet to its single-digit octal 
equivalent. (HINT: For each triplet, the octal conversion is 
the same as converting to a decimal number): 
010 001 100 101 001 
2 1 4 5 1 
72
Binary to Hexadecimal 
• Consider Binary: 1000100100110111 
STEP 1 Break the Byte into 'quartets' - 1000 1001 
0011 0111 
STEP 2 Use the table above to covert each quartet to its 
Hex equivalent - 8937 
• Therefore ... 1000100100110111 = 8937
Octal to Hexadecimal 
• step 1: first convert octal to binary. 
step 2: convert binary to hexadecimal. 
• convert octal 1057 to hexadecimal: 
• 1 0 5 7 
001 000 101 111 
0010 0010 1111 
2 2 15 (F)
Octal to binary 
• For instance, convert binary 1010111100 to octal: 
001 010 111 100 
1 2 7 4 
Therefore, 10101111002 = 12748. 
• Convert binary 11100.01001 to octal: 
011 100 . 010 010 
3 4 . 2 2 
Therefore, 11100.010012 = 34.228.
Hexadecimal to binary 
• Convert 0A2B.F to binary: 
0 in binary-0000 
A in binary-1010 
2 in binary-0010 
B in binary-1011 
F in binary- 1111 
so hex equivalent is: 0000 1010 0010 1011.1111
Binary Arithmetic Operations
Binary Addition 
• 0 + 0 = 0 
• 0 + 1 = 1 
• 1 + 0 = 1 
• 1 + 1 = 10 
+ 0 1 
0 0 1 
1 1 10 
78
• 1111 carry 
• 111101 
100111+ 
1100100 
79 
1 1 1 (carry) 
0 1 1 0 1 
1 0 1 1 1+ 
------------- 
1 0 0 1 0 0
Binary Subtraction 
• 0 - 0 = 0 
• 0 - 1 = borrow 1 from 
MSB 
• 1 - 0 = 1 
• 1 - 1 = 0 
- 0 1 
0 0 Borrow 
1 from 
MSB 
1 1 0 
80
Example of Subtraction 
111 
• 110011<- minuend 
- 10110<- subtrahend 
011101 
• 11100 
-10111 
101
Multiply Binary numbers 
 0 * 0 = 0 
 0 * 1 = 0 
 1 * 0 = 0 
 1 * 1 = 1 
82 
* 0 1 
0 0 0 
1 0 1
Multiply 1011 and 1010 
• 1 0 1 1 
× 1 0 1 0 
--------------- 
0 0 0 0 
1 0 1 1 
0 0 0 0 
+ 1 0 1 1 
------------------ 
1 1 0 1 1 1 0 
83
Dividing Binary Numbers 
___________ 
 1 0 1 ) 1 1 0 1 1 
− 1 0 1 
----- 
0 1 1 
− 0 0 0 
----- 
1 1 1 
− 1 0 1 
----- 
1 0
Complement 
• There are two types of complements for a number of base 
r, called r ’s complement and r-1 ‘s complement. 
• For example: for decimal numbers the base is 10 and 
complements are 10’s and 9’s complement. 
For binary numbers the base is 2 and complements are 
2’s and 1’s complement.
Decimal Number Complements 
• 9’s complement of the decimal number N=(10n-1)-N=n(9’s)-N 
• 10’s complement of the decimal number N=9’s complement+1 
• Example 1: 9’s complement of 134795? 
999999 
-134795 
----------------- 
865204 
10’s complement of 134795 is 865204+1=865205.
Contd.. 
• Example 2: 
find the 9’s and 10’s complement of 00000000. 
9’s complement of 00000000 is : 
99999999 
-00000000 
------------- 
99999999 
10’s complement of 00000000 is: 
99999999+1=100000000-> discard 1 since we have 8 bit 
representation only.
Binary Number Complements 
 1’s complement of a number N is: (2n-1)-N. 
Simply inverting the digits of a number N gives the 1’s 
complement of the binary number. 
 2’s complement of a number N is: 1’s complement of the 
number N + 1. 
 For example: 
1’s complement of 110100101 is: 001011010. 
2’s complement of 110100101 is: 
001011010+1=001011011.
Subtraction using 10’s complement 
• Perform 76425-28321. 
find 10’s complement of 28321=(99999-28321)+1 =71679 
add 10’s complement to first number: 76425+71679= 
=148104 
discard 1, so result is: 48104. 
• Perform 28531-345920. 
find 10’s complement of 345920= (999999- 345920)+1=654080 
add 10’s complement to first number: 28531+654080=682611 
find the 10’s complement of the result=(999999- 
682611)+1=317389 
append – sign with the result: -317389.
Subtraction using 2’s complement 
 Perform 11010011-10001100 
find 2’s complement of 10001100: 01110011+1=01110100. 
add this result to the first number: 01110100+11010011 
= 101000111 
Ignore the last carry : 01000111. 
 Perform 10001100-11010011 
find 2’s complement of 11010011: 00101100+1=00101101. 
add this result to the first number: 00101101+10001100 
=10111001 
change MSB to 0: 00111001 
find 1’s complement of above result: 11000110 
add 1 to the result: 11000110+1: 11000111-> MSB indicates a 
negative value.
Subtraction using 9’s complement 
 Perform 76425-28321. 
find 9’s complement of 28321: 99999-28321=71678 
add the above result to the first number: 
71678 
+76425 
-------- 
148103 
+1 
---------------- 
48104 
-----------------
Subtraction using 1’s complement 
 Perform 11010011-10001100. 
1’s complement of 10001100: 01110011 
add the result to first number: 
11010011 
+01110011 
------------- 
101000110 
+1 
--------------- 
101000111 
---------------
Example 
Q.1. Express -4 in 2’s complement form. 
Ans. Positive expression of number=0000 0100 
1’s complement=1111 1011 
add 1= 1111 1100.
Floating Point Representation 
• Represented in normalized form. 
• A floating point number whose mantissa doesn’t contain 
zero as the most significant digit of the number is 
considered to be in normalized form. 
• For example: + 370 in BCD is: 0000 0011 0111 0000 is 
in normalized form because leading zeros are not part of 
a zero digit. 
• Several times the number is written as a fraction 
multiplied by a power of 10. fractional part is known as 
‘mantissa’ and the power of 10 is known as ‘exponent’. 
E.g. 145.78, 0.23765* 103.
Binary Floating Point Number 
• A binary floating point number is represented by: 
mantissa * 2 exponent 
Where mantissa is a binary fraction with a non zero leading 
bit. 
• With the floating point representation, the following factors 
have to be decided: 
-- total no. of bits used for representing the mantissa. 
-- total no. of bits used for representing the exponent. 
-- whether to use a base other than 2 for the exponent. 
• A representation of floating point numbers in a 32 bit 
comSpigun t(e0r) word is shEoxwponn ebnet l(o1-w7): Mantissa (8-31)
Programming Language : Definition 
• A vocabulary and set of grammatical rules for instructing 
a computer to perform specific tasks. 
• The set of instructions are written to tell the computer: 
what operation to perform 
Where to locate data 
How to present results 
When to make certain decisions
Evolution of Programming languages 
• First Generation : Machine languages 
• Computers can understand only pulse and no pulse means 1 and 
0. This binary code is called machine code or machine language. 
They are directly executable program. 
• Computers don’t understand English, Hindi or Tamil. 
• Machine language poses 3 problems: 
1. It is difficult to understand and remember the various 
combinations of 0’s and 1’s. 
2. It is difficult for one computer to communicate with other 
computers since every machine has its own machine language. 
3. It is machine dependent.
Contd.. 
- Second generation language (Assembly Languages) 
 It is also low level language and machine dependent. 
 Its instruction consists of mnemonic code followed by 0 or 
more operands. 
 The mnemonic code used in assembly language is also known 
as ‘opcode’ which specifies the operation to be performed on 
given arguments. 
 Translated via assemblers. 
 Advantages of Assembly language are: 
1. Easy to locate the error. 
2. Easy to write code in assembly language than in machine 
language.
High Level Languages 
- User friendly and machine independent 
- Third Generation (procedure oriented languages) 
 High level languages designed to solve general purpose 
problems are called procedural languages. 
 Uses mathematical notations (translated via compilers) 
 They include COBOL, Pascal, FORTRAN, BASIC,C, C+ 
+,Java etc.The syntax used in every language is different. 
Another advantage is that they are portable.
Contd.. 
- Fourth Generation (problem oriented languages) 
 Used to solve specific problems. 
 They include query languages, report generators and 
application generators. 
 A single statement in 4 GL can perform the same task as 
multiple lines in 3 GL. For example: to create button, we just 
drag the button from tool bar in 4 GL while we have to write 
code for creating a button in 3 GL.
Contd.. 
- Fifth Generation (Natural languages) 
• Designed to make a computer to behave like an expert 
and solve problems. 
• LISP and PROLOG are mainly used to develop Artificial 
Intelligence and expert system.
PL hierarchy
Programming Environment 
• It comprises all those components that facilitate the 
development of a program. 
• These components are divided into two categories: 
Programming Tools and Application Program Interface 
(API). 
• API can be defined as a collection of data structures, classes, 
protocols and pre defined functions in form of libraries. These 
libraries can be included in the software packages of 
programming languages like C, C++ etc.
Contd.. 
• A software application which is used for the 
development, maintenance and debugging of a software 
program is known as programming tool. 
• There are some categories of programming tools: 
 Integrated Development tool: contains compiler, editor, 
debugger etc. 
Debugging Tool: helps to detect and remove bugs or 
error from a program. 
Memory usage Tool: helps to manage the memory 
resources efficiently.
Life cycle of a program development 
• The entire program development is divided into a number 
of phases: 
Requirement Analysis phase 
Design phase 
Implementation phase 
Testing phase 
Maintenance phase
Programming Paradigm 
• To solve a problem there are different programming 
approaches: 
Procedural programming 
Modular programming 
Object oriented programming
Procedural programming 
• The problem is viewed as a sequence of things to be done such 
as reading, calculating & printing. 
• Data is not given importance in this methodology. Data moves 
openly from one function to another. E.g. A payroll program, a 
function is not important that displays or checks data but the 
data in itself is more important. 
Global Data Global Data 
Function 1 
Local data 
Function 2 
Local data 
Function 3 
Local data
Modular Programming 
 With increasing size of program, a single list of instructions is 
a very inappropriate manner of programming. 
 So a program is divided into smaller units called functions 
(subprograms). 
 When we group a number of functions together into a large 
entity is called module. 
 Grouping of functions is done according to specific tasks. 
Data is hidden between different modules.
Object oriented programming 
• The idea behind this is to combine data and instructions that operate 
on that data. Such a unit is called an object. 
• Treats data as critical element. It doesn’t allow the data to move freely 
around the system. Objects may communicate through functions. 
Object A Object B 
Data 
Functions 
Data 
Functions 
Communication
Translator Programs
Assembler 
 Instructions written in assembly language must be translated 
to machine language instructions or object code : 
 Assembler does this 
 One to one translation : One AL instruction is mapped to one 
ML instruction. 
 AL instructions are CPU specific. 
 Assemblers are classified in two categories: single pass and 
two pass assemblers.
Compiler 
 Instructions written in high-level language also must be translated 
to machine language instructions : 
 Compiler does this 
 Generally one to many translation : One HL instruction is mapped 
to many ML instruction. 
 HL instructions are not CPU specific but compiler is. 
 Compiled languages include COBOL, FORTRAN, C, C++ etc. 
 Compilers are also classified as single pass and multi pass 
compilers.
Interpreter 
• A translation program that converts each high level 
program statement into the corresponding machine code. 
• Instead of the entire program, one statement at a time is 
translated and executed immediately.
Difference between compilation and 
interpretation
Linkers 
• Linkers and loaders are important part of any translator 
program. 
• Linker: Also known as binder. It is a program that combines 
object modules to form an executable program. 
Source 
file 
Source 
file 
Source 
file 
Source 
file 
Object file 
Object file Object file Object file 
Runtime linker 
library Executable 
program
Loaders 
• It is an Operating system utility that copies programs 
from a storage device to main memory where they can be 
executed. 
• Loader is responsible for loading the Operating system 
also.
Translation from HLL to ML
Problem Solving Techniques
Steps to solve a Problem 
 Analyze the problem. 
 Divide the process used to solve the problem in a series 
of tasks. 
 Formulate the algorithm to solve the problem. 
 Convert the algorithm in computer program. 
 Write the program in computer. 
 Input the data. 
 Program operates on input data. 
 Result produced. 
 Send the generated result to output unit to display it to 
user.
Techniques to solve the problem 
• There are 2 important techniques to solve the problem: 
Algorithms 
Flow Chart 
• Algorithm is a complete, detailed and precise step by step method 
to solve a problem independent of the software or hardware of the 
computer. 
• Flow chart is the pictorial representation of the algorithm depicting 
the flow of the various steps.
Top down approach of algorithms 
• Also known as divide and conquer. 
• In this approach problem is divided into 2 or more sub 
problems. The solution of each sub problem is taken out 
independently. Finally, the solution of all sub problem is 
combined to obtain the solution of the main problem. 
• Example of top down approach is binary search.
Program verification 
• Suppose we have coded a program for finding the 
average of 3 numbers, now we want to verify the coded 
program is correct or not. 
• This can be verified by implementing the program on a 
given list of data. 
• Implement the same program twice or thrice on the given 
list for different elements. If the program gives the 
correct result, then it is verified that the program is 
correct.
Efficiency of an algorithm (Termination and 
Correctness) 
• Efficiency of an algorithm means how fast an algorithm can 
produce the result for a given problem. 
• The efficiency of an algorithm depends on the time and space 
complexity. 
• Space complexity of an algorithm refers to the amount of 
memory required by the algorithm for its execution and 
generation of the final output. 
• Time complexity refers to the amount of computer time 
required by an algorithm for its execution.
Analysis of an algorithm 
• The analysis of an algorithm determines the amount of 
resources such as time and space required by it for its 
execution. 
• The complexity of an algorithm is estimated by 
asymptotic notations. 
• Asymptotic notations: they are represented in terms of 
function T(n), where n is the set of natural numbers i.e. 
1,2,3,..n.
Asymptotic notations 
• Θ notation: represents the average case running time. 
• O notation: represents worst case running time i.e. upper 
bound. 
• Ω notation: represents best case running time i.e. lower 
bound.
Flow charts Symbols
Example 1: to find the simple interest 
Algorithm: 
1. Start 
2. Read the name of the person, balance and rate of interest. 
3. Calculate the interest= balance * rate. 
4. Output the name of the person and interest amount. 
5. Stop.
Example 1: Flowchart
Example 2: to compute sum, average 
and product of 3 numbers 
Algorithm: 
1.Start. 
2.Read 3 numbers such as X, Y and Z. 
3.Find the sum of X, Y and Z say S=X+Y+Z. 
4.Compute the average say A=S/3. 
5.Compute the product say P= X*Y*Z. 
6.Output S, A, P. 
7.Stop.
Example 2: Flow chart
Switching Logics 
• Switching logic consists of two components - a condition 
and a goto command depending on the result of the 
condition test. The computer can determine the truth 
value of a statement involving one of six mathematical 
relations symbolized in the table below: 
Symbol Meaning 
== Equals 
!= Not Equal 
< Less than 
<= Less than or equal to 
> Greater than 
>= Greater than or equal to
Example 3: to read two numbers in 
decreasing order 
Algorithm: 
1.Start. 
2.Read two numbers say A and B. 
3.If A< B 
4. BIG=B 
5. SMALL=A 
6.ELSE 
7.BIG=A 
8.SMALL=B. 
9.Output BIG, SMALL. 
10.STOP.
Example 3: Flow Chart
Example 4: Repetition (to count from 1 
to 10) 
Algorithm: 
1.Start. 
2.Initialize a counter k=1. 
3.While k<=10 
4. print k. 
5. k =k+1. 
6.Stop.
Example 4: Flow Chart
Example 5: to find the factorial of a 
number 
Algorithm: 
1.Start. 
2.Input the number say N. 
3.Initialize a variable say F=1 and a counter say M=1. 
4.While M!=N 
5. Find F=F*M. 
6. M=M+1. 
7.Output F. 
8.Stop.
Example 5: Flow Chart
Tracing the Algorithm 
• To give the description of a program specifying the type 
of code, actual codes and its corresponding description is 
known as tracing an algorithm. 
• For example: int num1, num2; 
type: declaration statement 
code: int num1, num2; 
description: declares the integer type variables to store 
the values entered by the user.
Overview of C Language 
 A structured, high level, case sensitive and machine 
independent language. 
 C was evolved by Dennis Ritchie in 1972. 
 C compiler combines the capabilities of an assembly 
language with the features of a high level language. 
 C is highly portable. 
 C is well suited for the structured programming.
Basic structure of a C program 
Documentation Section 
Link Section 
Definition Section 
Global Declaration Section 
main() function section 
{ 
Declaration part 
Executable part 
} 
Subprogram Section (user defined 
functions)
Sample Program 1 
#include<stdio.h> 
#include<conio.h> 
void main() 
{ 
/* print the statement */ 
Printf(“hello world n ”); 
} 
Output: hello world
Contd.. 
• Every program must have exactly one main function. 
• Empty parentheses indicates that main has no argument. 
• The statements in curly braces { } form the function body. 
• Statements inside /* */ are said to be comments. 
• Comments can be anywhere in the program but can’t be 
nested. 
• printf() is a predefined standard C function for printing output.
Contd.. 
 Every statement in C should end with semicolon (;). 
 The information in () after the function name is known as 
argument. 
 n is newline character used to produce a newline. No space 
between  and n. 
 n, t etc are known as escape sequences. 
 #include is a preprocessor directive and stdio.h is standard I/O 
header file.
Sample Program 2 
• Adding two numbers 
#include<stdio.h> 
#include<conio.h> 
void main() 
{ 
int a=30; 
float b=45.5; 
float c; 
c=a+b; 
printf( “The sum is: %f”, c); 
} 
Output: The sum is 75.5.
Execution of a C program 
 The compilation and execution process of C can be divided in 
to multiple steps: 
1.Preprocessing - Using a Preprocessor program to convert C 
source code in expanded source code. "#includes" and 
"#defines" statements will be processed and replaced actually 
source codes in this step. 
2.Compilation - Using a Compiler program to convert C 
expanded source to assembly source code. 
3.Assembly - Using a Assembler program to convert assembly 
source code to object code. 
4.Linking - Using a Linker program to convert object code to 
executable code. Multiple units of object codes are linked to 
together in this step. 
5.Loading - Using a Loader program to load the executable code 
into CPU for execution.

More Related Content

What's hot

hierarchical bus system
 hierarchical bus system hierarchical bus system
hierarchical bus system
Elvis Jonyo
 
Unit II - 2 - Operating System - Threads
Unit II - 2 - Operating System - ThreadsUnit II - 2 - Operating System - Threads
Unit II - 2 - Operating System - Threads
cscarcas
 
12. dfs
12. dfs12. dfs
Parallel computing persentation
Parallel computing persentationParallel computing persentation
Parallel computing persentation
VIKAS SINGH BHADOURIA
 
Boot process
Boot processBoot process
Boot process
Salman Memon
 
Linux operating system ppt
Linux operating system pptLinux operating system ppt
Linux operating system ppt
Achyut Sinha
 
Introduction to computer hardware
Introduction to computer hardwareIntroduction to computer hardware
Introduction to computer hardware
K. A. M Lutfullah
 
CPU Architecture - Basic
CPU Architecture - BasicCPU Architecture - Basic
CPU Architecture - Basic
Yong Heui Cho
 
Silberschatz / OS Concepts
Silberschatz /  OS Concepts Silberschatz /  OS Concepts
Silberschatz / OS Concepts Alanisca Alanis
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithms
sathish sak
 
Synchronization hardware
Synchronization hardwareSynchronization hardware
Synchronization hardware
Saeram Butt
 
Operating system module
Operating system moduleOperating system module
Operating system module
kiamiel
 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.
CS_GDRCST
 
Parallel processing
Parallel processingParallel processing
Parallel processing
rajshreemuthiah
 
Generations of computer
Generations of computerGenerations of computer
Generations of computer
Jatin Jindal
 
Memory hierarchy unit 2 by ram k paliwal
Memory hierarchy  unit 2 by ram k paliwalMemory hierarchy  unit 2 by ram k paliwal
Memory hierarchy unit 2 by ram k paliwal
Ram Paliwal
 
Device Drivers
Device DriversDevice Drivers
Device Drivers
Suhas S R
 
Introduction to computing lecture1
Introduction to computing lecture1Introduction to computing lecture1
Introduction to computing lecture1Abdul_jabbar_k
 
Computer Architecture for Parallel Processing
Computer Architecture for Parallel ProcessingComputer Architecture for Parallel Processing
Computer Architecture for Parallel Processing
Dipak Kumar Singh
 

What's hot (20)

hierarchical bus system
 hierarchical bus system hierarchical bus system
hierarchical bus system
 
Unit II - 2 - Operating System - Threads
Unit II - 2 - Operating System - ThreadsUnit II - 2 - Operating System - Threads
Unit II - 2 - Operating System - Threads
 
12. dfs
12. dfs12. dfs
12. dfs
 
Parallel computing persentation
Parallel computing persentationParallel computing persentation
Parallel computing persentation
 
Boot process
Boot processBoot process
Boot process
 
Linux operating system ppt
Linux operating system pptLinux operating system ppt
Linux operating system ppt
 
Introduction to computer hardware
Introduction to computer hardwareIntroduction to computer hardware
Introduction to computer hardware
 
CPU Architecture - Basic
CPU Architecture - BasicCPU Architecture - Basic
CPU Architecture - Basic
 
Silberschatz / OS Concepts
Silberschatz /  OS Concepts Silberschatz /  OS Concepts
Silberschatz / OS Concepts
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithms
 
Memory virtualization
Memory virtualizationMemory virtualization
Memory virtualization
 
Synchronization hardware
Synchronization hardwareSynchronization hardware
Synchronization hardware
 
Operating system module
Operating system moduleOperating system module
Operating system module
 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.
 
Parallel processing
Parallel processingParallel processing
Parallel processing
 
Generations of computer
Generations of computerGenerations of computer
Generations of computer
 
Memory hierarchy unit 2 by ram k paliwal
Memory hierarchy  unit 2 by ram k paliwalMemory hierarchy  unit 2 by ram k paliwal
Memory hierarchy unit 2 by ram k paliwal
 
Device Drivers
Device DriversDevice Drivers
Device Drivers
 
Introduction to computing lecture1
Introduction to computing lecture1Introduction to computing lecture1
Introduction to computing lecture1
 
Computer Architecture for Parallel Processing
Computer Architecture for Parallel ProcessingComputer Architecture for Parallel Processing
Computer Architecture for Parallel Processing
 

Viewers also liked

History of computing
History of computingHistory of computing
History of computing
Hossain Md Shakhawat
 
Hexadecimal numbers
Hexadecimal  numbersHexadecimal  numbers
Hexadecimal numbersatcnerd
 
Assignment in T.L.E
Assignment in T.L.EAssignment in T.L.E
Assignment in T.L.E
Krizelle012
 
Computer history
Computer historyComputer history
Computer historyelmoreds
 
Hexadecimal
HexadecimalHexadecimal
Hexadecimalwardjo
 
hexadecimal notes By ZAK
hexadecimal notes By ZAKhexadecimal notes By ZAK
hexadecimal notes By ZAK
Tabsheer Hasan
 
Video Card (chs)
Video Card (chs)Video Card (chs)
Video Card (chs)
jake napoles
 
Chapter iii: Number System
Chapter iii: Number SystemChapter iii: Number System
Chapter iii: Number System
kclove
 
6th gen intel processor
6th gen intel processor 6th gen intel processor
6th gen intel processor
Amit Sinha
 
[1] Data Representation
[1] Data Representation[1] Data Representation
[1] Data Representation
Mr McAlpine
 
Abacus study material
Abacus study materialAbacus study material
Abacus study material
jayavidya80
 
Abacus Academy
Abacus AcademyAbacus Academy
Abacus Academy
rajdeep pratihari
 
Indian abacus product and program ppt
Indian abacus product and program pptIndian abacus product and program ppt
Indian abacus product and program ppt
Self-employed
 
Indian abacus parents presentation of the program
Indian abacus parents presentation of the programIndian abacus parents presentation of the program
Indian abacus parents presentation of the program
Self-employed
 
Computer Basic Definitions
Computer Basic DefinitionsComputer Basic Definitions
Computer Basic Definitionsnorzaini
 
K to 12 pc hardware servicing learning module
K to 12 pc hardware servicing learning moduleK to 12 pc hardware servicing learning module
K to 12 pc hardware servicing learning module
Tactical Foundation - Research and Extension Program
 
Presentation on computer data storage
Presentation on computer data storage Presentation on computer data storage
Presentation on computer data storage
GLG
 
Central processing unit
Central processing unitCentral processing unit
Central processing unit
Kamal Acharya
 

Viewers also liked (20)

History of computing
History of computingHistory of computing
History of computing
 
Hexadecimal numbers
Hexadecimal  numbersHexadecimal  numbers
Hexadecimal numbers
 
Assignment in T.L.E
Assignment in T.L.EAssignment in T.L.E
Assignment in T.L.E
 
Computer history
Computer historyComputer history
Computer history
 
Hexadecimal
HexadecimalHexadecimal
Hexadecimal
 
hexadecimal notes By ZAK
hexadecimal notes By ZAKhexadecimal notes By ZAK
hexadecimal notes By ZAK
 
Video Card (chs)
Video Card (chs)Video Card (chs)
Video Card (chs)
 
Chapter iii: Number System
Chapter iii: Number SystemChapter iii: Number System
Chapter iii: Number System
 
6th gen intel processor
6th gen intel processor 6th gen intel processor
6th gen intel processor
 
[1] Data Representation
[1] Data Representation[1] Data Representation
[1] Data Representation
 
Abacus study material
Abacus study materialAbacus study material
Abacus study material
 
Abacus Academy
Abacus AcademyAbacus Academy
Abacus Academy
 
Embedded operating systems
Embedded operating systemsEmbedded operating systems
Embedded operating systems
 
Indian abacus product and program ppt
Indian abacus product and program pptIndian abacus product and program ppt
Indian abacus product and program ppt
 
Indian abacus parents presentation of the program
Indian abacus parents presentation of the programIndian abacus parents presentation of the program
Indian abacus parents presentation of the program
 
Computer Elements
Computer ElementsComputer Elements
Computer Elements
 
Computer Basic Definitions
Computer Basic DefinitionsComputer Basic Definitions
Computer Basic Definitions
 
K to 12 pc hardware servicing learning module
K to 12 pc hardware servicing learning moduleK to 12 pc hardware servicing learning module
K to 12 pc hardware servicing learning module
 
Presentation on computer data storage
Presentation on computer data storage Presentation on computer data storage
Presentation on computer data storage
 
Central processing unit
Central processing unitCentral processing unit
Central processing unit
 

Similar to Fundamentals of Computers

Know your computer
Know your computerKnow your computer
Know your computer
Chitranshi Haridas
 
Introduction to Computer and its features
Introduction to Computer and its featuresIntroduction to Computer and its features
Introduction to Computer and its features
svps17nancy
 
E 100_p
E  100_pE  100_p
E 100_p
Jahairam76
 
computer organisation architecture.pptx
computer organisation architecture.pptxcomputer organisation architecture.pptx
computer organisation architecture.pptx
YaqubMd
 
Computers
ComputersComputers
Basics of computer
Basics of computerBasics of computer
Basics of computer
vijayalakshmimvvvcollege
 
Computer hardware
Computer hardwareComputer hardware
Computer hardware
DuaShaban
 
computer literacy chapter2.pptx
computer literacy chapter2.pptxcomputer literacy chapter2.pptx
computer literacy chapter2.pptx
ToobaFarooq10
 
MODULE 2.pptx
MODULE 2.pptxMODULE 2.pptx
MODULE 2.pptx
kndnewguade
 
Unit I.ppt
Unit I.pptUnit I.ppt
Unit I.ppt
DenashRajput
 
unit-i-computer-organization and architecture.ppt
unit-i-computer-organization and architecture.pptunit-i-computer-organization and architecture.ppt
unit-i-computer-organization and architecture.ppt
vardagotmare1
 
bachlor of computer application pc assembly and troubleshooting
bachlor of computer application pc assembly and troubleshootingbachlor of computer application pc assembly and troubleshooting
bachlor of computer application pc assembly and troubleshooting
KUSHSHARMA630049
 
Neethu Narayanan- Fundamentals of computer
Neethu Narayanan- Fundamentals of computerNeethu Narayanan- Fundamentals of computer
Neethu Narayanan- Fundamentals of computer
19940213
 
PC for Managers
PC for ManagersPC for Managers
PC for Managers
Hazel Anne Quirao
 
Computer architecture pptx
Computer architecture pptxComputer architecture pptx
Computer architecture pptx
MDSHABBIR12
 
I.T for Management: What is a computer and how does it work
I.T for Management: What is a computer and how does it work I.T for Management: What is a computer and how does it work
I.T for Management: What is a computer and how does it work
We Learn - A Continuous Learning Forum from Welingkar's Distance Learning Program.
 
What is computer and how it works
What is computer and how it worksWhat is computer and how it works
Generation of computer
Generation of computerGeneration of computer
Generation of computer
rameshkumar1646
 
SPC Unit 1
SPC Unit 1SPC Unit 1
SPC Unit 1
SIMONTHOMAS S
 
MY COMPUTER
MY COMPUTERMY COMPUTER
MY COMPUTER
ashantharuka
 

Similar to Fundamentals of Computers (20)

Know your computer
Know your computerKnow your computer
Know your computer
 
Introduction to Computer and its features
Introduction to Computer and its featuresIntroduction to Computer and its features
Introduction to Computer and its features
 
E 100_p
E  100_pE  100_p
E 100_p
 
computer organisation architecture.pptx
computer organisation architecture.pptxcomputer organisation architecture.pptx
computer organisation architecture.pptx
 
Computers
ComputersComputers
Computers
 
Basics of computer
Basics of computerBasics of computer
Basics of computer
 
Computer hardware
Computer hardwareComputer hardware
Computer hardware
 
computer literacy chapter2.pptx
computer literacy chapter2.pptxcomputer literacy chapter2.pptx
computer literacy chapter2.pptx
 
MODULE 2.pptx
MODULE 2.pptxMODULE 2.pptx
MODULE 2.pptx
 
Unit I.ppt
Unit I.pptUnit I.ppt
Unit I.ppt
 
unit-i-computer-organization and architecture.ppt
unit-i-computer-organization and architecture.pptunit-i-computer-organization and architecture.ppt
unit-i-computer-organization and architecture.ppt
 
bachlor of computer application pc assembly and troubleshooting
bachlor of computer application pc assembly and troubleshootingbachlor of computer application pc assembly and troubleshooting
bachlor of computer application pc assembly and troubleshooting
 
Neethu Narayanan- Fundamentals of computer
Neethu Narayanan- Fundamentals of computerNeethu Narayanan- Fundamentals of computer
Neethu Narayanan- Fundamentals of computer
 
PC for Managers
PC for ManagersPC for Managers
PC for Managers
 
Computer architecture pptx
Computer architecture pptxComputer architecture pptx
Computer architecture pptx
 
I.T for Management: What is a computer and how does it work
I.T for Management: What is a computer and how does it work I.T for Management: What is a computer and how does it work
I.T for Management: What is a computer and how does it work
 
What is computer and how it works
What is computer and how it worksWhat is computer and how it works
What is computer and how it works
 
Generation of computer
Generation of computerGeneration of computer
Generation of computer
 
SPC Unit 1
SPC Unit 1SPC Unit 1
SPC Unit 1
 
MY COMPUTER
MY COMPUTERMY COMPUTER
MY COMPUTER
 

More from Ankur Kumar

Mobile Computing (Part-2)
Mobile Computing (Part-2)Mobile Computing (Part-2)
Mobile Computing (Part-2)
Ankur Kumar
 
Mobile Computing (Part-1)
Mobile Computing (Part-1)Mobile Computing (Part-1)
Mobile Computing (Part-1)
Ankur Kumar
 
Be Creative
Be CreativeBe Creative
Be Creative
Ankur Kumar
 
Tcp IP Model
Tcp IP ModelTcp IP Model
Tcp IP Model
Ankur Kumar
 
Trade Mark
Trade MarkTrade Mark
Trade Mark
Ankur Kumar
 
E commerce
E commerceE commerce
E commerce
Ankur Kumar
 
Gsm network
Gsm networkGsm network
Gsm network
Ankur Kumar
 
Digital modulation
Digital modulationDigital modulation
Digital modulation
Ankur Kumar
 
Quadric surfaces
Quadric surfacesQuadric surfaces
Quadric surfaces
Ankur Kumar
 
Computer , Internet and physical security.
Computer , Internet and physical security.Computer , Internet and physical security.
Computer , Internet and physical security.
Ankur Kumar
 
Mobile Phone and SIM card cloning
Mobile Phone and SIM card cloningMobile Phone and SIM card cloning
Mobile Phone and SIM card cloning
Ankur Kumar
 
Termes - Termite inspired robots that can build for us.
Termes - Termite inspired robots that can build for us.Termes - Termite inspired robots that can build for us.
Termes - Termite inspired robots that can build for us.
Ankur Kumar
 
Illumination model
Illumination modelIllumination model
Illumination model
Ankur Kumar
 
Hidden lines & surfaces
Hidden lines & surfacesHidden lines & surfaces
Hidden lines & surfaces
Ankur Kumar
 
Tracking positioning-of-mobiles
Tracking positioning-of-mobilesTracking positioning-of-mobiles
Tracking positioning-of-mobiles
Ankur Kumar
 
Tracking and positioning_of_mobile_systems_in_telecom_network
Tracking and positioning_of_mobile_systems_in_telecom_networkTracking and positioning_of_mobile_systems_in_telecom_network
Tracking and positioning_of_mobile_systems_in_telecom_network
Ankur Kumar
 

More from Ankur Kumar (16)

Mobile Computing (Part-2)
Mobile Computing (Part-2)Mobile Computing (Part-2)
Mobile Computing (Part-2)
 
Mobile Computing (Part-1)
Mobile Computing (Part-1)Mobile Computing (Part-1)
Mobile Computing (Part-1)
 
Be Creative
Be CreativeBe Creative
Be Creative
 
Tcp IP Model
Tcp IP ModelTcp IP Model
Tcp IP Model
 
Trade Mark
Trade MarkTrade Mark
Trade Mark
 
E commerce
E commerceE commerce
E commerce
 
Gsm network
Gsm networkGsm network
Gsm network
 
Digital modulation
Digital modulationDigital modulation
Digital modulation
 
Quadric surfaces
Quadric surfacesQuadric surfaces
Quadric surfaces
 
Computer , Internet and physical security.
Computer , Internet and physical security.Computer , Internet and physical security.
Computer , Internet and physical security.
 
Mobile Phone and SIM card cloning
Mobile Phone and SIM card cloningMobile Phone and SIM card cloning
Mobile Phone and SIM card cloning
 
Termes - Termite inspired robots that can build for us.
Termes - Termite inspired robots that can build for us.Termes - Termite inspired robots that can build for us.
Termes - Termite inspired robots that can build for us.
 
Illumination model
Illumination modelIllumination model
Illumination model
 
Hidden lines & surfaces
Hidden lines & surfacesHidden lines & surfaces
Hidden lines & surfaces
 
Tracking positioning-of-mobiles
Tracking positioning-of-mobilesTracking positioning-of-mobiles
Tracking positioning-of-mobiles
 
Tracking and positioning_of_mobile_systems_in_telecom_network
Tracking and positioning_of_mobile_systems_in_telecom_networkTracking and positioning_of_mobile_systems_in_telecom_network
Tracking and positioning_of_mobile_systems_in_telecom_network
 

Recently uploaded

Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 

Recently uploaded (20)

Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 

Fundamentals of Computers

  • 2. What is Computer? • Derived from word ‘compute’. • A computer is an electronic device that takes data and instructions as input, processes the data and produces useful information as output. Data Input Output Process Information • So the electronic device is known as hardware and the set of instructions is known as software. Instructions
  • 3. Characteristics of Computer • Speed • Accuracy • Diligence • Versatile • Power of remembering • No IQ • No feeling
  • 4. History of Computers • First Calculating machine: Abacus means calculating board. • Mechanical device Napier Bones for the purpose of multiplication. • Slide rule for addition, subtraction, multiplication and division. • Pascal’s adding and subtractory machine. • Leibniz’s multiplication and dividing machine. • Charles babbage’s analytical engine. • Mechanical and electrical calculator to perform all type of calculation. • Modern electronic calculator.
  • 5. Generations of Computer • Each generation is distinguished from others on the basis of the type of switching circuits used. • Computers can be categorized into 5 generations: • First Generation (1940-1956) Vacuum tubes used to build circuitry for computer Used to perform calculation in milliseconds. Very large in size. Used machine language to perform operations. Used to take inputs from punch cards and output on paper. Computers of first generation were: ENIAC, EDVAC and UNIVAC-1. ENIAC is the first electronic computer.
  • 6. Contd..  Second Generation (1956-1963) Transistors used to build circuitry for computers. Smaller in size and faster than the first generation computers. Concept of Central Processing Unit (CPU), memory, programming language and input and output units came into picture. Used assembly language to give instructions. Programming languages such as COBOL, FORTRAN were developed during this period. Computers of second generation were: IBM 1620, CDC1604, PDP8 etc.
  • 7. Contd..  Third generation (1964-1971) They used integrated circuits (IC). IC is a silicon chip that embeds an electronic circuit. Size reduced and speed increased. BASIC (Beginners All purpose Symbolic Instruction Code) was developed during this period. Used keyboard as input device and monitor for output. Third generation computer includes IBM 370, PDP11 and CDC 7600.
  • 8. Contd.. • Fourth generation (1971-till date): Used large scale integrated circuit. The concept of microprocessor came. Techniques to connect the computers established i.e. LAN, WAN. Operating systems came into existence such as: DOS, Windows. High level programming languages were introduced. Graphical user interface based application. High storage capability and cheaper. Example of fourth generation computer is Personal Computer.
  • 9. Contd.. • Fifth generation (1980- future) Use of ultra large scale integration technology. High speed. Parallel processing. Portable mass storage medium e.g. CD-ROM. No requirement of assembling the different components of computer. Portable computers. Based on Artificial intelligence such as voice recognition system.
  • 10. Classification of Computers • Computers can be classified in following categories based on their computing capability, size, number of users and speed: 1.Microcomputers 2.Minicomputers 3.Mainframe Computers 4.Supercomputers
  • 11. Microcomputers • It has microprocessor as its CPU. • It performs the following operations: 1. Inputting 2. Storing 3. Processing 4. Outputting 5. Controlling • Examples of microcomputers is IBM-PC.
  • 12. Minicomputers • Medium sized computers. • Designed to be serve multiple users simultaneously. • Used as servers in LAN. • It has large storage capacity and operates at higher speed.
  • 13. Mainframe Computers • Very high speed and storage capacity. • They are placed in central location and are connected to several user terminals. • Larger and expensive. • Generally used in centralized databases. • Can also be used as controlling node in WAN. • Example of Mainframe computer is: IBM 3000 series.
  • 14. Supercomputer • Fastest and most expensive machines. • It is built by interconnecting hundreds of microprocessors. • It supports multiprocessing and parallel processing. • Mainly used for weather forecasting, biomedical research, aircraft design etc. • Example of super computer is: CRAY XMP.
  • 15. Basic Terms of Computer System • Computer System is basically divided into 2 parts: 1. Hardware 2. Software • Hardware refers to physical parts of computer system and software refers to set of instructions for computer to perform some task.
  • 16. Computer Organization • 4 logical units in every computer: • Input unit • Obtains information from input devices (keyboard, mouse) • Output unit • Outputs information (to screen, to printer, to control other devices) • Memory unit • Rapid access, low capacity, stores input information • Central processing unit (CPU) • Supervises and coordinates the various components of the computer • Performs arithmetic calculations and logic decisions
  • 17. Anatomy of Computer System • Keyboard • Mouse Input devices • Scanner • Monitor • Printer Output Devices • Speaker • Primary Memory • Secondary Memory Memory Management • Control unit • Arithmetic logical unit Processing units • Motherboard
  • 18. Keyboard • Keypad contains: • Alphabets • Numbers Alphanumeric keys • Special Symbols s.a. page up, page down, home, end etc. • Function Keys s.a. F1, F2 etc. performs a specific task. • Modifier keys s.a. ctrl, shift. • Space bar and escape key • Numeric keypad • qwert Keyboard (Typewriter Keyboard). • On key press it sends a code (ASCII Code) to the CPU.
  • 19. Mouse • Known as Pointing & Click Device. • Two / Three Buttons • Wheel / Optical Mouse • Normally Left Click – Select/ Run Right Click – Popup Menu
  • 20. Scanner  Input Device, Converts a hard copy into a computer file (digitized image).  Used to Scan Signatures, Photographs, documents etc.  Digitized image can be black & white or colored.  For colored images each image is considered as collection of dots with each dot representing the combination of red, green, blue in different proportion.  Nowadays Scanners with OCR produces editable documents.
  • 21. Monitor  Output device  It produces visual displays generated by the computer.  It is connected to some part of the CPU through cables.  The monitor can be classified as CRT (Cathode Ray Tube) and LCD (Liquid Crystal Display).  A monitor is characterized by its monitor size and resolution.
  • 22. Printer  Output Device  Produces hard copy of the electronic text.  Types:  Dot Matrix: used in low quality and high volume applications.  Inkjet: slower than dot matrix but produces high quality printouts.  Laser: consists of microprocessor, ROM and RAM that can store the textual information.  Printer and computer is connected using cable, the computer converts the document that is understandable by the printer using print driver software.
  • 23. Speaker • Output device. • It converts an electrical signal into sound. • Audio drivers need to be installed to produce the audio output. • Speakers are either in-built in the computer or attached externally to the computer.
  • 24. Primary Memory  Primary memory is the built in unit of the computer.  The data is stored in machine understandable binary format in the memory.  The types of primary memory are: ROM --permanent memory --non-volatile. --a chip inserted in motherboard. --stores the BIOS which performs POST(power on self test). RAM --It is read/write memory. --volatile.
  • 25. Contd.. Cache Memory -- It stores the data and application that was last processed by the CPU. --When CPU performs processing, it first searches the cache and then RAM.
  • 26. ROM types  There are 3 types of ROM: PROM: Programmable ROM i.e. a memory chip on which data can be written only once. It is manufactured as blank memory. EPROM: Erasable PROM i.e. a special type of PROM that can be erased by exposing it to UV light. EEPROM: Electric Erasable PROM i.e. similar to PROM but requires electricity to be erased.
  • 27. RAM types • SRAM: It is static RAM. It is faster, expensive and consumes less power. SRAM is used in cache memory. • DRAM: It is dynamic RAM. It is slower, cheaper and consumes less power. DRAM is widely used in main memory.
  • 28. Secondary Memory • They represent the external storage devices connected to the computer. • Non-volatile memory. • Stores information that is not in use currently. • Classification of secondary storage: --Magnetic storage device includes floppy disk, hard disk etc. --Optical storage device includes CD-ROM, CD-RW, DVD-ROM etc. --Magneto-optical storage device includes
  • 29. Hard Disk • Non-removable storage device. • Several Circular Magnetic Disks are housed in a single case. • Data is stored as 1s & 0s. • Typical Capacity is 20 GB -80 GB
  • 30. Floppy Disk • Magnetic Memory Device. • Removable storage. • A single circular mylar plastic disk, coated with magnetic material is packed in a protective plastic casing. • Typical size is 3.5” & Capacity is 1.44MB
  • 31. CD-ROM • Optical Device. • Removable Storage. • Read Only Memory. • Typical Capacity is 550 Mb – 800MB
  • 32. Processing in a Computer (Computer Architecture)
  • 33. CPU • a central processing unit (CPU) consists of • an arithmetic/logic unit (ALU) where math and logic operations are performed, • a control unit which directs most operations by providing timing and control signals, • and registers that provide short-term data storage and management facilities.
  • 34. ALU • A : The type of operation that the ALU needs to perform is determined by signals from the control unit . • B: The data can come either from the input unit, or • C: from the memory unit. • D: Results of the operation can either be transferred back to the memory unit or • E: directly to the output unit .
  • 35. Role of RAM in processing  stores instructions and/or data.  Memory is divided into an array of "boxes" each containing a byte of information.  A byte consists of 8 bits.  A bit (binary digit) is either 0 (OFF) or 1 (ON).  The memory unit also serves as a storage for intermediate and final results of arithmetic operations.  F : Control signal (a read or a write operation).  G : A location in memory  H : Input to memory data lines when the control signal J is enabled.  I : Memory to the output unit when the control signal L is enabled.
  • 36. Control Unit • CU transfers the data and the instruction of the corresponding operation to the ALU stored with it. • It fetches an instruction from memory by sending an address (G) and • a read command (F) to the memory unit. • The instruction word(s) stored at the memory location specified by the address is then transferred to the control unit (K). • After decoding this instruction, the control unit transmits the appropriate signals to the other units in order to execute the specified operation. • This sequence of fetch and execute is repeated by the control unit until the computer is either powered off or reset.
  • 37. Motherboard • It refers to a device used for connecting the CPU with the input and output devices. • Some of the components of a motherboard are: Buses System clock Microprocessor
  • 38. Contd.. • Buses: It is an electrical path that transfers data and instructions among different parts of computer. The bus can be data bus or address bus. • System clock: It is a clock used to synchronize the activities performed by the computer. • Microprocessor: CPU component that performs the processing and controls the activities performed by different part of computer.
  • 39. Software  Software includes application software and system software.  Application software is a program designed for the end users.  Example of application softwares are MS word, MS Excel etc.  System software is designed to operate computer hardware and to provide the platform for running application software.  Example of system software are: operating system, compilers, interpreters, assemblers and other utility programs.
  • 40. Operating System • OS is system software, which may be viewed as collection of software consisting of procedures for operating the computer. • It provides an environment for execution of programs (application software). • It’s an interface between user & computer.
  • 41. Contd.. Computer Machine/Hardware Machine Language (Low Level Language) Operating System Human Understandable Language (High Level Language) User / Programmer
  • 42. Types of OS  Batch Operating System: only one program is allowed to run at a time. No modification of data while program is in running state. If an error is encountered, start the program from scratch. Example: DOS  Interactive Operating System: It also can run only one program at a time. Modification and entry of data allowed while program is running. Example: Multiplexed Information and Computing Services.
  • 43. Contd..  Multiuser Operating System: Allows multiple user to use the system at the same time or at different times. Example: Linux, Windows 2000.  Multi-Tasking Operating System: Allows more than one program to run at the same time. Example: Unix and Windows 2000.  Multithreading Operating System: Allows running of different parts of a program at the same time. Example: Unix, Linux.
  • 44. DOS Operating System  Short form for Microsoft Disk Operating System.  Command line user interface.  Now a days it is not used as a stand alone product, it comes as an integrated product with Windows.  In MS-DOS one need to write the commands to accomplish some task. The commands are categorized into 3 classes: Environment command: CLS, TIME, DATE, VER etc. File Manipulation command: COPY, DEL, TYPE, DIR etc. Utilities: FORMAT, EDIT etc.
  • 45. UNIX Operating System • Unix controls all the commands generated from the user keyboards as well as the data generated in such a way that each user believes that he/she is the only person working on the computer. • It is written in C language. • The properties of Unix are: Multi user and multi tasking capability, portability, flexibility, security etc.
  • 46. Architecture of Unix  Hierarchical architecture.  Has several layers and each layer provides a unique function as well as maintains interaction with lower layers.  The layers of Unix operating system are: Kernel Service Shell User applications
  • 47. Contd.. User Applications Shell (Library Routines) Service Layer (process, memory, I/O services and file management Kernel (Scheduler, Device Driver, I/O Buffer) Hardware
  • 48. Kernel • Kernel enables a user to access the hardware with the help of system call. • Other functions of kernel are: Initiating and executing different programs at the same type. Allocating the memory. File handling. Sending and receiving information on network.
  • 49. Service layer • Requests are received from the shell and they are transformed into commands to the kernel. • It consists of many programs to provide various services. • It provides services such as: Access to I/O devices. Access to storage devices. File manipulation activities.
  • 50. Shell  Interface between the user and computer.  Also known as command interpreter and utility layer.  Primary function of the shell is to read the data and instructions from the terminal, execute the command and show the output.  Various shells are found in UNIX OS: Bourne shell C shell Korn shell Restricted shell
  • 51. User Applications • Used to perform several tasks and communication with other users of UNIX. • Includes Database management, software development , text processing and electronic communication etc.
  • 52. Networking Concepts • Computer network refers to interconnection of group of computers. • Different types of computer networks are: LAN (Local Area Network) MAN (Metropolitan Area Network) WAN (Wide Area Network)
  • 53. LAN • Privately owned Network. • It is limited to few kilometers. • It uses twisted pair cable, coaxial cable and optical fiber. • It adopts the topologies as: bus, ring and star. • Normally it works at the speed of 100-1000 Mbps.
  • 54. MAN and WAN • It connects the computers over a large geographical area such as district or city. • 2 or more interconnected LANs can be said MAN. • A network that spans across a country or across the world is called WAN.
  • 56. Introduction • How do you communicate data to computers? • How do the computers store and process data?
  • 57. Binary Number System • Binary system is a numeral system that represents numerical values using only 2 digits: 0 and 1 which are known as bits. • The base of the binary number system is 2. • All decimal numbers that a user enters in a computer system are first converted into binary numbers then the arithmetic operations are performed on them. The results are again converted into its decimal equivalent and are displayed to the user.
  • 58. Contd… • In computer system numbers can be represented in two ways: --signed --unsigned • In signed number, MSB represents the sign of the number. • If MSB is 0 then number is positive, if 1 then number is negative. • For example: 11111111 in unsigned is 255 and in signed it is -127.
  • 59. Binary Codes • Various binary codes are used to encode statements that consists of letters in numeric and symbol form. • Commonly used binary codes are: -- Binary Coded Decimal (BCD code) -- American Standard Code for Information Interchange (ASCII) code.
  • 60. Contd.. • In BCD, each decimal digit is represented by a binary code of 4 bits. • For example: decimal number is 127. So in BCD it will be: 0001 0010 0111. • ASCII is a standard alphanumeric code that represents numbers, alphabetic characters and symbols using a 7 bit code format. It consists of 128 decimal numbers ranging from 0 to 127 assigned to letters, numbers, punctuation marks and some special characters.
  • 62. Decimal (base 10) and binary (base 2) • Decimal • Uses positional representation • Each digit corresponds to a power of 10 based on its position in the number • Binary • Two digits: 0, 1 • To make the binary numbers more readable, the digits are often put in groups of 4
  • 63. Octal (Base 8) and Hexadecimal (Base 16)  Octal  8 digits are used-0,1,2,3,4,5,6,7.  Each digit corresponds to a power of 8 based on its position in the number .  Hexadecimal  Shorter & easier to read than binary  16 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F  “0x” often precedes hexadecimal numbers
  • 64. Decimal to base ‘n’ Conversions • Consider the integer and fractional parts separately. • For the integer part, • Repeatedly divide the given number by base n, and go on accumulating the remainders, until the number becomes zero. • Arrange the remainders in reverse order. • For the fractional part, • Repeatedly multiply the given fraction by n. • Accumulate the integer part. • Arrange the integer parts in the order they are obtained.
  • 65. Decimal to Binary  125.35 to binary?  125 /2= 62 remainder-1 62/2=31 remainder-0 31/2=15 remainder-1 5/2=7 remainder-1 7/2=3 remainder-1 3/2=1 remainder-1 ½=0 exit  Now .35 in binary will be: .35*2=0.70 keep 0 .70*2=1.4 keep 1 .40*2=0.80 keep 0  So 125.35 in binary is: 1111101.010
  • 66. Decimal to Octal • 125.35 in base 8? • 125/8= 15 remainder-5 15/8=1 remainder-7 .35*8= 2.8 keep 2 .8*8=6.4 keep 6 .4*8=3.2 keep 3 .2*8=1.6 keep 1 • So 125.35 in base 8 is: 175.2631.
  • 67. Decimal to Hexadecimal • 125.35 in hexadecimal? • 125/16=7 remainder-13 (D) 7/16=0 remainder-7 .35*16=5.6 keep 5 .6*16=9.6 keep 9 • 125.35 in hexadecimal is 7D.59.
  • 68. Binary to Decimal • 1010 = 1 * 23 + 0 * 22 + 1 * 21 + 0 * 20 = 8 + 2 = 10 • 1100 1001 = 1 * 27 + 1 * 26 + 1 * 23 + 1 * 20 = 128 + 64 + 8 + 1 = 201
  • 69. Octal to Decimal • 563.21 in decimal will be: 80 *3+ 81 *6+ 82*5+ 8-1 * 2+ 8-2 * 1 3+ 48 +320+.25+.016 371.266
  • 70. Hexadecimal to decimal • Shorter & easier to read than binary • 16 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F • “0x” often precedes hexadecimal numbers • 0x123 = 1 * 162 + 2 * 161 + 3 * 160 = 1 * 256 + 2 * 16 + 3 * 1 = 256 + 32 + 3 = 291 • Another example • 0xABC = A * 162 + B * 161 + C * 160 = 10 * 256 + 11 * 16 + 12 * 1 = 2560 + 176 + 12 = 2748
  • 71. Binary to Octal Convert 10001100101001 to octal:- STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary: 010 001 100 101 001 71
  • 72. 214510 = 8 010 001 100 101 0012 STEP TWO: Convert each triplet to its single-digit octal equivalent. (HINT: For each triplet, the octal conversion is the same as converting to a decimal number): 010 001 100 101 001 2 1 4 5 1 72
  • 73. Binary to Hexadecimal • Consider Binary: 1000100100110111 STEP 1 Break the Byte into 'quartets' - 1000 1001 0011 0111 STEP 2 Use the table above to covert each quartet to its Hex equivalent - 8937 • Therefore ... 1000100100110111 = 8937
  • 74. Octal to Hexadecimal • step 1: first convert octal to binary. step 2: convert binary to hexadecimal. • convert octal 1057 to hexadecimal: • 1 0 5 7 001 000 101 111 0010 0010 1111 2 2 15 (F)
  • 75. Octal to binary • For instance, convert binary 1010111100 to octal: 001 010 111 100 1 2 7 4 Therefore, 10101111002 = 12748. • Convert binary 11100.01001 to octal: 011 100 . 010 010 3 4 . 2 2 Therefore, 11100.010012 = 34.228.
  • 76. Hexadecimal to binary • Convert 0A2B.F to binary: 0 in binary-0000 A in binary-1010 2 in binary-0010 B in binary-1011 F in binary- 1111 so hex equivalent is: 0000 1010 0010 1011.1111
  • 78. Binary Addition • 0 + 0 = 0 • 0 + 1 = 1 • 1 + 0 = 1 • 1 + 1 = 10 + 0 1 0 0 1 1 1 10 78
  • 79. • 1111 carry • 111101 100111+ 1100100 79 1 1 1 (carry) 0 1 1 0 1 1 0 1 1 1+ ------------- 1 0 0 1 0 0
  • 80. Binary Subtraction • 0 - 0 = 0 • 0 - 1 = borrow 1 from MSB • 1 - 0 = 1 • 1 - 1 = 0 - 0 1 0 0 Borrow 1 from MSB 1 1 0 80
  • 81. Example of Subtraction 111 • 110011<- minuend - 10110<- subtrahend 011101 • 11100 -10111 101
  • 82. Multiply Binary numbers  0 * 0 = 0  0 * 1 = 0  1 * 0 = 0  1 * 1 = 1 82 * 0 1 0 0 0 1 0 1
  • 83. Multiply 1011 and 1010 • 1 0 1 1 × 1 0 1 0 --------------- 0 0 0 0 1 0 1 1 0 0 0 0 + 1 0 1 1 ------------------ 1 1 0 1 1 1 0 83
  • 84. Dividing Binary Numbers ___________  1 0 1 ) 1 1 0 1 1 − 1 0 1 ----- 0 1 1 − 0 0 0 ----- 1 1 1 − 1 0 1 ----- 1 0
  • 85. Complement • There are two types of complements for a number of base r, called r ’s complement and r-1 ‘s complement. • For example: for decimal numbers the base is 10 and complements are 10’s and 9’s complement. For binary numbers the base is 2 and complements are 2’s and 1’s complement.
  • 86. Decimal Number Complements • 9’s complement of the decimal number N=(10n-1)-N=n(9’s)-N • 10’s complement of the decimal number N=9’s complement+1 • Example 1: 9’s complement of 134795? 999999 -134795 ----------------- 865204 10’s complement of 134795 is 865204+1=865205.
  • 87. Contd.. • Example 2: find the 9’s and 10’s complement of 00000000. 9’s complement of 00000000 is : 99999999 -00000000 ------------- 99999999 10’s complement of 00000000 is: 99999999+1=100000000-> discard 1 since we have 8 bit representation only.
  • 88. Binary Number Complements  1’s complement of a number N is: (2n-1)-N. Simply inverting the digits of a number N gives the 1’s complement of the binary number.  2’s complement of a number N is: 1’s complement of the number N + 1.  For example: 1’s complement of 110100101 is: 001011010. 2’s complement of 110100101 is: 001011010+1=001011011.
  • 89. Subtraction using 10’s complement • Perform 76425-28321. find 10’s complement of 28321=(99999-28321)+1 =71679 add 10’s complement to first number: 76425+71679= =148104 discard 1, so result is: 48104. • Perform 28531-345920. find 10’s complement of 345920= (999999- 345920)+1=654080 add 10’s complement to first number: 28531+654080=682611 find the 10’s complement of the result=(999999- 682611)+1=317389 append – sign with the result: -317389.
  • 90. Subtraction using 2’s complement  Perform 11010011-10001100 find 2’s complement of 10001100: 01110011+1=01110100. add this result to the first number: 01110100+11010011 = 101000111 Ignore the last carry : 01000111.  Perform 10001100-11010011 find 2’s complement of 11010011: 00101100+1=00101101. add this result to the first number: 00101101+10001100 =10111001 change MSB to 0: 00111001 find 1’s complement of above result: 11000110 add 1 to the result: 11000110+1: 11000111-> MSB indicates a negative value.
  • 91. Subtraction using 9’s complement  Perform 76425-28321. find 9’s complement of 28321: 99999-28321=71678 add the above result to the first number: 71678 +76425 -------- 148103 +1 ---------------- 48104 -----------------
  • 92. Subtraction using 1’s complement  Perform 11010011-10001100. 1’s complement of 10001100: 01110011 add the result to first number: 11010011 +01110011 ------------- 101000110 +1 --------------- 101000111 ---------------
  • 93. Example Q.1. Express -4 in 2’s complement form. Ans. Positive expression of number=0000 0100 1’s complement=1111 1011 add 1= 1111 1100.
  • 94. Floating Point Representation • Represented in normalized form. • A floating point number whose mantissa doesn’t contain zero as the most significant digit of the number is considered to be in normalized form. • For example: + 370 in BCD is: 0000 0011 0111 0000 is in normalized form because leading zeros are not part of a zero digit. • Several times the number is written as a fraction multiplied by a power of 10. fractional part is known as ‘mantissa’ and the power of 10 is known as ‘exponent’. E.g. 145.78, 0.23765* 103.
  • 95. Binary Floating Point Number • A binary floating point number is represented by: mantissa * 2 exponent Where mantissa is a binary fraction with a non zero leading bit. • With the floating point representation, the following factors have to be decided: -- total no. of bits used for representing the mantissa. -- total no. of bits used for representing the exponent. -- whether to use a base other than 2 for the exponent. • A representation of floating point numbers in a 32 bit comSpigun t(e0r) word is shEoxwponn ebnet l(o1-w7): Mantissa (8-31)
  • 96. Programming Language : Definition • A vocabulary and set of grammatical rules for instructing a computer to perform specific tasks. • The set of instructions are written to tell the computer: what operation to perform Where to locate data How to present results When to make certain decisions
  • 97. Evolution of Programming languages • First Generation : Machine languages • Computers can understand only pulse and no pulse means 1 and 0. This binary code is called machine code or machine language. They are directly executable program. • Computers don’t understand English, Hindi or Tamil. • Machine language poses 3 problems: 1. It is difficult to understand and remember the various combinations of 0’s and 1’s. 2. It is difficult for one computer to communicate with other computers since every machine has its own machine language. 3. It is machine dependent.
  • 98. Contd.. - Second generation language (Assembly Languages)  It is also low level language and machine dependent.  Its instruction consists of mnemonic code followed by 0 or more operands.  The mnemonic code used in assembly language is also known as ‘opcode’ which specifies the operation to be performed on given arguments.  Translated via assemblers.  Advantages of Assembly language are: 1. Easy to locate the error. 2. Easy to write code in assembly language than in machine language.
  • 99. High Level Languages - User friendly and machine independent - Third Generation (procedure oriented languages)  High level languages designed to solve general purpose problems are called procedural languages.  Uses mathematical notations (translated via compilers)  They include COBOL, Pascal, FORTRAN, BASIC,C, C+ +,Java etc.The syntax used in every language is different. Another advantage is that they are portable.
  • 100. Contd.. - Fourth Generation (problem oriented languages)  Used to solve specific problems.  They include query languages, report generators and application generators.  A single statement in 4 GL can perform the same task as multiple lines in 3 GL. For example: to create button, we just drag the button from tool bar in 4 GL while we have to write code for creating a button in 3 GL.
  • 101. Contd.. - Fifth Generation (Natural languages) • Designed to make a computer to behave like an expert and solve problems. • LISP and PROLOG are mainly used to develop Artificial Intelligence and expert system.
  • 103. Programming Environment • It comprises all those components that facilitate the development of a program. • These components are divided into two categories: Programming Tools and Application Program Interface (API). • API can be defined as a collection of data structures, classes, protocols and pre defined functions in form of libraries. These libraries can be included in the software packages of programming languages like C, C++ etc.
  • 104. Contd.. • A software application which is used for the development, maintenance and debugging of a software program is known as programming tool. • There are some categories of programming tools:  Integrated Development tool: contains compiler, editor, debugger etc. Debugging Tool: helps to detect and remove bugs or error from a program. Memory usage Tool: helps to manage the memory resources efficiently.
  • 105. Life cycle of a program development • The entire program development is divided into a number of phases: Requirement Analysis phase Design phase Implementation phase Testing phase Maintenance phase
  • 106. Programming Paradigm • To solve a problem there are different programming approaches: Procedural programming Modular programming Object oriented programming
  • 107. Procedural programming • The problem is viewed as a sequence of things to be done such as reading, calculating & printing. • Data is not given importance in this methodology. Data moves openly from one function to another. E.g. A payroll program, a function is not important that displays or checks data but the data in itself is more important. Global Data Global Data Function 1 Local data Function 2 Local data Function 3 Local data
  • 108. Modular Programming  With increasing size of program, a single list of instructions is a very inappropriate manner of programming.  So a program is divided into smaller units called functions (subprograms).  When we group a number of functions together into a large entity is called module.  Grouping of functions is done according to specific tasks. Data is hidden between different modules.
  • 109. Object oriented programming • The idea behind this is to combine data and instructions that operate on that data. Such a unit is called an object. • Treats data as critical element. It doesn’t allow the data to move freely around the system. Objects may communicate through functions. Object A Object B Data Functions Data Functions Communication
  • 111. Assembler  Instructions written in assembly language must be translated to machine language instructions or object code :  Assembler does this  One to one translation : One AL instruction is mapped to one ML instruction.  AL instructions are CPU specific.  Assemblers are classified in two categories: single pass and two pass assemblers.
  • 112. Compiler  Instructions written in high-level language also must be translated to machine language instructions :  Compiler does this  Generally one to many translation : One HL instruction is mapped to many ML instruction.  HL instructions are not CPU specific but compiler is.  Compiled languages include COBOL, FORTRAN, C, C++ etc.  Compilers are also classified as single pass and multi pass compilers.
  • 113. Interpreter • A translation program that converts each high level program statement into the corresponding machine code. • Instead of the entire program, one statement at a time is translated and executed immediately.
  • 114. Difference between compilation and interpretation
  • 115. Linkers • Linkers and loaders are important part of any translator program. • Linker: Also known as binder. It is a program that combines object modules to form an executable program. Source file Source file Source file Source file Object file Object file Object file Object file Runtime linker library Executable program
  • 116. Loaders • It is an Operating system utility that copies programs from a storage device to main memory where they can be executed. • Loader is responsible for loading the Operating system also.
  • 119. Steps to solve a Problem  Analyze the problem.  Divide the process used to solve the problem in a series of tasks.  Formulate the algorithm to solve the problem.  Convert the algorithm in computer program.  Write the program in computer.  Input the data.  Program operates on input data.  Result produced.  Send the generated result to output unit to display it to user.
  • 120. Techniques to solve the problem • There are 2 important techniques to solve the problem: Algorithms Flow Chart • Algorithm is a complete, detailed and precise step by step method to solve a problem independent of the software or hardware of the computer. • Flow chart is the pictorial representation of the algorithm depicting the flow of the various steps.
  • 121. Top down approach of algorithms • Also known as divide and conquer. • In this approach problem is divided into 2 or more sub problems. The solution of each sub problem is taken out independently. Finally, the solution of all sub problem is combined to obtain the solution of the main problem. • Example of top down approach is binary search.
  • 122. Program verification • Suppose we have coded a program for finding the average of 3 numbers, now we want to verify the coded program is correct or not. • This can be verified by implementing the program on a given list of data. • Implement the same program twice or thrice on the given list for different elements. If the program gives the correct result, then it is verified that the program is correct.
  • 123. Efficiency of an algorithm (Termination and Correctness) • Efficiency of an algorithm means how fast an algorithm can produce the result for a given problem. • The efficiency of an algorithm depends on the time and space complexity. • Space complexity of an algorithm refers to the amount of memory required by the algorithm for its execution and generation of the final output. • Time complexity refers to the amount of computer time required by an algorithm for its execution.
  • 124. Analysis of an algorithm • The analysis of an algorithm determines the amount of resources such as time and space required by it for its execution. • The complexity of an algorithm is estimated by asymptotic notations. • Asymptotic notations: they are represented in terms of function T(n), where n is the set of natural numbers i.e. 1,2,3,..n.
  • 125. Asymptotic notations • Θ notation: represents the average case running time. • O notation: represents worst case running time i.e. upper bound. • Ω notation: represents best case running time i.e. lower bound.
  • 127. Example 1: to find the simple interest Algorithm: 1. Start 2. Read the name of the person, balance and rate of interest. 3. Calculate the interest= balance * rate. 4. Output the name of the person and interest amount. 5. Stop.
  • 129. Example 2: to compute sum, average and product of 3 numbers Algorithm: 1.Start. 2.Read 3 numbers such as X, Y and Z. 3.Find the sum of X, Y and Z say S=X+Y+Z. 4.Compute the average say A=S/3. 5.Compute the product say P= X*Y*Z. 6.Output S, A, P. 7.Stop.
  • 130. Example 2: Flow chart
  • 131. Switching Logics • Switching logic consists of two components - a condition and a goto command depending on the result of the condition test. The computer can determine the truth value of a statement involving one of six mathematical relations symbolized in the table below: Symbol Meaning == Equals != Not Equal < Less than <= Less than or equal to > Greater than >= Greater than or equal to
  • 132. Example 3: to read two numbers in decreasing order Algorithm: 1.Start. 2.Read two numbers say A and B. 3.If A< B 4. BIG=B 5. SMALL=A 6.ELSE 7.BIG=A 8.SMALL=B. 9.Output BIG, SMALL. 10.STOP.
  • 133. Example 3: Flow Chart
  • 134. Example 4: Repetition (to count from 1 to 10) Algorithm: 1.Start. 2.Initialize a counter k=1. 3.While k<=10 4. print k. 5. k =k+1. 6.Stop.
  • 135. Example 4: Flow Chart
  • 136. Example 5: to find the factorial of a number Algorithm: 1.Start. 2.Input the number say N. 3.Initialize a variable say F=1 and a counter say M=1. 4.While M!=N 5. Find F=F*M. 6. M=M+1. 7.Output F. 8.Stop.
  • 137. Example 5: Flow Chart
  • 138. Tracing the Algorithm • To give the description of a program specifying the type of code, actual codes and its corresponding description is known as tracing an algorithm. • For example: int num1, num2; type: declaration statement code: int num1, num2; description: declares the integer type variables to store the values entered by the user.
  • 139. Overview of C Language  A structured, high level, case sensitive and machine independent language.  C was evolved by Dennis Ritchie in 1972.  C compiler combines the capabilities of an assembly language with the features of a high level language.  C is highly portable.  C is well suited for the structured programming.
  • 140. Basic structure of a C program Documentation Section Link Section Definition Section Global Declaration Section main() function section { Declaration part Executable part } Subprogram Section (user defined functions)
  • 141. Sample Program 1 #include<stdio.h> #include<conio.h> void main() { /* print the statement */ Printf(“hello world n ”); } Output: hello world
  • 142. Contd.. • Every program must have exactly one main function. • Empty parentheses indicates that main has no argument. • The statements in curly braces { } form the function body. • Statements inside /* */ are said to be comments. • Comments can be anywhere in the program but can’t be nested. • printf() is a predefined standard C function for printing output.
  • 143. Contd..  Every statement in C should end with semicolon (;).  The information in () after the function name is known as argument.  n is newline character used to produce a newline. No space between and n.  n, t etc are known as escape sequences.  #include is a preprocessor directive and stdio.h is standard I/O header file.
  • 144. Sample Program 2 • Adding two numbers #include<stdio.h> #include<conio.h> void main() { int a=30; float b=45.5; float c; c=a+b; printf( “The sum is: %f”, c); } Output: The sum is 75.5.
  • 145. Execution of a C program  The compilation and execution process of C can be divided in to multiple steps: 1.Preprocessing - Using a Preprocessor program to convert C source code in expanded source code. "#includes" and "#defines" statements will be processed and replaced actually source codes in this step. 2.Compilation - Using a Compiler program to convert C expanded source to assembly source code. 3.Assembly - Using a Assembler program to convert assembly source code to object code. 4.Linking - Using a Linker program to convert object code to executable code. Multiple units of object codes are linked to together in this step. 5.Loading - Using a Loader program to load the executable code into CPU for execution.