0% found this document useful (0 votes)
96 views29 pages

1 Module 1-1 Prog in C - Intro To Computer

This document provides an introduction to computers and their history. It discusses the basic components and characteristics of computers, including the central processing unit, memory, input/output devices, and software. It also covers the advantages and disadvantages of using computers. Additionally, it summarizes the history of computers through three generations from the 1940s to 1970s, noting the transition from vacuum tubes to transistors and other improvements in processing power, size, reliability and programming languages.

Uploaded by

shivika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views29 pages

1 Module 1-1 Prog in C - Intro To Computer

This document provides an introduction to computers and their history. It discusses the basic components and characteristics of computers, including the central processing unit, memory, input/output devices, and software. It also covers the advantages and disadvantages of using computers. Additionally, it summarizes the history of computers through three generations from the 1940s to 1970s, noting the transition from vacuum tubes to transistors and other improvements in processing power, size, reliability and programming languages.

Uploaded by

shivika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Amity Business School

Amity School of Engineering & Technology (CSE)

Module I: Introduction (15)

Introduction to computer, history, von-Neumann architecture,


memory system (hierarchy, characteristics and types), H/W
concepts (I/O Devices), S/W concepts (System S/W &
Application S/W, utilities). Data Representation: Number
systems, character representation codes, Binary, octal,
hexadecimal and their interconversions. Binary arithmetic,
floating point arithmetic, signed and unsigned numbers,
Memory storage unit.

Amity School of Engineering & Technology (CSE)

Introduction to computer
• Computer is an integral part of our day to day life.

• Meaning of the computer is a device that can calculate.

• But the modern computer can do a lot more then


calculation.

• Computer is an electronic device that receive input, stores


or processes the input as per user instruction and provides
output in desired format.

1
Amity Business School

Amity School of Engineering & Technology (CSE)

Introduction to computer

• Computer input is called data.


• Output obtained after processing data based on user’s
instructions is called information.
• Raw fact and figures which can be processed using
arithmetic and logical operations to obtain information are
called data.
• Processes that can be applied to data can be two type
– Arithmetic Operation
– Logical operation

Amity School of Engineering & Technology (CSE)

Block Diagram of Computer

2
Amity Business School

Amity School of Engineering & Technology (CSE)

Components of Computer
• INPUT UNIT: Devices used to input data and instructions.

• OUTPUT UNIT: Devices used to provide information to


the user in desired format.

• CONTROL UNIT: All devices or parts of computer


interact through the control unit.
• ARITHMETIC LOGIC UNIT: All arithmetic operation
and logical operations take place through this unit.

• MEMORY UNIT: All input data ,information and data


interim to the processes are store in the memory. Memory of
two type-
• primary memory
• secondary memory 5

Amity School of Engineering & Technology (CSE)

Components of Computer
• Control unit, arithmetic logic unit and memory are together
called the central processing unit or CPU.

• Computer devices that we can see, and touch are the


hardware components of a computer.

• Set of instruction or programs that make the computer


function using these hardware point are called software.

3
Amity Business School

Amity School of Engineering & Technology (CSE)

Characteristics of Computer
• SPEED: Typically a computer can carry out 3-4 million
instruction per second.

• ACCURACY: Computers exhibits a very high degree of


accuracy. Errors that may occur are usually due to human
errors.

• RELIABILITY: Computer can carry out same type of


work repeatedly without throwing up errors due to tiredness or
boredom.

Amity School of Engineering & Technology (CSE)

Characteristics of Computer
• VERSATILITY: Computer can carry out a wide range of work.

• DILIGENCE: A computer can perform millions of tasks or


calculations with the same consistency and accuracy. It doesn’t feel
any fatigue or lack of concentration.

• STORAGE CAPACITY/MEMORY: Computer can store a


very large amount of data at a fraction of cost of traditional storage
of files.

• AUTOMATION: A computer is an automatic machine because


once started on a job they carry on until the job is finished without
any human assistance.

4
Amity Business School

Amity School of Engineering & Technology (CSE)

Advantages of Using Computers


• SPEED: It can handle trillions of instructions per second.
Incredible!
• ACCURACY: Can give you almost 100% accurate
results
• MULTITASKING: A person can do many different tasks
at the same time while working on computer
• STORAGE: Data can be stored separately for years
• DATA SECURITY: secure your data using data
encryption, tokens, key management etc
• AUTOMATION: can automate regular tasks like e-mail
• REDUCED COST: low cost solution to earn money in
many different ways.
9

Amity School of Engineering & Technology (CSE)

Disadvantages of Using Computers


• Computer have no intelligence
• Regular electric power supply is required.
• Trained people required to work on computers.
• Unemployment
• Health Issues like dry eyes, eyestrain, headache etc
• Cyber Crimes
• Virus and Hacking attacks
• Negative impact on environment

10

5
Amity Business School

Amity School of Engineering & Technology (CSE)

History of Computers
• First Generation: (1942-1954)
– Vacuum tube technology
– Unreliable
– Very costly
– Generate lot of heat
– Huge size
– Need AC
– Supported machine language only
– Consumed lot of electricity
Example: ENIAC,EDVAV,IBM-701,IBM-650

Amity School of Engineering & Technology (CSE)

History of Computers
• Second Generation: (1952-1964)
– Use of transistors
– Reliable as compared to first generation
– Smaller size as compare to first generation
– Generate less heat as compare to first generation
– Consumed less electricity as compare to first generation
– Faster as compare to first generation
– Still very costly
– Need AC
– Supported machine language and assembly language
Example: IBM-1620,IBM-7094

6
Amity Business School

Amity School of Engineering & Technology (CSE)

History of Computers
• Third Generation: (1964-1972)
– IC used
– More Reliable
– Smaller size
– Generate less heat
– Consumed less electricity
– Faster
– Still costly
– Need AC
– Supported high level language
– Example: IBM-360 series ,Honeywell-600

Amity School of Engineering & Technology (CSE)

History of Computers
• Forth Generation: (1972-1990)
– VLSI
– More Reliable
– Smaller size
– Use of PC’s
– Pipeline processing
– Concept of internet and network was introduced
– Very cheap
– No AC needed
– Computer become easily available
– Example: DEC-10, STAR-1000, CARY (super
computer)

7
Amity Business School

Amity School of Engineering & Technology (CSE)

History of Computers

• Fifth Generation: (1990 – till date)


– ULSI
– C,C++, JAVA, .NET
– Development of AI
– Development of NLP
– Advancement in parallel processing
– More user-friendly interface with multimedia feature
– Example: Desktop, laptop, notebook.

Amity School of Engineering & Technology (CSE)

General System Architecture

• In Computer Architecture, the General


System Architecture is divided into two
major classification units.
1.Store Program Control Concept
2.Flynn's Classification of Computers

16

8
Amity Business School

Amity School of Engineering & Technology (CSE)

17

Amity School of Engineering & Technology (CSE)

Store Program Control Concept


• The term Stored Program Control Concept refers to the storage of
instructions in computer memory to enable it to perform a variety of tasks in
sequence or intermittently.
• The idea was introduced in the late 1040s by John von Neumann who
proposed that a program be electronically stored in the binary-number format
in a memory device so that instructions could be modified by the computer
as determined by intermediate computational results.
• ENIAC (Electronic Numerical Integrator and Computer) was the first
computing system designed in the early 1940s. It was based on Stored
Program Concept in which machine use memory for processing data.
• Stored Program Concept can be further classified in three basic ways:
1. Von-Neumann Model
2. General Purpose System
3. Parallel Processing
18

9
Amity Business School

Amity School of Engineering & Technology (CSE)

Von-Neumann Model
• Von-Neumann proposed his computer architecture design
in 1945 which was later known as Von-Neumann
Architecture. It consisted of a Control Unit, Arithmetic, and
Logical Memory Unit (ALU), Registers and Inputs/Outputs.

• Von Neumann architecture is based on the stored-program


computer concept, where instruction data and program
data are stored in the same memory. This design is still
used in most computers produced today.

19

Amity School of Engineering & Technology (CSE)

Von-Neumann Model
A Von Neumann-based computer:
• Uses a single processor
• Uses one memory for both instructions and
data.
• Executes programs following the fetch-
decode-execute cycle

20

10
Amity Business School

Amity School of Engineering & Technology (CSE)

Von-Neumann Model

21

Amity School of Engineering & Technology (CSE)

Components of Von-Neumann Model

• Central Processing Unit


• Buses
• Memory Unit

22

11
Amity Business School

Amity School of Engineering & Technology (CSE)

CPU

• The part of the Computer that performs the bulk of data


processing operations is called the Central Processing Unit
and is referred to as the CPU.
• The Central Processing Unit can also be defined as an
electric circuit responsible for executing the instructions of
a computer program.
• The CPU performs a variety of functions dictated by the
type of instructions that are incorporated in the computer.
• The major components of CPU are Arithmetic and Logic
Unit (ALU), Control Unit (CU) and a variety of registers.

23

Amity School of Engineering & Technology (CSE)

• Arithmetic and Logic Unit (ALU)


• The Arithmetic and Logic Unit (ALU) performs the
required micro-operations for executing the instructions. In
simple words, ALU allows arithmetic (add, subtract, etc.)
and logic (AND, OR, NOT, etc.) operations to be carried
out.
• Control Unit
• The Control Unit of a computer system controls the
operations of components like ALU, memory and
input/output devices.
• The Control Unit consists of a program counter that
contains the address of the instructions to be fetched and an
instruction register into which instructions are fetched from
memory for execution.
24

12
Amity Business School

Amity School of Engineering & Technology (CSE)

Registers
• Registers refer to high-speed storage areas in the CPU. The
data processed by the CPU are fetched from the registers.
• Following is the list of registers that plays a crucial role in
data processing.

25

Amity School of Engineering & Technology (CSE)

Buses
• Buses are the means by which information is shared
between the registers in a multiple-register configuration
system.
• A bus structure consists of a set of common lines, one for
each bit of a register, through which binary information is
transferred one at a time. Control signals determine which
register is selected by the bus during each particular register
transfer.
• Von-Neumann Architecture comprised of three major bus
systems for data transfer.

26

13
Amity Business School

Amity School of Engineering & Technology (CSE)

27

Amity School of Engineering & Technology (CSE)

Memory Unit
• A memory unit is a collection of storage cells together with
associated circuits needed to transfer information in and out
of the storage. The memory stores binary information in
groups of bits called words. The internal structure of a
memory unit is specified by the number of words it contains
and the number of bits in each word.
• Two major types of memories are used in computer
systems:
1. RAM (Random Access Memory)
2. ROM (Read-Only Memory)

28

14
Amity Business School

Amity School of Engineering & Technology (CSE)

Number System
• A number system defines how a number can be
represented using distinct symbols.
• A number can be represented differently in
different number system

29

Amity School of Engineering & Technology (CSE)

Number System
• Decimal Number System
• Binary Number System
• Octal Number System
• HexaDecimal Number System

30

15
Amity Business School

Amity School of Engineering & Technology (CSE)

Decimal Number System


• The number system that we use in our day-to-day
life is the decimal number system. Decimal
number system has base 10 as it uses 10 digits
from 0 to 9.
• In decimal number system, the successive positions
to the left of the decimal point represents units,
tens, hundreds, thousands and so on.

31

Amity School of Engineering & Technology (CSE)

Decimal Number System


• In the decimal number systems each of the ten digits, 0
through 9, represents a certain quantity. The position of
each digit in a decimal number indicates the magnitude of
the quantity represented and can be assigned a weight. The
weights for whole numbers are positive powers of ten that
increases from right to left, beginning with 10º = 1
• ……………105 104 10³ 10² 10¹ 10º
• For fractional numbers, the weights are negative powers of
ten that decrease from left to right beginning with 10¯¹.
• 10² 10¹ 10º . 10¯¹ 10¯² 10¯³ ……..
• The value of a decimal number is the sum of digits after
each digit has been multiplied by its weights as in following
examples.
32

16
Amity Business School

Amity School of Engineering & Technology (CSE)

Decimal Number System


• Each position represents a specific power of the
base (10).
• For example, the decimal number 1234 consists of
the digit 4 in the unit's position, 3 in the tens
position, 2 in the hundreds position, and 1 in the
thousands position, and its value can be written as
=((4 × 1) + (3 × 10) + (2 × 100) + (1 × 1000))
=1234

33

Amity School of Engineering & Technology (CSE)

Binary Number System


• The binary system is less complicated than the decimal
system because it has only two digits, it is a base-two
system. The two binary digits (bits) are 1 and 0. The
position of a 1 or 0 in a binary number indicates its weight,
or value within the number, just as the position of a decimal
digit determines the value of that digit. The weights in a
binary number are based on power of two as:
• ….. 24 23 22 21 20 . 2-1 2-2……….
• With 4 digits position we can count from zero to 15.In
general, with n bits we can count up to a number equal to 2ⁿ
- 1.
• Largest decimal number = 2ⁿ - 1
34

17
Amity Business School

Amity School of Engineering & Technology (CSE)

Binary Number System


• A binary number is a weighted number.
• The right-most bit is the least significant bit (LSB)
in a binary whole number and has a weight of 2º
=1.
• The weights increases from right to left by a power
of two for each bit.
• The left-most bit is the most significant bit (MSB);
its weight depends on the size of the binary
number.

35

Amity School of Engineering & Technology (CSE)


Binary Number System Decimal number Binary number
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
10 1 0 1 0
11 1 0 1 1
12 1 1 0 0
13 1 1 0 1
14 1 1 1 0
15 1 1 1 1 36

18
Amity Business School

Amity School of Engineering & Technology (CSE)

Hexadecimal Number System


• The hexadecimal number system has sixteen digits and is
used primarily as a compact way of displaying or writing
binary numbers because it is very easy to convert between
binary and hexadecimal. Long binary numbers are difficult
to read and write because it is easy to drop or transpose a
bit.
• Hexadecimal is widely used in computer and
microprocessor applications. The hexadecimal system has a
base of sixteen; it is composed of 16 digits and alphabetic
characters.
• The maximum 3-digits hexadecimal number is FFF or
decimal 4095 and maximum 4-digit hexadecimal number is
FFFF or decimal 65.535
37

Amity School of Engineering & Technology (CSE)

Hexadecimal Number System


Decimal Binary Hexadecimal
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F 38

19
Amity Business School

Amity School of Engineering & Technology (CSE)

Octal Number System


• Like the hexadecimal system, the octal system provides a
convenient way to express binary numbers and codes.
• However, it is used less frequently than hexadecimal in
conjunction with computers and microprocessors to express
binary quantities for input and output purposes.
• The octal system is composed of eight digits, which are:
• 0, 1, 2, 3, 4, 5, 6, 7
• To count above 7, begin another column and start over:
• 10, 11, 12, 13, 14, 15, 16, 17, 20, 21 and so on.
• Counting in octal is similar to counting in decimal, except
that the digits 8 and 9 are not used.
39

Amity School of Engineering & Technology (CSE)

1st Program

#include <stdio.h>
// program prints hello world
int main()
{ printf ("Hello world!\n");
return 0;
}

40

20
Amity Business School

Amity School of Engineering & Technology (CSE)

Some more Programs

41

Amity School of Engineering & Technology (CSE)

Some more Programs


#include <stdio.h>
// program reads and prints the same thing
int main()
{ int number;
scanf(“%d”, &number);
printf (“%d\n”, number);
return 0;
}
42

21
Amity Business School

Amity School of Engineering & Technology (CSE)

Some more Programs

43

Amity School of Engineering & Technology (CSE)

Some more Programs

44

22
Amity Business School

Amity School of Engineering & Technology (CSE)

Good Programming Practices

45

Amity School of Engineering & Technology (CSE)

Input/Output

46

23
Amity Business School

Amity School of Engineering & Technology (CSE)

47

Amity School of Engineering & Technology (CSE)

Good Programming Practices

word

48

24
Amity Business School

Amity School of Engineering & Technology (CSE)

Good Programming Practices

49

Amity School of Engineering & Technology (CSE)

50

25
Amity Business School

Amity School of Engineering & Technology (CSE)

51

Amity School of Engineering & Technology (CSE)

Data Types

52

26
Amity Business School

Amity School of Engineering & Technology (CSE)

Arithmetic Operators
❑Basic operations +, -, *, /

53

Amity School of Engineering & Technology (CSE)

Arithmetic Operators

54

27
Amity Business School

Amity School of Engineering & Technology (CSE)

55

Amity School of Engineering & Technology (CSE)

Operator Precedence

56

28
Amity Business School

Amity School of Engineering & Technology (CSE)

Exercise

57

Amity School of Engineering & Technology (CSE)

58

29

You might also like