Está en la página 1de 32

Structured Programming Approach FEC205

Course Outcomes

Illustrate the basic terminology used in computer


programming.
Illustrate the concept of data types, variables and operators
using C.
Design and Implement control statements and looping
constructs in C.
Apply function concept on problem statements.
Demonstrate the use of arrays, strings, structures and files
handling in C.
Demonstrate the dynamics of memory by the use of pointers
to construct various data structures.
Module 1: Introduction to Computer, Algorithm
And Flowchart

1.1 Basics of Computer:


Turing Model, Von Neumann Model, Basics of
Positional Number System, Introduction to
Operating System and component of an Operating
System.

1.2 Algorithm & Flowchart :


Three construct of Algorithm and flowchart:
Sequence, Decision (Selection) and Repetition
Introduction to Programming
Generations of computers
Generation in computer terminology is a change
in technology a computer is/was being used.
There are totally five computer generations
known till date.
First Generation Computers
First Generation (1940-
1956) Vacuum Tubes. The
first computers used vacuum
tubes for circuitry and
magnetic drums for memory,
and were often enormous,
taking up entire rooms.
Used Machine language and
Assembly language
Second Generation Computers
The period of second generation
was 1959-1965.
In this generation transistors were
used that were cheaper, consumed
less power, more compact in size,
more reliable and faster than the
first generation machines made of
vacuum tubes.
In this generation, magnetic cores
were used as primary memory and
magnetic tape and magnetic disks
as secondary storage devices.
In this generation assembly
language and high-level
programming languages like
FORTRAN, COBOL were used.
Third Generation Computers
The period of third generation
was 1965-1971. The computers
of third generation used
integrated circuits (IC's) in
place of transistors.
A single IC has many
transistors, resistors and
capacitors along with the
associated circuitry.
High-level languages
(FORTRAN-II TO IV, COBOL,
PASCAL PL/1, BASIC,
ALGOL-68 etc.) were used
during this generation.
Fourth Generation Computers
The period of fourth generation
was 1971-1980. The computers
of fourth generation used Very
Large Scale Integrated (VLSI)
circuits. VLSI circuits having
about 5000 transistors and
other circuit elements and their
associated circuits on a single
chip made it possible to have
microcomputers of fourth
generation
All the high-level languages like
C, C++, DBASE etc., were used
in this generation.
Fifth Generation Computers
The period of fifth generation is 1980-
till date. In the fifth generation, the
VLSI technology became ULSI (Ultra
Large Scale Integration)technology,
resulting in the production of
microprocessor chips having ten
million electronic components.
This generation is based on parallel
processing hardware and AI (Artificial
Intelligence) software.
AI is an emerging branch in computer
science, which interprets means and
method of making computers think
like human beings.
All the high-level languages like C and
C++, Java, .Net etc., are used in this
generation.
Turing Machine

It is a mathematical model of computation which


is used for measuring the complexity of
an algorithm.
A Turing machine is invented by Alan Turing in
1936.
The machine can simulate any computer
algorithm, no matter how complicated it is!
Turing Machine
At any one time, the machine has a head which
is positioned over one of the squares on the tape.
With this head, the machine can perform three
very basic operations:
Read the symbol under the head.
Edit the cell by writing a new symbol
Move the head left or right by one square so that
the machine can read and edit the symbol on a
neighbouring square.
let's try printing the symbols "1 1 0" on an
initially blank tape:
Von Neumann Model

The von Neumann architecture, which is


also known as the von Neumann model is
a computer architecture.
It consists of a processing unit containing
an arithmetic logic unit and processor registers;
a control unit containing an instruction register
and program counter; a memory to store
both data and instructions; external mass
storage ; and input and output mechanisms
Basics of Positional Number System
Computer understands only positional number
systems
Types of number system:
1. Decimal
2. Hexadecimal
3. Octal
4. Binary
Operating System.
An operating system (OS) is a collection of
software that manages computer hardware
resources and provides common services for
computer programs.
component of an Operating System.
component of an Operating System
File manager: Manages files and directories
Memory manager: Management of Primary
Memory or Main Memory
Process manager: OS decides which process gets
the processor when and for how much time.
Network manager: Manages communication
between computers
Device manager: An Operating System manages
device communication via their respective drivers.
What is a Program- a program is a set of
instructions
What is a programming language - is a tool
that allows programmers to provide computers
with these instructions.
Evolution of programming languages
First Generation (1940-1956) - Machine
Languages
First Generation Languages use a binary code
that consists of strings of only zeroes (0) and
ones. (1).
The use of binary code is difficult to learn and
use.
Second Generation (1956-1963)
-Assembly Languages
Second Generation Languages uses mnemonics
code that consists of very short words for
commands.
Assembly language programs need to be
converted into machine language by an
assembler before it can be run.
Third Generation (1964-1971) -High Level
Languages
Third Generation Languages also referred to as
high level languages introduced data structures
and control structures .
Third generation languages are portable or
machine independent where a program written
from one computer can also be use by another
computer.
Eg: Fortran, Pascal, C , C++ etc.
Fourth Generation (1971-Present)
Fourth Generation Languages are more advance
than traditional high level Programming
languages because it uses English like
commands that do not require traditional input-
process-output.
Eg: SQL, HTML , VB etc.
Structure Programming Approach
Structured programming language allows a
programmer to code a program by diving the
whole program into smaller units or modules.
It follows Top-down approach
Introduction to C
C is a programming language developed at AT &
T s Bell laboratory of USA in 1972
Designed and developed by Dennis Ritchie
C is reliable, simple and easy to use
Major parts of popular operating systems like
Windows, UNIX, Linux are still written in C
Many popular gaming frameworks have been
build using C language
Examples to C
Steps in learning English language:

Alphabets Words Sentence Paragraphs

Steps in learning C:

Alphabets Constants
Digits Variables Instructions Program
Special symbols Keywords
Sample program
#include<stdio.h>
void main()
{
printf("Hello World");
}

También podría gustarte