0% found this document useful (0 votes)
37 views

Notes CS 2

Uploaded by

Amit Kumar Jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Notes CS 2

Uploaded by

Amit Kumar Jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

What is a computer?

An electronic machine , operating under the control of instructions stored in its


own memory
• accepts data
• manipulates the data according to specified rules
• produces results
• stores the results for future use
A computer is a machine that manipulates data according to a list of instructions.

A computer is a device capable of performing computations and making logical


decisions at speed millions and even billion of times faster them human beings can.

A Computer is an electronic machine which is use for data processing. The output
which comes after processing data through computer is known as Information.
What are data and information?
Data : 1 Ahmad Jamshedpur Jharkhand

Information:

Roll Name City State


1 Ahmad Jamshedpur Jharkhand

5 + 7 = 12

Data Instruction Information


Data: Collection of raw unprocessed facts, figures and symbols.
Information : Data that is organized, meaningful, and useful. (Processed data)
Who is a user?
Someone that communicates with a computer.
Someone who uses the information it generates.

What are hardware and software?


Hardware: The electric, electronic and mechanical equipment that makes up a computer.
(Physical components of a computer)
Software : The series of instructions that tells the hardware how to perform tasks.
(Software is a set of programs, which is designed to perform a well-defined function. A
program is a sequence of instructions written to solve a particular problem.)

What are common computer hardware components?


What is the information processing cycle?

Input
Any data or
instructions you
enter into a
computer

Communication Process
The capability of Manipulate the
communicating input (data) to
with other produce output
computers (information)

Storage
Area in a computer Output
that Data that has
can hold data and been processed
information for into
future use information
What is an input device?
Any hardware component that allows a user to enter data and instructions into a
computer.
What is an output device?
Any hardware component that can convey information to a user
What characteristics make a computer powerful?

Speed : Billions of operations can be carried out in a single second.

Reliability : Dependable because components have a low failure rate so they


produce consistent results.

Storage : Enormous amounts of data can be stored and made available for
processing anytime it is needed.

Communications : Two connected computers can share stored data, instructions,


and information.

Accuracy : If data is entered correctly and program works properly, the results are
error-free — garbage in, garbage out (GIGO) accuracy of output depends on
accuracy of input.
Classification Of Computers

PC (Personal Computer)
A PC can be defined as a small, relatively inexpensive computer designed for an
individual user. PCs are based on the microprocessor technology that enables
manufacturers to put an entire CPU on one chip. Businesses use personal computers
for word processing, accounting, desktop publishing, and for running spreadsheet
and database management applications. At home, the most popular use for personal
computers is playing games and surfing the Internet.
Although personal computers are designed as single-user systems, these systems are
normally linked together to form a network. In terms of power, nowadays high-end
models of the Macintosh and PC offer the same computing power and graphics
capability as low-end workstations by Sun Microsystems, Hewlett-Packard, and Dell.
Minicomputer
It is a midsize multi-processing system capable of supporting up to 250 users
simultaneously.
Mainframe
The mainframe is very large in size and is an expensive computer capable of supporting
hundreds or even thousands of users simultaneously. Mainframe executes many programs
concurrently and supports much simultaneous execution of programs.
Supercomputer
Supercomputers are one of the fastest computers currently available. Supercomputers
are very expensive and are employed for specialized applications that require an
immense amount of mathematical calculations (number-crunching). For example,
weather forecasting, scientific simulations, (animated)graphics, fluid dynamic
calculations, nuclear energy research, electronic design, and analysis of geological data
(e.g. in petrochemical prospecting).
Workstation
The workstation is a computer used for engineering applications (CAD/CAM), desktop
publishing, software development, and other such types of applications which require a
moderate amount of computing power and relatively high-quality graphics capabilities.
Workstations generally come with a large, high-resolution graphics screen, a large amount
of RAM, inbuilt network support, and a graphical user interface. Most workstations also
have mass storage device such as a disk drive, but a special type of workstation, called
diskless workstations, comes without a disk drive.
Common operating systems for workstations are UNIX and Windows NT. Like PC,
workstations are also single-user computers like PC but are typically linked together to
form a local area network, although they can also be used as stand-alone systems.
Application Of Computers
Home
Computers are used at homes for several purposes like online bill payment, watching
movies or shows at home, home tutoring, social media access, playing games, internet
access, etc.

Medical Field
Computers are used in hospitals to maintain a database of patients’ history, diagnosis, X-
rays, live monitoring of patients, etc.

Entertainment
Computers help to watch movies online, play games online; act as a virtual entertainer in
playing games, listening to music, etc. Videos can be fed from computers to full screen
televisions. Photo editors are available with fabulous features.

Industry
Computers are used to perform several tasks in industries like managing inventory,
designing purpose, creating virtual sample products, interior designing, video
conferencing, etc. Online marketing has seen a great revolution in its ability to sell various
products to inaccessible corners like interior or rural areas. Stock markets have seen
phenomenal participation from different levels of people through the use of computers.
Education
Computers are used in education sector through online classes, online examinations,
referring e-books, online tutoring, etc. They help in increased use of audio-visual aids in
the education field.

Government
In government sectors, computers are used in data processing, maintaining a database
of citizens and supporting a paperless environment. The country’s defense organizations
have greatly benefitted from computers in their use for missile development, satellites,
rocket launches, etc.

Banking
In the banking sector, computers are used to store details of customers and conduct
transactions, such as withdrawal and deposit of money through ATMs. Banks have
reduced manual errors and expenses to a great extent through extensive use of
computers.

Business
Nowadays, computers are totally integrated into business. The main objective of
business is transaction processing, which involves transactions with suppliers,
employees or customers. Computers can make these transactions easy and accurate.
People can analyze investments, sales, expenses, markets and other aspects of business
using computers.
Training
Many organizations use computer-based training to train their employees, to save
money and improve performance. Video conferencing through computers allows
saving of time and travelling costs by being able to connect people in various
locations.

Arts
Computers are extensively used in dance, photography, arts and culture. The fluid
movement of dance can be shown live via animation. Photos can be digitized using
computers.

Science and Engineering


Computers with high performance are used to stimulate dynamic process in Science
and Engineering. Supercomputers have numerous applications in area of Research
and Development (R&D). Topographic images can be created through computers.
Scientists use computers to plot and analyze data to have a better understanding of
earthquakes.
Advantages of computer

1) Speed
This is one of the biggest advantages of computers. At present, the computer is no
longer just a calculating device. It is a part of almost every function of human life.
Computers have an incredible speed that helps a human to complete his tasks in some
time. It can handle trillions of instructions per second which is really incredible. With
its incredible speed, it can reduce the amount of time to perform any digital task.

2) Accuracy
Computers not only provide incredible speed, instead, they can also give you almost
100%accuracy. This means that computers allow users to handle complex numerical
calculations or tasks not only with speed but also with accuracy. This is another
important advantage of computers.

3) Multitasking
Multitasking is one of the major benefits of computers. A person can do many
different tasks at the same time while working on a computer. A computer allows you
to play songs, use a document, calculate numerical problems, use the Internet, check
e-mail, and find files in memory simultaneously.
4) Storage
Computers can store and access vast amounts of data or information. The storage
capacity of computers has increased these days compared to earlier days. Data can be
stored separately for years in computer storage.
The commonly used measurement units for calculating storage capacity are Mega-Byte
(MB),Giga-Bytes (GB), Tera-Bytes (TB), and Peta-bytes (PB).

5) Data Security
Data Security is the process of protecting your digital data such as files, databases, and
accounts, etc. The computer allows you to protect your data from destructive powers
and unwanted or unauthorized users. It includes features such as data encryption,
tokens, and key management that help users protect digital data on various applications
and platforms.

6) Automation
The computer can also be used to automate regular tasks such as launching specific
applications or software, sending emails, scanning for viruses, and many other
maintenance tasks, with the help of Task Scheduler. Apart from it, computers can also be
programmed for performing several complex tasks. For example, computers can be
connected to a camera to track the movement of specific objects. If there is any
movement, then computers can automatically send an alert and start recording if they
are programmed accordingly.
7) Reduced Cost
Computers can be considered as a low cost solution to earn money in many different ways.
It is cheaper to start many business digitally rather than having physically.

Disadvantages of Computer

The use of computers has also caused different problems in society. The following are the
main problems or disadvantages of the computer:

1) Unemployment
As we discussed above that computers can perform many tasks automatically, this reduces
the need for people and increases unemployment in the society. It has also negatively
affected many others who do not have knowledge of working on computer systems.

2) Health Issues
Improper and prolonged use of computers can negatively affect your health. For example,
if you are constantly working on the computer, your eyes will become dry, which can result
in eyestrain, headache, etc? In addition, sitting too long can also cause pain in your neck or
back, which can result in serious injury in the future. Therefore, follow the appropriate
precautions and take a few minutes break after 30 minutes of computer use.
3) Cyber Crimes
There are some people who use computers and the Internet for negative activities.
They attempt to break the computer's security system and gain unauthorized access to
hack credit card details and other personal information. By accessing information, they
violate all laws and misuse the information for their own benefit. These types of
actions are covered under online cyber-crimes. In addition, hacking is the process of
gaining unauthorized access to computers for certain illegal purposes. Viruses are
usually transferred via email, internet download, or removable devices.

4) Improper Use
Most people do not understand the real need for computers. They just use computers
without any positive motive. They keep using computers to play games, chat with
friends on social media platforms, etc. However, a computer is a good source of
entertainment. But, if used without a schedule, it is not good for their studies and
their health. This also leads to a waste of time, energy and other resources.

5) Spread of False or Inappropriate Content


Not every information on the Internet is true. There are many resources for sharing
incorrect information or providing inappropriate content to users. There are many
sites that provide pornographic content and there are no restrictions, even children
are redirected to such websites. Unfortunately, with the anonymous nature of the
Internet, it is not easy to cope with such activities.
6) Negative Impact on Environment
The computer manufacturing process produces a lot of waste parts. Also, when people
change their electronics, they throw away their old devices. Such wastes can release
hazardous toxic in environment.

7) Virus and Hacking attacks


Virus is computer programs developed to damage or steal our personal or sensitive data.
In addition, hacking is the process of gaining unauthorized access to computers for
certain illegal purposes. Viruses are usually transferred via email, internet download or
removable devices.
Computer Block Diagram System: Mainly computer system consists of three parts, that
are central processing unit (CPU), Input Devices and Output Devices. The Central
Processing Unit (CPU) is divided into two parts again: arithmetic logic unit (ALU) and the
control unit (CU). The set of instruction is in the form of raw data.
A large amount of data is stored in the computer memory with the help of primary and
secondary storage devices. The CPU is like the heart/brain of the computer. The user
does not get the desired output, without the necessary option taken by the CPU. The
Central processing unit (CPU) is responsible for the processing of all the instructions
which are given by the user to the computer system.
The data is entered through input devices such as the keyboard, mouse, etc. This set of
instruction is processed by the CPU after getting the input by the user, and then the
computer system produces the output. The computer can show the output with the help of
output devices to the user, such as monitor, printer, etc.
1. CPU (Central Processing Unit)
2. Storage Unit
3. ALU(Arithmetic Logic Unit)
4. Control Unit

Central Processing Unit (CPU)


The computer system is nothing without the Central Processing Unit so, it is also known as
the brain or heat of computer. The CPU is an electronic hardware device which can perform
different types of operations such as arithmetic and logical operation.
The CPU contains two parts: the arithmetic logic unit and control unit. We have discussed
briefly the arithmetic unit, logical unit, and control unit which are given below:
Control Unit
The control unit (CU) controls all the activities or operations which are performed inside
the computer system. It receives instructions or information directly from the main
memory of the computer.
When the control unit receives an instruction set or information, it converts the
instruction set to control signals then; these signals are sent to the central processor for
further processing. The control unit understands which operation to execute, accurately,
and in which order.
Arithmetic and Logical Unit
The arithmetic and logical unit is the combinational digital electronic circuit that can
perform arithmetic operations on integer binary numbers.It presents the arithmetic and
logical operation. The outputs of ALU will change asynchronously in response to the input.
The basic arithmetic and bitwise logic functions are supported by ALU.
Storage Unit
The information or set of guidelines are stored in the storage unit of the computer system.
The storage unit provides the space to store the data or instruction of processed data. The
information or data is saved or hold in computer memory or storage device. The data
storage is the core function and fundamental of the computer components.
Components of Computer System
The hardware and software exist on the computer. The information which is stored
through the device is known as computer software. The hardware components of the
computer system are related to electronic and mechanical parts, and the software
component is related to data and computer programs. Many elements are connected to
the main circuit board of the computer system called a “motherboard.”
1. Processor.
2. Main Memory.
3. Secondary Memory.
4. Input Devices.
5. Output Devices.
These are mainly five components of the computer system. The computer hardware,
computer software, and liveware exist in the element of the computer system.
Processor
The processor is an electric circuitry within the computer system. The Central processing
unit is the central processor or main processor of the computer system. The processor
carries out the instructions of the computer program with the help of basic arithmetic
and logic, input/output operations.
Main Memory
The Random Access Memory is the main memory of the computer system, which is
known as RAM. The main memory can store the operating system software, application
software, and other information. The Ram is one of the fastest memory, and it allows
the data to be readable and writeable
Secondary memory
We can store the data and programs on a long-term basis in the secondary
memory. The hard disks and the optical disks are the common secondary devices. It
is slow and cheap memory as compare to primary memory. This memory is not
connected to the processor directly.
It has a large capacity to store the data. The hard disk has a capacity of 500
gigabytes. The data and programs on the hard disk are organized into files, and the
file is the collection of data on the disk. The secondary storage is direct access by
the CPU; that’s why it is different from the primary storage.
The hard disk is about 100 times the capacity of the main memory. The main
difference between primary and secondary storage is speed and capacity. There are
several large blocks of data which are copied from the hard disk into the main
memory.
Input Devices
The user provides the set of instruction or information to the computer system with
the help of input devices such as the keyboard, mouse, scanner, etc. The data
representation to the computer system is in the form of binary language after that
the processor processes the converted data. The input unit implements the data
which is instructed by the user to the system.
We can enter the data from the outside world into the primary storage as the input
through input devices. The input devices are the medium of communication between the
outside world and the computer system.
There are some important features of input devices which are given below:
1. The input devices receive or accept the data or instruction from the user, who exist in
the outside world.
2. These devices convert the data or instruction into the machine-readable form for
further processing.
3. The input device performs like the connection between the outside world and our
computer system.
4. The keyboard and mouse are common examples of input devices.
5. When the whole procedure is finished, we get the desired output from the output
devices such as monitor, printer, etc.

Output Devices
The output devices produce or generate the desired result according to our input, such as
a printer, monitor, etc. These devices convert the data into a human-readable form
from binary code.
The computer system is linked or connected to the outside world with the help of
output devices. The primary examples of output devices are a printer, projector, etc.
These devices have various features which are given below:
These devices receive or accept the data in the binary form.
The output devices convert the binary code into the human-readable form.
These devices produce the converted result and show to the user.

Functional Units of a Computer


i) Input Unit
Data and instructions should be first enter in the computer system to get the task
done. Without entering any input in the computer system, computer cannot do any
task and any function.
Eg: If we move our "mouse" from one position to other, then the data in the form of
input is sent to the computer unit and processor. Processor processes the information
and gives us the result. To know, where we are browsing, there is inbuilt function of
mouse, this helps users to know where the mouse cursor is.
Suppose you click on start menu in computer using your mouse, then the information
in the form of binary code is sent to the processor. Processor gives the output on the
monitor. And, hence we can see our start menu.
- Input units reads the data provided from external environment.
- This data in the form of binary code is sent to the computer unit.
- Computer unit processes the information and provides the necessary output to the
user.
ii) Output unit
The output unit is reverse of the input unit. When the processor sends the output to the
output unit. Then the output unit converts the information provided by computer system
from binary language to humans language. In this process, data is sent in external
environment like monitor and sound.
Eg: When input units send the request of opening any webpage to computer system,
computer system loads the webpage in memory and it is later provided to output unit.
And hence, output unit like monitor can provide us the webpage interface.
- It accepts the information provided by computer system in binary codes.
- But, we humans can't understand that language, So, Output unit converts the
information from binary language to Humans language.
- Output unit includes Monitor, Sound system etc.

iii) Storage unit


When the data and instructions are entered in the computer system using input system,
the computer stores that data before processing it and giving it to processor. When the
computer processes our data and instructions, then it provides this data to the output
unit. But, the provided data is also stored in somewhere in the computer system; To
perform this all works and functions, Storage unit of a computer system has been
designed.
- Storing the data and information in memory provided to output unit as a history.
- Processing the files required to output unit while using programs, applications and
games from storage devices.
iv) Central processing unit (CPU)
CPU is the most important component of the computer system. It controls the all
internal and external devices and their functions. Parts like motherboard, ram, storage
device, processors are present in this CPU. CPU performs all the Arithmetic and Logical
operations of computer. In short, The control Unit and the Arithmetic and Logic unit of a
computer system joined together is called as "Central Processing Unit".
- Arithmetic logical unit and Logical unit are the important components of this system.
- Architecture of computer is designed in this CPU, such that, only supported devices
can perform the operations. Like CPU designed by IBM cannot be used to run Mac OS.

v) Arithmetic and Logic unit (ALU)


All calculations, comparisons, processing and tasks are done in ALU. It consists of circuits
in which arithmetic operations like addition, subtraction, multiplication etc are
performed. While processing the data, ALU receives the data from the temporary
storage. In temporary storage, their is a function called as "register". This register is very
high speed memory which controls all the functions and provides the data to the ALU.
- ALU is an important component of CPU.
- ALU receives the data for processing from the temporary storage from the files called as
"registers".
- All processing and computations are done by the ALU.
Generation Of Language
First Generation: Machine Language
Machine language is the lowest level of programming language. It is the only language
that the computer understands. All the commands and data values are expressed using
1s and 0s.
In the 1950s each computer had its own native language. Although there were
similarities between each of the machine language but a computer could not understand
programs written in another machine language.
The main advantage of machine language is that the code can run very fast and
efficiently, since it is directly executed by the CPU.
However, on the down side, the machine language is difficult to learn and is far more
difficult to edit if errors occur. Moreover, if you want to add some instructions into
memory at some location, then all the instructions after the insertion point would have
to be moved down to make room in memory to accommodate the new instructions.
Last but not the least, code written in machine language is not portable and to transfer
code to a different computer it needs to be completely rewritten. Architectural
considerations make portability a tough issue to resolve.
Second Generation: Assembly Language
Assembly languages are symbolic programming languages that use mnemonics (symbols)
to represent machine-language instructions. Since assembly language is close to the
machine, it is also called low-level language.
Basically, an assembly language statement consists of a label, an operation code, and one
or more operands.
Labels are used to identify and reference instructions in the program. The operation code
(opcode) is a mnemonic that specifies the operation that has to be performed, such as
move, add, subtract, or compare. The operand specifies the register or the location in
main memory from where the data to be processed is located.
Assembly language is machine dependent. This makes the code written in assembly
language less portable as the code written to be executed on one machine will not run on
machines from a different or sometimes even the same manufacturer.
The following instructions are a part of assembly language code to illustrate addition of
two numbers
MOV AX,4 Stores the value 4 in the AX register of CPU
MOV BX,6 Stores the value 6 in the BX register of CPU
ADD AX,BX Add the contents of AX and BX register. Store the result in AX register
Third Generation Programming Language
The third generation was introduced to make the languages more programmer-friendly.
3GLs spurred the great increase in data processing that occurred in the 1960s and 1970s.
in these languages, the program statements are not closely related to the internal
characteristics of the computer and is therefore often referred to has high-level
languages.
3GLs made programming easier, efficient and less prone to errors.
Programs were written in an English-like manner, making them more convenient to use
and giving the programmer more time to address a client's problems.
Most of the programmers preferred to use general purpose high level languages like
BASIC (Beginners' All-purpose Symbolic Instruction Code), FORTRAN, PASCAL, COBOL,
C++ or Java to write the code for their applications.
Again, a translator is needed to translate the instructions written in high level language
into computer-executable machine language. Such translators are commonly known as
interpreters and compilers.
3GLs makes it easier to write and debug a program and gives the programmer more time
to think about its overall logic. The programs written in such languages are portable
between machines.
Fourth Generation: Very High Level Languages
4GLs is a little different from its prior generation because they are basically
nonprocedural so the programmers define only what they want the computer to do,
without supplying all the details of how it has to be done.
Characteristics of such language include:
the code comprising of instructions are written in English-like sentences;
they are nonprocedural
the code is easier to maintain
4GL code enhances the productivity of the programmers as they have to type fewer lines
of code to get something done. It is said that a programmer become 10 times more
productive when he writes the code using a 4GL than using a 3GL.
A typical example of a 4GL is the query language that allows a user to request information
from a database with precisely worded English-like sentences.
Let us take an example in which a report has to be generated that displays the total
number of students enrolled in each class and in each semester. Using a 4GL, the request
would look similar to this:
TABLE FILE ENROLLMENT
SUM STUDENTS BY SEMESTER BY CLASS
The only down side of a 4GL is that it does not make efficient use of machine’s
resources. However, the benefit of executing a program fast and easily far outweighs the
extra costs of running it.
Fifth Generation Programming Language

5GLs are centered on solving problems using constraints given to the program,
rather than using an algorithm written by a programmer.
Most constraint-based and logic programming languages and some declarative
languages form a part of the fifth-generation languages.
5GLs are widely used in artificial intelligence research.
Typical examples of a 5GL include Prolog, OPS5, and Mercury.
Another aspect of a 5GL is that it contains visual tools to help develop a program. A
good example of a fifth generation language is Visual Basic.
With 5GL, the programmer only needs to worry about what problems need to be
solved and what conditions need to be met, without worrying about how to
implement a routine or algorithm to solve them.
A compiler is a special type of program that transforms source code written in a
programming language (the source language) into machine language comprising of just
two digits- 1s and 0s (the target language). The resultant code in 1s and 0s is known as the
object code. The object code is the one which will be used to create an executable
program.
If the source code contains errors then the compiler will not be able to its intended task.
Errors that limit the compiler in understanding a program are called syntax errors. Syntax
errors are like spelling mistakes, typing mistakes, etc. Another type of error is logic error
which occurs when the program does not function accurately. Logic errors are much harder
to locate and correct.
Interpreter: Like the compiler, the interpreter also executes instructions written in a high-
level language. While the compiler translates instructions written in high level
programming language directly into the machine language; the interpreter on the other
hand, translates the instructions into an intermediate form, which it then executes.
Usually, a compiled program executes faster than an interpreted program. However, the big
advantage of an interpreter is that it does not need to go through the compilation stage
during which machine instructions are generated. This process can be time-consuming if
the program is long. Moreover, the interpreter can immediately execute high-level
programs.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy