Вы находитесь на странице: 1из 26

Credits : (3-1-0) 4

Semester: Ist and IInd


Department : Computer Science and Engineering
NITK Surathkal
Course Objective
 Gain a working knowledge of C Programming
language.
 Study concepts of structured programming language -
conditional statements, looping statements, arrays,
functions, structures and pointers.
 Introduction to files- handling and management
 Develop efficient and modular C code.
 Develop programming skills, logical thinking and
reasoning for problem solution.
Syllabus
No Chapter Name Hours
1 Introduction to Computer System- Characteristics, block 1 Hour
1 diagram, parts of the computer and different kinds of memory.
2 Introduction to C Programming language - Algorithms and 2 Hours
2 Flowcharts, Types of programming languages, Features of C,
Structure of a C program, Characteristics and applications,
3 C fundamentals: Constants, Variables, Identifiers, Keywords and 2 Hours
3
Data types
4 Operators in C-Arithmetic,
C - Arithmetic,Relational,
Relational,Logical,
Logical,assignment,
assignment, 2 Hours
4 conditional, increment/decrement, bitwise, associativity and
precedence of operators.
5 5 C input/output functions - printf, scanf, getchar, putchar 2 hours
6 Decision making and branching- if statement, else-if ladder, 5 Hours
6
nested else-if statements, switch case, continue, goto, break.
7 7 Decision making and Looping- for, while, do-while 5 Hours
Syllabus
No Chapter Name Hours
8 Arrays- Single and Multi dimensional array 5 Hours
9 Strings- String handling functions and operations 5 Hours
10 Structures and Unions -Introduction, Nesting of structures, 5 Hours
Bitfields and Unions
11 Functions in C -categories, arrays within functions, nesting 5 Hours
of functions, Recursion, Parameter
passing methods.
12 Pointers in C - introduction, operations. 5 Hours
13 File management in C-types of files, file modes, file 5 Hours
functions.
14 Object oriented programming- Introduction, Object 5 Hours
oriented features.
15 Cyber Security -
Chapter 1
Introduction to Computer System
Introduction
 What is a computer ?

Processing

INPUT Computer OUTPUT


Data + Instructions Processed Data i.e
Information

Memory
What is a computer ?
General purpose Electronic device, that
accepts (inputs), stores, manipulates,
and generates (outputs) data as
numbers, text, graphics, voice,
video files, or electrical signals, in
accordance with instructions called a
program.
Characteristics of a computing System
 Speed : Computers work very fast. It takes only few seconds for
calculations that we take hours to complete. Computer speed is
measured in millions of instructions per second i.e MIPS
 Accuracy: - The degree of accuracy of computer is very high and
every calculation is performed with the same accuracy.
 Versatility: - It means the capacity to perform completely different
type of work.
 Storage: - The Computer has an in-built memory where it can store a
large amount of data.
 Reliable : Reliability for a computing system is the attribute in which
we get consistent performances on all occasions according to its
specifications.
Components of a Computer
 Hardware is any part of your computer that has
a physical structure.
Example : computer monitor keyboard, mouse, printer,
motherboard, Hard disk etc.

 Software is any set of instructions that tells the


hardware what to do. It is the one which guides the
hardware and tells it how to accomplish each task.
Example: web browsers, games, and word processors
like Word, PowerPoint etc.
Computer to a Layman
Generation of 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. They were very expensive to operate
and in addition to using a great deal of electricity, generated a
lot of heat, which was often the cause of malfunctions.
 First generation computers relied on machine language, the
lowest-level programming language understood by
computers, to perform operations, and they could only solve
one problem at a time. Input was based on punched cards and
output was displayed on printouts.
 Example The UNIVAC and ENIAC computers
Generation of Computers Cont…
 Second Generation (1956-1963) Transistors
 Transistors replaced vacuum tubes. The transistor was far
superior to the vacuum tube, allowing computers to become
smaller, faster, cheaper, more energy-efficient and more
reliable than their first-generation predecessors.
 Though the transistor still generated a great deal of heat that
subjected the computer to damage, it was a vast improvement
over the vacuum tube.
 Second-generation computers still relied on punched cards
for input and printouts for output.
 Second-generation computers moved from cryptic binary
machine language to assembly languages, which allowed
programmers to specify instructions in words.
 Third Generation (1964-1971) Integrated Circuits
 The Integrated circuit was the hallmark of the third
generation of computers. Transistors were miniaturized
and placed silicon chips, called semiconductors, which
drastically increased the speed and efficiency of
computers.
 users interacted with third generation computers
through keyboards and monitors and interfaced with
an operating system, which allowed the device to run
many different applications at one time with a central
program that monitored the memory
 Fourth Generation (1971-Present) Microprocessors
 The microprocessor brought the fourth generation of computers, as
thousands of integrated circuits were built onto a single silicon chip.
 The microprocessor located all the components of the computer—
from the central processing unit and memory to input/output
controls—onto a single chip.
 In 1981 IBM introduced its first computer for the home user, and in
1984 Apple introduced the Macintosh. More and more products
nowadays use microprocessors.
 As these small computers became more powerful, they could be
linked together to form networks, which eventually led to the
development of the Internet.
 Fourth generation computers also saw the development of GUIs,
the mouse and handheld devices.
Block Diagram of a Computer
Central Processing Unit CPU

Control Arithmetic and


UNIT logical Unit
OUTPUT
INPUT
Primary memory (Internal) UNIT
UNIT

Secondary memory (external)

1. Input unit
2. System Unit
3. Output Unit
Units of the Computer System

Input Unit: We know that the computer is an electronic machine


which like any other machine takes as inputs raw data and
performs some processing giving out processed data. Thus the
input unit takes data from us to the computer in an organized
manner for processing. E.g. Keyboard, Mouse, Scanner

Output Unit: Similarly the output produced by the computer after


processing must also be kept somewhere inside the computer
before being given to the user in human readable form. The
output can also be stored inside the computer for further
processing. E.g. Monitor, Printer.
Units of the Computer System Cont ….
System Unit: In order to carry out the processing operations the
computer has a system unit which allocates the task between its
various functional units. They are
1. Arithmetic and logical unit
2. Control unit.
3. Storage Unit

Central Processing Unit (CPU) = ALU + CU

 The ALU and the CU of a computer system are jointly known as


the central processing unit. One may call the CPU as the brain
of the computer system. It behaves like the brain that takes all
major decisions, makes all sorts of calculations and directs
different parts of the computer functions by activating and
controlling the operations.
ALU
Arithmetic and Logical Unit (ALU)
 After you enter data through the Input Device , it is stored
in the primary storage unit. The actual processing of the
data and instruction are performed by the Arithmetic and
Logical Unit.
 The major operations performed by the ALU are addition,
subtraction, multiplication, division, logic and
comparison. Data is transferred to ALU from storage unit
when required.
 After processing the output is returned back to storage unit
for further processing or getting stored.
CU
Control Unit (CU)
 The Control Unit acts like the supervisor seeing that things are
done in proper fashion. Control Unit is
responsible for coordinating various operations using time
signal. The control unit determines the sequence in which
computer programs and instructions are executed.
 Things like processing of programs stored in the main memory,
interpretation of the instructions and issuing of signals for other
units of the computer to execute them.
 It also acts as a switch board operator when several users access
the computer simultaneously. Thereby it coordinates the
activities of computer’s peripheral equipment as they perform
the input and output.
Storage Unit
 The process of saving data and instructions permanently is known as
storage. Data has to be fed into the system before the actual processing
starts.
 The processing speed of Central Processing Unit (CPU) is so fast that
the data has to be provided to CPU with the same speed. Therefore the
data is first stored in the storage unit for faster access and processing.

All data and instructions are stored in the


storage unit before and after processing.
What is processing?
 Processing: The task of performing operations like
arithmetic and logical operations is called processing. The
Central Processing Unit (CPU) takes data and instructions
from the storage unit and makes all sorts of calculations
based on the instructions given and the type of data
provided. It is then sent back to the storage unit.
Memory
. Main memory
Main memory also known as primary memory
It is a temporary (volatile) memory which holds data and
instructions during processing.

 RAM – Random Access Memory which is a volatile memory.


The different types are
1. Static RAM RAM
2. Dynamic RAM
Main Memory cont….
ROM – Read Only Memory which stores the BIOS and cannot be
modified easily by the programmer.
1. PROM ( Programmable ROM): One time write
2. EPROM(Erasable PROM) : erasable to UV light source
3. EEPROM( Electrically EPROM): electrically erasable

ROM
Secondary Memory
Secondary memory
Secondary memory is a permanent memory
It is non volatile and in which data can be stored on a large
scale from a few MBs to few TBs.

Magnetic Discs Optical Discs USB Drives


Hard Disc DVD Thumb drive
 What are the characteristics of a computer?
With a neat diagram, explain the block diagram of a
computer.
Distinguish between RAM and ROM.
Distinguish between primary and secondary memory.
Explain the following components of the computer
 ALU
 CPU
 CU
 Mention the features of the various generation of
computers.

Вам также может понравиться