You are on page 1of 62

MODULE – 1

INTRODUCTION TO COMPUTING
AND PROBLEM SOLVING

Dr Sunil Kumar P V
Assistant Professor,
SCOPE, VIT Vellore
Class- Outline

◼ Introduction to Digital Computer

◼ Introduction to Programming Languages


Introduction to Digital Computer
What is a Computer?
◼ The term computer is derived from the word ‘compute’
◼ means ‘to calculate’.

◼ A computer is an electronic machine that accepts data


from the user, processes the data, and generates the
desired output.

◼ Computer performs both simple and complex operations,


with ‘speed ‘and ‘accuracy’.
Digital Vs Analog Computer

◼ A digital computer uses distinct values to represent the


data.
◼ All information are represented using the digits 0s and 1s

◼ Analog computer represents data as variable across a


continuous range of values.
◼ The earliest computers were analog computers.
Characteristics of Computer

◼ Speed
◼ Accuracy
◼ Diligence
◼ Storage capacity
◼ Versatility

Computer cannot do any work without instructions from


the user.
Parts of a Computer System
Software and Hardware
◼ Software is used to perform a task.
◼ A set of programs and documents are collectively called
software.
◼ Program is a set of instructions, written in a language understood
by the computer, to perform a specific task.

◼ The hardware consists of physical devices of the


computer.
◼ It cannot perform any task of its own, needs to be
instructed by the software.
Data
◼ Data are isolated values, which by themselves have no
significance.
◼ For example, the data like 29, “January”, and 1994.

◼ The data is provided as input to the computer, which is


processed to generate some meaningful information.
◼ For example, 29, January and 1994 are processed by the
computer to give the date o f birth of a person.
Users
◼ Users are people who write computer programs or interact
with the computer.

◼ They are also known as skinware, liveware, humanware


or peopleware.

◼ Programmers, data entry operators, system analyst and


computer hardware engineers fall into this category.
The Input-Process-Output Concept

◼ A computer is an electronic device that accepts data,


processes data, generates output, and stores data.

◼ The concept of generating output information from the


input data is also referred to as input-process-output
concept.
The Input-Process-Output Concept

◼ A computer consists of three main components

◼ Input/Output (I/O) Unit


◼ Central Processing Unit (CPU)
◼ Memory Unit
Von Neumann’s Computer
Architecture Model
Continued…

◼ Memory: Storage of Information


◼ Processing Unit: Computation of Information
◼ Input: Getting information on to the computer
◼ Output: Getting information out of the computer
◼ Control Unit: Make sure that all the other parts perform
their tasks accurately and at correct time.
CPU
◼ 3 Main components

◼ Control Unit (CU)


◼ Arithmetic and Logic Unit (ALU)
◼ Registers
Memory
◼ Two types

◼ Internal Memory: CPU registers, cache memory and main


memory.
◼ used by the CPU to perform the computing tasks

◼ External Memory (Storage): Hard Disk, Floppy Disk,


Optical Disk
◼ used to store the large amount of data and the software
Internal Memory (Primary/Main)
◼ Limited storage capacity
◼ Temporary storage (Volatile)
◼ Fast access
◼ High cost
CPU Register
◼ It is internal to the CPU.
◼ Contains information that the arithmetic and logic unit
needs to carry out the current instruction.
◼ They are the fastest of all forms of computer storage
Main Memory (RAM)
◼ It contains the programs and data that are currently being
run.

◼ The ALU can quickly transfer information between a


processor register and locations in main storage, called
"memory addresses".

◼ RAM is directly connected to the CPU via a "memory


bus" and a "data bus“.
Cache Memory
◼ It is a special type of internal memory used by many
CPUs to increase their performance.

◼ Some of the information in the main memory is


duplicated in the cache memory.
Types of RAM
◼ Dynamic RAM and Static RAM.
◼ Dynamic RAM (DRAM):
◼ The information stored in DRAM has to be refreshed after every
few milliseconds otherwise it will get erased.
◼ It has higher storage capacity and is cheaper than Static RAM.

◼ Static RAM (SRAM):


◼ The information stored in Static RAM need not be refreshed, but
it remains stable as long as power supply is provided.
◼ SRAM is costlier but has higher speed than DRAM.
External Memory (Secondary)
◼ Very high storage capacity
◼ Permanent storage (non-volatile), unless erased by user
◼ Relatively slower access
◼ Stores data and instructions that are not currently being
used by CPU but may be required later for processing
◼ Cheapest among all memory.
◼ Hard Disk, Magnetic Disk, Optical Disks
Storage Vs. Memory
Memory (e.g., RAM)
• The information stored is needed now
• Keep the information for a shorter period of time
(usually volatile)
• Faster
• More expensive
• Low storage capacity (~1/4 of a DVD for 1 GB)

Storage (e.g., Hard disk)


• The information stored is not needed immediately
• The information is retained longer (non-volatile)
• Slower
• Cheaper
• Higher storage capacity (~50 DVD’s for 200 GB)
Storage Devices
Tape drives

5 1/2” Floppy drive

Flash memory card


3 1/2 “ Floppy drive
USB flash drive
Storage Devices
Zip drives
CD/DVD/Bluera
y

Hard disk

Magento Optic
I/O Devices
◼ Permit the memory of computer to get information and
send data to output devices.

◼ They permit the computer to communicate to the user and


to secondary storage devices like tape and disk drives.
Input Devices
Any peripheral used to provide data and input signals to
the computer
Input Devices
3-D scanner
Fingerprint scanner

Digital
Camera

Joystick Scanner
s

Wearable input gloves

Racing
Wheel
Barcode Tablet
Scanner
Output Devices
A Place to present processed data

Monitor Speakers

Projector

Plotter Laser Printer


Ports and Connectors
◼ A port is a place to
connect an external
device to the computer.
◼ It can also be a
programmatic point
through which
information flows from a
program.
Ports and Connectors
◼ A connector is any connector used within computers or to
connect computers to networks, printers or other devices.
Introduction to Programming
Languages
Programming Languages
◼ Language is a means of communication.
◼ Through a language the computer user can state what
commands the computer should carry out to process the
data.
Classification of Computer Languages
Programming Languages ...

 Machine Languages (1st Generation)


 Assembly Languages (2nd Generation)
 Procedural Languages (3rd Generation)
 Problem Oriented Languages (4th
Generation)
 Natural Languages (5th Generation)
Machine Language
◼ Language directly understood by a computer.
◼ Normally written as strings of binary 0s and 1s.
◼ For eg: 101101010 has a specific meaning for a computer
◼ Specific to a hardware

◼ An instruction consists of two parts:


◼ Operation Code (OPCODE)
◼ Address of one or more memory locations (OPERANDS)
Machine Language

◼ Instruction Format:

◼ OPCODE tells the computer which operation to perform


from the instruction set of the computer.

◼ OPERAND tells the address of the data on which the


operation is to be performed.
Machine Language

◼ A sample machine language program:


Machine Language

◼ Advantages:
◼ Can be executed very fast
◼ Suited for small computers having limited memory.

◼ Disadvantages:
◼ Machine dependent
◼ Difficult to program
◼ Error prone
◼ Difficult to modify.
Assembly Language

◼ Programming language that overcomes the limitations of


machine level language.

◼ Uses Mnemonic Operation Codes and Symbolic


Addresses.
◼ For eg: ADD, SUB, etc.
Assembly Language

◼ An instruction consists of three parts:


◼ A label - symbolic address of the instruction
◼ An operation code - operation to be performed
◼ An operand - symbolic address of memory

◼ Format:
◼ LABEL: OPERATION CODE OPERAND

◼ Eg:- ADD A, B ; Adds the values at the operands


addressed by A and B, result at A
Assembly Language
◼ Advantages:
◼ Easy to understand
◼ Easy to locate and correct errors
◼ Easy to modify
◼ Efficiency almost same as machine language

◼ Disadvantages:
◼ Machine dependant
◼ An intermediate translating program is required
◼ Cannot be executed in small sized computers
◼ Knowledge of hardware required.
Assembler

◼ Software that translates assembly language program into


machine language program
High Level Languages
◼ Machine independent

◼ Knowledge about the internal structure of the computer


is not necessary

◼ Uses English words and mathematical symbols.


High Level Languages
◼ Advantages:
◼ Machine independent
◼ Easy to learn and use
◼ Less errors during program development
◼ Easy to modify and maintain

◼ Disadvantages:
◼ Takes more time to run and require more storage
High Level Languages
 All languages above assembly language
 Procedure oriented Languages (3rd Gen.)
− General purpose language
− Express a logic
− Solve a variety of problems
− e.g. Pascal, BASIC, FORTRAN, COBOL
Advantages Disadvantages
 English like statements Executes more slowly
 Easy to understand and modify
 Machine independent
Language Categories

• Third generation languages (3GL)


– First higher level language
– Supports structured and OOP
• Code is reusable
• Code is portable
– Typically written in an IDE
– C/C++ creates games and applications
– Java creates web applets
– ActiveX creates Web and Windows applets
High Level Languages ...

 Problem oriented languages (4th Gen.)


 Solve specific problems or develop specific
applications
 PC Application software
 Query languages & report generators
 Application generators
High Level Languages ...

 Natural language (5th Gen.)


 Make man-machine interface humanlike
 Simulate learning process
 LISP and PROLOG
Programming Languages

• Used to generate source code


• Avoids using machine code
• Have strict rules of syntax
– Symbols and punctuation have meaning
– Spelling must be exact
• Code is converted into machine language
Compiler
◼ Translator program (software) that translates high level
language program into object code or executable.

◼ A program written in high level language is known as


source code.
Compiler
Compiler
◼ Every language (eg: Python, C, C++, JAVA, etc) has its
own compiler

◼ During compilation, it brings out any errors related to


the syntax of the language.

◼ Logical errors cannot be detected by the compiler.


Compiler
Interpreter
◼ It is a high level language translator

◼ Takes one statement of a program, translates it into


machine language and executes it.

◼ Difference
◼ Compiler translates the entire source program in to machine
language and is not involved in execution.
Interpreter
Programming Languages ...

 Machine Languages (1st Generation)


 Assembly Languages (2nd Generation)
 Procedural Languages (3rd Generation)
 Problem Oriented Languages (4th
Generation)
 Natural Languages (5th Generation)
Software Classification
◼ System Software
◼ For doing system related tasks.
◼ Eg: Operating Systems, Compilers, interpreters, Device Drivers

◼ Application Software
◼ For doing a specific user task.
◼ Eg: MS Office, Photoshop, MS Paint, etc..
Operating Systems

◼ It is a system software that manages computer hardware


and software resources in a system.
◼ Examples:- Windows, Linux, Mac etc.
Functions of Operating Systems
◼ Process Management
◼ Creation and deletion of processes
◼ Suspension and resumption of processes
◼ Process synchronization
◼ Deadlock handling

◼ Memory Management
◼ Allocate and de-allocate memory space as needed
◼ Decide which processes are to be loaded into memory
Functions of Operating Systems
◼ File Management
◼ Creation and deletion of files
◼ Creation and deletion of directory
◼ Mapping of files onto disk storage
◼ Backup of files on stable (non volatile) storage

◼ Secondary Storage Management


◼ Free space management
◼ Storage allocation
Class- Summary

◼ Introduction to Digital Computer

◼ Introduction to Programming Languages

You might also like