Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CSEG 1003
Programming for
Problem Solving
Instructor
Dhiviya Rose J . Asst. Prof. Senior Scale
School of Computer Science and Engineering | UPES
CSEG1003 Programming for Problem Solving
Road Map
• Generations of Computers and Languages
•
Introduction •
•
Organization of Computers
Number Systems Conversion
Logical Analysis and Thinking
LECTURE #1
EVOLUTION ,GENERATION OF COMPUTERS &
CLASSIFICATION OF COMPUTERS
Instructor
Dhiviya Rose J . Asst. Prof. Senior Scale
School of Computer Science and Engineering | UPES
CSEG1003 Programming for Problem Solving
History
• Abacus
• Sliding Beads on a rack
• Counting purpose
• Operators on addition and subtraction
• 300 B.C.
• Napier Bones
• Logarithmic value carved on ivory sticks
• Scotsman ->John Napier
• 1617
CSEG1003 Programming for Problem Solving
Steps……..Inventions
• Pascaline Machine
• Functional Automatic Calculator
• French Mathematician
• Blaise Pascal
• 1642
• gear-driven calculating machine
• Eight movable dials
CSEG1003 Programming for Problem Solving
Gear Engine
CSEG1003 Programming for Problem Solving
CSEG1003 Programming for Problem Solving
Steps……..Inventions
• Jacquard Powerloom
• 1801
• weave automatically
• read from punched wooden cards
CSEG1003 Programming for Problem Solving
Steps……..Inventions
• Jacquard Powerloom
• 1801
• weave automatically
• Programs punched in cards
• read from punched wooden cards
CSEG1003 Programming for Problem Solving
Jacquards Loom
CSEG1003 Programming for Problem Solving
Steps……..Inventions
• Differential Engine
• Charles Babbage – Father of Computers
• English Mathematician
• 1822
• First Computer
• Basic calc+ Log + Differential equation
• Steam Driven machine
• Single Stored program in Memory
• Memory + Central Processing Unit
• Punch Cards as memory
CSEG1003 Programming for Problem Solving
Steps……..Inventions
• Analytical Engine
• Charles Babbage
• 1833
• Fully functional
• differential engine
• Contains
• Input device as cards
• Control unit
• Output device
CSEG1003 Programming for Problem Solving
CSEG1003 Programming for Problem Solving
Steps…Inventions
• Hollerith Tabulator
• Herman Hollerith
• 1889
• U.S Census Bureau
• Official Purpose
• Punch cards
• store data
• Used Electricity
• Later IBM
• Mainframe+OS
• OS/2 -> OS with
windows
CSEG1003 Programming for Problem Solving
Memory Tapes
CSEG1003 Programming for Problem Solving
Steps……..Inventions
• Mark 1
• 1944
• IBM + Harvard Aiken
• Replaces the mechanical component
• Relays
• Electro magnetic component
• ENIAC
• 1946
• John Eckert and John Mauchly
• Electronic Numerical Integrator And Calculator
• Electronic Vaccum Tubes
CSEG1003 Programming for Problem Solving
Steps……..Inventions
• EDVAC
• Electronic Discrete Variable Automatic Computer
• John Eckert and John Mauchly
• Capability to stop and resume
• EDSAC
• Electronic Delay Storage Automatic Calculator
• 1949
• Maurice Wilkes
• Mercury delay lines – memory
• Vacuum tubes --- logic
CSEG1003 Programming for Problem Solving
Steps……..Inventions
• UNIVAC
• Universal Automatic Compute
• 1951
• Beginning of computer era
• John Eckert and John Mauchly
• 1970
• Integrated Circuits
• Replaces vaccum tubes
• 1980
• Very Large Scale Integration (VLSI)
CSEG1003 Programming for Problem Solving
Apple II
CSEG1003 Programming for Problem
Solving
GENERATION OF
COMPUTERS
CSEG1003 Programming for Problem Solving
CSEG1003 Programming for Problem Solving
First Generation
• 1940 – 1956
• Vaccum Tubes
• Machine Language
• Specification
• Vacuum tubes -> circuitry
• Magnetic drums -> memory
• Input ->punched cards and paper tape
• Output ->printouts
• Examples
• UNIVAC -U.S. Census Bureau in 1951
• ENIAC computers
• Disadvantage
• Expensive
• Huge conception of electricity
• Big & Clumsy
• Air conditioning Necessary
• Non portable
CSEG1003 Programming for Problem Solving
CSEG1003 Programming for Problem Solving
Second Generation
• 1956 - 1963
• Transistor
• used to relay and switch electronic signals
• Assembly language
• Specification
• punched cards for input
• printouts for output
• Transistor for circuits
• magnetic core technology for memory
• Computers smaller, faster, cheaper, portable and
more energy-efficient and need air conditioning.
CSEG1003 Programming for Problem Solving
CSEG1003 Programming for Problem Solving
Third Generations
• 1964 – 1970
• Integrated Circuits
• Transistors were miniaturized and placed on silicon chips called
semiconductors
• High Level Language
• Specifications
• Keyboard as input
• Monitor as output
• Operating System
• Central program that controls the devices
• Advantages
• Speed
• Efficiency
• Portable
• Cheap
• Less power
CSEG1003 Programming for Problem Solving
CSEG1003 Programming for Problem Solving
Fourth Generation
• 1970 – Present
• Data Communication
• Microprocessors
• thousands of integrated circuits were built onto a single silicon chip
• Properties
• Instruction set
• Bandwidth
• Clock Speed
• Example
• Intel 4004 chip – minuscule chip(cpu+ memory+ i/p+ o/p unit)
• 1984 Apple introduced the Macintosh
• Specification
• Microprocessor
• Mouse and other handheld devices
• CPU and ALU
• RAID – Redundant array of Independent Disk for memory
CSEG1003 Programming for Problem Solving
CSEG1003 Programming for Problem Solving
Fifth Generation
• Present and Beyond
• Artificial Intelligence
• Game Playing
• Expert System
• Robotics
• Mega chips
• Parallel processing
• Voice Recognition
• Example
• No fully AI computers
• 1997, an IBM super-computer called Deep Blue defeated world
chess champion Gary Kasparov in a chess
CSEG1003 Programming for Problem Solving
CSEG1003 Programming for Problem
Solving
CLASSIFICATION OF
COMPUTERS
CSEG1003 Programming for Problem Solving
Classification of Computers
Types of Computers
Special
Purpose Analog Super
General
Purpose Digital Main Frame
Hybrid Mini
Micro
CSEG1003 Programming for Problem Solving
Super Computers
CSEG1003 Programming for Problem Solving
Mini Computers
CSEG1003 Programming for Problem Solving
Micro Computers
CSEG1003 Programming for Problem Solving
LECTURE #3
NUMBER SYSTEM CONVERSION PROBLEMS
Instructor
Dhiviya Rose J . Asst. Prof. Senior Scale
School of Computer Science and Engineering | UPES
CSEG1003 Programming for Problem Solving
• Base 10
• Valid digits - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
• Position
• unit
• ten
• hundred
• thousand
CSEG1003 Programming for Problem Solving
• Base 2
• Valid digits - 0, 1
• Position
• least significant bit(LSB)
• most significant bit(MSB)
CSEG1003 Programming for Problem Solving
Contd.
CSEG1003 Programming for Problem Solving
Contd.
CSEG1003 Programming for Problem Solving
Activity
Binary Decimal Octal HexaDecimal
6E7
92
12A
1010100101
745
679
1010101000
320
CSEG1003 Programming for Problem Solving
LECTURE #5
PROBLEM SOLVING TECHNIQUES &
LOGICAL ANALYSIS AND THINKING
Instructor
Dhiviya Rose J . Asst. Prof. Senior Scale
School of Computer Science and Engineering | UPES
How to solve a problem?
Check it
Introduction to Algorithms
• The algorithm is the abstract idea of solving a problem.
Flowchart
• Diagram representation –
Structuring a Program
• Develop efficient computer solution to problems:
1. Use Modules
2. Use four logic structures
a. Sequential structure
• Executes instructions one after another in a sequence.
b. Decision structure
• Branches to execute one of two possible sets of instructions.
c. Loop structure
• Executes set of instruction many times.
d. Case structure
• Executes one set of instructions out of several sets.
3. Eliminate rewriting of identical process by using modules.
4. Use techniques to improve readability including four logic
structure, proper naming of variables, internal documentation
and proper indentation.
CSEG1003 Programming for Problem Solving
Example:1
CSEG1003 Programming for Problem Solving
CSEG1003 Programming for Problem Solving
Pseudocode
• Pseudocode means an imitation computer code.
• Pseudocode is close to the actual programming
language.
• Using the Pseudocode, the programmer can start
to write the actual code.
• Psedocode Programming Constructs includes
• READ, PRINT, SET , INITIALIZE
• INCREMENT,DECREMENT,
• IF…THEN….ENDIF,IF….THEN….ELSE….ENDIF,
• REPEAT ….UNTILL, DO…WHILE
CSEG1003 Programming for Problem Solving
CSEG1003 Programming for Problem Solving
Practice Activities
• Given 2 numbers. Calculate sum, difference, multiplication
and division.
• Finding the Area of Rectangle
• Finding the biggest of 3 numbers
• Finding the simple interest for the given P, T, R values.
• To swap two numbers
• Find whether a given number is even or odd.
• Check if the given number is divisible by 2 and 3 or not.
• Check whether a given character is an alphabet, digit or
special character.
CSEG1003 Programming for Problem Solving