TCS Notes Unit 1
TCS Notes Unit 1
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
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.
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.
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.
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.
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.
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.
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.
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.
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
21 = 2
22 = 2*2 = 4
23 = 2*2*2 = 8
210 = 1,024
220 = 1,048,576
Unit Equivalent
Practice Problems:
Problem Solution
Fig. 4 Multi user/multi tasking operating each user runs his/her own
session on the server
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:
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.
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
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
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
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
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
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 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.