Sei sulla pagina 1di 11

CE141 - Computer Concepts & Programming 2017 - 18

Lec – 1 Introduction to Computation


1. Program - A computer program is a collection of instructions that performs a specific task
when executed by a computer. Computer requires programs to function and typically
executes the program's instructions in a central processing unit.
2. Software - Computer software (often called just software) is a set of instructions and
associated documentation that tells a computer what to do or how to perform a task or it can
mean all the software on a computer, including the applications and the operating system.
3. Instruction - An instruction is an order given to a computer processor by a
computer program.
4. Data - Computer data is information processed or stored by a computer. This information
may be in the form of text documents, images, audio clips, software programs, or other types
of data. Computer data may be processed by the computer's CPU and is stored in files and
folders on the computer's hard disk.
5. Debug - Debugging is the routine process of locating and removing computer program bugs,
errors or abnormalities, which is methodically handled by software programmers
via debugging tools. Debugging is also known as debug.
6. Test - In computer hardware and software development, testing is used at key checkpoints in
the overall process to determine whether objectives are being met. For example, in software
development, product objectives are sometimes tested by product user representatives
7. File - A file is an object on a computer that stores data, information, settings, or commands
used with a computer program. In a graphical user interface (GUI) such as Microsoft
Windows, files display as icons that relate to the program that opens the file.
8. Directory - A directory is a location for storing files on your computer. Directories are found
in a hierarchical file system, such as Linux, MS-DOS, OS/2, and UNIX.
9. Linking - Linking is the process of collecting and combining various pieces of code and data
into a single file that can be loaded (copied) into memory and executed
10. Loading - In computing, a loader is the part of an operating system that is responsible for
loading programs and libraries. It is one of the essential stages in the process of starting a
program, as it places programs into memory and prepares them for execution
11. Libraries - In programming, a library is a collection of precompiled routines that a program
can use. The routines, sometimes called modules, are stored in object format. Libraries are
particularly useful for storing frequently used routines because you do not need to
explicitly link them to every program that uses them. The linker automatically looks in
libraries for routines that it does not find elsewhere. In MS-Windows environments, library
files have a .DLL extension.
12. Compilation - A compiler is a computer program (or a set of programs) that transforms
source code written in a programming language (the source language) into another computer
language (the target language), with the latter often having a binary form known as object
code.
13. Execution - Execution in computer and software engineering is the process by which a
computer or a virtual machine performs the instructions of a computer program. The
instructions in the program trigger sequences of simple actions on the executing machine.

Dipsi Dave
1
CE141 - Computer Concepts & Programming 2017 - 18

Lec – 2 Introduction to Computation


 Introduction + Block diagram + functions of various components of computer.
 Introduction
 Computer has been invented mainly as a tool for computations.
 But today Computers are not only used for computations, but they are used in various
fields like Banking, Insurance, Research, Education, Space Applications, Business,
Fashion Design, Engineering, Communication, etc.

 What is Computer?
 Computer is an electronic device used for storing, processing, and retrieving the
information.
 Computer has mainly two components: hardware and software.
 The hardware of the computers consists of physical parts of the system which are visible
as well as user can touch and feel it.
 The parts of the hardware are circuit boards, chips, CPU, wires, Hard disk, Key board,
Mouse, Printers and so on.
 A software of the computers is logical part of the computers and not visible to the users.
 Users cannot directly communicate with hardware but users have to first communicate
with software and then software communicates with the hardware to complete work.

Block Diagram

 Functions of various Components


1. Central Processing Unit (CPU)
 Central Processing Unit is the brain of the computer. It is also known as a processor. The
main purpose of the CPU is to execute the programs and stored in the memory.
 It consists main three parts: ALU, Main memory, C.U
Dipsi Dave
2
CE141 - Computer Concepts & Programming 2017 - 18

a. ALU (Arithmetic Logical Unit): It Performs Arithmetical Operations like


addition, subtraction, multiplication, division and also performs logical operations
like AND, OR, NOT operations.
b. C.U (Control Unit): It controls all activities of C.P.U and other connected
devices.
 Its main job is to fetch instructions from main memory and execute it over C.P.U.
 It has main two parts:
1) IR (Instruction Register): It contains instructions which are in execution.
2) PC (Program Counter): It contains the address of next instruction for execution.

2. Main memory:
 It is also known as primary memory or internal memory.
 It is used to store instructions and other information in Binary form (0 or 1).
 This memory is also known as semiconductor memory because it is made by
semiconductor material like silicon.
 It is divided into various types: RAM, ROM, PROM, EPROM, and EEPROM.

I. RAM (Random Access Memory):


 It is volatile memory; it means the data will lost once the power is off. So, it is also called
temporary memory.

II. ROM (Read Only Memory):


 It is non-volatile memory, it means the data will retain even if the power is off. So it is
also called permanent memory.
 The user cannot store the data into RAM.
 It is pre-stored with some programs like BIOS program (for booting process) and some
mathematical functions like sin, cos, tan….etc.

III. PROM ( Programmable Read Only Memory) :


 It is also non-volatile memory, and it is also called permanent memory.
 Here user can store his information into PROM but only once.
 After that modification is not allowed.

IV. EPROM (Erasable Programmable Read Only Memory) :


 It is also non-volatile memory, and it is also called permanent memory.
 Here also user can store information into EPROM but only once.
 After that modification is not allowed.
 But user can delete the information from EPROM chip using ultra violet rays and can be
again rewrite.

V. EEPROM (Electrically Erasable Programmable Read Only Memory) :


 It is also non-volatile memory, and it is also called permanent memory.
Dipsi Dave
3
CE141 - Computer Concepts & Programming 2017 - 18

 Here also user can store information into EEPROM.


 After that modification is also allowed

Main Memory Full Name Type of Memory


Volatile/ non-Can user store
Can User modify
volatile Info? Info?
RAM Random Access Memory Temporary Volatile NO NO
Memory
ROM Read Only memory Permanent non-volatile NO NO
Memory
PROM Programmable Read Only Permanent non-volatile Yes NO
Memory Memory
EPROM Erasable Programmable Read
Permanent non-volatile Yes NO, It Can delete
Only Memory Memory
EEPROM Electrically Erasable Permanent non-volatile Yes Yes
Programmable Read Only Memory
Memory

3. Input Section
 Input section of a computer consists of the devices which are used to enter the
information into the computer from outside world.
 The devices used to enter the input the computer are called input devices.
 Example: Keyboard, Mouse, touch screen etc...

4. Output Section
 Output section of a computer consists of devices used to send the information to the
outside world.
 The devices used for output are known as output devices.
 Example: Monitor, Printer, LCD, Speakers etc…

5. Secondary Storage Devices


 It is also known as Auxiliary memory or external memory.
 This is permanent memory.
 User can store data permanently on this memory.
 It can be modified.
 Ex: hard disk, floppy disk, CD, DVD, pen drive…etc.

 Classification of Computers 
 There are two types of data: 
1. Digital data (Discrete data)
2. Analog data (Continues)
 Computers are also classified based on their size, cost and configuration.

Dipsi Dave
4
CE141 - Computer Concepts & Programming 2017 - 18

 Advantages Of Computers
 The speed, accuracy, storage, reliability and automation are main advantages of
computers.

1. Speed:
 The computer works at very high speed.
 So we can perform large program in a few seconds.
 Computer performs millions of operations in second.

2. Accuracy:
 Computer performs the computations at very high speed without any mistakes.
 There are many applications which need high degree of accuracy.
 For example, in space application the path of the rocket is computed by computers
without any mistakes.

3. Storage:
 Computers store large information using various storage devices available with
computers.
 They not only store large information but also make them available when it is required
for processing.
 The storage includes both primary memory and secondary memory.

4. Reliability:
 Computer is a very reliable device.
 The information stored today in computer is available after years in same form.

Dipsi Dave
5
CE141 - Computer Concepts & Programming 2017 - 18

5. Automation:
 Once the one task is created in computers, it can be performed by single click any time.
 For example, once the software for banking application is installed in computer, it
calculates the interest quarterly or half yearly by just sending one command.
 The automation makes it possible to perform complex work by a click of command or
button.

 Limitations Of Computers
1. Lack of Intelligence:
 Humans have natural intelligence which makes them use common sense when any work
in done. Computer cannot think while doing work as it does not have natural intelligence.
 Computer only executes the instructions provided by human user.

2. Unable to correct mistakes:


 If human is provided the information which is incorrect, then it uses after correcting the
information. Computer cannot correct the mistakes by itself. So if computer is provided
wrong or incorrect information, it will use as it is.
 This makes the wrong work or wrong calculations.

 Difference between Hardware and Software


Hardware Software
Physical component logical component
Can see and touch Cannot see and touch
It is divided into three parts : microprocessor , It is divided into two categories: System
motherboard & Other peripherals. Software & Application Software.
It is electronics components, so it is designed by It is the collection of programs, so it is
the electronics engineer. designed by computer engineer.
For maintenance, screw driver, tester, brush is For maintenance, all types of software
required. testing is required.
For design, it requires special software (chip For design, it requires system software.
designing software)
Hardware is like car Software is like driver of car
Ex: keyboard, mouse, monitor, CPU, printer Ex: Microsoft Office, Paint, loader, linker,
Operating System……

 Computer Software
 Software is a one type of program that contains sequence of instructions to perform
certain functionality.
 There are two types of software :
1. System software
2. Application software

Dipsi Dave
6
CE141 - Computer Concepts & Programming 2017 - 18

1. System Software
 System software is designed to operate the computer hardware.
 It is also provide platform for running application software.
 Types of system software:
a. Operating system
b. System support software
c. System development software

a. Operating system: It is the interaction between hardware and software.


 Ex: DOS, Windows-XP, VISTA, LINUX, UNIX…

b. System support Software: it mange the hardware more efficiently. Ex: Drivers of the
I/O devices, Antivirus software's.
 Driver is a one type of interfacing program which can interacts between I/O devices and
O.S.
 Antivirus programs remove viruses from the computer.

c. System development Software: it provides the environment to user to develop


application software's.
 Ex: editor, pre-processor, compiler, interpreter, loader..etc.
 Editor: is used to create the programs and to modify the programs.
 Pre-processor: is used before translators (compilers, editors), which is used to replace
some segments of the code with some another segment.
 Compilers: Is the software which translates high level programs into low level programs.
 Interpreters: Is the software which translates line by line high level programs into low
level programs.
 Loaders: Is the software which can load object codes into the main memory and execute
it.

2. Application Software
 Application software is designed to perform specific user applications.
 There are two categories of application software :
a. General-purpose software: Microsoft Office, Oracle etc.
b. Specific-purpose software: tax calculation software, pay-roll system, banking
software's….etc.
 The most important categories of software packages are as follows:
a. Database management software
b. Graphics software
c. Data communication software

Dipsi Dave
7
CE141 - Computer Concepts & Programming 2017 - 18

Lec – 3 Introduction to Programming


 Program: A computer program is a collection of instructions that performs a specific
task when executed by a computer. Computer requires programs to function and typically
executes the program's instructions in a central processing unit.
 Programming: Computer programming (often shortened to programming) is a process
that leads from an original formulation of a computing problem to executable computer
programs.

 Introduction of Computer languages Programming language is the language which is


used to write the program. Computer languages are divided into two categories:
1. Low level language
a. Machine language
b. Assembly language
2. High level language

 Machine language programming:


o The Machine language is written using binary language (0’s and 1’s).
o Computer can understand only low level language. So Computer has to not convert it, so
low level languages are faster.
o Machine Level language is also known as Binary Language and Low Level language.
 Advantages of Machine language programming:
o The programs are compact and small.
o The programs are stored in very less memory.
o Once programs are entered into main memory computer can directly execute it
without using any translator.
o Suitable for low volume application.
o It does not require any translator to run (like assembler).
 Disadvantages of Machine language programming:
o The programs are difficult to understand and debug.
o It is required more time to write the program because it is written in bit form (0’s
and 1’s)
o The programmer often makes errors, which are difficult to find.
o It is not suitable for large application.
o The program cannot describe because it is written in bits.
o The programs are not portable.

 Assembly language:
o The Assembly language is written using set of instructions (mnemonics).
o Assembly language programming is also low level language
o Computer requires assembler to translate assembly language into machine language.
 Advantages of Assembly language :
o The program is easy to describe because of instructions.

Dipsi Dave
8
CE141 - Computer Concepts & Programming 2017 - 18

o The programs are very easy to understand or debug. 3. It is required less time to
write the program.
 Disadvantages of Assembly language :
o It is required assembler to translate assembly language into machine language.
o Programmer needs to learn the structure of assembly language and syntax of every
statement.
o Assembly language programs are not portable because it is dependable on
machine.

 Higher level language:


o The Higher level languages are written using English statements.
o Computer cannot understand high level language.
o So Computer have to convert high level language into low level language, so high level
languages are slower than low level language.
o Higher level language is a potable language across machines.
o For Example: C, C++, FORTRAN, COBOL, Java…etc.
 Advantages of High level language :
o The high level language is easy to understand or debug.
o No need to learn computer architecture because it is not depends on the computer.
o It is required less time to write the program because it is written using English
statements.
o The programs are portable.
 Disadvantages of High level language :
 It is required compiler or interpreter to translate high level language into machine
level language.
 It is also required loader to load the programs into main memory.
 Programmer needs to learn the structure of high level language and syntax of
every statement.
 Some high level languages are dependent on operating system.

 Translator: The translator translates high level language into low level language. There
are three types of translator:
1. Assembler
2. Compiler
3. Interpreter
1. Assembler: Assembler converts assembly language into machine level language.
2. Compiler: Compiler converts high level language into low level language. First
Compiler accept high level program as input. After it checks the program for any
errors if there is no any error in the program then compiler convert High level
program into low level language. If there is any errors then compiler display list of
errors.
3. Interpreter: Interpreter converts high level language into low level language.

Dipsi Dave
9
CE141 - Computer Concepts & Programming 2017 - 18

First Interpreter accept high level program as input. After it checks the first
statement of the program for error if there is not any error in the first statement
then interpreter convert the statement into low level language. If there is any error
then compiler displays that error. This process is repeated until all the statement in
the program is checked.
Note: Compiler convert whole high level program into low level program. Interpreter converts
high level language into low level program statement by statement.

 Difference between Compiler and Interpreter:


1 It checks the whole program at a time and It checks the program line by line and stops
then display the list of errors. checking whenever error occurs.
2 It converts whole source code into object It converts source code into object code line
code. by line.
3 After completion, source code is not For, every execution of line, source code is
required. required.
4 The object code of program generated It generates the object code for each line
when the program is error free. immediately if that line is error free.
5 The execution process of program is The execution process of program is faster.
faster.

 Programming Languages: Computer programming languages are used to communicate


instructions to a computer. They are based on certain syntactic and semantic rules, which
define the meaning of each of the programming language constructs.
Combining and averaging information from various internet sites, langpop.com claims that in
2013 the ten most popular programming languages are (in descending order by overall
popularity): C, Java, PHP, JavaScript, C++, Python, Shell, Ruby, and Objective-C and C #.

 Types of Languages:
1. Interpreted Programming Languages
2. Functional Programming Languages
3. Compiled Programming Languages
4. Procedural Programming Languages
5. Scripting Programming Languages
6. Markup Programming Languages
7. Logic-Based Programming Languages
8. Concurrent Programming Languages
9. Object-Oriented Programming Languages

a. Interpreted Languages: An interpreted language is a programming language for which


most of its implementations execute instructions directly, without previously compiling a
program into machine-language instructions. The interpreter executes the program
directly, translating each statement into a sequence of one or more subroutines already

Dipsi Dave
10
CE141 - Computer Concepts & Programming 2017 - 18

compiled into machine code. Ex: BASIC, Pascal, Python, JavaScript, Lisp, MATLAB,
Perl, PHP, Ruby, Tcl., Windows PowerShell etc…
b. Functional Languages: Functional programming languages define every computation as
a mathematical evaluation. They focus on the application of functions. Many of the
functional programming languages are bound to mathematical calculations. Ex:
Pure Impure
Agda, Frege, Hope, Mercury, QML, C++, C#, Curl, OPSS, Python, Ruby, Lisp
Clean, Hakell, Owl Lisp
c. Compiled Languages: A compiled language is a programming language whose
implementations are typically compilers (translators that generate machine code from
source code), and not interpreters (step-by-step executors of source code, where no pre-
runtime translation takes place). Ex: C, C++, C#, COBOL, Cobra, FORTRAN, JAVA,
Visual Basic etc…
d. Procedural Languages: Procedural (imperative) programming implies specifying the
steps that the programs should take to reach to an intended state. A procedure is a group
of statements that can be referenced through a procedure call. Procedures help in the
reuse of code. Procedural programming makes the programs structured and easily
traceable for program flow. Ex: Bliss, Component Pascal, MATLAB, PL/C etc…
e. Scripting Languages: Scripting languages are programming languages that control an
application. Scripts can execute independent of any other application. They are mostly
embedded in the application that they control and are used to automate frequently
executed tasks like communicating with external programs. Ex: AppleScript, MEL (Maya
Embedded Language), PHP, Tcl, VBScript etc…
f. Markup Languages: A markup language is an artificial language that uses annotations
to text that define how the text is to be displayed. Ex: Curl, HTML, XML, XHTML etc…
g. Logic Based Languages; Logic programming is a type of programming paradigm which
is largely based on formal logic. Any program written in a logic programming language
is a set of sentences in logical form, expressing facts and rules about some problem
domain. Ex: Prolog, Poplog, Oz etc…
h. Concurrent Languages: Concurrent programming is a computer programming
technique that provides for the execution of operations concurrently — either within a
single computer, or across a number of systems. In the latter case, the term distributed
computing is used. Ex: Concurrent Pascal, Limbo, SALSA etc…
i. Object Oriented Languages: Object-oriented programming (OOP) is a programming
paradigm based on the concept of “objects”, which may contain data, in the form of
fields, often known as attributes; and code, in the form of procedures, often known as
methods. In OOP, computer programs are designed by making them out of objects that
interact with one another. Ex: JavaScript (first named Mocha, then LiveScript), C++, C#,
GNU E etc...

Dipsi Dave
11

Potrebbero piacerti anche