Você está na página 1de 55

9/26/2011 By | Meeta Manwani ---

NMIMS University.
1 9/26/2011 By | Meeta Manwani ---
NMIMS University.
1 By | Meeta Manwani ---
NMIMS University.
1
Progromm1ng
Conoep1s Us1ng C
M8A1ech (ALL) 1kIM I
9/26/2011 By | Meeta Manwani ---
NMIMS University.
2 9/26/2011 By | Meeta Manwani ---
NMIMS University.
2 9/26/2011 2 By | Meeta Manwani ---
NMIMS University.
What is Computer :
The word 'compute' means to calculate.
-We apply mathematical operations like addition , subtraction ,
multiplication , etc and many other formulas for calculations.
- Simpler Calculations take less time. But complex calculations
take much longer time.
-Another factor is accuracy in calculations.
So man explored with the idea to develop a machine which
can perform this type of arithmetic calculation faster and with
full accuracy.
This gave birth to a device or machine called ' computer'.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
3 9/26/2011 By | Meeta Manwani ---
NMIMS University.
3 9/26/2011 By | Meeta Manwani ---
NMIMS University.
3
-Computer is an electronic device.
-For a common man computer is simply a calculator , which
works automatic and quite fast.
-For a person who knows much about it , computer is a
machine capable of solving problems and manipulating data .
t accepts data , processes the data by doing some
mathematical and logical operations and gives us the desired
output.
-Computers are now affecting every sphere of human activity
and bringing about many changes in industry , government ,
education , medicine , scientific research , law, social
science and etc.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
4 9/26/2011 By | Meeta Manwani ---
NMIMS University.
4 9/26/2011 By | Meeta Manwani ---
NMIMS University.
4
They are presently used among other applications to .
- Design Buildings , bridges and machines
- Control space vehicles
- Assist in railway reservation
- Control inventories to maximize material cost
- Grade examinations and process results
- Aid in teaching
- Systematically store and quickly retrieve data on land
records.
- Play games like chess and video games and etc
9/26/2011 By | Meeta Manwani ---
NMIMS University.
5 9/26/2011 By | Meeta Manwani ---
NMIMS University.
5 9/26/2011 By | Meeta Manwani ---
NMIMS University.
5
orithms :
n order to solve a problem using a computer , it is necessary to
evolve a detailed and precise step by step method of solution.
** Procedure to find the average number of vowels in a passage :
Step 1 : Let Number of Characters = 0.
Step 2 : Let Number of Vowels = 0.
Step 3 : Repeat steps 4,5,6 & 7 until end of passage is reached.
Step 4 : Read one character from the passage.
Step 5 : Add 1 to Number of characters.
Step 6 : f the character is any one of the letters A,E,,O,U, a,e,i,o,u
add 1 to Number of Vowels.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
6 9/26/2011 By | Meeta Manwani ---
NMIMS University.
6 9/26/2011 By | Meeta Manwani ---
NMIMS University.
6
Step 7 : Move to next character.
Note : Step 8 is reached when no more characters are
left in passage .
Step 8 : Average number of vowels = Number of
vowels / Number of characters.
Step 9 : Write Average Number of Vowels , Number of
characters.
Step 10 : Stop
Simpe Mode Of a computer :
If a machine is to be built to carry out the
above algorithm , it should have the following
features :
9/26/2011 By | Meeta Manwani ---
NMIMS University.
7 9/26/2011 By | Meeta Manwani ---
NMIMS University.
7
-t should be able to interpret each instruction in the algorithm
and carry it out.
- t should be able to read a text consisting of a set of
characters.
- t should be able to add and divide.
- t should be able to compare a character read from the
passage. With the letters A,E,,O,U ,a,e,i,o,u and if it matches
any one of these characters , add 1 to the number of vowels.
- t should be able to store ( or remember) computed values.
- t should be able to write ( or output) the answers obtained.
-f the steps in the algorithm are to be carried out automatically
without human intervention , the entire algorithm must be stored
for reference.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
8 9/26/2011 By | Meeta Manwani ---
NMIMS University.
8
A computing machine designed to carry out the algorithms for
data processing thus has the following configuration :
Memory
Processing Unit
nput Output
Organization Of
Computer
An 3put U3it is provided to read the algorithm and the data to be
processed by the algorithm.
The Memory U3it stores the algorithm and computed values.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
9 9/26/2011 By | Meeta Manwani ---
NMIMS University.
9
The !rocessi3 U3it interprets the instructions and carries them
out.
t has the capability to perform arithmetic operations character
manipulation operations and logical operations.
The Output U3it prints or displays the computed results.
Characteristics Of Computer :
The interesting features of Computer are :
Speed : Computer can work very fast. t takes only few
seconds for calculations that we take hours to complete.
2 ccuracy : The degree of accuracy of computer is very high
and every calculation is performed with the same accuracy.
The accuracy level is determined on the basis of design of
computer . The errors in computer are due to human and
inaccurate data.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
10 9/26/2011 By | Meeta Manwani ---
NMIMS University.
10
3. iie3ce : A computer is free from tiredness., lack of
concentration , fatigue, etc. t can work for hours without creating
any errors.
Due to this capability , it overpowers human being in routing type
of work.
4. Versatiity : t means the capability to perform completely
different types of work. You may use your computer to prepare
payroll slips. Next moment you can use it for inventory
management or to prepare electric bills.
5. Obedie3ce : t performs the instructions at tremendous speed
and with accuracy. nstructions are carried out obediently with no
questions asked.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
11 9/26/2011 By | Meeta Manwani ---
NMIMS University.
11
6. Storae : The Computer has an in-built memory where it can
store a large amount of data.
7. No Feei3 : t does not have feelings , emotions., taste ,
knowledge and experience. Thus it does not get tired even after
long hours of work . t does not distinguish between users.
8. !ower of Rememberi3 : Computer has the power of storing
any amount of information or data. Any information can be
stored and recalled as long as you require it , for any number of
years. t depends entirely upon you how much data you want to
store in a computer and when to lose or retrieve those data.
9. No " : Computer is a dumb machine and it cannot do any
work without instructions from the user. t performs the
instructions at tremendous speed and with accuracy. t is you to
decide what you want to do and in what sequence.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
12 9/26/2011 By | Meeta Manwani ---
NMIMS University.
12
!robem So;i3 usi3 a computer :
n order to solve a problem using the computer the following
steps should be carried out.
i) The given problem is analyzed.
ii) The method used to solve the problem is broken down into a
sequence of elementary tasks.
iii) Based on this analysis an algorithm to solve the problem is
formulated . The algorithm should be precise , concise and
unambiguous.
iv) The algorithm is expressed in a precise notation. An algorithm
expressed using a precise notation is called computer
program. The precise notation is called the computer
programming language.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
13 9/26/2011 By | Meeta Manwani ---
NMIMS University.
13
v) The computer program is fed to the computer.
vi) The computer's processing unit interprets the instructions in
the program , executes them and sends the results to Output
Unit.
lowchart :
Having obtained an algorithm for solving the problem , user
express the algorithm in pictorial form called a Flowchart.
The Flowchart primarily used as an aid in formulating and
understanding algorithms. The sequencing of instructions and
repetitions of group of instructions may be quickly seen by
inspecting a flowchart.
n standard convention used in drawing flowcharts , the following
shapes are used for various blocks in a flowchart.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
14 9/26/2011 By | Meeta Manwani ---
NMIMS University.
14
1) Rectangles with rounded ends are used to indicate START
and STOP.
2) Parallelograms are used to represent input and output
operations.
3) Diamond shaped boxes are used to indicate questions asked
or conditions tested based on whose answers appropriate
exits are taken by a procedure.
4) Rectangles are used to indicate any processing operation
such as storage and arithmetic.
** Example : Find out the highest marks obtained in an
examination and the roll number of the student obtaining the
highest marks.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
15 9/26/2011 By | Meeta Manwani ---
NMIMS University.
15
3put : Assume that each student's paper will have a roll number
and total marks obtained by him or her.
orithm :
Step : Read the first student's paper and note down the roll
number and the marks. This is the highest marks found so far.
Step 2 : Repeat steps 3 and 4 until no more papers are left.
Step 3 : Read the next student's paper. Compare the marks in this
paper with the highest marks found so far.
Step 4 : f the marks read in Step 3 is greater than the highest
marks noted , then erase that and replace it by this new roll number
. Else do not do anything.
Remark : As soon as all papers have been examined go to Step 5.
Step 5 : Print the roll number and the maximum marks noted.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
16 9/26/2011 By | Meeta Manwani ---
NMIMS University.
16
START
STOP
READ ROLL NO
, MARKS
MAXROLLNO ROLLNO
MAXMARKS MARKS
ANY MORE
PAPERS ?
MAXROLLNO ROLLNO
MAXMARKS MARKS
READ ROLL NO
, MARKS
S MARKS >
MAXMARKS?
PRNT
MAXROLLNO ,
MAXMARKS
YES
YES
NO
NO
1
2
3
4
5
6
7
8
9
A Flowchart giving the
method for picking the
highest marks.
17
Block Diagram Of Computer and Structure Of CPU
9/26/2011 By | Meeta Manwani ---
NMIMS University.
18
!U - CPU is a Central Processing Unit Of a Computer.t consists of circuits
to perform arithmetic and logic operations and also has circuits to control and
coordinate the functioning of the memory and /O units of a computer .
rithmetic a3d Loic U3it
Arithmetic and Logic Unit consists of a complicated set of logic circuit and
accumulator. t is mainly responsible for
- Arithmetic Calculations
-Logical comparison and decision
o3tro U3it
Control Unit controls operations of other parts of CPU as well as all parts of
computer by sending a control signal, e.g.
control sequence of instruction to be executed
control flow of data among all parts of computer
interpret instructions
regulate timing of processor
send control single to and receive control single from peripheral devices
9/26/2011 By | Meeta Manwani ---
NMIMS University.
19
omputer 3put U3its
An input device lets you communicate with a computer. You
can use input devices to enter information and issue
commands. A keyboard , mouse , scanner , digital camera ,
touch pads and joystick are examples of input devices.
Description of Computer nput Units :
eyboard :
- Used to type ( manual data entry ) into the computer.
- Most Common nput device today.
- The keyboard consists of following major categories of keys.
i) Letter Keys : These are the 26 letters of English alphabet
arranged as in a typewriter.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
20
ii) Digit Keys :
There are two sets of digit keys ; one on the second row from
the top of the keyboard and other at the bottom right which
allows quick entry of numbers.
iii) Special character keys :
These are the characters such as < , > , ! , @ , # , $ , % , ^, & ,
* , + , - , / , = , (, ) , { , } , [ , ] , ; , " , ' , ? , etc.
iv) Non-Printable Control Keys :
These are used for backspacing , going to next line , tabulation ,
moving cursor up or down , insert delete characters , space bar
for leaving a space , etc.
v) Function Keys : These are labeled as F1,F2 ,-- up to F12 and
when pressed will invoke programs stored in the computer.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
21
!oi3ti3 e;ices :
Pointing devices move some object on the screen and can
do some action .
Common pointing devices are as follows :
-Mouse : Most common pointing device
- Trackball : Basically an upside down mouse
- Joystick : A stick mounted on spherical ball which moves in a
socket . Used to move the cursor on screen.
22
Sca33er :
A scanner allows you to scan documents, pictures, or graphics
and view them on the computer. You can also use software to
edit the items you scan.
Used to put printed pictures and text into a computer
Converts an image into dots that the computer can
understand
To scan text, optical character recognition (OCR) software is
needed
iita amera
Used to take electronic pictures of an object
The pictures taken by a digital camera can be used directly by
a computer
ROM/VROM
Can be used to put both sound and images into a computer
Use a laser to read a Compact Disk (CD) or a DVD disk
23
Other input Methods
Ma3etic i3 character reco3itio3MR) :
n this method , human readable characters are printed on documents( ex
on cheques ) using a magnetic ink.
A ma3etic i3 reader can recognize such characters ( i.e., the cheque
number and branch code at the bottom of cheque The amount written in the
cheque is later entered using magnetic ink. The cheque can then can be
read by a special input unit which can recognize magnetic ink characters.
Optical Mark
Optica Mar Readi3 a3d Reco3itio3 OMR) :
n this method special pre-printed forms are designed with boxes which can
be marked with a dark pencil or ink.Such a document is read by a document
reader which transcribes the marks into electrical pulses which are
transmitted to the computer.
These documents are applicable in areas where responses are one out of a
small number of alternatives . They are used for :
24
i) Objective type answer papers in examination in which large number of
candidates appear.
ii) Market surveys , population surveys where responses can be one or more out
of few possibilities.
iii) Order forms containing a small choice of items.
iv) Time sheets of factory employees in which start and stop times may be
marked.
Optica haracter Reco3itio3 OR) :
An optical scanner is a device used to read an image , convert it into a set of 0s
and 1's and store this in computer's memory.. This representation is called the
bitmap of the image. Each bit in this representation of the image is called a
pixe. This image can be a handwritten document or a printed document or a
picture.
Storing the text in ASC code implies that it is necessary to recognize the
characters and convert the bitmap to an equivalent ASC code. Such
recognition software is called Optical Character Recognition.
25
ar odi3 :
n this method , small bars of varying thickness and spacing are printed on
packages., tags , etc. , which are read by optical readers and converted to
electrical pulses.
** omputer Output U3its :
There are different principal devices to output the information from a computer.
MonItors and DIspIays
-- Shows the processed information on a
screen
-- A monitor uses a Picture Tube like a
television with the image displayed on the front
of the tube, which is called the screen.
26
Iat PaneI DIspIays :
Displays are flat and use plasma, LCD, active-
matrix, or some other technology
. Laptop Computers use flat panel displays which
use liquid crystals for displaying output of a
computer.
Monitors used to be called Cathode Ray Tubes
(CRTs) because of the picture tube, which is a large
vacuum tube.
A monitor or display produce a soft copy. When the
device is turned off the information goes away.
Monitors are slowly being replaced by flat panel
displays.
27
PrInters :
Printers produce a hard copy
The information is printed on paper and
can be used when the device is off.
t is also called a printout
otmatrix pri3ters (impact printer)
Uses metal pins to strike an inked ribbon to make dots on a piece of paper.
Can see the dots that make up the letters or images.
Lowest print quality of all of the printers.
Very low in cost per page to use.
Rarely used today because of the poor print quality, but still used in business
to print multi-part forms.
28
Drum PrInters :
There are two types of Line Printers . Drum Printers and the Chain Printers.
A Drum Printer consists of a cylindrical drum . The characters to be printed are
embossed on its surface. The paper is taped onto a drum for precise alignment
to the nozzles.
When the desired character for the selected position rotated around to the
hammer line, the hammer hit the paper from behind and pushed it into the
ribbon and onto the character.
As the drum rotates , the hammer waits
and is activated when the character to
be printed at that position appears in
front of the hammer.
Printer Drums are expensive and
cannot be changed often.
29
aIn PrInters :
A Chain Printer has a steel band on which the characters sets are embossed
.
The band is rotated at a high speed. As the band rotates , a hammer is
activated when the desired character as specified in buffer register comes in
front of it.
The main advantage of chain printers is the ease with which chains may be
changed.
Thus different fonts and different scripts may be used with the sane printer.
$erIaI PrInters :
Serial Printers print one character at a time , with a print head moving across
a line. They are similar to typewriters. Serial Printers are normally slow.. A
popular Serial Printer is ' dot matrix' printer. n such a printer the print head
consist of an array of pins. These pins are moved forward to form a character
and they hit the carbon ribbon in front of the paper thereby printing that
character.
30
nk jet prInters (non-Impact prInter) :
Use drops of magnetic ink to produce
dots on a page to produce text or images.
The print quality is almost the same as a
laser printer's.
Problems with the ink
The ink is very expensive
The ink is water soluble and will run if the
paper gets wet
Highest cost per page of all the printers
For producing color documents, it has the
highest quality at a reasonable price.
31
aser prInters (non-Impact prInter) :
How the laser printer produces an image
A laser or LEDs make dots on a light sensitive drum
Toner (very tiny particles of plastic) stick to the drum
where the dots where made
Paper is pressed against the drum and the toner is
placed on the paper
The paper is heated and the toner melts into the
paper
Produces the highest quality printout
For black and white printouts, very low cost per page
Printout is permanent
Color laser printers are still fairly expensive.
32
$peakers
used to output sound
PIotters :
Special Plotters to produce good quality drawings and graphs have been
designed.
There are two types of plotters : Drum Plotter and a Flat Bed Plotter.
n Drum Plotter , the paper on which the graph is to be drawn is mounted on
a rotating drum.The drum can rotate in either clockwise or anti-clockwise
direction . The pen can move left to right , right to left ,or up or down.. The
movements of drum and pen are controlled by graph plotting program.
A Flat bed plotter has a stationary horizontal plotting surface on which paper
is fixed. The pen is mounted on the carriage which can move in either X or Y
direction. A graph plotting program is used to move the pen to trace the
desired graph.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
33
Buses : Collection of wires with a common purpose. n computer
architecture, a bus is a subsystem that transfers data between
computer components inside a computer or between computers.
Each wire is called a line. Typically , buses carry information from one
place to another.
!orts
!U
RM
is
o3troer
Graphics
ard
Sou3d
ard
Networ
ard
omputer
Bus
Monitor
Speakers
9/26/2011 By | Meeta Manwani ---
NMIMS University.
34
%ypes Of buses of 3)
Point To Point :
Serial
Port
Control
Unit
Modem
ALU
9/26/2011 By | Meeta Manwani ---
NMIMS University.
35
%ypes Of buses 2 of 3)
MultiPoint :
omputer omputer
omputer
omputer
is o3troer
!U Memory
Video o3troer
9/26/2011 By | Meeta Manwani ---
NMIMS University.
36
%ypes Of buses 3 of 3)
Daisy Chain :
e;ice o3troer
%ermi3ator
e;ice
e;ice
e;ice
9/26/2011 By | Meeta Manwani ---
NMIMS University.
37
uses i3side a omputer :
!U
Memory
/O Modue
/O e;ice
ata us
ddress us
o3tro us
9/26/2011 By | Meeta Manwani ---
NMIMS University.
38
ata us :
- Carries data between the CPU and memory or /O devices.
- Bi-directional
- Data transferred " out of " the CPU for write Operations.
- Data transferred " into " the CPU for read Operations.
-Typical sizes : 8,16,32,64 lines.
- Signal names : D0,D1.D2,D3,etc
ddress us :
Carries an address from the CPU to Memory or /O devices.
-Unidirectional
- The address is always supplied by CPU.
- Typical sizes : 16 , 20 , 24 lines
- Signal names : A0 , A1 , A2, A3 , etc.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
39
o3tro us :
-Collection of signals for coordinating CPU activities.
- Each signal has a unique purpose.
- Typical sizes : 10-20 lines
- Signals are output , input , or bi-directional
- Typical Signals :
- /RD ( read)
- /WR (write)
- CLK (clock)
- /RQ (interrupt request )
- etc.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
40
ateories of omputer Memory a3d Storae :
> !rimary Memory :
RAM : Random Access Memory ( handles read / write)
provides temporary storage of programs in execution and the
data being processed.
Different types of RAM :
i) SRAM : Static RAM ( ts storage is fixed as long as power is
supplied to the computer.) . However it is more expensive than
DRAM. t is usually used for cache memory . As it is static , it
does not need to be refreshed.
ii) DRAM Dynamic RAM , although its name sounds
sophisticated , is the oldest and simplest ( therefore the slowest
) type of RAM used today. The word " dynamic comes from the
fact that it must be electronically "refreshed constantly in order to
maintain the data in stores.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
41
iii) EDORAM : Enhanced data output DRAM , is a type of
RAM that improves the memory access time on faster
microprocessors such as the ntel Pentium. EDORAM was
initially optimized for the 66 MHz Pentium.
iv) SDRAM : Synchronous DRAM is a new form of RAM that
can be synchronized to the clock speed of the computer, a
powerful feature that optimizes data access by the system
buses.
v) RDRAM : Rambus DRAM, is ntel's designated
successors to SDRAM has an effective speed of 800 MHz.
vi) DDR double data rate RAM , is SDRAM , that is slower
than RDRAM but uses a technology that can theoritically
double older transfer rates.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
42
ROM : read only memory , PROM , programmable ROM (
write once) are used for permanent storage of programs and data
built into the computer by the manufacturer.
EPROM , EEROM and flash memory are rewritable PROM
that unlike , RAM , retains its storage when power is turned off.
EPROM (Erasable PROM ) is erased by shining ultraviolet light
on the exposed chip. To write to or erase an EPROM , one must
use a PROM burner.
EEPROM ( electronically erasable PROM ) is more convenient
than EPROM because it can be erased electronically and can be
written in bytes.
EEPROM is erased and rewritten at byte level which is slower
than flash memory updating.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
43
Flash Memory ( also called "flash RAM ) , a special type of
EEPROM , can be erased and rewritten in multi-byte blocks
rather than the single bytes characteristics of EEPROM.
> Seco3dary Storae sowest data access) :
a) Tape : ( permanent magnetic storage ) is , by far ( the
slowest access storage ) . t is now used only for backup.
b) Magnetic Disks ( permanent magnetic storage ) include
diskettes ( floppies) , harddisks and removable cartridges.
c) Magneto optical disks ( permanent magnetic storage ;
laser assisted writing; permanent ) combine magnetic and
optical techniques.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
44
d) Optical disks : (ex- DVD , recordable CDs , etc) utilizing
laser technology allow data to be stored in much greater
densities than magnetic storage media.
> ache memory ( small , fast RAM ) is designed to
hold frequently used data.
> Reisters :
-A register is a single storage location within the CPU.
-- Unlike memory , which is " outside " the CPU.
- - Examples of Registers.
- Accumulator (ACC) , Program Counter (PC) , nstruction
Register ( R) , Memory Address Register ( MAR) , Memory
Data Register (MDR) , Status Register (SR) .
9/26/2011 By | Meeta Manwani ---
NMIMS University.
45
General purpose Registers ( R0 , R1 , ..)
-ncluded on some CPU's
-Used for Highspeed temporary storage of program
variables.
- acup Systems :
Although a hard disk is an extremely reliable device, a hard
disk is subject to electromechanical failures that cause loss
of data . Furthermore, data files , particularly those accessed
by several users are subject to errors introduced by users.
There is also a possibility of errors introduced by software.
With any method of data storage , a backup system is a
way of storing data in more than one place to protect it from
damage and errors is vital.
9/26/2011 By | Meeta Manwani ---
NMIMS University.
46
Magnetic tape is used primarily for backup purposes. For
personal computer users an easy and inexpensive way to
backup a hard disk file is to simply copy it to a diskette
whenever it is updated. But this is not practical for a
system with many files or many users.
Personal computer users have the option of purchasing
their own tape backup system to be used on a regular
basis for copying all data from hard disk to a high capacity
tape.
Data thus saved can be restored to the hard disk later if
needed. A key advantage of a tape backup system is that
it can copy the entire hard disk in minutes saving you from
the trouble of swapping diskettes in and out of the
machines.
Computer Software may be classified into two broad categories :
appicatio3 software and system software.
Application Software is a set of programs necessary to carry out
operations for a specified applications . Ex Programs to solve a
set of equations or examination results etc.
System Software are general programs written for the system
which provides the environment to facilitate the writing of
application software. Ex Programming language translators.
Computer programming languages are developed with primary
objecti;e of facilitating a large number of people to use computers
without need to know the internal structure of the computer.
La3uaes are aso desi3ed to be machi3e i3depe3de3t i.e.,
the structure of programming language should not depend upon
the internal structure of a specified computer.
Assembly Language :
The first step in the evolution of programming languages was
the development of what is known as an assemby a3uae.
n an assembly language, m3emo3ics are used to represent
operation codes and string of characters to represent
addresses . t is matched to a particular computer's processor
structure. t is thus machine dependent . t is necessary for
assembly language to know all details of a computer's logical
structure.
n order to execute assembly language program on a computer
, it should first be translated to its equivalent machine
language program.
The mnemonic operation codes should be converted to absolute
numeric operation codes. This translator is known as assember
The input to an assembler is source program and the
equivalent output machine language program is known as an
object proram.
Assembler
Assembly language
program ( Source
program)
Machine language
program ( Object
program)
The main advantage of using assembly language is the efficiency
of machine language program resulting from it.
The main disadvantages of assembly languages are :
i) t is machine dependant i.e., it is not portable from one
machine to another .
ii) As assembly language programmer must be an expert who
knows all about logical structure of computer for which the
program is written.
iii) Writing assembly programs is difficult and time consuming.
igher Level Programming Languages :
With improvements in technology , computers were designed
with larger memory capacity , higher speed and improved
reliability.
As a result , a good notation to express aorithms became an
essential requirement. t is good to write algorithms in
English ,a natural language and then is translated to
machine language automatically by a computer and
executed using specific notations.
Such notations used to express algorithms are known as hih
e;e procedure orie3ted prorammi3 a3uaes
A high level language to express algorithms must have the
following features :
i) Facility to describe the nature of the data to be processed.
ii) Should provide Operators which are appropriate to the data
items and data structures in the language.
iii) Should provide a set of characters using which symbols in
the language are constructed.
iv) Should provide o3tro structures to sequence the
operations to be performed. Repetitio3 of roups of
stateme3ts is also necessary.
v) A set of syntax rules which precisely specify the
combination of words and operators permissible in a
language.
vi) A set of semantic rules which assign a single precise and
unambiguous meaning to each legal syntactic structure in
language.
This below given diagram depicts how machine
independence is achieved by using translators to translate a
high level language program to machine languages.
High Level
Language
Program
Algorithm Translator
Sequence of
machine
instructions
Program
Object Program in
machine language
** %ra3sators used to translate the higher level language
program into respective machine instructions.
Some igh Level Languages :
FOR%RN :
Fortra3 stands for FORmula %RNslation . This language is
the oldest high level language. The language was designed to
solve scie3tific a3d e3i3eeri3 probems and is currently
the most popular language among scientists and engineers.
OOL :
COBOL stands for Ommon usiness Oriented Language.
This language was developed for data processing
professionals for busi3ess data processi3.
S : stands for eginner's ll purpose Symbolic
nstruction ode. BASC is available on all personal
computers and even in some pocket calculators. But its
greatest drawback is that it has not been standardized.
!asca :
This programming language was designed with the primary aim of
providing a language which allows a beginners to learn good problem
solving and programming methods.
!asca has faciities to ma3ipuate , 3ot o3y 3umbers but aso
;ectors, matrices, stri3s of characters , records , fies , etc.
La3uae : was de;eoped by e33is Ritchie i3 2 at e
Laboratories i3 US. This first major use of C was to write an
operating system known as UN. t is concise, providing only the bare
essentials required in a language so that a translator can translate it
into an efficient machine language code.
La3uae : C++ language is an objectorie3ted prorammi3
a3uae OO!) The methodology of OOP enables a programmer to
extend the concept of functions and subroutines to that of an object .
An object is modeled by a collection of data structures and a set of
procedures that can be performed on this data structure. And many
other languages such as a;a, Scripti3 a3uaes , etc.

Você também pode gostar