Presentation On C Programming Introduction (

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

EEE 123

Computing Method and Techniques


for Engineering Analysis

Prepared by Dr. Mehdi Hasan Chowdhury, EEE, CUET


What Is a Computer?

A computer is an electronic device that can:


- accept data (input)
- manipulate data (process)
- produce information (output) and
- store the results for future use (storage).
Generally, the term is used to describe a
collection of devices that function together as
a system.
A Personal Computer System
Monitor Speaker
(output) (output) System unit
(processor, memory…)

Printer
(output)

Storage devices
(CD-RW, Floppy,
Hard disk, zip,…)
Mouse
(input)
Scanner Keyboard
(input) (input)
Why Is A Computer So Powerful?
◼ Speed;
◼ Reliability (low failure rate);
◼ Accuracy;
◼ Ability to store huge amounts of data and
information;
◼ Ability to communicate with other computers.
How Does a Computer Know
what to do?
◼ It must be given a detailed list of instructions, called a
compute program or software, that tells it exactly
what to do.
◼ Before processing a specific job, the computer program
corresponding to that job must be stored in memory.
◼ Once the program is stored in memory the compute can
start the operation by executing the program instructions
one after the other.
What Are The Primary
Components Of A Computer ?
◼ Input devices.
◼ Central Processing Unit
(control unit and
arithmetic-logic unit).
◼ Memory.
◼ Output devices.
◼ Storage devices.
Common Input Devices
◼ Keyboard.
◼ Mouse.
The Central processing Unit
The central processing unit (CPU) contains
electronic circuits that cause processing to
occur. The CPU interprets instructions to the
computer and performs the logical and
arithmetic operations. It is considered the
“brain” of the computer.
Memory
Memory also called Random Access Memory
or RAM (temporary memory) is the main
memory of the computer. It consists of
electronic components that store data
including numbers, letters of the alphabet,
graphics and sound. Any information stored in
RAM is lost when the computer is turned off.

Read Only Memory or ROM is memory that is


etched on a chip that has start-up directions
for your computer. It is permanent memory.
Common Output Devices
Output devices make the information
resulting from the processing available for
use. The two output devices more commonly
used are the printer and the computer
screen.

The printer produces a hard copy of your


output, and the computer screen produces a
soft copy of your output.
Common Storage Devices
Auxiliary storage devices are used to store
data when they are not being used in
memory. The most common types of auxiliary
storage used on personal computers are hard
disk drive (HDD), Solid State Drive (SSD),
miniature mobile storage media, etc.
Program & Programming Language
Program:- A Set of instructions which
when carried out by processor for some
Specific input, generates specific output.

Programming Language:- A specific


manner/grammar of writing a program
with some predefined rules, symbols and
their use as a part of language.
Example: Pascal, C, C++, JAVA, Python.
Evolution of Programming languages
– First Generation : Machine languages
• Strings of numbers giving machine specific instructions
• Example:
+1300042774
+1400593419
+1200274027
– Second Generation : Assembly languages
• English-like abbreviations representing elementary computer operations
(translated via assemblers)
– Example:
LOAD BASEPAY
ADD OVERPAY
STORE GROSSPAY
– Third Generation : High-level languages
• Codes similar to everyday English
• Use mathematical notations (translated via compilers)
• Example: grossPay = basePay + overTimePay
PL hierarchy
What does the computer
understand?
• Computer only understands machine
language instructions.
Assembler
• Instructions written in assembly language
must be translated to machine language
instructions :
– Assembler does this
• One to one translation : One AL instruction
is mapped to one ML instruction.
• AL instructions are CPU specific.
Compiler
• Instructions written in high-level language also
must be translated to machine language
instructions :
– Compiler does this
• Generally, one to many translation : One HL
instruction is mapped to many ML instruction.
• HL instructions are not CPU specific, but compiler
is.
Interpreter
• An interpreter translates high-level instructions into
machine language line by line.

• Advantage of interpreter:
✓ It can execute a program immediately.
✓ Compilers require some time before an executable program
emerges.

• However, programs produced by compilers run much


faster than the same programs executed by an interpreter.
Importance of this subject
❑ “C” is the base language of any
other programming language.

❑ To be a Good Programmer one


must know fundamentals of C
programming language.
History of ‘C’
❑ Root of the modern language is ALGOL 1960.
✓ It’s first computer language to use a block structure.
✓ It gave concept of structured programming.

❑ In 1967, Martin Richards developed a language, BCPL


Basic Combined Programming Language

❑ In 1970, Ken Thompson created a language called ‘B’.


(based on the BCPL)
✓ It used to create early version of Unix.

❑ In 1972,by Dennis Ritchie introduced new language


called as ‘C’ .

You might also like