You are on page 1of 10

Computer Programming

and Numerical Analysis


Dr. Veeramani C. Nathan
Room no. A-109, Ground Floor, Chemical Engineering Department, IIT Roorkee
E-mail: c.veeramani@ch.iitr.ac.in
Lecture-01
Course Overview, Contents, References, Programming
pre-requisites, first program, How the program
executes, What happens inside the computer
Course Overview
Lectures
 3 hours/week (Tuesday 3-4 pm, Wednesday 2-3 pm & Friday 2-3
pm)
 Venue: MS Teams
Practical Sessions – (will be held later in February, 2021)
 Venue: CAD Lab, Chemical Engineering Department
Marks distribution –
CWS: 60%
ETE: 40%
References
 www.cplusplus.com
 www.cppreference.com
 www.goalkicker.com

Online compiler options


 codechef.com
 onlinegdb.com
 repl.it
 rextester.com, etc.
References
 Dietel, H. M. and Deitel, P. J., “C++ How to
Program”, Pearson Education, 10th Edition, 2017
 Balaguruswamy, E., “Object Oriented
Programming with C++”, McGraw Hill Education, 7th
Edition, 2017
 Lafore, R., “Object Oriented Programming with C+
+”, Pearson Education, 4th Edition, 2008
 Grewal, B. S., “Numerical Methods in Engineering
and Science: with programs in C and C++”, Khanna
Publishers, 11th Edition, 2013
Programming Pre-requisites
Operating System Shell – bash, csh, ksh, etc.
Linux – Ubuntu, Scientific Linux, etc.
Windows, etc. Few important commands
ls – list files and folders
cp – copy files and folders
Compiler mv – move files and
gcc/g++ on Linux folders
mingw/g++ on Windows rm – remove files and
icc, xlcc, pgicc, etc. folders
Programming IDEs:
Text Editor Codeblocks – provides
gedit, kate, vim, emacs, etc. compiler and text editor in
notepad, etc. one integrated
development
environment (IDE).
Netbeans, Eclipse, etc.
Let’s do our first program

Source code: addNumbers.cpp

Preprocessor
directive

Object code: addNumbers.o

Preprocessed code

Executable code: addNumbers


What happens inside!!

CPU Central Processing Unit


L2
Arithmetic Logic Unit
cache
IR
Instruction Register
General ALU PC
Program Counter
Purpose PSR
Processor Status Register
Registers L2
L1 L1 L1 cache
cache cache cache

Random Access Memory


Memory Addresses RAM
such as 0x3287fd23
Computer Organization
Intel Core i7 3960X Sandy bridge 32 nm

Multicore processor organization (Second Level)

Single Core (Third level)

Arithmetic Load and


Instruction
and Logic Store
Logic
Unit (ALU) Logic

L1 I-Cache L1 D-Cache

L2 Instruction-
L2 Data-Cache
Cache

You might also like