Computers Notes
Computers Notes
MODULE 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.
Overview of C: Basic structure of C program, executing a C program. Constant, variable and data
types, Operators and expressions.
What is a Computer?
A Computer is device that can automatically performs a set of instructions. The computer takes
as input these instructions as a single unit, uses them to manipulate the data, and outputs the
results in user-specified ways. The processing is fast, accurate and consistent, and is generally
achieved without significant human intervention.
Computer Generations
Computers are such an integral part of our everyday life. Even more so the generation who
have grown from infancy within the global desktop and laptop revolution since the 1980s. The
history of the computer goes back several decades however and there are five definable generations
of computers.
Each generation is defined by a significant technological development that changes
fundamentally how computers operate – leading to more compact, less expensive, but more
powerful, efficient and robust machines.
The language evolved from cryptic binary language to symbolic (assembly‘) languages.
This meant programmers could create instructions in words. About the same time high level
programming languages were being developed (early versions of COBOL and FORTRAN).
Transistor-driven machines were the first computers to store instructions into their
memories – moving from magnetic drum to magnetic core technology‘. The early versions
of these machines were developed for the atomic energy industry.
Summary:
✓ Transistors Replaced Vacuum Tubes
▪ Faster, Smaller and consumed less power
✓ Needs air conditioner
✓ Memory– Magnetic cores, disks
✓ Input– Punch Cards
✓ Output – Paper
✓ Programmed using– Assembly level Language
✓ High level languages: COBOL and Fortran appeared
✓ Stored Program concept –both data and program to reside in memory
Summary:
• Microprocessor
• Large scale integration and Very Large Scale integration technology –entire CPU, its
memory, I/O control circuitry on a single chip)
• Intel introduced 4004 microprocessors in 1971
• Laptops and smart phones offer Giga Bytes of memory
• OS moved from MSDOS to mouse based GUI like windows
• Laptops, smart phones, microwave ovens and washing machines –microprocessors are
used
• Internet
• Windows, Linux for desktops and laptops
• Android for smart phones
The essence of fifth generation will be using these technologies to ultimately create
machines which can process and respond to natural language, and have capability to learn and
organize.
Summary:
✓ Computers of future is the vision
✓ Artificial Intelligence and natural Languages
✓ VLSI to ULSI
✓ Speech recognition and speech output
✓ Quantum computers: Googles D-Wave 2X computer
o It is 100 million times faster than today's computer
✓ Parallel processing: Quad-core and Octa-core
✓ Neural networks and Expert systems (used in financial institutions for detection of credit
card fraud)
Computer Types
Since the advent of the first computer different types and sizes of computers are offering
different services. Computers can be as big as occupying a large building and as small as a laptop
or a microcontroller in mobile & embedded systems.
The four basic types of computers are as under:
1. Supercomputer
2. Mainframe Computer
3. Minicomputer
4. Microcomputer
Supercomputer
The most powerful computers in terms of performance and data processing are the
Supercomputers. These are specialized and task specific computers used by large organizations.
These computers are used for research and exploration purposes, like NASA uses
supercomputers for launching space shuttles, controlling them and for space exploration purpose.
The supercomputers are very expensive and very large in size. It can be accommodated in large
air-conditioned rooms; some super computers can span an entire building.
Summary:
✓ Huge machine – most powerful & fastest.
✓ Multiple CPU – uses multiple CPUs for parallel data processing
✓ Speed is measured in – FLOPS(floating point operations per second)
✓ “Tianhe-2” – Fastest super computer.
✓ Handle multiple users.
✓ Weather forecasting , analysis of geological data, nuclear simulation, space exploration.
✓ Enormous storage, huge amount of power & heat.
Mainframe Computer
Although Mainframes are not as powerful as supercomputers, but certainly they are quite
expensive nonetheless, and many large firms & government organizations uses Mainframes to
run their business operations. The Mainframe computers can be accommodated in large air-
conditioned rooms because of its size. Super-computers are the fastest computers with large data
storage capacity, Mainframes can also process & store large amount of data. Banks
educational institutions & insurance companies use mainframe computers to store data about their
customers, students & insurance policy holders.
Summary:
✓ These are multi-user machines that can support hundreds or thousands of users using the
feature of time sharing supported by systems like Linux.
✓ Interaction – terminal & keyboard.
✓ Runs multiple program – even with a single CPU.
✓ Speed – MIPS (million instructions per second)
✓ Used – stock exchange transactions
▪ on-line transactions
▪ Government Sectors
▪ Banks
▪ Financial Sectors
Mini Computer
Minicomputers are used by small businesses & firms. Minicomputers are also called as
―Midrange Computers‖. These are small machines and can be accommodated on a disk with not
as processing and data storage capabilities as super-computers & Mainframes.
These computers are not designed for a single user. Individual departments of a large
company or organizations use Mini-computers for specific purposes. For example, a production
department can use Mini-computers for monitoring certain production process.
Summary:
✓ Mid-range computers.
✓ Down sized mainframes.
✓ Servers.
✓ DEC – Digital equipment corporation introduced in 1970s, the mini computer is positioned
between mainframe and a micro-computer
Micro Computer
Desktop computers, laptops, personal digital assistant (PDA), tablets & smartphones are
all types of microcomputers. The micro-computers are widely used & the fastest growing
computers. These computers are the cheapest among the other three types of computers. The
Micro-computers are specially designed for general usage like entertainment, education and
work purposes. Well known manufacturers of Micro-computer are Dell, Apple, Samsung,
Sony& [Link] computers, Gaming consoles, Sound & Navigation system of a car,
Netbooks, Notebooks, PDA‘s, Tablet PC‘s, Smartphones, Calculators are all type of
Microcomputers.
Summary:
• PC – single user machine
• They are used both in the standalone mode (at home) and in a network (in office). Memory –
GB/TB
• Takes form – desktops, notebooks
• Single CPU – high end support – intel core i5,i7 etc…
• Operating system – windows, Mac OS , Linux
• PC supports – word processing
spread sheet handling
internet browsing
handling image, video, audio etc..,
• Variant of PC – workstation.
CSE, CITECH 2018-19 Page 10
C •Programming for Problem solving (18CPS13/23) Module 1: C Overview
• Workstation – powerful processors, high resolution terminal, High quality graphics.
• Scientific application – software development.
• Connected to network – share resources.
Summary:
• In decimal system for computing, a digit can have ten values (0 to 9) or states.
• In binary system, a digit can have only two states (0 or 1) is called binary digit (bit)
• Computers understand only binary system (i.e) 0 or 1.
• Byte represents 8 bits
• Byte is the standard unit of measurement of computer memory, data storage and
transmission speed.
• CPU handles data in larger units called words. In 32 bit machine 1 word=32 bits=4 bytes
In 64 bit machine 1 word=64 bits=8 bytes
Word is a even multiple of bytes.
• A bit (short for binary digit) is the smallest unit of data in a computer. A bit has a single
binary value, either 0 or 1.
• Half a byte (four bits) is called a nibble.
• A byte is a unit of data that is eight binary digits long.
o A byte is the unit most computers use to represent a
o character such as a letter, number.
• A word is a unit of data of a defined bit length.
Unit Equivalent to Remarks
I terabyte (TB)
1024 gigabytes Capacity of today's hard disks.
1 petabyte (PB)
1024 terabytes Space used for rendering of film Avatar
CPU
A central processing unit (CPU) is the electronic circuitry within a computer that
carries out the instructions of a computer program by performing the basic arithmetic, logical,
control and input/output (I/O) operations specified by the instructions. The computer industry
has used the term "central processing unit" at least since the early 1960s. [1] Traditionally, the
term "CPU"
refers to a processor, more specifically to its processing unit and control unit
(CU), distinguishing these core elements of a computer from external components such
as main memory and I/O circuitry.[2]
The form, design, and implementation of CPUs have changed over the course of
their history, but their fundamental operation remains almost unchanged. Principal components
of a CPU include the arithmetic logic unit (ALU) that performs arithmetic and
logic operations, processor registers that supply operands to the ALU and store the results
of ALU operations and a control unit that orchestrates the fetching (from memory) and
execution of instructions by directing the coordinated operations of the ALU, registers and other
CSE,components.
CITECH 2018-19 Page 14
C Programming for Problem solving (18CPS13/23) Module 1: C Overview
This part of the computer system collects the raw data from the input devices and converts
it to useful information which can then be used by the output devices. On some computers,
the CPU can be a single microchip. On bigger systems, the CPU can be formed from a number
of chips working together.
Control Unit this part controls the input and output devices
Arithmetic Logic Unit this is the part that does all the working out: it does all the maths
and makes the decisions
Immediate Access Store this is the memory available for programs and data. The
more memory the CPU has - the more programs it can run at the same time; and the
more data it can deal with in one go.
Primary Memory
Primary storage (also known as main memory or internal memory), often referred to
simply as memory, is the only one directly accessible to the CPU. The CPU continuously
reads instructions stored there and executes them as required. Any data actively operated
on is also stored there in uniform manner.
Historically, early computers used delay lines, Williams tubes, or rotating magnetic drums
as primary storage. By 1954, those unreliable methods were mostly replaced by
magnetic core memory. Core memory remained dominant until the 1970s, when
advances in integrated circuit technology allowed semiconductor memory to become
economically competitive.
This led to modern random-access memory (RAM). It is small-sized, light, but quite
expensive at the same time. (The particular types of RAM used for primary storage
are also volatile, i.e. they lose the information when not powered).
Main memory is directly or indirectly connected to the central processing unit via a
memory bus. It is actually two buses (not on the diagram): an address bus and a data bus. The
CPU firstly sends a number through an address bus, a number called memory address, that
indicates the desired location of data.
Then it reads or writes the data in the memory cells using the data bus. Additionally, a memory
management unit (MMU) is a small device between CPU and RAM recalculating the actual
memory address, for example to provide an abstraction of virtual memory or other tasks.
As the RAM types used for primary storage are volatile (uninitialized at start up), a computer
containing only such storage would not have a source to read instructions from, in order
to start the computer. Hence, non-volatile primary storage containing a small startup
program (BIOS) is used to bootstrap the computer, that is, to read a larger program from
non-volatile secondary storage to RAM and start to execute it.
Secondary Memory
Secondary st orage (also known as external memory or auxiliary storage), differs from
primary storage in that it is not directly accessible by the CPU. The computer usually uses
its input/output channels to access secondary storage and transfers the desired data
using intermediate area in primary storage. Secondary storage does not lose the data when the
device is powered down—it is non-volatile. Per unit, it is typically also two orders of magnitude
less expensive than primary storage. Modern computer systems typically have two orders of
magnitude more secondary storage than primary storage and data are kept for a longer time there.
In modern computers, hard disk drives are usually used as secondary storage. The time taken
to access a given byte of information stored on a hard disk is typically a few thousandths of a
second, or milliseconds. By contrast, the time taken to access a given byte of information
stored in random-access memory is measured in billionths of a second, or nanoseconds. This
illustrates the significant access-time difference which distinguishes solid-state memory from
rotating magnetic storage devices: hard disks are typically about a million times slower than
memory. Rotating optical storage devices, such as CD and DVD drives, have even longer access
times. With disk drives, once the disk read/write head reaches the proper placement and the data
of interest rotates under it, subsequent data on the track are very fast to access. To reduce the
seek time and rotational latency, data are transferred to and from disks in large contiguous
blocks.
Most computer operating systems use the concept of virtual memory, allowing
utilization of more primary storage capacity than is physically available in the system. As
the primary memory fills up, the system moves the least-used chunks (pages) to secondary
storage devices (to a swap file or page file), retrieving them later when they are needed. As
CSE, CITECH 2018-19 Page 16
C Programming for Problem solving (18CPS13/23) Module 1: C Overview
more of these retrievals from slower secondary storage are necessary, the more the overall
system performance is degraded.
Summary:
The CPU has evolved from a bulky vacuum tube based unit of the 1940s to a modern 5cm square
chip that is commonly called the microprocessor, or simple processor.
✓ The CPU represented by a single chip in a PC.
✓ CPU needs both fast (primary memory) and slow (secondary memory)memory for its
operation
It comprises the following components
✓ Arithmetic and Logic Unit (ALU)
✓ Control Unit (CU)
✓ Special purpose registers
✓ A clock
✓ The output is copied to another register from there it is copied to primary memory.
✓ The next cycle can now begin.
✓ All these activities need synchronization by the clock.
✓ Clock generates pulses at regular intervals.
✓ CPU cannot execute more than one instruction in one clock pulse even though one
instruction may take several clock pulses to execute.
✓ Faster the clock, faster is the execution
✓ The intel core i7 has a clock speed of 3.4 GHz, which means it emits 3.4 billion pulses in one
second.
✓ Today’s processors have multicore in the [Link]- An octacore chip has eight processors in
the chip.
✓ All these activities need synchronization by the clock.
✓ Clock generates pulses at regular intrevals.
✓ CPU cannot execute more than one instruction in one clock pulse even though one
instruction may take several clock pulses to execute.
✓ Faster the clock, faster is the execution
✓ The intel core i7 has a clock speed of 3.4 GHz, which means it emits 3.4 billion pulses in
one second.
✓ Today’s processors have multicore in the [Link]- An octacore chip has eight processors in
the chip.
MEMORY
Computer supports multiple types of memory
Two types: Primary memory
Secondary memory
Primary memory has the following types: housed in motherboard, fastest in CPU itself
✓ RAM-SRAM, DRAM (Volatile)
✓ ROM- PROM,EPROM,EEPROM (non volatile)
✓ Cache memory (L1,L2 and L3) Volatile
✓ CPU registers Volatile
Cache Memory
✓ Holds portion of program that are frequently used by CPU.
✓ Available between CPU and RAM
✓ When executing, CPU first looks for the instruction and data in cache. if found it is cache
hit else it is cache miss.
✓ Modern computers support multiple levels of cache.
✓ CPU contains L1 cache ( small and fast), L2 outside CPU but close to it.
✓ L3 slow than L1 and L2 but faster than RAM
✓ First CPU searches in L1, if not
▪ found searches in L2, if not found
▪ then in L3, if not found takes from RAM
CSE, CITECH 2018-19 Page 19
C Programming for Problem solving (18CPS13/23) Module 1: C Overview
Registers
✓ Registers are a type of computer memory used to quickly accept, store, and transfer data and
instructions that are being used immediately by the CPU.
✓ The registers used by the CPU are often termed as Processor registers.
✓ A processor register may hold an instruction, a storage address, or any data (such as bit
sequence or individual characters).
Secondary Memory:
✓ Hard disk including the portable disk (500 GB to 4 TB).
✓ Magnetic tape (20 TB).
✓ CD-ROM (700 MB-less than 1 GB).
✓ DVD-ROM (4.7 GB and 8.5 GB).
✓ Blu-ray disk (27 GB and 50 GB).
✓ Flash memory based on the EEPROM (1 GB to 128 GB).
✓ The obsoleted floppy disk (1.2 MB and 1.44 MB).
Hard Disk:
✓ Every disk contains a spindle that holds one or more platters made of non-magnetic
material like glass or aluminium (Fig. 1.4). Each platter has two surfaces coated with
magnetic material.
✓ Information is encoded onto these platters by changing the direction of magnetization using
a pair of read-write heads available for each platter surface.
✓ Eight surfaces require eight heads; they are mounted on a single arm and cannot be
controlled individually.
✓ Each surface is composed of a number of concentric and serially numbered tracks.
✓ There are many tracks bearing the same track number as there are surfaces. This can then
visualize a cylinder comprising all tracks bearing the same number on each disk surface.
✓ Thus, there will be as cylinders in the disk as there are tracks on each usable surface.
✓ Each track is further broken into sectors or blocks. So, if each track has 32 blocks and a
disk has eight surfaces, then Up 256 blocks per cylinder.
Magnetic Tape
✓ The age-old magnetic tape is still around thanks to the enhancements that have been made to
this device.
✓ The basic technology has not changed though; the tape is made of a plastic film with one side
coated with magnetic material.
✓ The entire mechanism comprising two spools and the tape is encapsulated in a small cassette
or cartridge.
✓ Current technology supports capacities of 1 TB or more, but 200 TB tapes are expected to
be launched in the near future.
✓ Data are read from and written to the tape using a read-write head.
✓ To locate a file, the tape has to be rewound before a sequential search can begin.
✓ Tape backup is most suitable for archiving data of the hard disk that are not expected to be
needed at short notice. The backup is inexpensive and convenient for restoring lost data.
Optical Disks:
The CD-ROM, DVD-ROM and Blu-Ray.
Non-volatile read-only memory, these disks, comprising mainly the CD-ROM and DVD-ROM,
can hold large volumes of data(700 MB to 8.5 GB).
✓ The Blu-ray disk enhances this capacity to 50 GB. A laser beam in their drives controls the
read and writes operations.
✓ Optical disks are made of carbonate material with a thin layer or two of reflective film.
✓ A laser beam is used to construct pits and lands by burning (writing) 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.
✓ The optical drive uses three motors for the following
o functions: operating the tray, spinning the disk and guiding the laser beam.
Flash Memory:
✓ They are portable, need little power and are quite reliable.
✓ The capacities offered by this class of devices are increasing
o exponentially while their prices continue to decline substantially.
✓ The memory stick or pen drive is the most common type of flash memory used on the
computer.
✓ The solid state disk (SSD) a bigger device meant to replace the traditional magnetic hard disk.
Many small laptops (like Chrome books) have the operating system and a small set of programs
stored on this online device.
✓ magnetic card, is used mainly in cameras, but using adapters, they can connect to the USB port
as well.
The most popular form of this device is the micro-SD card.
Floppy Disk :
✓ The floppy diskette was once the only form of portable storage that could be carried in the
pocket.
✓ A read/write head actually makes contact with this disk while it is rotating.
✓ The floppy was available in two sizes (5.25" and 3.5"), offering capacities of 1.2 MB and 1.44
MB respectively.
A Computer Port is an interface or a point of connection between the computer and its peripheral
devices. Some of the common peripherals are mouse, keyboard, monitor or display unit, printer,
speaker, flash drive etc.
The main function of a computer port is to act as a point of attachment, where the cable
from the peripheral can be plugged in and allows data to flow from and to the device.
A computer port is also called as a Communication Port as it is responsible for communication
between the computer and its peripheral device. Generally, the female end of the connector is
referred to as a port and it usually sits on the motherboard.
In Computers, communication ports can be divided into two types based on the type or
protocol used for communication. They are Serial Ports and Parallel Ports.
A serial port is an interface through which peripherals can be connected using a serial
protocol which involves the transmission of data one bit at a time over a single communication
line. The most common type of serial port is a D-Subminiature or a D-sub connector that carry
RS-232 signals.
A parallel port, on the other hand, is an interface through which the communication between
a computer and its peripheral device is in a parallel manner i.e. data is transferred in or out in
parallel using more than one communication line or wire. Printer port is an example of
parallel port.
PS/2
PS/2 connector is developed by IBM for connecting mouse and keyboard. It was
introduced with IBM‘s Personal Systems/2 series of computers and hence the name
PS/2 connector. PS/2 connectors are color coded as purple for keyboard and green for
mouse.
VGA Port
VGA port is found in many computers, projectors, video cards and High Definition TVs.
It is a D-sub connector consisting of 15 pins in 3 rows. The connector is called as DE-15.
VGA port is the main interface between computers and older CRT monitors. Even the modern
LCD and LED monitors support VGA ports but the picture quality is reduced. VGA carries
analogue video signals up to a resolution of 648X480.
HDMI
HDMI is an abbreviation of High Definition Media Interface. HDMI is a digital interface
to connect High Definition and Ultra High Definition devices like Computer monitors, HDTVs,
Blu-Ray players, gaming consoles, High Definition Cameras [Link] can be used to carry
uncompressed video and compressed or uncompressed audio signals.
USB
Universal Serial Bus (USB) replaced serial ports, parallel ports, PS/2 connectors, game
ports and power chargers for portable devices. USB port can be used to transfer data, act
as an interface for peripherals and even act as power supply for devices connected to it. There
are three kinds of USB ports: Type A, Type B or mini USB and Micro USB.
Input Devices
An input device is any hardware device that sends data to a computer, allowing you to
interact with and control it. The most commonly used or primary input devices on a computer
are the keyboard and mouse. However, there are dozens of other devices that can also be used
to input data into the computer.
Today, input devices are important because they are what allows you to interact with and add
new information to a computer. For example, if a computer had no input devices, it could run
by itself but there would be no way to change its settings, fix errors, or other various user
interactions. Also, if you wanted to add new information to the computer (e.g., text, command,
document, picture, etc.), you wouldn't be able to do so without an input device.
Output Devices
An output device is any device used to send data from a computer to another device or user.
Most computer data output that is meant for humans is in the form of audio or video. Thus, most
output devices used by humans are in these categories. Examples include monitors, projectors,.
Output devices allow computers to communicate with users and with other devices. This can include
peripherals, which may be used for input/output (I/O) purposes, like network interface cards
(NICs), modems, IR ports, RFID systems and wireless networking devices, as well as mechanical
output devices, like solenoids, motors and other electromechanical devices.
Some of the most common output devices that people are familiar with include monitors, which
produce video output; speakers, which produce audio output; and printers, which produce text or
graphical output.
Computers in a network
The Network allows computers to connect and communicate with different computers via any
medium. LAN, MAN and WAN are the three major types of the network designed to operate
over the area they cover. There are some similarities and dissimilarities between them. One of
the major differences is the geographical area they cover, i.e. LAN covers the smallest
area; MAN covers an area larger than LAN and WAN comprises the largest of all.
Local Area Network (LAN): LAN or Local Area Network connects network devices in such a
way that personal computer and workstations can share data, tools and programs. The group of
computers and devices are connected together by a switch, or stack of switches, using a private
addressing scheme as defined by the TCP/IP protocol. Private addresses are unique in relation to
other computers on the local network. Routers are found at the boundary of a LAN, connecting
them to the larger WAN.
Metropolitan Area Network (MAN): MAN or Metropolitan area Network covers a larger area
than that of a LAN and smaller area as compared to WAN. It connects two or more computers
that are apart but resides in the same or different cities. It covers a large geographical area and may
serve as an ISP (Internet Service Provider). MAN is designed for customers who need a high-
speed connectivity. Speeds of MAN ranges in terms of Mbps. It‘s hard to design and maintain a
Metropolitan Area Network.
The fault tolerance of a MAN is less and also there is more congestion in the network. It
is costly and may or may not be owned by a single organization. The data transfer rate and the
propagation delay of MAN is moderate. Devices used for transmission of data through MAN are:
Modem and Wire/Cable. Examples of a MAN are the part of the telephone company network
that can provide a high-speed DSL line to the customer or the cable TV network in a city.
Wide Area Network (WAN): WAN or Wide Area Network is a computer network that extends
over a large geographical area, although it might be confined within the bounds of a state or
country. A WAN could be a connection of LAN connecting to other LAN‘s via telephone lines
and radio waves and may be limited to an enterprise (a corporation or an organization) or
accessible to the public. The technology is high speed and relatively expensive.
There are two types of WAN: Switched WAN and Point-to-Point WAN. WAN is
difficult to design and maintain. Similar to a MAN, the fault tolerance of a WAN is less and
there is more congestion in the network. A Communication medium used for WAN is PSTN or
Satellite Link. Due to long distance transmission, the noise and error tend to be more in WAN.
Network hardware
Networking hardware, also known as network equipment or computer
networking devices, are physical devices which are required for communication and
interaction between devices on a computer network. Specifically, they mediate data in a
computer network.[1] Units which are the last receiver or generate data are called hosts or data
terminal equipment.
Taking a wider view, mobile phones, PDAs and even modern coffee machines may
also be considered networking hardware. As technology advances and IP-based networks
are integrated into building infrastructure and household utilities, network hardware will
become an ambiguous term owing to the vastly increasing number of "network capable"
endpoints.
Switch: a device that connects devices together on a computer network, by using packet
switching to receive, process and forward data to the destination device. Unlike less
advanced network hubs, a network switch forwards data only to one or multiple devices that
need to receive it, rather than broadcasting the same data out of each of its ports.[5] It works
on OSI layer 2.
Bridge: a device that connects multiple network segments. It works on OSI layers 1 and 2.
Repeater: an electronic device that receives a signal and retransmits it at a higher level or
higher power, or onto the other side of an obstruction, so that the signal can cover longer
distances.
Repeater hub: for connecting multiple Ethernet devices together and making them act as a
single network segment. It has multiple input/output (I/O) ports, in which a
signal introduced at the input of any port appears at the output of every port except the
original incoming.[1] A hub works at the physical layer (layer 1) of the OSI
model.[8] Repeater hubs also participate in collision detection, forwarding a jam signal to all
ports if it detects a collision. Hubs are now largely obsolete, having been replaced
by network switches except in very old installations or specialized applications.
Assembly-level language
System software that converts source code to object code is called language processor.
There are three types of language interpreters−
Interpreter − Converts high level programs into machine level program line by line.
Compiler − Converts high level programs into machine level programs at one go rather
than line by line.
Device Drivers: System software that controls and monitors functioning of a specific device on
computer is called device driver. Each device like printer, scanner, microphone, speaker, etc.
that needs to be attached externally to the system has a specific driver associated with it. When
you attach a new device, you need to install its driver so that the OS knows how it needs to be
managed.
Application Software
A software that performs a single task and nothing else is called application software.
Application software are very specialized in their function and approach to solving a problem.
So a spreadsheet software can only do operations with numbers and nothing else. A hospital
management software will manage hospital activities and nothing else. Here are some commonly
used application software −
Word processing
Spreadsheet
Presentation
Database management
Multimedia tools
Utility Software
Application software that assist system software in doing their work is called utility software. Thus
utility software is actually a cross between system software and application software. Examples of
utility software include
Antivirus software
Compression tools
Backup tools
Summary :
✓ External devices are connected to computer through ports
✓ All ports are connected to motherboard
✓ There are different types of ports are
1. [Link]
2. [Link] port
3. [Link] port
4. [Link]
5. [Link]/2
6. [Link]
7. [Link]-45
CSE, CITECH 2018-19 Page 31
C Programming for Problem solving (18CPS13/23) Module 1: C Overview
Serial Port :
a connector by which a device that sends data one bit at a time may be connected to a computer. Once used
by the keyboard, terminals and modems, they are offered in 9 and 25
pin configurations.
Parallel Port :
a connector for a device that sends or receives several bits of data simultaneously by using more than one
wire and uses 25 pins where data are transferred in parallel.
PS/2 Port : is a 6-pin connector used for connecting keyboards and mouse to a PC compatible computer
system.
High Definition Multimedia Interface (HDMI) : HDMI is a connector and cable capable of
transmitting high-quality and high-bandwidth streams of audio and video between devices.
Input devices
✓ Some of the input devices are
✓ [Link]
✓ [Link] Devices
✓ [Link] – 1. Flatbed
2. Handheld – Barcode
3. MICR (Magnetic Ink)
Keyboard
✓ Either physical or touchscreen.
✓ Has QWERTY layout and consists of letters , numerals and special symbols called Characters.
✓ Each characters has unique value called ASCII value.
✓ Eg: A = 65 , ! = 21
✓ Special keys like - Enter key, Backspace, Delete, Ctrl key, Function key [F1] .
✓ Connected - PS/2 or USB
Pointing Design
✓ Mouse in desktop & touchpad in laptop.
✓ GUIs need a pointing device to control the movement of cursor
✓ Early mouse – rotating ball & 2 buttons.
✓ Right ,left click & scroll.
✓ Later - Optical mouse with infrared laser or LED to track movements.
✓ Now wireless mouse uses radio frequency technology.
✓ In laptop – rectangular space with 2 buttons.
Scanner
✓ Scanner-creates digital image of a doc by optically scanning it.
✓ Works with the special software that is shipped with the product.
✓ Connects to the USB port.
✓ Pictures are converted to JPEG files and documents to pdf files.
✓ Scanner can act in photocopier mode which directly print the document without saving it.
✓ Modern scanners have OCR(Optical Character Recognition) facility – image file converted to text
file and then can be edited.
✓ Handheld scanners – manually moved across the doc.
✓ MICR(Magnetic Ink Character Recognition) – used to read codes printed on bank cheques.
OutPut Device
✓ Output: information that can be seen or heard
✓ Output Devices
o Monitors: CRT and LCD
o Printers :
✓ Impact (Dot Matix Printer, Daisy Wheel Printer, Line Printer)
✓ Non Impact (Ink Jet Printer, Laser Printer)
o Plotters
Monitor
✓ CRT( Cathode ray tube) Monitor
o Uses rarefied tube containing 3 electron guns(RGB) and screen coated with phosphorescent
material.
o The guns emit electrons to create images on the screen by selectively lighting up the
phosphors.
✓ Resolution 640 * 480 pixels which translates to an aspect ratio of 4:3.
✓ They are large and heavy, energy-inefficient and generate lot of heat.
✓ Note : Resolution is the number of pixels (individual points of color) contained on a
display monitor.
✓ The aspect ratio of a display device is the proportional relationship between the width and the
height of the display.
LCD Monitor
✓ It comprises thousands of liquid crystals, which may allow or block the passage of light through
them.
✓ An image is formed by selectively applying a voltage to these crystals and using a separate light
source for light to pass through them.
✓ The backlight is provided either
o by fluorescent light.
✓ Aspect ratio 16:9
✓ Consumes less power, generates less heat, takes less space and increased life span.
✓ Note : A fluorescent lamp or fluorescent
✓ tube is a low-pressure mercury-vapor
✓ gas-discharge lamp that uses fluorescence
✓ to produce visible light.
Printers
✓ IMPACT – print head to strike (impact) a ribbon placed between the print head and paper
o Noisy, slow, low quality document compared to non - impact but still dot matrix printer is
used as it is cheaper.
✓ Non –I mpact – no strike (impact)
o Quiet, fast and produce high quality document but expensive.
Impact Printers
Dot-matrix printer
✓ print head has either 9 or 24 pins which are fired in multiple combinations to generate
letters, numerals and symbols.
✓ The ribbon is impregnated with ink, and when the pins fire against the ribbon, an
impression is created on the paper behind it.
✓ Speed – 300 cps (characters per second).
✓ A printer with 24pins offers the best print quality at 144 dpi(dots per inch),
✓ Due to gaps between the pins doesn’t produce quality output.
Daisy-wheel Printer
✓ It employs a wheel with separate characters distributed along its outer edge.
✓ Characters are pre formed and not generated
✓ The wheel is rotated so that the desired character directly faces the ribbon.
✓ We can print characters of different fonts.
✓ Can’t print graphics
✓ Obsolete
Line Printer
✓ It uses print chain containing the characters.
✓ The chain rotates continuously in front of the paper.
✓ Hammer strikes the paper in the normal
▪ manner, but speed is high 1200 lpm
CSE, CITECH 2018-19 Page 36
C Programming for Problem solving (18CPS13/23) Module 1: C Overview
Plotter
✓ Plotters makes line drawings, unlike printers which print text and graphics
✓ It uses one or more automated pens
✓ Commands are taken from special files called vector graphic files
✓ Based on plotter type, either pen moves or paper moves
✓ Slow and expensive
✓ Suitable to create drawings of buildings and machines and can handle large size papers.
Computers in Network
✓ Interconnection of computer is called a computer network.
Different ways of connecting computers in network is called as network topology
Network Types :
✓ Local Area Network (LAN)
✓ Wide Area Network (WAN)
Technology advances have led to the birth of other types of
networks
o Metropolitan Area Network (MAN)
o Campus Area Network (CAN)
o Personal Area Network (PAN)
o Internet and intranet
Network Hardware
Network Interface Card:
A network interface card (NIC) is a hardware component without which a computer cannot be
connected over a network.
It is a circuit board installed in a computer that provides a dedicated network connection to the
computer. It is also called network interface controller, network adapter or LAN adapter.
Software
Computer software also called software, is a set of instructions and its associated documentations that tells
a computer what to do or how to perform a task.
There are 3 types of Software :
System Software
Application Software
Utility Software
System software is a type of computer program that is designed to run a computer’s hardware
and application programs.
The operating system (OS) is the best-known example of system software. The OS manages all the other
programs in a computer.
Application software is a program or group of programs designed for end users. Application software is a
program or group of programs designed for end users.
System Software :
Basic Input Output System (BIOS)
This is a small program that checks the hardware devices and peripherals at boot time and then loads the
operating system.
Operating system
This is the central system software that manages both the hardware and the programs running on the
computer.
Device driver
Every hardware needs a special software that knows how to handle it. Programs access a device driver by
making a call to the operating system.
Compilers and associated programs A programmer invokes a compiler program to convert the source
code written by them to machine code.
Application Software
Office software office software was one of its first applications. This category now comprises three
separate applications – word processing, spread sheet and presentations.
Database software This software package, commonly known as Data Base Management System (DBMS),
allows data having a uniform structure to be stored in a database. Microsoft Office has a DBMS
component (Access), but it is Oracle that dominates this space.
Communications software Computer networking led to the development of software that allowed users
to communicate with one another. Eg- Email , Skype and Whatsapp
Entertainment software Home entertainment on the PC has also seen the rise of software related to
gaming and multimedia.
Anti-virus software A virus is a small program designed by a person with malicious intent. Anti-virus
software is now an essential program to have on your computer.
Special-purpose software Apart from the general-purpose software mentioned previously, application
software are also available for desktop publishing, computer - aided design/manufacturing ( CAD / CAM )
and distance learning
Network Topology
The star topology uses a central hub to which all nodes are connected. Because network traffic passes
through the hub, the entire network fails if the hub fails to work. On the other hand, new nodes can be
added without disrupting the service.
Nodes using the ring topology are connected in a closed loop without using a hub. Data moves from one
node to the next one which examines each packet to determine whether it should be allowed to move further
CSE, CITECH 2018-19 Page 43
C to
on Programming
the next node. for
For Problem solving
uni-directional (18CPS13/23)
rings, failure of one node causes Module 1: CtoOverview
the network shut down.
Nodes in a mesh topology are connected to one another, offering a choice of multiple routes for data to
travel. When a node breaks down, the packet simply changes its route. This is the most expensive of all the
topologies, and is found mainly in corporate networks.
int main()
{
enum week day;
day = Wed;
printf("%d",day);
return 0;
}
Output:
2
2. #include <stdio.h>
enum State {Working = 1, Failed = 0, Freezed = 0};
int main()
{
printf("%d, %d, %d", Working, Failed, Freezed);
return 0;
}
Output:
1, 0, 0
include <stdio.h>
enum day {sunday = 1, monday, tuesday = 5, wednesday, thursday = 10, friday,
turday};
int main()
{
printf("%d %d %d %d %d %d %d", sunday, monday, tuesday,
wednesday, thursday, friday, saturday);
CSE, CITECH 2018-19 Page 56
Creturn
Programming
0; for Problem solving (18CPS13/23) Module 1: C Overview
}
Output:
1 2 5 6 10 11 12
1. Output
Enter value of n
99
Sum = 1.000001
Enter value of n
143
Sum = 0.999999
We know that the sum of n terms of 1/n is 1. However, due to errors in floating point representation the
result is not always 1.