UNIT I
INTRODUCTION TO COMPUTERS
Part-A
(2 Mark Questions)
1.List the various applications of Computers.
Banking- Utilizes digital solutions for secure transactions, fraud detection, and customer
service automation.
Education- Enhances learning through e-learning platforms, smart classrooms, and AI-driven
personalized education
Industries- Implements automation, IoT, and robotics for efficient manufacturing, quality
control, and logistics
Entertainment- Leverages streaming services, virtual reality, and AI-driven content
recommendations for user engagement.
Hospitals- Employ advanced medical technologies, AI diagnostics, and electronic health
records for improved patient care
Data processing. - Involves collecting, analysing, and managing vast amounts of information
for informed decision-making
2.Differentiate between ROM and RAM
Random Access Memory (RAM) Read Only Memory (ROM)
RAM is a volatile memory that
ROM is a non-volatile memory that the could
could store the data as long as the
retain the data even when the power is turned off.
power is supplied.
Read and write operations are
Only read operations are supported.
supported.
Used to store the data that has to be It is typically used to store firmware or microcode,
currently processed by CPU which is used to initialize and control hardware
temporarily. components of the computer.
It is a high-speed memory. It is much slower than the RAM.
CPU can easily access data stored
CPU cannot easily access data stored in ROM.
in RAM.
3.Define software. Briefly discuss about different types of software.
Software is a set of instructions, programs, or data that tell a computer how to
perform specific tasks.
It is the intangible part of a computer system (unlike hardware, which is
physical).
Application software and system software.
4.Write down some few characteristics of computer.
Speed
Accuracy
Automation
Storage
Versatility
Communication
5.Which computer system with highest speed and capacity explain it?
A supercomputer is a very powerful computer designed to perform extremely
complex calculations at very high speed. It is capable of executing trillions of instructions
per second and is mainly used for scientific, engineering, and research applications that
require massive data processing.
6.Define operating system. Mention any two operating system commonly used.
Operating system is used to interface between computer hardware device and end users.
Ex: Windows OS, Linux, Fedora.
7.Write an algorithm to compute a simple interest.
Algorithm to Compute Simple Interest
Step 1: Start
Step 2: Read the values of Principal (P), Rate of Interest (R), and Time (T)
Step 3: Compute Simple Interest using the formula:
SI=P×R×T100
Step 4: Display the value of SI
Step 5: Stop
8. Differentiate between compiler and interpreter.
Compiler Interpreter
A compiler translates the entire source
An interpreter translates the source
code of a program into machine code at
code line-by-line into machine code.
once.
Faster execution (since translation Slower execution (since translation
happens once). happens line by line).
Requires more memory as it generates a Requires less memory since no
separate executable file. separate file is generated.
Compiler Interpreter
Python, JavaScript, BASIC
C, C++, Java (compiled languages).
(interpreted languages).
10.Convert the binary number system into decimal number system (101010)2 =?10
11.State the difference between algorithm and pseudocode.
Algorithm Pseudocode
A step-by-step procedure to solve A detailed, structured, and
a problem in simple English or programming-like representation of
mathematical form. an algorithm using plain English.
More theoretical, focuses on logic More practical, looks similar to actual
and sequence of steps. programming code.
Easily understood by anyone (no Mainly intended for programmers to
coding knowledge required). easily translate into actual code.
No specific syntax or structure is Follows a structured format similar to
required. programming languages.
To describe the problem-solving To act as an intermediate step between
process clearly. algorithm and actual program code.
12.Convert the decimal number system into octal number system (19.35)10=( )8?
13..Draw the flowchart to find out whether the given number is odd or not.
Part-B
1. Explain the basic Computer Organization with a neat diagram.
Basic Computer Organization
The basic computer organization explains the way in which different units of computer are
interconnected with each other and controlled. Basic units of computer system are:
1) Input Unit
2) Central Processing Unit
3) Output Unit
1. Input Unit
An input unit is an electronic device, which is used to feed input data and control signals to a
computer.
Computers need data and instructions in order to solve any problem. We need to put the data
and instructions into the computers. The input unit consists of one or more input devices. All
input devices perform the following functions:
1. Accept data and instruction from the outside world.
2. Convert it to a form that the computer can understand.
3. Supply the converted data to the computer system for further processing
Input Devices
Following are the common input devices which are used in Computer Systems
Keyboard
Mouse
Joy Stick
Light pen
Track Ball
Scanner
Graphic Tablet
Microphone
2. Central processing unit
It is the heart of the computer system. All operations are carried out in CPU only. In most
modern computers, a single IC does the following work,
i) It performs all calculations
ii) It makes all decisions
iii) It controls and co-ordinates all units of the computer
The CPU is sub-divided into the following sub-system:
1. Control unit
2. Arithmetic and logical unit (ALU)
3. Memory unit
Primary Storage
Secondary storage
(i) Control unit
The control unit instructs the computer how to carry out program instructions. It directs the
flow of data between memory and arithmetic logical unit. It controls and coordinates the
entire computer system.
(ii) Arithmetic and logical unit
Arithmetic and logical unit performs all the arithmetic and logical operations, arithmetic
operations like addition, subtraction, multiplication and logical operations such as
comparisons. All calculations are performed in the arithmetic and logical unit (ALU) of the
computer.
(iii) Memory unit
Memory unit is the part of computer which holds data for processing and other information.
The memory units of a computer are classified as 2 types:
1) Primary Memory
2)Secondary Memory
1) Primary Memory:
Primary memory is also known as primary storage or main memory.
Primary memory is computer memory that a processor or computer accesses first or
directly.
It hold the program being currently executed in the computer.
This primary memory is temporarily store the data for processing by CPU.
Each &ever information can process through any main memory.
It is fast & expensive.
Commonly used primary memories are,
1. RAM (Random Access Memory)
2. Rom (Read Only Memory)
Cache Memory
Cache memory holds frequently requested data and instructions so that they are
immediately available to the CPU when needed.
Cache memory is an extremely fast memory that acts as a buffer between RAM and
the CPU, which is placed between CPU and the main memory.
Cache memory is used to reduce the average time to access data from the Main
memory
(iv) Secondary Memory
The secondary storage represents the external storage devices that are connected to
the computer.
It may store several programs, documents, database, etc.
It is the permanent storage; the data stored in this storage will not be erased when the
power is lost. It is a non-volatile memory.
The secondary memory is slower than the primary memory.
Example: Some of the commonly used secondary memory devices are Floppy disk, Hard
disk drive, Compact Disk (CD), Digital Video Disk (DVD).
3. Output unit
These devices used to get the response or result from the processor. Output unit is the
communication between the user and the computer. The output unit of a computer provides
the information and results of a computation to the outside world. It converts information into
human-readable form. It can be text, graphics, tactile, audio, and video.
Commonly used output devices are,
Monitor
Graphic Plotter
Printer
Speaker
Headphone
Projector
Touchscreen
2.List and explain different generations of Computers.
• First Generation Computer.
• Second Generation Computer.
• Third Generation Computer.
• Fourth Generation Computer.
• Fifth Generation Computer.
First Generation Computer.
• These computers were vacuum tube-based machines.
• They used magnetic drums for memory.
• Input were fed into the computer using Punched cards
• The size of these computers was very large and it produces more heat.
• They were more expensive.
• 5000 additions and 350 multiplications/sec
• Ex: ENIAC, EDVAC, UNIVAC1
Second Generation Computer.
• Here the Transistor replaced the bulky vacuum tubes.
• Transistors are smaller than vacuum tubes and have higher operating speed.
• Thus, the size of the computer got reduced considerably.
• Manufacturing cost was also very low.
• Ex: IBM7090, CDC3600
Third Generation Computer.
• These computers were based on Integrated Circuits (ICs) Technology.
• A single IC has many transistors, registers and capacitors built on a single thin slice of
silicon.
• So that the size of the computer got further reduced.
• These Computers were small in size, low cost, large memory and processing speed is very
high.
Fourth Generation Computer.
• It uses very large-scale Integrated Circuits (VLSI) built on a single silicon chip called
microprocessors.
• These computers are called microcomputers.
• Thus, the size of the computer got reduced.
• The personal computer (PC) are comes under the Fourth Generation
Fifth Generation Computer.
• The speed is extremely high in fifth generation computer.
• The concept of Artificial intelligence has been introduced to allow the computer to take its
own decision (self-reliant).
• It is still in a developmental stage
3.Draw a flowchart and also write an pseudocode to find the roots of quadratic
equation.
Step 1. Start the process.
Step 2. Read the coefficients of the equation, a, b and c from the user.
Step 3. Calculate, discriminant = (b * b) – (4 * a * c)
Step 4. Check if (discriminant > 0)
4.1: Compute root1 = (-b + sqrt(discriminant)) / (2 * a)
4.2: Compute root2 = (-b - sqrt(discriminant)) / (2 * a)
4.3: Print root 1 and root 2.
Step 5: Else if (discriminant = 0)
5.1: Compute root1 = -b / (2 *a)
5.2: root2 = root1
5.3: Print root 1 and root 2
Step 6. Else, perform the following operations.
6.1: Compute real = -b / (2 * a)
6.2: Calculate imaginary = sqrt(-discriminant) / (2 * a)
6.3: Print “Roots are imaginary”
Step 7. Stop
4.Draw the flowchart to withdraw the cash from ATM machine with verify the following
condition
i) whether your card is valid?
ii) is your PIN is correct?
iii) Do you have enough balance?
iv) if yes dispense cash else show error.
5. Discuss in detail the steps in Problem-Solving Techniques
Steps in Problem-Solving Techniques
1. Problem definition phase
2. Getting started on a problem
3. The use of specific examples
4. Similarities among problems
5. Working backwards from the solution
6. General problem-solving strategies
7.
1. Problem Definition Phase
Understand the problem
Work out what must be done rather than how to do it
A lot of care must be taken in working out what must be done
Example
Finding the square root
Finding the greatest common divisor
From the definition develop an algorithm
2. Getting started on a problem
There may be many ways to solve the problem, and also many solutions to most
problems.
Have an idea of where to start the problem
Try to understand the problem clearly and do not worry about implementation
Develop an implementation-independent solution
Postpone coding
3. The use of specific examples
Pick on a specific example of the general problem we are trying to solve
Use some properties to try to get a solution for the problem
Apply the mechanism to solve the problem
Example : Find out the maximum number from the given set of numbers
Use some geometrical or schematic diagrams representing certain aspects of the problem
4. Similarities among problems
See if there are any similarities between the current problem and other problems that
we have solved or we have seen solved
Try to solve the problem independently
5. Working Backwards from the Solution
1. If we do not know where to start on a problem,
2. We can work backwards to the starting conditions
3. Whatever attempts that we make to get started on a problem write down the various steps
and explorations we made.
4. Once we have solved a problem we must remember the steps that we went about
discovering the solution
5. The most important one is practice
6. General Problem-Solving Strategies
a) Divide and Conquer
It is defined as one large complex problem is divided into number of sub problems
and finds the solution. The sub problem solutions are combined to form the solution for large
problem.
Example: MERGE SORT
b) Dynamic programming:
Dynamic programming is an algorithm that can be used when the solution to a
problem can be viewed as the result of a sequence of decisions.
Example: TRAVELLING SALESMAN PROBLEM
e) Backtracking: During the search if infeasible solution is sensed then backtrack to
previous node.
Example: Sudoku, 8-Queens Problem
c) Branch and Bound:
Branch- splitting procedure
Bound- computes upper and lower bounds
Example: Knapsack problem
d)Greedy method: Find the feasible solution from the set of solution for the given problem
Example: job scheduling
6. Write short notes on various Programming logic techniques.
Programs can be written by using the combination of building blocks such as sequence,
selection, repetition.
1. Sequence structure
The instructions are computed in sequence of actions that is completed in a specific order.
Sequence refers to the execution of code statements one after another in a specific order. This is
the simplest form of control structure where instructions are executed in the same order in which
they appear.
2. Selection
Selection involves making decisions based on conditions. It allows the program to choose
different paths of execution. The primary selection constructs are if, else if, else, and switch.
The if-else statement in C is used to perform the operations based on some specific condition.
The operations specified in if block are executed if and only if the given condition is true.
There are the following variants of if statement in C language.
If Statement
The if statement is used to check some given condition and perform some operations depending
upon the correctness of that condition. It is mostly used in the scenario where we need to perform
the different operations for the different conditions. The syntax of the if statement is given below.
3.Repetition
• Repetition structures are used to repeat statements or blocks of code.
• The decision whether to repeat the code is based on the evaluation of a logical expression.
• If the expression is true, the code is executed. If false, the code is not executed.
• A while loop is one of the most common types of loop.