Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
400 views

TCS Notes Unit 1

This document provides an overview of computer generations and memory hierarchy. It discusses the five generations of computers from the first generation (1946-1959) which used vacuum tubes, to the current fifth generation (1981-present) which uses technologies like ULSI and modern programming languages. Each generation saw improvements in size, speed, reliability and capabilities. The document also describes the computer memory hierarchy, distinguishing between external secondary memory (disks, tapes) and internal primary memory (main memory, cache, registers) that is directly accessible by the processor.

Uploaded by

Utkarsh Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
400 views

TCS Notes Unit 1

This document provides an overview of computer generations and memory hierarchy. It discusses the five generations of computers from the first generation (1946-1959) which used vacuum tubes, to the current fifth generation (1981-present) which uses technologies like ULSI and modern programming languages. Each generation saw improvements in size, speed, reliability and capabilities. The document also describes the computer memory hierarchy, distinguishing between external secondary memory (disks, tapes) and internal primary memory (main memory, cache, registers) that is directly accessible by the processor.

Uploaded by

Utkarsh Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

UNIT-I

INTRODUCTION TO COMPUTERS & ALGORITHMS & FLOWCHARTS

Topics: Generation of computers, Computer system memory hierarchy,


Input / Output, RAM/ROM, Software & Hardware, Understand bit, byte,
KB, MB, GB and their relations to each other, Operating System
overview, Computer Networks Overview.
Algorithms and Flow Charts – Examples of Flow charts for loops and
conditional statements. --8 Hrs

Introduction to computers
 Computer is an electronic-device that accepts input as data, processes
it & stores temporarily into a storage device and gives out useful
output.
 A program is a sequence of instructions written using a computer
programming language to perform a specified task.
 Computers have power to perform billions of calculations in fraction of
seconds. They are very accurate and are reliable.

Generation of computers
The computers of today have originated in the second half of the twentieth
century. As the technology improved in physics and electronics there was
evolutionary developments in the hardware and software of computers.
Sooner the computer started to evolve and the technological advancement
marked a generation of computers.
First Generation of Computers
Computers were developed between 1946 – 1959, and were called the first
generation computers. They were large and limited to basic calculations. They
consisted of large devices like the vacuum tubes. The input method of these
computers was a machine language known as the 1GL or the first generation
language.
The data was entered using physical methods such as punch cards, paper
tape, and magnetic tape into those computers.
Examples of the first generation computers include ENIAC, EDVAC, UNIVAC,
IBM-701, and IBM-650. J.P.Eckert and J.W.Mauchy invented the first successful
electronic computer called ENIAC, that stands for “Electronic Numeric
Integrated and Calculator”.
These computers were large and very unreliable. They would heat up and
frequently shut down and could only be used for very basic computations.

 Advantages:
1. It was made up of vacuum tubes which were the only electronic
component available during those days.
2. These computers could calculate in milliseconds.
 Disadvantages:
1. Heavy, Bulky, and very big in size, weighed about 30 tonnes.
2. These computers were very costly.
3. The vacuum tubes required a large cooling system.
4. Limited programming capabilities
5. Large amount of energy consumption.
6. Not reliable and frequent maintenance was required.

SECOND GENERATION

Second generation Computers were developed between 1959-1965. These


computers were more reliable and in place of vacuum tubes, they used
transistors (semiconductors). Smaller in size compare to first generation
computers. The input for these computers were higher level languages
like COBOL, FORTRAN etc.
Examples of the second generation computers include IBM 1620, IBM
7094, Honeywell 400, CDC 1604, CDC 3600, UNIVAC 1108. They were faster
than their predecessors.

Advantages:
1. Due to the presence of transistors instead of vacuum tubes, the size
of electronic components decreased.
2. Less heating effect coz. energy consumed was less as compared to
1st generation of computers.
3. Assembly language and punch cards were used as input.
4. Low cost than first generation computers.
5. Better speed, could calculate in microseconds.
6. Better portability as compared to first generation
Disadvantages:
1. A cooling system was required.
2. Constant maintenance was required.
3. Only used for specific purpose.

Third Generation of Computers

Computers developed in the third generation period of 1965 – 1971 differed


from the first and the second generations by the fact that a new circuit
element like IC’s (Integrated Circuits) were used. An integrated circuit is a
small device that can contain thousands and thousands of devices like
transistors, resistors and other circuit elements that make up a computer.
Robert Noyce and Jack Kilby in 1958-1959 invented Integrated Circuit or the
IC chips. With the invention of IC’s, it became possible to fit thousands of
circuit elements into a small region and hence the size of the computers
eventually became smaller and smaller. Computers that used IC’s during
that period were, PDP-8 (Personal Data Processor), PDP-11, ICL 2900, IBM
360 series, IBM 370/168, Honeywell-6000 series.

Advantages:
1. They were fast, much more reliable and consumed far less power.
2. These computers were cheaper as compared to second-generation
computers.
3. Use of IC in the computer provided small size computers.
4. IC also improved the performance of the computer as compared to
earlier computers.
5. These computers had big storage capacity.
6. Instead of punch cards, mouse and keyboard was used for input.
7. They used an operating system for better resource management.
8. These computers reduce the computational time from microseconds
to nanoseconds.
9. They used high level input languages such as COBOL, FORTRAN-II,
FORTRAN-III, FORTRAN-IV, PASCAL, ALGOL-68, BASIC, etc. These
languages were much easier to learn and performed more complex
calculations.

Disadvantages:
1. IC chips are difficult to maintain.
2. Highly sophisticated technology was required for the manufacturing
of IC chips.
3. A cooling system was required.

Fourth Generation of Computers


Fourth Generation of computers were developed between 1971 – 1980.
These computers used VLSI technology or the Very Large Scale Integrated
(VLSI) circuits technology and were based on microprocessor. Intel was the
first company to develop a microprocessor. A microprocessor is used in a
computer for any logical and arithmetic operation and to perform execute
any program. Graphics User Interface (GUI) technology used provided
more comfort to users.
The first “personal computer” or PC developed by IBM, belonged to this
generation. VLSI circuits had almost about 5000 transistors on a very small
chip and were capable of performing many high-level tasks and
computations. These computers were thus very compact and thereby
required a small amount of electricity to run.
Examples, STAR 1000, CRAY-X-MP (Super Computer), DEC 10, PDP 11,
CRAY-1. This generation of computers had the first “supercomputers” that
could perform many calculations accurately.
They were also used in networking and also used higher and more
complicated languages as their inputs. The computer languages
like languages like C, C+, C++, DBASE etc. were the input for these
computers.
Advantages:
1. Fastest in computation and size was reduced as compared to the
previous generation of computer.
2. Heat generated was negligible.
3. Small in size as compared to previous generation computers.
4. Required less maintenance.
5. All types of high-level language could be used in these types of
computers.

Disadvantages:
1. The Microprocessor design and fabrication were very complex.
2. Cooling system was required in many cases due to the presence of
ICs.
3. Advance technology was required to make the ICs.

Fifth Generation of Computers


This is the present generation of computers and is the most advanced one.
The generation began around 1981 and is the present generation of
computers. The methods of input include the modern high-level languages
like Python, R, C#, Java etc. The aim of the fifth generation is to make a
device, which could respond to natural language input and was capable of
learning and self-organizing.
This generation is based on ULSI (Ultra Large Scale Integration) technology
resulting in the production of microprocessor chips having millions and
billions of electronic components.
Examples include: Intel P4, i3 – i10, AMD Athlon, Desktop, Laptop,
NoteBook etc.

Advantages:
1. They are most reliable and work faster.
2. They are available in different sizes and unique features.
3. They come with more user-friendly interfaces with multimedia
features.
Disadvantages:
1. They tend to be sophisticated and complex tools.
2. They give more power to companies to watch what you are
doing and even allow them to infect your computer.
3. They may make the human brains dull.

Quiz on Generation of Computers

Q 1: The language used in ENIAC:


A) C B) C++ C) 1 GL D) Python
Ans: Basically ENIAC was a first generation computer and therefore the
correct option is 1 GL.

Q 2: Which among these will have VLSI?


A) DEC 10 B) PDP 11 C) CRAY-1 D) All of these.
Ans: Earlier VLSI or the very large scale integration was employed in the
fourth generation of computers. All of these above examples are from the
fourth generation and therefore the answer is D.

Q 3: Which among these will have ULSI?


A) DEC 10 B) PDP 11 C) IBM 360 D) Intel P4, i3 – i10
Answer is D

Practice Questions
Q 1: You can use Java in which of these following generations:
A) Second
B) Third
C) Fourth
D) Fifth
Ans: D is the correct option.
Q 2: The ULSI technology is used in which generation of computers:
A) Third
B) First
C) Fourth
D) Fifth
Ans: D is the correct option.

Computer system memory hierarchy


Memory Hierarchy Design is divided into two main types:
1. External Memory or Secondary Memory
Comprising of Magnetic Disk, Optical Disk, Magnetic Tape i.e.
peripheral storage devices which are accessible by the processor via
I/O Module.
2. Internal Memory or Primary Memory
Comprising of Main Memory, Cache Memory & CPU registers. This is
directly accessible by the processor.

Fig. 1 Memory hierarchy


The following characteristics of Memory Hierarchy can be made from
above Fig. 1:
1. Capacity: It is the total volume of information the memory can store.
As we move from top to bottom in the hierarchy, the capacity
increases.
2. Access Time: It is the time interval between the read/write request
and the availability of the data. As we move from bottom to top in
the hierarchy, the access time decreases.
3. Performance:
Earlier computer system were designed without Memory Hierarchy,
due to large difference in access time the speed gap increased
between the CPU registers and Main Memory, which resulted in
lower performance of the system and thus, enhancement was
required. The performance of the system increased by minimizing
the levels of memory hierarchy to access & manipulate data.
4. Cost per bit: As we move from bottom to top in the Hierarchy, the
cost per bit increases i.e. Internal Memory is costlier than External
Memory.
Input / Output:

Functional components of a Digital Computer

Fig. 2 Components of a Digital Computer

 Input Unit :The input unit consists of input devices that are attached
to the computer. These devices take input and convert it into binary
language that the computer understands. Some of the common input
devices are keyboard, mouse, joystick, scanner etc.

 Central Processing Unit (CPU): Once the information is entered into


the computer by the input device, the processor processes it. The
CPU is called the brain of the computer because it is the control
center of the computer. It first fetches instructions from memory and
then interprets them so as to know what is to be done. If required,
data is fetched from memory or input device. Thereafter CPU
executes or performs the required computation and then either
stores the output temporarily in the memory or displays on the
output device. The CPU has three main components which are
responsible for different functions – Arithmetic Logic Unit (ALU),
Control Unit (CU) and Memory registers.
 Arithmetic Logical Unit (ALU): The ALU, as its name suggests
performs mathematical calculations and takes logical decisions.
Arithmetic calculations include addition, subtraction, multiplication
and division. Logical decisions involve comparison of two data items
to see which one is larger or smaller or equal.
 Control Unit: The Control unit coordinates and controls the data flow
in and out of CPU and also controls all the operations of ALU,
memory registers and also input/output units. It is also responsible
for carrying out all the instructions stored in the program. It decodes
the fetched instruction, interprets it and sends control signals to
input/output devices until the required operation is done properly by
ALU and memory.
 Memory Registers: A register is a temporary unit of memory in the
CPU. These are used to store the data that is directly used by the
processor. Registers can be of different sizes(16 bit, 32 bit, 64 bit and
so on) and each register inside the CPU has a specific function like
storing data, storing an instruction, storing address of a location in
memory etc.
 Memory : Memory attached to the CPU is used for storage of data
and instructions and is called internal memory. The internal memory
is divided into many storage locations, each of which can store data
or instructions. Each memory location is of the same size and has an
address. With the help of the address, the computer can read any
memory location easily without having to search the entire memory.
When a program is executed, it’s data is copied to the internal
memory and is stored in the memory till the end of the execution.
The internal memory is also called the Primary memory or Main
memory. This memory is also called as RAM, i.e. Random Access
Memory.
 Output Unit : The output unit consists of output devices that are
attached with the computer. It converts the binary data coming from
CPU to human understandable form. The common output devices
are monitor, printer, plotter etc.
RAM/ROM
Computer memory (RAM and ROM)

Fig. 3 Different types of computer memories

Random Access Memory (RAM)


 It is also called as read write memory or the main memory or
the primary memory.
 The time of access of data is independent of its location in memory,
therefore this memory is also called Random Access memory (RAM).
 The programs and data that the CPU requires during execution of a
program are stored in this memory.
 It is a volatile memory as the data loses when the power is turned
off.
Read Only Memory (ROM)
 Stores very important information essential to operate the system,
like the program essential to boot the computer.
 It is not volatile.
 Always retains its data.
 Used in embedded systems or where the programming needs no
change.
 Used in calculators and peripheral devices.

RAM ROM
Temporary storage Permanent storage
Stores data in MBs Store data in GBs
Volatile Non-Volatile
Used in normal Used for startup process of a computer
operation (booting)
Writing data is faster Writing data is slower
Software & Hardware
A Computer is an electronic device that can perform various operations &
Calculations at a greater speed than an ordinary machine or human mind.
It comprises of many physical and tangible components that we can touch
or feel, called the Hardware and programs and commands that drive the
hardware, called the Software.
The Software is the set of instructions fed in form of programs to manage
the computer system and control the hardware components. For example:
 The antivirus that we use to protect our computer system is a type of
Software.
 The media players that we use to play multimedia files such as
movies, music etc. are Software.
 The Microsoft Office we use to edit the documents is Software.

Depending on its function and application, Software can be divided into


three major types:
1. System Software
2. Application Software
3. Utility Software

System Software
These are the software that directly allows the user to interact with the
hardware components of a computer system. As the humans and
machines follow different languages, there has to be an interface that will
allow the users to interact with the core system, this interface is provided
by the software. The system software is the most important part of the a
computer system that controls the hardware. This System Software can be
further divided into four major types:
1. The Operating System – It is the main program that manages and
controls the inter-action of the components of a computer system.
For ex., Microsoft Windows, Linux, Mac OS etc. are vendors who
supply the Operating System ( OS ).
2. The Language Processor – The hardware components present in the
computer system does not understand human language. There are
three types of languages involved in the world of human-machine
interaction:
 Machine-Level Language: The machines only understand the
digital signals or the binary codes or the binary language which
consist of 0’s and 1’s. These are totally machine dependent
language.
 Assembly-Level Language: These are the Low-Level Languages
(LLL), that forms a correspondence between machine level
instruction and general assembly level instructions. Assembly
language uses a mnemonics to represent each low-level
machine instruction or operation-code also called the op-codes.
For ex. ADD instruction is used to add two quantities, the HALT
instruction is used to stop a program etc. It is a machine
dependent language and varies from processor to processor.
 High-Level Language: These are the simple English like
statements, that humans use to program and code as it is easy
to read and understand by the humans. For ex., Java, C, C++,
Python etc.
The machine level language is very complex to understand and code,
therefore the users prefer the High-Level Language or the HLL for
coding. These codes need to be converted into the machine language
so that the computer can easily understand and work accordingly.
This operation is performed by the Language Processor which is
made up of further three components:
 Assembler: Language processor used to convert the assembly
language into machine level language.
 Compiler: Language processor used to convert High-Level
Language into machine level language at once, thus execution
time is fast. The error detection is difficult in a compiler.
Programming Languages like C, C++ and Simula use compilers.
 Interpreter: Language processor used to convert High-Level
Language into machine level language line-by-line, thus
execution time is slow. Error-detection is easier in an
interpreter as it reports as soon as a bug (error) is caught and
restarts the process. Programming Languages like Python, Ruby,
Visual Basic and Java uses an interpreter.
3. The Device Drivers – The device drivers are the system software
programs that act as an interface between the various Input-Output
devices and the users or the operating system. For ex., the Printers,
CD-ROM, DVD, Web cameras come with a driver disk that is needed
to be installed into the system to make the device run in the system.
4. The BIOS – It stands for Basic Input Output System and is a small
firmware that controls input-output devices attached to the system.
This software is also responsible for starting the OS or initiating the
booting process.

Understand bit, byte, KB, MB, GB

Units of Memory
A bit is a binary digit, the smallest unit of data on a computer. A bit can
hold only one of two values: 0 or 1, corresponding to the electrical values
of off or on, respectively.
Bits are usually assembled into a group of eight to form a byte. A byte
contains enough information to store a single ASCII character, like "h". Any
character on a keyboard (QWERTY) can be represented by using one byte
of memory.
A kilobyte (KB) is 1,024 bytes, computers use binary (base two) math,
instead of a decimal (base ten) system.
Computer storage and memory is often measured in megabytes (MB) and
gigabytes (GB). A medium-sized novel contains about 1 MB of information.
1 MB is 1,024 kilobytes, or 1,048,576 (1024x1024) bytes, not one million
bytes.
We count in base 10 by powers of 10:

101 = 10
102 = 10*10 = 100
103 = 10*10*10 = 1,000
106 = 1,000,000

Computers count by base 2:

21 = 2
22 = 2*2 = 4
23 = 2*2*2 = 8
210 = 1,024
220 = 1,048,576

So in computer jargon, the following units are used:

Unit Equivalent

1 kilobyte (KB) 1,024 bytes

1 megabyte (MB) 106 bytes or 103 KB

1 gigabyte (GB) 109 bytes or 103 MB

1 terabyte (TB) 1012 bytes or 103 GB

1 petabyte (PB) 1015 bytes or 103 TB


Unit Equivalent

1 exabyte (EB) 1018 bytes or 103 PB

1 zettabyte (ZB) 1021 bytes or 103 EB

1 yottabyte (YB) 1024 bytes or 103 ZB

 Byte -- Any character on keyboard can be stored


 Kilo Byte -- Any short text or email
 Mega Byte -- MP3 is about 1 MB per minute or the human
genome consists of DNA representing 800 MB
of data.
 Giga Byte –An ordinary computer might have 4 GB of RAM. A
flash memory card (USB Pendrive) used in a
camera can store 16 to 32 GB. 32GB phone could
hold about 8,192 usual photos. A typical film is
700 megabytes to 1.5 GB.
 Tera Byte -- 1 TB = 200,000 5-minute songs; 310,000
pictures; or 500 hours worth of movies
10 TB = Amount of data produced by the Hubble
Space Telescope per year
24 TB = Amount of video data uploaded to
YouTube per day in 2016

 Peta Byte: --1 PB = 500 billion pages of standard typed text


(or 745 million floppy disks)
1.5 PB = 10 billion photos on Facebook
20 PB = The amount of data processed by
Google daily in 2008
 Exa Byte: --1 EB = 11 million 4K videos
5 EB = All the words ever spoken by humankind
15 EB = Total estimated data held by Google

Practice Problems:

Problem Solution

Yes it fits: 600 MB + 2000 MB is 2600 MB.


Karan has 600 MB of data. Kiran
2600 MB is 2.6 GB, so it will fit on the 4 GB
has 2000 MB of data. Will it all
drive no problem. Equivalently we could say
fit on Alice's 4 GB pen drive?
that the 4 GB drive has space for 4000 MB.

Janahavi has 100 small images,


each of which is 500 KB. How 100 times 500 KB is 50000 KB, which is 50
much space do they take up MB.
overall in MB?

Assume a group is recording


the sound inside a haunted MP3 audio takes up about 1 MB per
House for 20 hours as MP3 minute. 20 hours, 60 minutes/hour, 20 * 60
audio files. About how much yields 1200 minutes. So that's about 1200
data will that be, expressed in MB, which is 1.2 GB.
GB?

Similarly, one 1 GB is 1,024 MB, or 1,073,741,824 (1024x1024x1024)


bytes. A terabyte (TB) is 1,024 GB; 1 TB is about the same amount of
information as all of the books in a large library. A petabyte (PB) is 1,024
TB. 1 PB of data, if written on a stack of CDs would create a stack of height
a mile high. An exabyte (EB) is 1,024 PB. A zettabyte (ZB) is 1,024 EB.
Finally, a yottabyte (YB) is 1,024 ZB.

Operating System overview


An operating system (OS) is a system software program that controls the
system's hardware and that interacts with the user and application software.
OS the computer's master control program. The OS provides the tools
(commands) that enable you to interact with the PC. When a command is
entered, the OS translates it into code that the machine can understand. The
OS also ensures that the results are displayed on screen, printed, and so on.

The operating system performs the following functions:


 Displays the on-screen elements with which user can interact.
 Loads programs (such as word processing and spreadsheet programs)
into the computer’s memory to be used by the user.
 Coordinates programs working with the computer's hardware and
other software.
 Manages the way information is stored on and retrieved from disks.

Operating systems can be organized into four major types: real-time,


single user/single-tasking, single-user/multitasking, and multi-
user/multitasking.

Real-time operating system ( RTOS ):


A RTOS is a very fast, relatively small OS. Real-time OS are often the
embedded OS, they are built into the circuitry of a device and are not
loaded from a disk drive. A real-time operating system is needed to run
real-time applications and they responds to certain inputs extremely
quickly—thousandths or millionths of a second (milliseconds or
microseconds, respectively). Real-time applications are needed to run
medical diagnostics equipment, life-support systems, machinery, scientific
instruments, and industrial systems.
RTOS is used in the following make of mobiles:
 Symbian - Used in cell phones, mainly ones made by Nokia.
 Embedded Linux - Android is a subset, used in many devices like
Samsung etc.
 BlackBerry OS - For BlackBerry phones.
 iOS - Subset of Mac OS X, used in Apple's mobile devices.

Single-User/Single-Tasking Operating Systems


An operating system that allows a single user to perform just one task at a
time is a single-user/single tasking operating system. To a user, a "task" is
a function such as printing a document, writing a file to disk, editing a file,
or downloading a file from a network server. To the operating system, a
task is a process, and small and simple OS can only manage a single task at
a time. MS-DOS is one example of a single-tasking OS, and the Palm OS,
used on the Palm handheld computers. Such operating systems are
limited in characteristic and they take up very little space on disk or in
memory while running and do not require a powerful and expensive
computer.

Single-User/Multitasking Operating Systems


A single-user/multitasking operating system allows a single user to
perform two or more functions at once. It takes a special operating system
to keep two or more tasks running at once. The most commonly used
personal computers usually run such OS, including Microsoft Windows and
the Macintosh Operating System. The multitasking features of these OS
have greatly increased the productivity of people in a large variety of jobs
because they can accomplish more in a shorter period of time.
A disadvantage of a single-user/multitasking operating system is the
increased size and complexity it needs to support multitasking.

Multi-User/Multitasking Operating Systems


A multi-user/multitasking operating system is an operating system that
allows multiple users to use programs that are simultaneously running on
a single network server; called a terminal server. This is not at all the same
as connecting to a network server for the sake of accessing files and
printers. In multi-user OS, it gives each user a complete environment,
called a user session, on the server. Each user’s applications run within
their user session on the server separate from all other user sessions. The
software that makes this possible is called a terminal client. In a multi-
user/multitasking operating system environment, all or most of the
processing occurs at the server. Examples of multi-user OS include UNIX,
VMS (Virtual Memory System) used in older mid-range computers by
Digital Equipment Corporation (DEC), and mainframe operating systems
such as MVS (Multiple Virtual Storage) used in IBM Mainframe
System/370 and System/390.

Fig. 4 Multi user/multi tasking operating each user runs his/her own
session on the server

The advantage of these operating systems is that they can be managed by


making changes to one server, rather than to many terminal clients. They
also allow the user to work with applications that require a more powerful
computer. A disadvantage is that if the server goes down, then the user
work is disrupted.

1. The small pictures on the desktop are called icons that represent links
to resources on the PC or network.
2. Multi-tasking is the ability to perform two or more tasks at the same
time.
3. You interact with a command-line interface by typing strings of
characters at a(n)_________ .
4. A running program may take up the whole screen or it may appear in a
rectangular frame, called a(n)
5. A program that lets you back up data files is an example of a(n)
_________ _
6. In a graphical user interface, you use a mouse (or other pointing device)
to move a(n) screen __________around the screen.
7. A(n). supports an application that responds to certain input very, very
quickly.
8. The process of moving from one open window to another is
called_________
9. In Windows, when you right-click some objects on the screen, a special -
appears.
10. In a GUI_________ let you view parts of a program or file that do not
fit in the window.

Networks:

Local Area Networks (LANs)


A local area network (LAN) is a data communication system consisting of
several devices such as computers and printers. This type of network
contains computers that are relatively near each other and are physically
connected using cables, infrared links, or wireless media. A LAN can
consist of just two or three PCs connected together to share resources, or
it can include hundreds of computers of different kinds. Any network that
exists within a single building, or even a group of adjacent buildings, is
considered a LAN. A LAN is not a system that connects to the public
environment (such as the Internet) using phone or data lines. It is often
helpful to connect separate LANs together so they can communicate and
exchange data. In a large company, for example, two departments located
on the same floor of a building may have their own separate LANs, but if
the departments need to share data, then they can create a link between
the two LANs.

Wide Area Networks (WANs)


Typically, a wide area network (WAN) is two or more LANs connected
together, generally across a wide geographical area. For example, a
company may have its corporate headquarters and manufacturing plant in
one city and its marketing of office in another. Each site needs resources,
data, and programs locally, but it also needs to share data with the other
sites. To accomplish this feat of data communication, the company can
attach devices that connect over public utilities to create a WAN. (Note,
however, that a WAN does not have to include any LAN systems. For
example, two distant mainframe computers can communicate through a
WAN, even though neither is part of a local area network.)
These remote LANs are connected through a telecommunication network
(a phone company) or via the Internet through an Internet service
provider (ISP) that contracts with the telecommunication networks to gain
access to the Internet’s backbone.

Hybrid Networks
Between the LAN and WAN structures, you will find hybrid networks such
as campus area networks (CANs) and metropolitan area networks (MANs).
In addition, a new form of network type is emerging called home area
networks (HANs). The need to access corporate Web sites has created two
classifications known as intranets and extranets. The following sections
introduce these networks.

Campus Area Networks (CANs)


A campus area network (CAN) follows the same principles as a local area
network, only on a larger and more diversified scale. With a CAN, different
campus offices and organizations can be linked together. For example, in a
typical university setting, a bursar's office might be linked to a registrar's
office. In this manner once a student has paid his or her tuition fees to the
bursar, this information is transmitted to the registrar's system so the
student can enroll for classes. Some university departments or
organizations might be linked to the CAN even though they already have
their own separate LANs.

Metropolitan Area Networks (MANs)

The metropolitan area network (MAN) b a large-scale network that


connects multiple corporate LANs together. MANs usually arc not owned
by a single organization; their communication devices and equipment are
usually maintained by a group or single network provider that sells its
networking services to corporate customers. MANs often take the role of
a high-speed network that allows for the sharing of regional resources.
MANs also can provide a shared connection to other networks using a
WAN link. Figure 7A.9 shows the relationship between LANs, MANs,
and WANs.

Home Area Networks (HANs)


A home area network (HAN) is a network contained within a user’s home
that connects a person’s digital devices, from multiple computers and
their peripheral devices, such as a printer to telephones, VCRs, DVDs,
televisions, video games, home security systems, “smart” appliances, fax
machines, and other digital devices that are wired into the network.

Intranets and Extranets


Much of the technology available on the Internet is also available for
private network use. The company’s internal version of the Internet is
called an intranet. An intranet uses the same Web server software that
gives the public access to Web sites over the Internet. The major
difference is that an intranet usually limits access to employees and
selected contractors having ongoing business with the company. Web
pages have become very popular and, using integrated software, many
operating systems offer complete Web server software or at least a
personal Web server. This gives users the ability to create Web pages on
their local computers that can be viewed by other members of the same
network. Just like on the Internet, users can allow others (again, usually
employees) to browse their Web site and to upload or download files,
video clips, audio clips, and other such media. Users also can set controls
and limit who may access the Web site. Extranets are becoming a popular
method for employees to exchange information using the company’s Web
site or e-mail while traveling or working from home.
An extranet is a partially accessible internal company Web site for
authorized users physically located outside the organization. Whereas an
intranet resides completely within the company's internal network and is
accessible only to people that are members of the same company or
organization, an extranet provides various levels of accessibility to
outsiders. You can access an extranet only if you have a valid username
and password, and your identity determines which parts of the extranet
you can view.
Algorithm
• An algorithm is a step by step procedure written in English like language
to solve a complex problem by simplifying the logic involved in the
program, which must be solved in finite number of steps by
→ accepting a set of inputs and
→ producing the desired output for the given problem.

Characteristics of an algorithm
 must have finite number of steps
 must be unambiguous
 must have not have steps that run indefinitely
 must terminate
 must have precise and concise statements
 must solve the given problem

• Example-1: Write an algorithm to add 2 numbers entered by a user.


Algorithm: To add two numbers
Input: Two numbers
Output: The desired sum after adding the numbers
Step 1: Start
Step 2: Accept two numbers num1, num2 from the user
Step 3: Read values into num1 and num2
Step 4: Add num1 & num2 and assign the result to sum.
sum←num1+num2
Step 5: Display sum
Step 6: Stop

• Example-2: Algorithm to find the exchange (swap) two numbers entered


by user.
Algorithm: To add two numbers
Input: Two numbers
Output: The swapped numbers
Step 1: Start
Step 2: Declare variables num1, num2 and temp
Step 3: Read values into variables num1,num2
Step 4: temp= num1
num1= num2
num2=temp
Step 5: Display num1 and num2
Step 6: Stop

Example-3:Algorithm to find the largest of two numbers entered by user.


Input: Two numbers
Output: The largest of two numbers

Step 1: Start
Step 2: Declare variables a and b.
Step 3: Read values into variables a, b.
Step 4: If a>b
Display a is the largest number.
Else
Display b is the largest number.
Step 5: Stop

Example-4: Algorithm to find the largest among three different numbers


entered by user.
Input: Three numbers
Output: The largest of three numbers

Step 1: Start
Step 2: Declare variables a, b and c.
Step 3: Read values into variables a, b and c.
Step 4: If a>b
If a>c
Display a is the largest number.
Else
Display c is the largest number.
Else
If b>c
Display b is the largest number.
Else
Display c is the greatest number.
Step 5: Stop

Example-5: Algorithm to convert temperature entered in degrees


Farenheit to degrees Celcius.

Input: Temperature in degrees Farenheit


Output: Temperature in Degrees Celcius

Step 1: Start
Step 2: Declare variables F, C.
Step 3: Read values into variable F.
Step 4: C =(F-32)*5/9
Step 5: Display temperature C in degrees
Step 6: Stop

Example-6: Algorithm to find the area of a rectangle by entering the two


sides of a rectangle.
Input: Two sides of a rectangle (length & breadth)
Output: Area of a rectangle

Step 1: Start
Step 2: Declare variables L, B, Area
Step 3: Read values into variable L, B
Step 4: Area =L*B
Step 5: Display the Area
Step 6: Stop
Example-6: Algorithm to find the sum of N natural numbers by accepting
N from the keyboard.
Input: Number N
Output: Sum of N natural numbers

Step 1: Start
Step 2: Declare variables i, N, Sum
Step 3: Read a value into variable N
Step 4: i=1, Sum=0
Step 5: Sum=Sum +i
Step 6: i=i+1
Step 7: if I <=N goto step 5
Step 8: Display Sum
Step 9: Stop

Flow Charts: Diagrammatic representation of an algorithm. It’s another


notation that gives a pictorial representation of an algorithm to explain
the sequence of steps and logic involved in the program, in a much
simplified way.

Symbols used in the flowchart:

Symbol Name Function

An oval represents a start


Start/End or end point

A line that connects &


Arrows shows direction of flow &
relationships between the
different steps of the
flowchart.
Parallelogram represents
Input/Output input or output

Rectangle represents a
Process process

Rhombus represents a
decision
Decision

Circle represents a
connector to connect the
Connector flow of one part to the
other sub-part

Represents looping based


Looping on value and condition of
variable

Represents a procedure or
Predefined function or module of a
process program
Advantages of flowcharts:
 Visual Clarity. With flowchart it enhances the visualizing capability of a
program to simplify the logic involved.
 Allows Instant Communication.
 Allows effective Coordination among development team members.
 Increases the efficiency of a software development team.
 Helps in effective Analysis and in problem solving.
 Assists in proper Documentation for future reference.

==================== End of UNIT-I =======================

You might also like