Problem Solving and Programming
Problem Solving and Programming
o Input devices: devices are used to input data and instructions into the
computer. E.g. keyboard, mouse.
o CPU (Central Processing Unit): Responsible for processing data and
instructions. It receives data from input devices. It processes the data
and stores the output or display to the output devices. It is divided
into three sections:
➢ ALU (Arithmetic & Logical Unit): Responsible for performing various arithmetic
operations like addition, subtraction, etc.
➢ CU (Control Unit): Responsible for coordinating and controlling data in and out of
the CPU.
➢ Memory Registers: Non-persistent/temporary storage in the CPU – storing data
that is directly used by the CPU.
Computer Hardware (Cont.)
o Output devices: devices are used to display the result to the user. E.g.
monitor, printer.
o Memory/RAM: Memory attached to the CPU – is used to store data
and instructions. Data is loaded when a program is executed and
remains in the memory till the program end.
o Storage or auxiliary memory: Persistent storage of data in which the
data resides even if we switch off the computer. E.g. hard-drives, CD,
DVD.
Generations of
Computers
First Generation
Advantage:
● Could perform various operations in milliseconds.
Disadvantages:
● Very big in size, weight in tons.
● Very costly.
● Not efficient.
● Huge electricity consumption.
● Punch cards and magnetic tapes are used to take input.
Second Generation
Advantage:
● Quite small and low cost compared with the first generation.
Disadvantages:
● Still produces a lot of heat, so a cooling system is required.
● Very limited usage.
● Still, punch cards are used to take input.
Third Generation
Advantage:
● Smaller and cheaper than the second generation.
● The mouse and keyboard are used to take input.
● Fast and reliable.
● Storage capacity is increased.
● Computational time is reduced from microseconds to nanoseconds.
Disadvantages:
● Still, a cooling system is required.
● IC chips are difficult to make.
Fourth Generation
Advantage:
● Smaller in size compared to the third generation.
● All types of high-level languages are used.
● Faster than the previous generation.
● Less heat generated.
Disadvantages:
● VLSI chips design and fabrication is complex.
Fifth Generation
Advantage:
● Very light and handy.
● Reliable and work faster.
● All high-level languages can be used.
Disadvantages:
● ULSI chip design and fabrication is very complex.
Generation of
Programming Language
Programming Language
• Machine-level language
• Used to program first-generation computers.
2GL
• Solve the problem based on constraints and logic, rather than using
an algorithm written by a programmer.
• Designed to make the computer solve a given problem without the
programmer.
Generation of Programming Languages
Programming Languages
Low Level
1GL (Machine Language)
2GL (Assembly Language)
High Level
3GL (Pascal, COBOL, FORTRAN, CC, C++, C#, Java, BASIC, Pascal,
Fortran, ALGOL, COBOL)
4GL (Perl, Python, Ruby, SQL, Unix Shell, Oracle Reports, R)
5GL (OPS5, Mercury, Prolog, LISP)
Software
Software
File Management: Manages the files, folders, and directory structures of the
computer. It is used to create, edit, copy, move and delete files.
Device Driver
Source Code/Program
Language Processors
Assembler Compiler
The compiler scans the whole program and The interpreter translates just one statement
translates it into machine code at once. of a program at a time into machine code.
Overall execution is fast. Overall execution is slow.
A compiler creates an intermediary object
It does not create object code.
code.
The program does not require
Programs require translation everytime users
translation/compilation everytime users run
run the program.
the program.
A compiler generates the error message only Keep translating the program until the first
after it scans the complete program. error is found.
1. Number System
Thank You