86
10/8/2013 DCE FOC 1 UNIT I Introduction to Computers

Newly Revised Unit1 computer programming

Embed Size (px)

Citation preview

Page 1: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 1/86

10/8/2013 DCE – FOC1

UNIT I

Introduction to Computers

Page 2: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 2/86

10/8/2013 DCE – FOC2

OBJECTIVES

1.1 Introduction to computer 1.2 Characteristics of computer

1.3 Evolution of computer 1.4 Classification of computers1.5 Generations of computers

1.6 Basic computer Organization1.7 Number System

Page 3: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 3/86

10/8/2013 DCE – FOC3

1.1 Introduction

Definition:

Computer is an electronic devicethat takes input from the user, processes thegiven input and generates output in the form of useful information.

Page 4: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 4/86

10/8/2013

Introduction Contd..

Page 5: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 5/86

10/8/2013

ComputerPerforms computations and makes logical decisionsMillions / billions times faster than human beings

Computer programsSets of instructions for which computer processes data

Hardware

Physical devices of computer system

SoftwarePrograms that run on computers

Introduction Contd..

Page 6: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 6/86

10/8/2013

• Definition:

• Introduction To Computer Software• Operating system• Problem solving Techniques• Computer Prog ramming languages• Computer Threats

Introduction Contd..

Page 7: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 7/86

10/8/2013 DCE – FOC

Computer Hardware

MotherboardPower switch

Reset switchHard driveFloppyCD/DVD

Serial portsParallel port

Keyboard/mouseNetwork cardModem

Sound cardVideo cardRAMFan

CablesUSB port

Page 8: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 8/86

10/8/2013 DCE – FOC

Computer Hardware Contd..

Page 9: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 9/86

10/8/2013 DCE – FOC

Components of CPU

Motherboard : Printed Circuit Board (PCB).Processor: Heart of the computer.Ram chips: Used to hold data and program

temporarily.SMPS: Switch Mode Power Supply. Converts ACsupply to 5v and 12v DC.ROM Chips: This have the booting program of thecomputer.Disk Drives: Computer permanent storage Unit.

Page 10: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 10/86

10/8/2013 DCE – FOC10

1.2 Characteristics of computers

1- SpeedComputer can perform millions of instructionsand even more per secondThe speed of computer is measured in terms of microsecond (10 -6 second) or nanosecond (10 -9 second)

The speed of a computer generally dependsupon its hardware configuration

Page 11: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 11/86

10/8/2013 DCE – FOC 11

2- Accuracy

The degree of accuracy of computer is veryhigh and every calculation is performed withthe same accuracy

The errors in computer are due to human

and inaccurate data

Characteristics Contd..

Page 12: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 12/86

10/8/2013 DCE – FOC

Characteristics Contd..

3- Diligence Computers can perform repetitive calculationsany number of times with the same accuracy

It can work for hours without creating anyerror

Due to this capability it overpowers humanbeing in routine type of work

Page 13: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 13/86

10/8/2013 DCE – FOC 13

4- Versatility

Computers are versatile machines

It can perform completely different type of works and can be used for differentpurposes

Characteristics Contd..

Page 14: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 14/86

10/8/2013 DCE – FOC

5- Reliability A computer produces results without any error

Most of the errors generated are human errorsthat are created by the user itself

6- No IQ (in te ll igenc e quo t ien t )

Computer is a dumb machine and it cannotdo any work without instruction from the user and it cannot take its own decision as you can

Characteristics Contd..

Page 15: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 15/86

10/8/2013 DCE – FOC

15

7- No Feeling It does not have feelingsit does not get tired even after long hours of work8- StorageThe Computer has an main memory and storedata in secondary storage devices such asfloppies, CDs Flash Memory which can be keptoutside your computer and can be carried toother computers.

Characteristics Contd..

Page 16: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 16/86

Application

EducationBanking

Airline and Railway ReservationPayment of Electricity and Telephone BillMedical Diagnosis

Weather ForecastingCartoon Film Production

10/8/2013 DCE – FOC

Page 17: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 17/86

10/8/2013 DCE – FOC

17

1.3 Evolution Of Computers

1.3.1 Manual ComputingDevices

i) The first calculatingdevice was called SandTable . It used stonesfor representingnumbers. It is used toperform additionoperation.

Fig. 1.2: AbacusComputer

Page 18: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 18/86

10/8/2013 DCE – FOC

Evolution Contd..

ii) 5000 years back an ABACUS is used for arithmetic operations. It consists of beads, wiresand woodern frame. Calculations are performedby sliding beads.

iii) In 1814,English mathematician John Napier built a mechanical device Napier’s bones for the

purpose of multiplication of 2 numbers.

Page 19: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 19/86

10/8/2013 DCE – FOC

19

1.3.2 Automatic ComputingMachinei) Difference Engine:

It was developed in the year 1822 byCharles Babbage (father of computer)

It was the first automatic computing device

It was capable of solving numerical problems

Evolution Contd ..

Page 20: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 20/86

10/8/2013 DCE – FOC

ii) MARK I :

It was designed in 1944, by an Americanmathematician, Howard Aiken

It was capable of multiplying 20 figures in 6 sec

It was noisy and large in size

Evolution Contd..

Page 21: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 21/86

10/8/2013 DCE – FOC

21

Evolution Contd..

iii) Electronic Numerical Integrator AndCalculator(ENIAC):

It was a general purpose electronic digitalcomputer developed in the year 1946

It used 17,468 vaccum tubes and capable of solving any types of computing problems

Page 22: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 22/86

10/8/2013 DCE – FOC

Evolution Contd..

iv) Electronic Discrete Variable AutomaticComputer (EDVAC)It was invented by John Eckert and JohnMauchly in 1949It was considered as the successor of ENIAC. Itwas capable of processing alphabets and

numbersIt used 5200 vaccum tubes

Page 23: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 23/86

10/8/2013 DCE – FOC

1.5 Computer Generations

Generation 1: Vacuum Tube Computers

Generation 2: Transistor ComputersGeneration 3: Integrated CircuitsGeneration 4: Microprocessors

Page 24: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 24/86

10/8/2013 DCE – FOC

1 - First Generation Computers

First generation computers used vaccum tubes These computers were large in sizewriting programs on them was difficult

Some of the computers of this generation were:

ENIAC

EDVAC EDSAC ( Electronic Delay Storage AutomaticComputer )UNIVAC-1

Page 25: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 25/86

10/8/2013

First Generation : ENIAC

Page 26: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 26/86

10/8/2013 DCE – FOC

26

\The operating speed was quite slowPower consumption was very highIt required large space for installationThe programming capability was quite low

Machine language

Special purpose computer Not easily transferableExecute only one program at a time

More fault Because of more heat.

Limitations of First GenerationComputers

Page 27: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 27/86

10/8/2013 DCE – FOC

27

Around 1955 a device called Transistor replacedthe bulky electric tubes in the first generationcomputer Light weight electronic device.Smaller,Faster,Cheaper,More efficient, Moreproductive more reliable.

Replacing Machine language with assemblylanguage.They have no filament and require no heating.

Manufacturing cost was also very low

2-Second GenerationComputers

Page 28: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 28/86

10/8/2013 DCE – FOC

Second Generation Contd..

In the second generation, the concept of CentralProcessing Unit (CPU), memory, input andoutput units were developed

Some of the computers of the SecondGeneration were:

IBM 1620 : used for scientific purpose.IBM 1401 : used for business applications.CDC 3600 : Its size was large and is used for scientific purposes .

Page 29: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 29/86

10/8/2013

Second Generation : IBM7094

Page 30: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 30/86

10/8/2013 DCE – FOC

30

It was introduced in 1964They used Integrated Circuits (ICs)

Some of the computers developed during thisperiod were: IBM-360ICL-1900 IBM-370VAX-750

3 - Third GenerationComputers

Page 31: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 31/86

10/8/2013

Third Generation : Integrated Circuits

Computers of this generations

were small in sizelow cost, large memoryprocessing speed is very high

4 F h G i

Page 32: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 32/86

10/8/2013 DCE – FOC

32

It uses large scale Integrated Circuits(LSIC) built on a single silicon chip calledmicroprocessorsThese computers are very smallThese computers are called

microcomputers

4-Fourth GenerationComputers

Page 33: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 33/86

10/8/2013

Fourth Generation: VLSI

Improvements to IC technology made it possible to integrate more and moretransistors in a single chip

SSI (Small Scale Integration): 10-100MSI (Medium Scale Integration): 100-1,000LSI (Large Scale Integration): 1,000-10,000VLSI (Very Large Scale Integration):>10,000

Microprocessors

Page 34: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 34/86

10/8/2013 DCE – FOC

5-Fifth Generation Computer

It was introduced in 1990sThe speed is extremely high and it canperform parallel processing

The concept of Artificial intelligence has beenintroduced to allow the computer to take itsown decision

It is still in a developmental stage

Page 35: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 35/86

10/8/2013

Fifth Generation :Examples

Page 36: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 36/86

10/8/2013 DCE – FOC

36

1.6 TYPES OF COMPUTERS

1-Microcomputers2-Mini Computers 3-Mainframe computers4-Supercomputers

Page 37: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 37/86

10/8/2013 DCE – FOC

37

1.6.1 Microcomputers

Micro computers are generally available inthe form of PCs, workstations andnotebook computers.Provides access to a wide variety of computing applications, such as wordprocessing, photo editing, e-mail, andinternet.

Page 38: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 38/86

10/8/2013 DCE – FOC

Block Diagram of aMirco Computer

Microprocessor

Peripheral devices

Interface circuitry

System Bus

Memory

Page 39: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 39/86

10/8/2013 DCE – FOC

39

1.6.2 Mini Computers

A mini computer was first introduced in the year 1960 by Digital Equipment Corporation (DEC)

They are smaller in size

The mini computer is used in multi-user systemin which various users can work at the sametime.

Page 40: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 40/86

10/8/2013 DCE – FOC

Mini Computers Contd..

This type of computer is generally used for processing large volume of data in anorganization

They are also used as servers in Local AreaNetworks (LAN)

Examples: PDP11, IBM(8000 series), VAX 75000etc

Page 41: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 41/86

10/8/2013 DCE – FOC

41

1.6.3 Mainframes

These types of computers are generally 32-bitmicroprocessors.They operate at very high speed

They have very large storage capacity and canhandle the work load of many usersThey are generally used in centralizeddatabases. They are also used as controllingnodes in Wide Area Networks (WAN)

Page 42: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 42/86

10/8/2013 DCE – FOC

Mainframe : Examples

Example of mainframes are VAX 8000,CDC 6600 and IBM 3000 series

Page 43: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 43/86

Page 44: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 44/86

10/8/2013 DCE – FOC

44

Supercomputers are mainly being used for whether forecastingNuclear researchFluid mechanics

Animated graphicsaircraft design

other areas of science and technology.Examples of supercomputers are:CRAY 3, Cyber 205, NEC SX-3 .

Supercomputers Contd..

Page 45: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 45/86

10/8/2013 DCE – FOC

1.6. Basic computer Organization

Page 46: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 46/86

DCE – FOC

Basic computer Organization

Memory

CPU

InputDevices

OutputDevices

Page 47: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 47/86

10/8/2013 DCE – FOC

Block diagram of a computer system

CPU

Input Unit Memory Unit Output Unit

Registers

Arithmetic andLogic Unit

Control Unit

Page 48: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 48/86

10/8/2013 DCE – FOC

Input Unit

Accept data and Instruction from the user

Convert it to a form that the computer can understood

Example:1. Keyboard

In which data is entered by manually typing certain keysA keyboard typically has 101 or 105 keys

2. Mouse It is a pointing device

This is the receiving sections of the computer.

Page 49: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 49/86

10/8/2013 DCE – FOC

Input Devices

Modem

A device that sendsand receives data toand from computersover telephone lines.

Page 50: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 50/86

10/8/2013 DCE – FOC

Central Processing Unit

It performs all calculations and all decisionIt controls and co-ordinates all units of the computer It interprets instructions of a programIt sent back data to the storage unit

The sub divisions are

1) Control unit

2) Arithmetic and logical unit3) Registers This is the manufacturingsection of the computer.

This is the administrative section of the computer.

Central Processing Unit cont’

Page 51: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 51/86

10/8/2013 DCE – FOC

Central Processing Unit cont

Control Unit: Controlling of all operations likeinput, processing and output

– addition (+) – subtraction (-) – multiplication (*) – division (/) – equal to (=) – less than (<) – greater than (>) – less than or equal to (<=) – greater than or equal to (>=) – less than or greater than (< V >)

• Arithmetic/Logic Unit: Itexecutes all arithmetic and logicaloperations.

Page 52: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 52/86

10/8/2013 DCE – FOC

How does the CPU work?

Each instruction takes a machinecycleComputers have a clockInstruction Set : Each CPUexecutes a specific set of operations, i.e. instructions

ControlUnit

Arithmetic/Logic

Unit

Memory

1. Fetch

2. Decode 3. Execute

4. Store

Page 53: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 53/86

10/8/2013 DCE – FOC

Memory Unit

To store data, instructions or processing data, intermediate results of processing and final processed information.

Primary Memory (Ram, Rom)

A device that stores program instructions or data temporarily Installed on the MotherboardComprised of IC’s

Secondary Memory (Hard disk, Floppy disk etc.,)

Non Volatile and long term StorageHolds larger amounts of dataNot as fast as primary memory

This is the rapid access, relatively low-capacitywarehouse section of the computer.

This is the long term, high capacitywarehousing section of the computer.

Page 54: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 54/86

10/8/2013 DCE – FOC

Difference between RAM & ROM

ROM RAM

Non-volatile Volatile

Cost effective Very high

High Storage capacity Small storage capacity

Processing speed is low High

OS supporting programs canbe stored

User-defined programs canbe stored any time

Page 55: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 55/86

10/8/2013 DCE – FOC

Secondary Storage

Secondary storage is separate from theprocessing unit

Software and data can be stored on apermanent basis

Secondary storage is necessary becauseprimary storage can be used only temporarilyand it has limited capacity.

Page 56: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 56/86

10/8/2013 DCE – FOC

Secondary Storage Contd..

CD-ROM (compact disk read-only memory ) hasa disk format identical to that of audio compactdisksRegular CD-ROMs can hold up to 700 megabytesper diskCD-RW technology permits writing on opticaldisksDVD-ROM, for digital video disk has astonishingstorage capacity, up to 17GB if both layers andboth sides are used.

Page 57: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 57/86

10/8/2013 DCE – FOC

Secondary Storage Contd..

Flash Memory : An electronic circuitry that offersa nonvolatile and rewritable type of memoryIt functions like a combination of RAM and hard

disk• Flash memory cards are used in digital cameras,cell phones, printers, handheld computers,pagers, and audio recorders

Page 58: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 58/86

10/8/2013 DCE – FOC

Output Unit

Communication between user and the computer

Output Unit is an electronic device used tocommunicate the output obtained after processing tothe user It converts the binary data into user readable formExample: Printer, Monitor, and Speakers

This is the shipping section of the computer.

d

Page 59: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 59/86

10/8/2013 DCE – FOC

Output device : Monitor

Display device that forms an image by converting electrical signalsfrom the computer into pixels of colored light on the screen

Page 60: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 60/86

10/8/2013 DCE – FOC

Output device : Printer

Output device that produces text or graphical images on paper

Page 61: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 61/86

10/8/2013 DCE – FOC

Output device : Speakers

Output devices that receive signals from thecomputer’s sound card to play music,narration, or sound effects

Page 62: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 62/86

10/8/2013 DCE – FOC

1.7 Number System

Page 63: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 63/86

10/8/2013 DCE – FOC

Representing Information

Data is stored using Binary DigitsBITS

Binary means 2 statesrepresented by 1 (on) or 0 (off)

Does the computer actually store a bunch of 1’s

and 0’s ?????

Page 64: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 64/86

10/8/2013 DCE – FOC

Representing Information

Page 65: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 65/86

10/8/2013 DCE – FOC

Nibbles, Bits, and Bytes

BIT (one digit)

NIBBLE (4 bits, or 1/2 a byte)

BYTE (8 bits)every letter, symbol, or number can be representedby one byte

Page 66: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 66/86

10/8/2013 DCE – FOC

Storage capacity

Bits and Bytes

Page 67: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 67/86

10/8/2013 DCE – FOC

Number System

Inside the computer, the numbers arerepresented in bits and bytes . For example, the number three isrepresented by ‘ 00000011 ’

The number system can be classified into1. Decimal Number System

2. Binary Number System3. Octal Number System4. Hexadecimal Number System

Page 68: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 68/86

10/8/2013 DCE – FOC

Number System Contd..

In a number the value of each digit is determinedby using three considerations

1. The digit2. The position of the digit in the number 3. The base or radix of the number system

D i l N b S t

Page 69: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 69/86

10/8/2013 DCE – FOC

Decimal Number System

In this number system the base or radix is 10The digits are 0 to 9Example: 4326

This can be written as6 x 10 0

2 x 10 1

3 x 10 2

4 x 10 3

= 4 x 10 3 + 3 x 10 2 + 2 x 10 1 + 6 x 10 0

= 4326

Bin r N mber S stem

Page 70: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 70/86

10/8/2013 DCE – FOC

Binary Number System

The number system that is used in thecomputer systemsThe base or radix of binary number system is 2It has only two numbers 0 and 1.

Example (100111) 2 is equivalent to (39) 10

1 x 25

+ 0 x 24

+ 0 x 23

+ 1 x 22

+1 x 21

+ 1 x 20

= 32+0+0+4+2+1 = (39) 10

Page 71: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 71/86

10/8/2013 DCE – FOC

Octal Number System

The base or radix of octal number systemis 8It uses digits 0 to 7

Example: (67) 8 is equivalent to (55) 10

6 x 8 1 + 7 x 8 0 = 48 +7 = (55) 10

Page 72: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 72/86

10/8/2013 DCE – FOC

Hexadecimal Number System

The hexadecimal number system has abase of 1616 digits are: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E

and F.Example :1. Hexadecimal equivalent for (14) 10 is

(E) 16

Table for Binary and

Page 73: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 73/86

10/8/2013 DCE – FOC

Table for Binary andhexadecimal equivalents

Decimal Hexadecimal Binary 0 0 0000

1 1 0001

2 2 0010

3 3 0011

4 4 0100

5 5 0101

6 6 0110

7 7 0111

8 8 1000

9 9 1001

10 A 1010

11 B 1011

12 C 1100

13 D 1101

14 E 1110

15 F 1111

Conversion of Decimal

Page 74: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 74/86

10/8/2013 DCE – FOC

Number System

Decimal to binary systemDecimal to octal systemDecimal to hexadecimal system

Conversion from one

Page 75: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 75/86

10/8/2013 DCE – FOC

Number System to another

Binary

HexaDecimal

DecimalOctal

Group by 3 digits

‚ by base 8

G r o

u p

b y

4

X positional valueby power of 2

Steps for Decimal to

Page 76: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 76/86

10/8/2013 DCE – FOC

Binary conversion

1. Divide the given decimal number with the base2

2. Iteratively divide the quotient by the same base

2 until it is divisible and obtain the remainder 3. The resultant binary number is formed by

collecting all the remainders (the firstremainder is the least significant digit and thelast remainder is the most significant digit).

Steps for Decimal to Octal

Page 77: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 77/86

10/8/2013 DCE – FOC

pconversion

1. Divide the given decimal number with thebase 8

2. Iteratively divide the quotient by the samebase 8 until it is divisible and obtain theremainder

3. The resultant octal number is formed bycollecting all the remainders

Steps for Decimal to

Page 78: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 78/86

10/8/2013 DCE – FOC

Hexadecimal conversion

1. Divide the given decimal number with thebase 16

2. Iteratively divide the quotient by the samebase 16 until it is divisible and obtain theremainder

3. The resultant hexadecimal number isformed by collecting all the remainders

Conversion of Binary

Page 79: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 79/86

10/8/2013 DCE – FOC

Conversion of BinaryNumber System

Binary to decimal conversionBinary to octal conversionBinary to hexadecimal conversion

Steps for Binary to

Page 80: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 80/86

10/8/2013 DCE – FOC

Decimal conversion

1. Represent all the digits in the power of 2.

2. Multiply and then add the correspondingdigits.

Ex: (100)2

= 1 x 2 2 + 0 x 2 1 + 0 x 2 0 =(5)10

Steps for Binary to

Page 81: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 81/86

10/8/2013 DCE – FOC

Octal conversion

1. The base of the binary is 2 and the octalis 8. The base for the octal number is 3 rd power of the base o binary. Therefore

grouping 3 digits of binary number.

2. The grouped binary number is the octalequivalent.

Ex: (111101100) 2 = 111 101 100 = (7 5 4) 8

Steps for Binary to Hexadecimal

Page 82: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 82/86

10/8/2013 DCE – FOC

conversion

The base of the binary is 2 and thehexadecimal is 16(2 4).Grouping 4 digits of binary number

The grouped binary number is thehexadecimal equivalent

Ex: (111101100) 2 = 0001 1110 1100= (1EC) 16

Conversion of Octal

Page 83: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 83/86

10/8/2013 DCE – FOC

Conversion of OctalNumber System

Octal to decimal conversionOctal to binary conversionOctal to hexadecimal conversion

Steps for Octal to Decimal

Page 84: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 84/86

10/8/2013 DCE – FOC

pconversion

1. Represent all the digits in the power of 8

2. Multiply and then add the correspondingdigits

Ex: (516)8

= 5 x 8 2 +1 x 8 1 + 6 x 8 0

=324

Steps for Octal to Binary

Page 85: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 85/86

10/8/2013 DCE – FOC

p yConversion

1.Represent each digit of octal number in binary form.

2. Combine the binary form of eachdigit to get the binary number.

Ex: (516) 8 =(101 001 110) 2

Steps for Octal to Hexadecimal

Page 86: Newly Revised Unit1 computer programming

7/27/2019 Newly Revised Unit1 computer programming

http://slidepdf.com/reader/full/newly-revised-unit1-computer-programming 86/86

conversion

Octal to hexadecimal conversion cannotperformed directly. Therefore we need the helpof binary number.

Octal Binary Hexadecimal

Ex: (345) 8 = (011 100 101) 2

=(0000 1110 0101) =(0E5) 16