Lec1 - Introduction To Computers
Lec1 - Introduction To Computers
1
Introduction
Course Title: Programming Fundamentals
Course Code: CSC103
Course Instructor: Prof. Dr. M. Farhan Shafique
Contact me at
◦ [email protected]
◦ 051-9049250
◦ Office 417, Academic Block 1, ECE Building Top floor
2
GRADING POLICY
THEORY ( 75/100)
Mid Term 25%
Assignment 10%
Quizzes 15%
Final exam 50%
LAB(25/100)
Lab assignments
Lab mid
Lab terminal
project
3
Programmers vs Developers vs Software Engineers
A software engineer is much more focused on the
architecture side i.e. crafting the final product bringing all
the system together (system integration). Software
Engineer has skills to do all levels of software development
(including development and programming)
whereas a developer concentrates more on individual
tasks inside of that development. Like different modules of
a software system. The software developer is also capable
of programming. However developer can not do system
integration.
The programmer is the most focused role in software
development. He is capable to make pseudocode and
translate the logic into a programing code. However the
programmer (coder) doesn’t have any idea about whole
system and structure of the software
4
Books and Resources
Recommended Books
1. Let us C by Yashavant P. Kanetkar
2. C, How to program by Dietel & Dietel
5
Lecture breakdown
• Computers and components of computers
• Hardware and software
• Computer operation
• Networks
• Operating system
• Software languages
6
Computers
Computer are integral part of our everyday existence
◦ Be it school, banks, shops, railway stations, hospital or your own home
7
Computer - Components
A computer system has three main components:
◦ Hardware: The physical equipment associated with a computer system
◦ Software: is a set of instructions that tells the hardware what to do
◦ User: who uses the power of the computer for some purpose
◦ A user may or may not be a person.
8
Hardware vs Software
9
Data and Information
Data are Facts and figures which relay something specific
◦ not organized in any way, and
◦ provide no further information regarding patterns, context, etc.
◦ "unstructured facts and figures that have the least impact on the typical manager“
https://www.just.edu.jo/~mqais/CIS99/PDF/Ch.01_Introduction_%20to_computers.pdf
10
Computer - Operations
At the core, the operations performed by a computer are:
Arithmetic operations − Examples include calculaKons like addiKon, subtracKon, differenKals,
square root, etc.
Logical operations − Examples include comparison operaKons like greater than, less than, equal
to, opposite, etc.
11
Computer – Basic Parts
Input Unit − Devices like keyboard and mouse that are used to
◦ Input data and instructions to the computer
Output Unit − Devices like printer and visual display that are used to
◦ Provide information to the user in desired format
Control Unit − Controls all the funcKons of the computer.
◦ All devices or parts of computer interact through the control unit
Arithmetic Logic Unit − This is the brain of the computer where all arithmeKc operaKons and
logical operations take place.
Memory
◦ All input data, instructions and data interim to the processes are stored
◦ Memory is of two types – primary memory and secondary memory
◦ Primary memory resides within the CPU and secondary memory is external to it
12
Components of Computers
13
Computer – Characteristics
Speed − A computer can carry out a few billion instrucKons per second.
Accuracy − Computers exhibit a very high degree of accuracy.
◦ Errors may occur due to inaccurate data, wrong instructions or bugs
Reliability − Computers can carry out same type of work repeatedly
◦ Without throwing up errors, due to tiredness or boredom, unlike humans
Versatility − Computers can carry out a wide range of work from
◦ data entry and ticket booking to
◦ complex mathematical calculations and continuous astronomical observations
◦ If the user can input the necessary data with correct instructions
◦ computer will do the processing.
14
Characteristics of Computer
15
Computers – Advantages and Disadvantages
Computers can take up routine tasks
◦ while releasing human resource for more intelligent functions
16
Computers - Booting
Starting a computer or a computer-embedded device
◦ is referred to as booting
17
Computer – Networks
A computer network allow connection between multiple computers
◦ To allow communication and sharing of services
18
Computer – size and use
Desktop Laptop Tablet Server Main frame
Mainframe
◦ Serve a large number of users
Supercomputer
◦ Very high performance
◦ to solve complex problems
19
Computer – Hardware
Hardware - Any physical component of a computer system
◦ That contains circuit board, ICs, or other electronics and storage media
◦ Monitor, keyboard, mouse, printer, projector, and usb thumb/flash drive etc.
◦ CPU, HDD/SSD , fans, modem, motherboard, network card, RAM etc.
Hardware upgrade
◦ Possible in Desktop and similar computers
◦ replacing an existing hardware with a newer one
20
A Computer System Unit
A computer system unit or cabinet
◦ Contains most of the devices
Components
◦ Motherboard
◦ Microprocessor
◦ Memory
◦ RAM
◦ ROM
◦ CMOS
◦ Storage Disk Drives
21
Computer – Memory/Storage
The basic unit used in computer data storage is called a bit (binary digit)
◦ A bit can either take a value of 0 or 1
◦ Computer use this binary number system to store numbers
◦ For example, 22 in base-10 is 0001 0110 is base-2 (binary) Unit name Unit Symbol Description
Bit b 0 or 1
Eight bits make a computer byte
Byte B 8 bits
◦ Can represent a number, for example 0 to 255
Kilobyte KB 1024 bytes
Megabyte MB 1024 kilobytes
Gigabyte GB 1024 megabytes
Terabyte TB 1024 gigabytes
22
Computer – Software
The hardware devices need user instructions to function
◦ A set of instructions that achieve a single outcome
◦ is called program or procedure.
◦ Many programs functioning together to do a task make a software
◦ Example 1: A word-processing software enables the user
◦ to create, edit and save documents
◦ Example 2: A web browser enables the user to
◦ view and share web pages and multimedia files.
23
Operating System (1/2)
Operating system (OS) is the lifeline of computer
◦ Co-ordinates between different devices
◦ Schedules multiple tasks as per priority
◦ Allocates resource to each task
◦ Enables computer to access network
◦ Enables users to access and use application software
24
Operating System (2/2)
Performs various hardware resource management tasks like
◦ Processor Management – ensure optimum utilization of the CPU
◦ Manages multiple threads/programs trying to access the CPU
◦ Memory Management
◦ Manages primary and secondary memory, fast loading and execution of programs
◦ Involves loading of input/output data and instructions for each program
◦ Once execution is complete, the allocated memory space is cleared
◦ When the memory is full, employs paging, which is utilization of HDD as memory
◦ File Management
◦ Device Management
◦ Manages hardware devices via device drivers and provide access to other software
25
Computer – Software Language Processor (1/2)
A language processor is a system software, which
◦ Converts all user instructions into machine understandable language
26
Computer – Software Language Processor (2/2)
A program written in a high-level language like C, C++, Java etc.
◦ is called source code
27
Computer – Software – Compiler
System software that store the complete program
◦ scans it and translates the complete program into object code, and
◦ then creates an executable code is called a compiler
Compilers are generally more complex than Interpreters
◦ Compilers need more memory space
◦ Take longer in compiling source code
◦ Execution of the generated machine code is faster
28
Goals of this course
This course is about computer Programming
◦ Developing software in C (a High-level language )
◦ Which will be translated to instructions (and input data)
◦ An executed on the computer to obtain correct/expected output
◦ Various features provided by C language and computer
languages in general
29
A C language code Example
#include <stdio.h>
int main()
{
int n, c, row, t = 1;
printf("Enter a number in range (2 to 30): "); Enter a number in range (2 to 30): 2
1
scanf("%d", &n);
232
30