Aaron Computer Sceince Notes
Aaron Computer Sceince Notes
CHAPTER-I:
1. Define computer.
3. Characteristics of computer.
Generation
Mode of use
Data organization
Number conversion
CHAPTER-II:
Explain bus, ring, star, mesh, and hybrid and tree topology.
Email.
Webpage.
5. Steps in learning C
7. Classification of C constants
CHAPTER-I
1. Define computer.
-Computer is an electronic device for storing and processing data, typically in binary form, according to
instructions given to it in a variable program.
-A computer is a device that accepts information (in the form of digitalized data) and manipulates it for
some result based on a program or sequence of instructions on how the data is to be processed.
2. Speed: Very fast device. Can perform several billion (109) even trillion (1012) arithmetic
operations per second.
4. Diligence: Can work continuously without getting tired i.e. free from monotony, lack of
concentration, tiredness.
6. Power of remembering: Can store & recall any amount of information at any time with the
help of storage devices.
7. No I.Q.: Cannot take its own decisions, has to be instructed what to do & in what sequence.
8. No feelings: As a machine devoid of emotions & feelings. Cannot make judgments based on
feelings & instincts.
9. Input Unit:
-It supplies converted instructions & data to the storage unit for storage & further processing.
-Output interfaces converts these coded results to human acceptable (readable) form.
It holds,
-Final results of processing, before the system releases them to an o/p unit.
1. Primary Storage.
2. Secondary Storage.
-Used to hold data, intermediate results and results of ongoing processing of job(s).
-Small capacity.
-Expensive.
-Volatile.
-Large Capacity.
-Cheaper than primary storage.
-Does not perform any actual processing of jobs, but acts as a central nervous system for components of
computer systems.
-Brain of computer.
-CU+ALU.
-Activates & controls the operations of other units of the computer system.
-Used to hold data, intermediate results and results of ongoing processing of job(s).
-Small capacity.
-Expensive.
-Volatile.
-Large Capacity.
o RAM (Random Access Memory) is the internal memory of the CPU for storing data, program,
and program result.
o It is a read/write memory which stores data until the machine is working. As soon as the
machine is switched off, data is erased.
o RAM is volatile
o RAM is small, both in terms of its physical size and in the amount of data it can hold.
o The word static indicates that the memory retains its contents as long as power is being
supplied. However, data is lost when the power gets down due to volatile nature.
o SRAM chips use a matrix of 6-transistors and no capacitors. Transistors do not require power to
prevent leakage, so SRAM need not be refreshed on a regular basis.
o No need to refresh
o Faster
o Large size
o Expensive
o DRAM, unlike SRAM, must be continually refreshed in order to maintain the data.
o This is done by placing the memory on a refresh circuit that rewrites the data several hundred
times per second.
o All DRAMs are made up of memory cells, which are composed of one capacitor and one
transistor.
o Used as RAM
o Smaller in size
o Less expensive
o Less power consumption
o The memory from which we can only read but cannot write on it.
o This type of memory is non-volatile. The information is stored permanently in such memories
during manufacture.
o The user buys a blank PROM and enters the desired contents using a PROM program.
o Inside the PROM chip, there are small fuses which are burnt open during programming.
o For erasing this charge, ultra-violet light is passed through a quartz crystal window (lid).
o It can be erased and reprogrammed about ten thousand times. Both erasing and programming
take about 4 to10 ms (millisecond).
o EEPROMs can be erased one byte at a time, rather than erasing the entire chip. Hence, the
process of reprogramming is flexible but slow.
-Advantages of ROM
o Non-volatile in nature
o Easy to test
>Cache Memory
o A CPU cache is a hardware cache used by the central processing unit (CPU) of a computer to
reduce the average cost (time or energy) to access data from the main memory.
o A cache is a smaller, faster memory, located closer to a processor core, which stores copies of
the data from frequently used main memory locations.
o Most CPUs have a hierarchy of multiple cache levels (L1, L2, often L3, and rarely even L4), with
different instruction-specific and data-specific caches at level 1.
>HDD (Hard Disk Drive) / SSD (Solid State Drive)
6. Input and output devices.
-Input Devices
o Keyboard
o Mouse
o Joy Stick
o Scanner
o Microphone
o Light Pen
o Track Ball
1) Keyboard
2) Mouse
o It is a very famous cursor-control device having a small palm size box with a round ball at its
base, which senses the movement of the mouse and sends corresponding signals to the CPU
when the mouse buttons are pressed.
o Generally, it has two buttons called the left and the right button and a wheel is present between
the buttons.
o A mouse can be used to control the position of the cursor on the screen, but it cannot be used
to enter text into the computer.
3) Joystick
o Joystick is also a pointing device, which is used to move the cursor position on a monitor screen.
o It is a stick having a spherical ball at its both lower and upper ends. The lower spherical ball
moves in a socket.
o The joystick can be moved in all four directions.
o It is mainly used in Computer Aided Designing (CAD) and playing computer games.
4) Light Pen
o It is used to select a displayed menu item or draw pictures on the monitor screen.
o When the tip of a light pen is moved over the monitor screen and the pen button is pressed, its
photocell sensing element detects the screen location and sends the corresponding signal to the
CPU.
5) Track Ball
o Track ball is an input device that is mostly used in notebook or laptop computer, instead of a
mouse.
o This is a ball which is half inserted and by moving fingers on the ball, the pointer can be moved.
o Since the whole device is not moved, a track ball requires less space than a mouse.
o A track ball comes in various shapes like a ball, a button, or a square.
6) Scanner
o Microphone is an input device to input sound that is then stored in a digital form.
o The microphone is used for various applications such as adding sound to a multimedia
presentation or for mixing music.
8) Magnetic Card Reader (MICR)
o MICR input device is generally used in banks as there are large number of cheques to be
Processed every day.
o The bank's code number and cheque number are printed on the cheques with a special type of
ink that contains particles of magnetic material that are machine readable.
o This reading process is called Magnetic Ink Character Recognition (MICR).
o The main advantages of MICR is that it is fast and less error prone.
o Bar Code Reader is a device used for reading bar coded data (data in the form of light and
o Dark lines).
o Bar coded data is generally used in labelling goods, numbering the books, etc.
o It may be a handheld scanner or may be embedded in a stationary scanner.
o Bar Code Reader scans a bar code image, converts it into an alphanumeric value, which is
o Then fed to the computer that the bar code reader is connected to.
o OMR is a special type of optical scanner used to recognize the type of mark made by pen or
pencil.
o It is used where one out of a few alternatives is to be selected and marked.
o It is specially used for checking the answer sheets of examinations having multiple choice
questions.
-Output Devices
o Monitor
o Printer
1) Monitor
Monitors, commonly called as Visual Display Unit (VDU), are the main output device of
A computer. It forms images from tiny dots, called pixels that are arranged in a rectangular
Form. The sharpness of the image depends upon the number of pixels.
There are two kinds of viewing screen used for monitors.
-Cathode-Ray Tube (CRT)
-Flat-Panel Display
Cathode-Ray Tube (CRT) Monitor
The CRT display is made up of small picture elements called pixels. The smaller the pixels,
The better the image clarity or resolution. A finite number of characters can be displayed on a
screen at once. The screen can be divided into a series of character boxes - fixed location on the
screen where a standard character can be placed. Most screens are capable of displaying 80
characters of data horizontally and 25 lines vertically.
2) Printer
Impact Printers
Impact printers print the characters by striking them on the ribbon, which is then pressed on the
paper.
Characteristics of Impact Printers are the following:
-Very low consumable costs
-Very noisy
-Useful for bulk printing due to low cost
-There is physical contact with the paper to produce an image
Non-impact Printers
Non-impact printers print the characters without using the ribbon. These printers print a
Complete page at a time, thus they are also called as Page Printers.
These printers are of two types -
-Laser Printers
-Inkjet Printers
Characteristics of Non-impact Printers
-Faster than impact printers
-They are not noisy
-High quality
-Supports many fonts and different character size
Laser Printers
These are non-impact page printers. They use laser lights to produce the dots needed to
Form the characters to be printed on a page.
Advantages
-Very high speed
-Very high quality output
-Good graphics quality
-Supports many fonts and different character size
Disadvantages
-Expensive
-Cannot be used to produce multiple copies of a document in a single printing Inkjet Printers
o Inkjet printers are non-impact character printers based on a relatively new technology.
o They print characters by spraying small drops of ink onto paper. Inkjet printers produce high
quality output with presentable features.
o They make less noise because no hammering is done and these have many styles of printing
modes available. Color printing is also possible.
o Some models of Inkjet printers can produce multiple copies of printing also.
o Advantages
-High quality printing
-More reliable
o Disadvantages
-Expensive as the cost per page is high
-Slow as compared to laser printer
Generation.
Mode of use.
Data organization.
Number conversion.
-Classification of Computer
1. Analog Computers
2. Digital Computers
3. Hybrid Computers
Analog Computers
o These computers are ideal in situations where data can be accepted directly from measuring
instrument without having to convert it into numbers or codes.
o Analog computers do not require any storage capability because they measure and compare
quantities in a single operation. Output from an analog computer is generally in the form of
readings on a series of dial (Speedometer of a car) or a graph on strip chart.
Applications
o They are frequently used to control process such as those found in oil refinery where flow and
temperature measurements are important.
Digital Computers
A Digital Computer, as its name implies, works with digits to represent numerals, letters
or other special symbols. Digital Computers operate on inputs which are ON-OFF type
and its output is also in the form of ON-OFF signal. Normally, an ON is represented by a
1 and an OFF is represented by a 0.
So we can say that digital computers process information which is based on the presence
or the absence of an electrical charge or we prefer to say a binary 1 or 0.
A digital computer can be used to process numeric as well as non-numeric data.
It can perform arithmetic operations like addition, subtraction, multiplication and division
and also logical operations.
Most of the computers available today are digital computers. The most common
examples of digital computers are accounting machines and calculators.
The results of digital computers are more accurate than the results of analog computers.
Analog computers are faster than digital.
Analog computers lack memory whereas digital computers store information.
Hybrid Computers
A hybrid is a combination of digital and analog computers.
It combines the best features of both types of computers, i-e. It has the speed of analog
computer and the memory and accuracy of digital computer.
Hybrid computers are used mainly in specialized applications where both kinds of data
need to be processed. Therefore, they help the user, to process both continuous and
discrete data.
For example a petrol pump contains a processor that converts fuel flow measurements
into quantity and price values.
In hospital Intensive Care Unit (ICU), an analog device is used which measures patient's
blood pressure and temperature etc, which are then converted and displayed in the form
of digits.
Hybrid computers for example are used for scientific calculations, in defense
-Classification of Computer
o Generations of Computers
1. Vacuum Tube: Vacuum tubes have the functionality of controlling the flow of electronics in a
vacuum. Generally, it is used in switches, amplifiers, radios, televisions, etc.
3. Integrated Circuit (IC): Integrated circuits are silicon chips that contain their circuit elements like
transistors, resistors, etc.
4. Microprocessors: Microprocessors are the components that contain the CPU and its circuits and
are present in the Integrated Circuit.
5. Central Processing Unit (CPU): The CPU is called the brain of the computer. CPU performs
processing and operations work.
6. Magnetic Drum: Magnetic Drum is like a cylinder that stores data and cylinder.
7. Magnetic Core: Magnetic cores are used to store information. These are arrays of small rings.
8. Machine Language: Machine Language is the language that a computer accepts (in the form of
binary digits). It is also called low-level programming language.
10. Artificial Intelligence: Artificial Intelligence deals with creating intelligent machines and
behaviors.
• Unreliable
• Very costly
• Huge size
• Need of AC
• Non-portable
• 1959-1965
• AC required
IBM 1620 , IBM 7094 , CDC 1604 , CDC 3600 , UNIVAC 1108
• 1965-1971
• IC used
• Costly
• AC required
IBM-360 series, Honeywell-6000 series, PDP (Personal Data Processor), IBM-370/168, TDC-316
• 1971-1980
• Very cheap
• Use of PCs
• Pipeline processing
• No AC required
• 1980-till date.
• ULSI technology
-Classification of Computer
Data organization
o A file system is the logical view that an operating system provides so that users can manage
information as a collection of files
File
Ex.-a file may contain a Java program, a JPEG image, or a MP3 audio clip
o File names are often separated, usually by a period, into two parts
o Main name
o File extension
-Create a file
-Delete a file
- Open a file
- Close a file
-Rename a file
-Copy a file
-Classification of Computer
NUMBER SYSTEMS
-Decimal number system-value of base is 10 (0,1,2,3,4,5,6,7,8,9)
-Binary number system- value of base is 2 (0 & 1)
-Octal number system- value of base is 8 (0,1,2,3,4,5,6,7)
-Hexadecimal number system- value of base is 16 (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)
CHAPTER-II
1. Computer network definition, application.
Computer network
A computer network is a set of two or more computers connected together for the
purpose of sharing resources.
Network consists of two or more computers that are linked in order to share resources
(such as printers and CDs), exchange files, or allow electronic communications.
The computers on a network may be linked through cables, telephone lines, radio waves,
satellites, or infrared light beams.
Explain bus, ring, star, mesh, and hybrid and tree topology.
Network Topology
A network topology refers to the way in which the network links its nodes (computers or
other communication devices) together.
It is the study of arrangement of the elements (links, nodes, etc.) of a network.
1. Bus Topology
Bus topology is a specific kind of network topology in which all of the various devices in
the network are connected to a single cable or line.
The physical Bus Network Topology is the simplest and most widely used of the
network designs. It consists of one continuous length of cable that is shared by all the
nodes in the network . Bus networks make up what is known as a passive topology. Bus-
connected computers act "expectantly," that is, before transmitting data, they verify that
none of the other computers on the bus are transmitting information, sending packets
when the connection is free. In general, passive networks based on contention (so-called
because each computer has to compete for the transmission time).
Bus networks usually use coaxial cables that connect to each of the computers through T-
shaped connectors. A terminator specific to the type of cable used placed on each end
node of the network (if a cable used 50 Ohm, 50 Ohm terminators must use). Since the
bus network is nothing more than a set of cables, connectors, and terminators, the signal
is not amplified when traveling through the wiring.
Advantages
It uses established standards and it is relatively easy to install and the use for small
networks.
It requires less media than other topologies.
Failure of one node does not affect the network functioning.
Cost is less as only one main cable is required and least amount of cable is required to
connect computers.
Expansion is easier. New node can be easily added by using a connector.
Disadvantages
Each node has two adjacent nodes, forming a single continuous pathway for signals
through each node - a ring.
A node can directly communicate with the two adjacent nodes.
No master node for controlling other nodes. A node receives data from one of its two
adjacent nodes.
If the data is addressed to that node it utilizes it or else just passes on to the next node.
Data travel from node to node, with each node along the way handling every packet.
The physical ring Topology is a circular loop of point-to-point links. Message travel
around the ring from node to node in a very organized manner. Each workstation checks
the message for a matching destination address. If the address doesn't match the node
simply regenerates the message and sends it on its way. If the address matches, the node
accepts the message and sends a reply to the originating sender.
In ring topology, the various nodes are connected in form of a ring or circle (physical
ring), in which data flows in a circle, from one station to another station.
It has no beginning or end that needs to be terminated.
There are two kinds of ring topologies:
1. Single ring - In single ring network, a single cable is shared by all the devices and data travel
only in one direction. Each device waits for its turn and then transmits. When the data reaches its
destination, another device can transmit.
2. Dual ring: This topology uses two rings to send the data, each in different direction. Thus
allowing more packets to be sent over the network.
Advantages
It works well where there is no central node for making routing decisions.
More reliable than star as communication is not dependent on a single central node.
Alternate routing is possible if link or node fails.
There is no master computer on controller. Every computer has equal chance to place the
data.
There are no collisions.
Data packets travel at greater speeds.
It is easier to locate the problems with device and cable i.e. fault isolation is simplified. If
one device does not receive a signal within a specified time, it can issue an alarm. This
alarm alerts the network operator to the problem and its location.
Disadvantages
More complicated control software.
A ring network requires more cable than a bus network.
A break in cable ring brings down entire network (in case of single ring).
Adding or removing the node disturbs the network activity.
In ring network, communication delay is directly proportional to the number of nodes in
the network. Hence addition of new nodes in the network also increases communication
delay.
It is considerably difficult to install and reconfigure ring Topology
Media failure on unidirectional or single loop causes complete network failure.
3. Mesh Topology
In a mesh topology, all nodes over a network are interconnected with one another. Every
node not only sends its own signals but also relays data from other nodes.
Full mesh topology is the one where every node is connected to every other node in the
network.
The mesh network topology uses redundant connections between the node on the
network, applying a fault tolerance strategy.
Each node included in the network connected to the rest of the node, which explains why
this type of topology requires extensive wiring.
This type of topology can cope with the failure of one or two segments of the network
without interrupting traffic since it has redundant lines.
Mesh networks are more expensive and difficult to install than other types of network
topologies due to the large number of connections they require.
In most cases, networks that use this redundant connection strategy included within the
broader hybrid networks.
Advantages of Mesh Topology
1. It is robust as the failure of one node does not collapse the entire system. If one link fails, the
entire system continues to work.
2. There is no traffic congestion problem as dedicated links are being used.
3. Dedicated links ensure faster transmission without any delay.
4. Dedicated links also ensure data privacy and security.
5. Point to point links makes fault identification and isolation easier.
Disadvantages
1. Connecting each device to every other device in the network makes installation and
reconfiguration difficult.
2. It has high cabling cost as n (n-l)/2 links are required to connect n nodes.
4. Star Topology
The physical star Topology uses a central controlling or hub with dedicated legs
pointing in all directions – like points of a star.
Each network device has a dedicated point-to-point link to the central hub.
There is no direct link between these computers and the computers can communicate via
central controller only.
This strategy prevents troublesome collisions and keeps the lines of communications
open and free of traffic.
Since in the star topology each computer on the network uses a different cable
connection, this type of topology is expandable, only limited by the number of ports
available in the hub (although it is possible to join several hubs to increase the number of
ports ).
The expansion of a star topology network does not present any difficulty, since adding
another computer to the network means nothing more than placing a cable between the
computer and the hub. In fact, the rest of the network users will not even notice the
extension.
The routing function is performed by the central controller which centrally controls
communication between any two computers by establishing a logical path between them.
It means that if one computer A wants to send data to another computer B, Computer A
sends the data to the controller & this controller then sends the data to computer B.
This Topology, obviously, require a great deal of cabling.
This design provides an excellent platform for reconfiguration and trouble-shooting.
Changes to the network are as simple as plugging another segment into the hub and a
break in the LAN is easy to isolate and doesn't affect the rest of the network.
Advantages of Star Topology
The benefits of star topology are:
1. It is easier to add new node or modify any existing node without disturbing
network i.e. expansion is easier.
2. Addition of new node does not increase communication delay.
3. If any local computer or link fails, the entire system does not collapse. Only that link or
computer is affected.
4. It is easy to find device and cable problems i.e. fault identification and isolation is easier.
5. Media faults are automatically isolated to the failed segment.
5. Hybrid Topology
The hybrid Topology is a type of Topology that is composed of one or more interconnections
of two or more networks that are based upon different physical topologies in a single network
that is composed of one or more interconnections of two or more networks that are based upon
the same physical topology.
6) Tree Topology
Tree or Hierarchical Topology: The type of Topology in which a central 'root' node, the top
level of the hierarchy, is connected to one or more other nodes that are one level lower in the
hierarchy i.e., the second level, with a point-to-point link between each of the second level nodes
and the top level central 'root' node, while each of the second level nodes that are connected to
the top level central 'root' node will also have one or more other nodes that are one level lower in
the hierarchy, i.e., the third level, connected to it, also with a point-to-point link, the top level
central 'root' node being the only node that has no other node above it in the hierarchy – the
hierarchy of the tree is symmetrical, each node in the network having a specific fixed number, f,
of nodes connected to it at the next lower level in the hierarchy, the number, f, being referred to
as the 'branching factor' of the hierarchical tree.
Advantages:
Supported by several hardware and software venders.
It allows more devices to be attached to a single central hub and can therefore increases
the distance a signal can travel between devices.
Disadvantages:
Overall length of each segment is limited by the type of cabling used.
If the backbone line breaks, the entire segment goes down.
More difficult to configure and wire than other topologies.
It has higher cabling cost in setting up a tree structure.
Limited coverage, about Limited coverage, about Unlimited (usually in 1000Km) range,
Distance
upto 2 miles(or 2500 upto 100 miles(or 200 uses repeater and other connectivity
coverage
meters) km) for range extension
Speed of High, typically 10 Mbps, High, typically 100 Slow, about 1.5 Mbps (May vary based
operation 100 Mbps and 1000 Mbps Mbps on wireless technologies used)
Locally installed, twisted Locally installed and Locally installed and based on
Technologies pair, fiber optic cable, common carrier e.g. twisted pair
based on common
used for wireless wires, fiber, coaxial cable, wireless
carrier e.g. twisted pair,
medium including wireless and cellular
(e.g. WLAN, ZigBee) fiber optic cable etc.
network based
Used mainly by fixed
desktop computers and
portable computers (e.g.
Used mainly by desktop Can be used by any devices, but
Applications laptops). Now-a-days it is desktop devices are mainly using
and mini computers.
used by smart phones due This network type.
to emergence of WLAN
network
Disadvantages of E-mail
Emotional responses. Some emails cause upset or anger. A reply in the heat of the moment
can’t be retracted.
Information overload. Too many people send too much information.
Lacks the personal touch. Some things are best left untyped. Email will never beat a hand
written card or letter when it comes to relationships.
Misunderstandings. Emails from people who don’t take the time to read what they write
before clicking ‘send’. Time is wasted, either to clarify or, worse, acting on a
misinterpretation of the message.
Disadvantages of HTTP:
Privacy :Anyone can see content
Integrity: Someone might alter content.
HTTP is insecure since no encryption methods are used.
Authentication: Not clear who you are talking with.
Stateless : Need State management techniques to maintain the information across
multiple request-response cycles
Webpage
Web pages are what make up the World Wide Web. These documents are written in
HTML (hypertext markup language) and are translated by your Web browser.
Web pages can either be static or dynamic. Static pages show the same content each time
they are viewed. Dynamic pages have content that can change each time they are
accessed.
These pages are typically written in scripting languages such as PHP, Perl, ASP, or JSP.
The scripts in the pages run functions on the server that return things like the date and
time, and database information.
All the information is returned as HTML code, so when the page gets to your browser, all
the browser has to do is translate the HTML.
Please note that a Web page is not the same thing as a Web site.
A Web site is a collection of pages.
A Web page is an individual HTML document.
-Algorithm can be defined as: “A sequence of activities to be processed for getting desired
output from a given input.”
E.g. write an algorithm to read two numbers and find their sum.
Algorithm:
Step 1: Start
Step 2: Read the first num1.
Step 3: Read the second num2.
Step 4: Sum= num1+num2
Step 5: Print Sum
Step 6: End
Flowchart:
A graphical representation of an algorithm is known as flowchart.
Flowchart Symbols:
General Rules for flowcharting
1. All boxes of the flowchart are connected with Arrows. (Not lines)
2. Flowchart symbols have an entry point on the top of the symbol with no other entry points.
The exit point for all flowchart symbols is on the bottom except for the Decision symbol.
3. The Decision symbol has two exit points; these can be on the sides or the bottom and one side.
4. Generally a flowchart will flow from top to bottom. However, an upward flow can be shown
as long as it does not exceed 3 symbols.
5. Connectors are used to connect breaks in the flowchart
6. All flow charts start with a Terminal or Predefined Process (for interrupt programs or
subroutines) symbol.
7. All flowcharts end with a terminal or a contentious loop.
E.g. draw a flowchart to find the area of a circle of radius r.
5. Steps in learning C
Constants
It is a quantity that doesn’t change.
Variables
Keywords
-These are words whose meaning has already been explained to the C compiler.
7. Classification of C constants
-Ex.: +325
-32
-Some compilers allow variable names whose length up to 40 characters but it is safer to have max
length 8 characters.
m_hra
The scanf () function in C is used to read formatted input from the standard input (keyboard). It works
similarly to the printf () function, but instead of printing output, it reads input values and stores them in
variables. Here's a short explanation along with an
The scanf () function in C is used to read formatted input from the standard input
(keyboard). It works similarly to the printf() function, but instead of printing
output, it reads input values and stores them in variables. Here's a short
explanation along with an
a) The if statement
Syntax:
Syntax:
If (condition)
Do this;
Else
Do this;
These are also called as ternary (To run one code when the condition is true and another code
when the condition is false) operators.
Else