Professional Documents
Culture Documents
Unit 1
Unit 1
TECHNIQUES
Unit 1 : Introduction To
Computer System &
Programming ,
Algorithms
• Basic Terminologies: Program, Software, Operating System, I/O Devices,
Process. Brief about computer systems, Basics of Number System, basic
structure of simple programming, Understanding program development cycle.
• Basics of Algorithm: Introduction to Algorithms, Characteristics of
Algorithms, Algorithm Notation, Merits & Demerits of Algorithms.
Or
A computer is a digital electronics machine that can be programmed to carry out sequences of arithmetic or
logical operation automatically.
Or
Programmable machine designed to perform arithmetic and logical operation automatically and
sequentially as inputs given by users .
a. Hardware = Internal devices + Peripheral devices : All physical part of the computer (or everything we
can touch) are known as hardware.
• Types of Software:
a. Application Software: - Application software directs the computer to execute commands given by the
user and may be said to include any program that processes data for a user. For example, word
processors, spreadsheets, database management, inventory and payroll programs etc.
b. System Software: - System software is a type of computer program that is designed to run a
computer’s hardware and application programs. System software comprises the programs that you use
to manage your computer, including operating systems such as Windows, Linux, or UNIX for larger
computers and Google Android and Apple iOS for smartphones.
• The main processing device in any computer is the CPU (Central Processing Unit), which performs
binary calculations to make the computer run. This component is often referred to as the ‘brain of the
computer’.
a. ALU (Arithmetic Logic Unit) : It is the arithmetic logic unit, which performs arithmetic and logical
functions. Arithmetic functions include addition, subtraction, multiplication division, and comparisons.
Logical functions mainly include selecting, comparing, and merging the data.
b. Control Unit : The control unit (CU) is a component of a computer's central processing unit (CPU) that
directs the operation of the processor. It tells the computer's memory, arithmetic/logic unit and input and
output devices how to respond to the instructions that have been sent to the processor.
c. Memory or Storage Unit : It is called Random access memory (RAM). It temporarily stores data,
programs, and intermediate and final results of processing. So, it acts as a temporary storage area that
holds the data temporarily, which is used to run the computer.
Volatile memory is the type of memory in which data is lost Non-volatile memory is the type of memory in which data
1.
as it is powered-off. remains stored even if it is powered-off.
2. Contents of Volatile memory are stored temporarily. Contents of Non-volatile memory are stored permanently.
RAM(Random Access Memory) is an example of volatile ROM(Read Only Memory) is an example of non-volatile
4.
memory. memory.
In volatile memory, data can be easily transferred in In non-volatile memory, data can not be easily transferred in
5.
comparison to non-volatile memory. comparison to volatile memory.
6. In Volatile memory, process can read and write. In Non-volatile memory, process can only read.
9. Volatile memory is more costly per unit size. Non-volatile memory is less costly per unit size.
Volatile memory has a huge impact on the system’s Non-volatile memory has a huge impact on a system’s storage
10.
performance. capacity.
Advantages-
Advantages-
•More reliable
•Fast speed
13. •Stores data permanently
•Low power consumption
•Inexpensive memory
•Better system performance as it increases speed
•Helps in booting of operating system
Disadvantages-
Disadvantages-
•Expensive
14. •Slow speed
•Limited storage space
•Can only read data
•Stores data temporarily
1. Analyze the problem. The computer user must figure out the problem, then decide how to resolve the
problem - choose a program.
2. Design the program. A flow chart is important to use during this step of the PDLC. This is a visual
diagram of the flow containing the program. This step will help you break down the problem.
3. Code the program. This is using the language of programming to write the lines of code. The code is
called the listing or the source code. The computer user will run an object code for this step.
4. Debug the program. The computer user must debug. This is the process of finding the "bugs" on the
computer. The bugs are important to find because this is known as errors in a program.
5. Formalize the solution. One must run the program to make sure there are no syntax and logic errors.
Syntax are grammatical errors and logic errors are incorrect results.
6. Document and maintain the program. This step is the final step of gathering everything together.
Internal documentation is involved in this step because it explains the reasoning one might of made a
change in the program or how to write a program.
• Your programming language statements are called source code, and the translated machine language
statements are object code.
• Each programming language uses a piece of software, called a compiler or an interpreter, to translate
your source code into machine language.
• Machine language is also called binary language, and is represented as a series of 0s and 1s.
• After a program’s source code is successfully translated to machine language, the computer can carry
out the program instructions. When instructions are carried out, a program runs, or executes. In a typical
program, some input will be accepted, some processing will occur, and results will be output
• It is done with the help of the compiler. The compiler checks the source code for the syntactical or
structural errors, and if the source code is error free, then it generates the object code.
• The c compilation process converts the source code taken as input into the object code or machine code.
The compilation process can be divided into four steps, i.e., Pre-processing, Compiling, Assembling,
and Linking.
2. Compiler : The code which is expanded by the preprocessor is passed to the compiler. The compiler converts
this code into assembly code. Or we can say that the C compiler converts the pre-processed code into assembly
code. In this phase compiler gives the information about any syntax error or warning available in your code.
3. Assembler : The assembly code is converted into object code by using an assembler. The name of the object file
generated by the assembler is the same as the source file. The extension of the object file in DOS is '.obj,' and in
UNIX, the extension is 'o'. If the name of the source file is 'hello.c', then the name of the object file would be
'hello.obj'. Here assembly level code is converted into a machine understandable code that in binary code using
an assembler. It is prewritten program that translate assembly code into machine code.
4. Linker : A Linker is a computer program that takes one or more object files generated by a compiler and
combines them into one, executable program. The linker is to link the object code of our program with the
object code of the library files and other files. The output of the linker is the executable file. The name of the
executable file is the same as the source file but differs only in their extensions. In DOS, the extension of the
executable file is '.exe', and in UNIX, the executable file can be named as 'a.out'.
7. Merging of list.
2. Uniqueness – Results of each step are uniquely defined and only depend on the input and the result of
the preceding steps.
3. Finiteness – The algorithm stops after a finite number of instructions are executed.
1. An algorithm will be enclosed by START (or BEGIN) and STOP (or END).
2. To accept data from user, generally used statements are INPUT, READ, GET or OBTAIN.
3. To display result or any message, generally used statements are PRINT, DISPLAY, or WRITE.
4. Generally, COMPUTE or CALCULATE is used while describing mathematical expressions and based
on situation relevant operators can be used.
3. It is not dependent on any programming language, so it is easy to understand for anyone even without
programming knowledge.
4. Every step in an algorithm has its own logical sequence so it is easy to debug.
5. By using algorithm, the problem is broken down into smaller pieces or steps hence, it is easier for
programmer to convert it into an actual program.
Disadvantages of Algorithm
Input: F
Output: C
F: temperature in Fahrenheit
C: temperature in Celsius.
Step 1: Start.
Step 5: Stop.
Input : A,B
Output : Sum
A : First number
B : Second number
Step 1: Start
Step 4: Sum=A+B
Step 6: Stop
Prepared by : Ms. Aditi Mehta 28