PSP Unit 1 Introduction 25 6 2022 5am

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 37

Course – PROBLEM-SOLVING

THROUGH PROGRAMMING

Course Instructor
Dr. Umadevi V
Department of CSE, BMSCE
Webpage:https://sites.google.com/site/drvumadevi/

February 25, 2024 CSE, BMSCE 1


Unit-1

Introduction to Computer Hardware and Software:


Computer generations, computer types, bits, bytes and words,
CPU, Primary memory, Secondary memory, ports and connections,
input devices, output devices, Computers in a network, Network
hardware, Software basics, software types. Problem solving,
algorithms and flowchart.
Overview of C: Basic structure of C program, executing a C
program. Constant, variable and data types, Operators and
expressions

February 25, 2024 CSE, BMSCE 2


Computer

 Computer is an electronic device


which accepts input, processes data,
stores information and produces
output.

February 25, 2024 CSE, BMSCE 3


Computer Generations
 The computer of each generation is smaller, faster and more
powerful than preceding generation. There are five computer
generations.
• Vacuum tubes
First (1946-1959)
• Magnetic drums for memory

• Transistors
Second (1959-1965)
• Magnetic cores, disks, punched cards and printouts

• Integrated circuits (ICs)


Third (1965-1971)
• Keyboard, monitor and operating system

• Microprocessors
Fourth (1971-1980)
• Networking

• AI & ULSI
Fifth (1980-present)
February 25, 2024 CSE, BMSCE 4
Computer Generations
First Generation: The vacuum tubes were used for computation. Magnetic
drums were used for memory requirements. It consumed lot of space,
power and generated lot of power. ENIAC (Electronic Numerical Integrator
and Computer) used 18000 vacuum tubes, 1800 acquired sq. ft. room
space and consumed 180KW of power. The machine level language (0s and
1s) was used. Punched cards were used for input and Paper for output.
They were used for scientific work.

Second Generation: The transistors was the most important component


which replaced vacuum tubes. Magnetic cores were used for memory. It
were more reliable than first generation computer. The assembly or
symbolic language was used. The input and output mechanism remained
same. The stored program concept was introduced which stores both data
and program.

February 25, 2024 CSE, BMSCE 5


Computer Generations (Contd…)
Third Generation: The Integrated circuits(IC) was the most important
component. The transistors, diodes, resistors, capacitors were integrated on
a single chip. The high-level language was used like BASIC, C, C++ and
JAVA. Memory capacity increased and magnetic hard disk was used for
secondary generation. The third generation computers also had OS and
computer could rum programs invoked by multi users.
Fourth Generation: The Microprocessor was the most important
component. With the help of LSI (Large Scale Integration) and VLSI (Very
Large Scale Integration) the entire CPU is on a single chip. OS have moved
from MSDOS to GUI (Graphical User Interface) like windows. The
networking technology has also been improved. The size was reduced and
the speed was increased
Fifth Generation: Artificial Intelligence and use of natural languages are
the main features of this generations. These systems are expected to
interact with users in natural language. Speech recognition and speech
output should also be possible. Computers must be able to perform parallel
processing. The quad-core and octa-core was also introduced. Neural
networks and expert systems have been developed.

February 25, 2024 CSE, BMSCE 6


Computer Generations

February 25, 2024 CSE, BMSCE 7


Computer Types
Apart from being classified by generations, computers can
also be categorized by their size. The size of a computer is
often an indirect indication of its capabilities.
 Supercomputers
 Mainframes
 Minicomputers/Midrange computers
 Microcomputers
 Smartphones and Embedded Computers

February 25, 2024 CSE, BMSCE 8


Computer Types
Supercomputers: These are huge machines having most
powerful and fastest processors. It uses multiple CPUs for
parallel data processing. Speeds are measured in flops
(floating point operations per second). The fastest operates
at 34 petaflops. They are used for weather forecasting,
analysis of geological data. They have enormous storage,
uses more power and generate lot of heat. They are used by
government agencies.
Mainframes: These are multi-user machines that support
many users using the feature of time sharing. It can run
multiple programs even with a single CPU. The processor
speed is measured in MIPS (Million instructions per second).
It is used to handle data, applications related to
organization and online transactions in banks, financial
institutions and large corporations.

February 25, 2024 CSE, BMSCE 9


Computer Types (Contd…)
 Minicomputers/Midrange computers: It was introduced by
DEC (Digital Equipment Corporation). They can serve hundreds
of users and are small enough to partially occupy a room. They
are used in smaller organizations or a department of a large
one. They are not affordable to be used in home.
 Microcomputers: The microcomputer or PC is introduced by
Apple and endorsed by IBM. This is a single-user machine
powered by a single-chip microprocessor. They are very
powerful machines having gigabytes of memory. They are both
used in standalone mode and in a network. A microcomputer
takes the form of desktop, notebook (laptop) or a netbook
(smaller laptop). PCs today are powered by 3 types of OS –
windows (7, 8 or 10), Mac OS X (Apple) and Linux. They are
used for engineering and scientific applications and for
software development.

February 25, 2024 CSE, BMSCE 10


Computer Types (Contd…)
 Smartphones and Embedded Computers: The smartphone
is a general purpose computer i.e., capable of making phone
calls. It has a powerful processor, with multiple cores, supports
GBs of memory, and runs developed OS (Android or iOS). It
can be operated with keyboard, touch or stylus. Embedded
Computers or micro-controllers are very small circuits
containing a CPU, non-volatile memory, input and output
handling facilities. They are embedded into many machines
that we use – cars, washing machines, cameras etc. The
processor here runs a single unmodifiable program stored in
memory.

February 25, 2024 CSE, BMSCE 11


BITS, BYTES AND WORDS
 Computer can understand only two states: 0 and 1.
 A digit can have only two states or values known as a
binary digit, abbreviated as bit (b).
 The name nibble was coined to represent four bits.
 The name byte (B) was coined to represent eight bits.
 The byte is the standard unit of measurement of
computer memory, data storage and transmission speed.
 The CPU handles memory data in larger units, called
words and it is usually even multiple of bytes (two
bytes, four bytes etc.).
 When referred to a computer it has 32-bit (4 bytes)
machine i.e., size of word is 32 bits.

February 25, 2024 CSE, BMSCE 12


BITS, BYTES AND WORDS

February 25, 2024 CSE, BMSCE 13


CPU (CENTRAL PROCESSING UNIT)
Central Processing Unit (CPU) is like the heart or brain of the computer. The
user does not get the desired output, without the necessary option taken by
the CPU. The CPU is responsible for the processing of all the instructions
which are given by the user to the computer system.

Mouse Printer
Keyboard Speaker

February 25, 2024 CSE, BMSCE 14


CPU (CENTRAL PROCESSING UNIT) (Contd…)

The CPU comprises of following functional components:


i. ALU (Arithmetic and Logic Unit)
ii. CU (Control Unit)
iii, Input Unit
iv. Output Unit
iii. Registers
iv. Memory
The ALU is a “super calculator” carrying out all arithmetic tasks and Boolean operations.
The CU controls the way data is moved between the various components of computer. Both ALU and
CU use the service of clock for synchronizing their Operations.
The CPU uses a few high-speed registers to store the current instruction and its data. One of the
registers, program counter, stores the address of next instruction to be executed. All program
instructions are executed using the fetch-decode-execute mechanism. The CPUs are rated in GHz
(gigahertz).

Input Unit: It is used to give the input that is data to the computer. It is done with the help of input
devices. Ex: Mouse, Keyboard
Output Unit: It is used to receive the output (information) from the computer. It is done with the
help of output devices. Ex: Printer, Speaker.

Memory: Collection of chips on motherboard, where all computer processing and program
instructions are stored. There are two types: Primary Memory and Secondary Memory.

February 25, 2024 CSE, BMSCE 15


Primary Memory
 Primary memory is the main memory, which stores data
and programs, which are currently needed by CPU. The
size is less than the secondary memory and it is costly.
 RAM (Random Access Memory):
 Static RAM
 Dynamic RAM
 ROM (Read Only Memory):
 PROM (Programmable Read Only Memory):
 EPROM (Erasable Programmable Read Only Memory)
 EEPROM (Electrically Erasable Programmable Read Only Memory)
 Cache Memory
 Registers

February 25, 2024 CSE, BMSCE 16


Primary Memory (Contd…)
 RAM (Random Access Memory): It is the main memory, where the
user can write information into RAM and read information from it. It is
accessible to users. The RAM is randomly accessible by user. It is a
volatile memory, which means the data, or information is retained as
long as power supply is ON. There are two types of RAM: SRAM (Static
RAM) and DRAM (Dynamic RAM).
 ROM (Read Only Memory): It is a permanent memory that can be
read but not written. It is a non-volatile memory, which means the data
or information is retained even power supply is not there. It contains a
start-up program BIOS (Basic Input Output System) which transfers
control to OS.
 PROM (Programmable Read Only Memory): It is programmed as per requirement of
customer’s choice. The programmer burns the data into PROM. The data once written
cannot be changed.
 EPROM (Erasable Programmable Read Only Memory): It can be rewritten (but only once)
even though it has been previously burned. It is erased by exposing it to UV-rays.
 EEPROM (Electrically Erasable Programmable Read Only Memory): It can be erased and
rewritten multiple times. The electric voltage is used to erase the data. The pen drive we
use today is of EEPROM.

February 25, 2024 CSE, BMSCE 17


Primary Memory (Contd…)
Cache Memory: It holds those portions of program that are
frequently used by CPU. It acts as a buffer between CPU and RAM.
The CPU first looks for the instructions in cache. It executes faster
than RAM, expensive and limited in size. It has multiple levels:
L1 (Level 1) – smallest and fastest – 32 KB
L2 (Level 2) – present closer to CPU – 256 KB
L3 (Level 3) – shared by cores – 8 MB

Registers: The small number of ultra-fast registers integrated into


the CPU represent the fastest memory of the computer. The CPU
does all its work here. Each register has the length of the
computer. The data is loaded into register before processing.
Registers are numbered and a program instruction specifies these
numbers. Ex: OR1R2R3 which means multiplication operation is
performed on R1 and R2 is performed and stored in R3.

February 25, 2024 CSE, BMSCE 18


Secondary memory
Secondary memory is not directly connected to CPU. It exists
inside the machine and also externally. It is a non-volatile, offline
and long-term storage memory. It is slower, cheaper than primary
memory but the capacity is higher.
 Hard disk/ Hard drive/ Fixed disk
 Magnetic tape
 Optical Disks (CD-ROM, DVD ROM, Blu-ray Disk):
 Flash Memory
 Floppy Diskette

February 25, 2024 CSE, BMSCE 19


Secondary Memory (Contd…)
 Hard disk/ Hard drive/ Fixed disk: It is the oldest secondary storage
device. It has more capacity but, the cost is less comparatively. It is
commonly present in laptop with 500GB and desktop with 1TB. It
contains a spindle, which holds one or more platters made up of non-
magnetic material. It has two surfaces which is coated with magnetic
material. Each surface has serially numbered tracks and further broken
into sectors or blocks. The disk runs with the speed of 5400 and 7200
rpm.
 Magnetic tape: The magnetic tape is made up of plastic film with one
side coated with magnetic material. It supports 1 TB or more, but 200
TB are also expected. The device is not fully portable though because,
a separate tape drive is required. The data is accessed sequentially.
This makes it unsuitable for backup.
 Optical Disks (CD-ROM, DVD ROM, Blu-ray Disk): It is non-volatile
read-only memory. The CDROM and DVD-ROM, can hold large volumes
of data (700MB to 8.5 GB). The Blu-ray disk has the capacity upto 50
GB. A laser beam in their drives controls the read and write operations.
A laser beam is used to construct pits and lands by burning selected
areas along its tracks. CD-R, DVD-R: Data can be recorded only once.
CD-RW, DVD-RW: Data can be recorded multiple times.

February 25, 2024 CSE, BMSCE 20


Secondary Memory (Contd…)
 Flash Memory: It doesn’t have any moving parts, is based on
the EEPROM. It is available in various forms- pen drive,
magnetic card (SD Card), solid state disk (SSD). They are
portable, need little power and quite reliable.
 The memory stick or pen drive is the most common type of flash memory
used on the computer. It is a small, removable piece of circuit and it
connects to the USB port of computer.
 The solid state disk is a bigger device meant to replace the traditional
magnetic hard disk.
 The magnetic card is used mainly in cameras and the most popular is the
micro-SD card.
 Floppy Diskette: This is represented by a rectangular plastic
case containing a thin magnetic disk. It was available in two
sizes (5.25” and 3.5”), offering capacities of 1.2 MB and 1. MB.
It is unsuitable for backup purpose.

February 25, 2024 CSE, BMSCE 21


Difference between Primary memory and Secondary memory

Primary Memory Secondary Memory

February 25, 2024 CSE, BMSCE 22


Ports and Connections
Devices like scanners, printers are connected to a computer
through docking points called ports. It is impossible to use wrong
connector for a port.

SERIAL PORT: This port transfers one bit at a time serially.


They are offered in 9-pin and 25-pin configuration. They were used
for connecting keyboard, mouse, and modems.

PARALLEL PORT: This port is used to transfer data in parallel, 8


bits at a time. This is implemented using 25 pins.

USB (Universal Serial Bus): This replaced serial and parallel


ports in motherboard. Most computers offer four USB ports to
support scanners, printers and mouse.

February 25, 2024 CSE, BMSCE 23


Ports and Connections (Contd…)
VGA (Video Graphics Array): This 15-pin port allows transfer of
analog video data to the monitor. This is replaced with DVI
(Digital Video Interface) which uses digital data.

RJ45 port: This port is used by Ethernet network. Even though


computer connects wirelessly, the wired RJ45 remains as a useful
option.

PS/2 port: This port has replaced serial port. It has 6 pins but
occurs as a pair in two different colors. The ports and connectors
for keyboard are purple, while the mouse uses green port. USB has
invaded this area also.

HDMI (High Definition Multimedia Interface): This is used for


transferring audio and video between computers and HDTVs,
projectors and home theaters.

February 25, 2024 CSE, BMSCE 24


Input Devices
Input devices are needed to interact with the Operating System (OS) to perform
tasks.

KEYBOARD
• Physical/touch screen
• Contains letters, numerical and symbols

POINTING DEVICES
(MOUSE/TOUCHPAD)
• Controls the movement of cursor on the screen
• Mouse has rotating ball and two buttons used for
various tasks.
SCANNER
• Creates a digital image of a document.
• The document to be scanned is placed on a glass
plate covered by lid.

February 25, 2024 CSE, BMSCE 25


Output Devices
The information produced can be heard or seen with the
help of output devices

MONITOR
• Displays both text and graphics.
• CRT/LCD Monitors

PRINTER
• Produces hardcopy of output.
• Impact printers (Dot matrix, Daisy-wheel, Line printer)
• Non-Impact printers (Laser, Inkjet printers)

PLOTTER
• Can make drawings by using automated pen.
• Used for creative drawings like buildings and
machines.
• Slow and expensive.

February 25, 2024 CSE, BMSCE 26


Computers in a network
A computer network is a group of computer systems and
other computing hardware devices that are linked
together through communication channels to facilitate
communication and resource sharing among wide range of
users.

February 25, 2024 CSE, BMSCE 27


Network Topology
Network Topology: The ways used to connect the computers.
The different types are: Bus, Star, Ring, and Mesh.

February 25, 2024 CSE, BMSCE 28


Network Topology
Bus Topology: It uses a single cable called as bus to which
all computers are connected. The failure of one single node
doesn’t disturb other nodes.

Star Topology: It uses a central hub to which all nodes are


connected. If the hub fails, entire network fails and the
nodes cannot be added easily.

Ring Topology: It is connected in the form of closed loop


without hub. Data moves from node to node. For
unidirectional rings, if one node fails, the network fails.

Mesh Topology: Nodes are connected to one another


offering multiple paths. If node breaks down, then data
passing changes its route. It is expensive.
February 25, 2024 CSE, BMSCE 29
Network Types
Networks are also classified on their size. The most common types are LAN
and WAN. And some other types are: MAN, CAN and PAN.
LAN (Local Area Network): They are used in smaller organizations
usually using Ethernet. The usual speed will be 100Mbps.
WAN (Wide Area Network): They are used in cities and can connect
larger distance. They use optic fiber cables. Banks, Airline and Hotel
reservations use WANs.
MAN (Metropolitan Area Network): It is sandwiched between LAN and
WAN and used for interconnecting in same cities.
PAN (Personal Area Network): This is the smallest network and can
connect only few meters. It connects small devices like phones, laptops
through Bluetooth.

Intranet is a network of computers designed for a specific group of users


and can be accessed from Internet but with restrictions.
Internet is wide network of computers and is open for all and itself
contains a large number of intranets.

February 25, 2024 CSE, BMSCE 30


Difference between LAN, WAN, MAN

Basis LAN MAN WAN

LAN stands for local area MAN stands for WAN stands for wide
Full-Form network. metropolitan area network. area network.

Operates in small areas such Operates in larger areas


Geographic Operates in large areas
as the same building or such as country or
Span such as a city.
campus. continent.

While WAN also might


MAN’s ownership can be
Ownership LAN’s ownership is private.
private or public.
not be owned by one
organization.

February 25, 2024 CSE, BMSCE 31


NETWORK HARDWARE
Connecting computers in a network require additional devices that are not
part of the computer’s basic configuration.

Hub and Switch: Computers in a single network is connected to a central


device called hub or switch.
HUB accepts network data from computer and broadcasts to the nodes by
checking destination address.
SWITCH will have a table which contains MAC (Media Access Control)
addresses of connected devices. The data is sent after looking up the table
for destination.

Bridge and Router: The network supports many nodes which leads to
congestion. Hence, the network may be split into a number of segments,
with a BRIDGE connecting them. It connects two networks using the same
protocol.
ROUTER connects two similar or dissimilar networks separated by long
distance. It is a part of two networks and thus have two addresses. It has a
routing table to store address.

February 25, 2024 CSE, BMSCE 32


Bridge, Hub, Switch, Router

February 25, 2024 CSE, BMSCE 33


Software basics
 Software is a collection of code that drives a computer to
perform related group of tasks.
 Programs in software use a language.
 The source code is created by programmer using
programming languages like C, C++, Java, Python etc.
 The software is developed to operate on multiple
platforms.

February 25, 2024 CSE, BMSCE 34


Software Types
Computer software can be broadly classified into two types:
System software and Application Software.
System Software: Software run by the computer to manage the
hardware connected to it is known as system software.
System software examples: BIOS (Basic Input-Output System): It
checks the hardware devices and peripherals at boot time. OS
(Operating System): It manages both hardware and programs
running on the computer.

Application Software: Software not directly connected with


hardware but related to a specific application is known as
application software.
Application software examples: Office software: This comprises of
three separate applications: word processing, spread sheet and
presentations. Database software: It allows data to have a uniform
structure to be stored in a database.

February 25, 2024 CSE, BMSCE 35


Difference between System Software and Application Software

System Software Application Software

System software is used for operating Application software is used by user to


computer hardware. perform specific task.
System softwares are installed on the Application softwares are installed
computer when operating system is according to user’s requirements.
installed.
In general, the user does not interact with In general, the user interacts with
system software because it works in the application softwares.
background.
System software can run independently. Application software can’t run
It provides platform for running independently. They can’t run without
application softwares. the presence of system software.
Some examples of system softwares are Some examples of application softwares
compiler, assembler, debugger, driver, are word processor, web browser, media
etc. player, etc.

February 25, 2024 CSE, BMSCE 36


Thanks for Listening

My contact details
Dr. Umadevi V, Associate Professor, Department of CSE, BMSCE
Staff Room: 4th floor, New Academic block

[email protected]

8762742909

February 25, 2024 CSE, BMSCE 37

You might also like