Documente Academic
Documente Profesional
Documente Cultură
1 What is a Computer
2
3 A computer is a machine that executes a set of arithmetic or
logical instructions.
4 The sequence of these instructions can be changed to perform a variety of operations
and get various outputs.
5 ============================================================
=============================
6
7 journey starts with pioneer Charles Babbage.
8 Charles Babbage ,the father of computer, designed the first automatic computing
engine.
9 It was to operate on steam and was called the Difference Engine
10 ============================================================
====
11
12 Harvard Mark-I (refer Figure 1. 6) computer was built as a
partnership between Harvard and IBM in 1944.
13 It was the first programmable digital computer made in the U.S.
14 ============================================================
=========================
15
16 But it was not a purely electronic computer. The Mark-I computer was constructed
out of switches, clutches, relays and rotating shafts.
17 ============================================================
===============================
18 The first completely electronic computer is well known as ENIAC (Electronic
Numerical Integrator And Calculator) and was developed by University of Pennsylvania
in 1946.
19 This was followed by many evolutions and then came Apple I Computer (refer
Figure 1.7)in 1976, which could be setup as a Do It Yourself Kit.
20 ============================================================
=======================================================
21 The computers that we use today is a transformation which was a result of the
invention of the microprocessor.
22 A microprocessor (uP) is a computer that is fabricated on an integrated circuit (IC -
refer Glossary).
23 ============================================================
===================
24 Computers had been around for 20 years before
25 the first microprocessor was developed by Intel (one of the leading companies that
manufactures hardware) in 1971.
26 =======================================================
27 Intel did not invent the electronic computer. But they were the first to succeed in
designing an entire computer on a single chip (IC).Thus Intel 4004, the first
microprocessor.
28 Intel followed the 4004 with the 8008 and 8080.
29 ============================================================
===================
30 Few of the latest use of computer technology can be listed as
below. (Refer glossary for details)
31 Digital Signature verification
32 Natural Language Speech to Text
33 Augmented Reality
34 Cloud Computing
35 Phablets
36 Omnidirectional Imaging
37 Social Networking
38 ============================================================
==========================
39 1.2 Components in a Computer System
40
41 A computer consists of following components:
42 Hardware
43 Software
44 Firmware
45 ===================================================
46 Also called VDU (Visual Display Unit), the Monitor is the primary output device.
47 ============================================================
48 1.2.1.4 Memory Devices
49 These are the devices which store the information.
50
51 The term primary memory is used for the information in physical
systems which functions at high-speed
52 . For example, it is capable of performing complex calculations and displaying the
results at the same time.
53 Secondary memory devices are physical devices for program and
data storage which are slow to access but offer higher memory capacity.
54
55 Primary memory stored on secondary memory is called virtual memory.
56 RAM (refer Figure 1. 14, Glossary), and Computer cache (refer
Glossary)are examples of Primary memory storage.
57 Magnetic tapes, Compact Disks (CDs), Digital Versatile Disks(DVDs - refer Figure
1. 15) are all examples of Secondary Memory Storage.
58
59 The memory is organized into memory cells each storing one binary bit (0 or 1).
60 ============================================================
=============
61
62 1.2.1.5 Central Processing Unit
63
64 The Central Processing Unit (CPU) or the computer processor performs calculations,
processes information, stores data in memory and controls the flow of data.
65 ============================================================
======
66
67 The conventional processors are small in size and have all the circuits integrated on a
single chip.
68 Because of its small size, the processor is also known as microprocessor.A minimal
hypothetical microprocessor might only include an arithmetic logic unit (ALU) and a
control logic section.
69 ============================================================
============
70
We also have multi-core processors that have a single chip containing more than one
microprocessor. This effectively multiplies the processor's potential performance by the
number of cores (the independent actual central processing units).
1 System Software
2 Utility Software
3 Application Software
System Software
It is the software used to manage and control the hardware components and which allow
interaction between the hardware and the other types of software (refer Figure 1. 17). The
most obvious type of system software is the computer's operating system
4 Single-tasking : A Single Tasking system has only one running program (refer
Glossary).The Palm OS for Palm handheld computers is an example of a single-user and
single-task operating system.
It is software such as anti-virus software like Norton and McAfee, or Microsoft Security
Essentials which help to maintain and protect the computer system but may not directly
interface with the hardware. Utilities like Winzip help to combine and compress data files
so that they occupy less memory and can be easily sent in mails
Also known as apps, these are designed to allow the user of the system complete a
specific task or set of tasks. Apps include programs like web browsers, games and office
software.
1.2.3 Firmware
Examples include
remote control.
5 Devices like printers, scanners, cameras and USB drives have firmware stored
internally.
6
7 ==========================================
1.3 Computer Language
Low Level Programing Languages : These languages are very close to the hardware.
They can be directly converted to machine code without any intermediate steps and hence
have faster execution.
1 for example : Assembly language. C language can be used for low level programing
as it can directly interface with memory, hardware and the CPU. It can also be used to
create Operating Systems, and because of its user-friendly programing features, it can be
considered as Middle Level Language also.
2 =====================================================
3 High Level Programing Languages : They provide a very high level of abstraction
from the detail of memory management, and may go through two stages of processing
before they can be understood and executed by the computer. These stages are called
Compilation and Interpretation (refer Glossary). They are easier and have more user-
friendly programing features. For example : java, c++,c#.
1 Arithmetic Unit
2 Logical Unit
i. Arithmetic Unit(AU)
1 AND
2 OR
3 NOT
2.1.1 Central Processing Unit (CPU)
b. Control Unit(CU)
1 Fetch - The Fetch Operation is used for taking the instructions given by the user.
2 Decode - The Decode Operation is used for interpreting the meaning of the
instructions fetched by registers. Decoding instructions means the CPU will find out
which operation is to be performed on the instructions.
3 Execute - The Execute Operation is performed by the CPU and the results
produced by the CPU are then stored into the memory and after that they are displayed on
the user screen.
2.1.3 Memory
The unit that communicates directly with CPU is called the main memory.
Only data currently needed by the processor reside in main
memory. Rest of the information is stored in auxiliary memory and transferred to
main memory when required.
There are following types of Memories:
1 Main memory
1 RAM (Random Access Memory)
2 ROM (Read Only Memory)
2 Auxiliary Memory
3 Magnetic Disks
4 Magnetic tapes etc.
2.2 Bus
The processor, main memory and Input/Output devices can be interconnected through
common data communication lines which are termed as a common bus,
The bus lines which are used to transfer data are grouped into three
categories:
1 Data Bus
1 Address Bus
1 Control Bus
1
Data Bus
1 Data bus is a computer subsystem that allows transferring of data from one
component to another on a motherboard, or between two computers.
2 Address Bus
1 An address bus is used to specify a physical address.
3 Control Bus
1 A control bus is a part of a computer bus, used by CPUs for communicating with
other devices within the computer.
2 It carries commands from the CPU and returns status signals received from the
devices.
2.3
Addressing
Modes
Direct Addressing Mode - In direct addressing, the instruction tells where the value can
be found, but the value itself is out in the memory.
Indirect Addressing Mode - Indirect addressing uses address register to point at the
location of the operand in memory, that is, the address of an operand is obtained
indirectly via an address register.
System software
System software refers to the files and programs that makes up the
computer's operating system. System files consist of libraries of functions, system
services, drivers for printers, other hardware, system preferences and various
configuration files.
1 Assemblers
2 Compilers
3 File Management Tools
4 System Utilities
5 Debuggers
The system software is installed on the computer when the operating system is installed.
Application programs are used by end user, whereas system software is not meant to be
run by the end user.
System software runs at the most basic level of the computer and
hence it is called "low-level" software.User interface is generated by the system
software and allows the operating system to interact with the hardware.
An assembler is a program that converts basic computer instructions into a pattern of bits.
These bits are used by computer's processor to perform its basic operations. Some people
call these instructions as assembler language and others use the term assembly language.
1 Each program statement in the source program is taken by the assembler program
and a corresponding bit stream or pattern (a series of 0's and 1's of a given length) is
generated.
2 The output of the assembler program is called the object code or object program
relative to the input source program. The object program consisting of a sequence of 0's
and 1's is also known as machine code.
3.2
Assembly Language
Assembly language program consists of mnemonic codes which are easy to remember as
they are similar to words in the english language.
It consists of mnemonic codes for each of the different machine code instructions that the
machine understands. A mnemonic is an abbreviation of the actual instruction.
Another advantage of assembly language is the size of the resulting programs. Since
conversion from a higher level by a compiler is not required, the resulting programs can
be exceedingly small.
1 Assembly language can be used for communication with the machine at the hardware
level and hence it is often used for writing device drivers.
Example
1 Label
1 Opcode
1 Operand
1 Comments
JMP LOOP
3.4
Compilers
In the five stages of a compiler, the high level language is translated to a low level
language which is generally closer to that of the target computer.
3.5 Interpreters
Interpreter vs Compiler
5 The primary difference between a compiler and interpreter is the way in which a
program is executed. The compiler converts the source code to machine code and then
saves it as an object code before creating an executable file for the same. The compiled
program is executed directly using the machine code or the object code. But an interpreter
does not convert the source code to an object code before execution.
6 An interpreter executes the source code line by line and conversion to native code
is performed line by line while execution is going on (at runtime). Hence the run time
required for an interpreted program will be high compared to a compiled program.
Computing Environments
It usually refers to one or more very big computer(s) capable of supporting a large
number of simultaneous users and doing bulk calculations and data processing.
It is usually used for extensive operations like Enterprise Resource Planning (refer
glossary) or transaction processing. The Mainframe environment (Refer Figure 5. 2) is
expensive and ensures very high level of security and reliability supporting massive
throughput
4 Datasets should have meaningful names. For example, Customers data should be
stored in a file named CUSTOMER.DATA. Here customer and data are the two segments
or qualifiers of your dataset name.
Mainframes have Security software products like RACF( Resource Access Control
Facility)which control access to datasets.
The Mainframe terminal has 80 columns on a line for coding. The area from columns 8 to
11 is called Area A. The area between columns 12 to 72 is called Area B.
1 WLAN (Wire Less Area Network) : A Wireless Local Area Network (WLAN) links
two or more devices using some wireless method that is without any physical cables. This
enables the to move around within a local coverage area while being connected to the
network. WLANs are used in places like in-home networks, airplanes, trains, restaurants,
hotels.
1 Twisted Pair
2 Coaxial Cable
3 Optic Fiber
a. Twisted Pair
1 Twisted pair cables are of two types: Unshielded Twisted Pair (UTP) and Shielded
Twisted-Pair (STP).
1 The unshielded cables are individually covered but do not have any wrapping or
layer surrounding the twisted pair, that is why they are called unshielded.
The shielded cables are individually covered and the twisted pair is wrapped in a
foil shielding to help provide a more reliable data communication.
Its transmission speed varies from 2 million to 10 billion bits per second.
b. Coaxial cable
c.
Optical fiber
3 Its advantages over metal wires include less transmission loss, immunity from
electromagnetic radiation, and very fast transmission speed, up to trillions of bits per
second.
Wireless network refers to computer network that is not connected by cables of any kind.
3 Wireless MAN - Wireless metropolitan area networks are a type of wireless network
that connect many wireless LANs. WiMAX is an example of Wireless MAN.
4 Wireless WAN - Wireless wide area networks are wireless networks that typically
cover large areas, like networking neighboring towns and cities.
Bus Network
Advantages
1 Implementation is easier.
2 Best Topology for small networks.
Disadvantages
3 Due to the cable length, the number of nodes that can be connected is also less.
4 It can perform well for a limited number of nodes only.
5 If the main cable or the Bus fails, then all the nodes connected to it also fail to
serve.
Star Network
All nodes are connected to a central node or hub. This layout found
typically in a Wireless LAN, where each client connects to the central Wireless
access point.
Advantages
6 As it is centralized in nature, it is simple in terms of operation.
7 It also keeps each device isolated in the network. It means if one node stops
working, it does not affect the function of other nodes.
Disadvantage
8 The whole network operation is dependent on the central hub. The entire network
fails if the central hub fails.
Ring Network
Advantage
9 There is no requirement of a central server as the communication between two nodes
channelizes through all the intermediate nodes.
Disadvantages
10 Even if a single node of the network fails, it can cause the entire network to fail.
11 Entire network is affected whenever any change or movement is made for a network
node.
Mesh Network
Advantage
12 This arrangement of the network nodes makes it is possible to transmit data from
one node to many other nodes at the same time.
Disadvantage
13 In an arrangement where each node is connected to every other node of the
network, many of the connections may serve no major purpose as they behave as
redundant connections.
Fully Connected Network
Each node connects with all the other nodes in the network.
Advantages
14 A fault in one terminal on the network will not effect other nodes, as the data has
multiple redundancy paths that can be used.
15 Data transfer rates can be kept at an acceptable level as whenever network usage is
high the data can be transmitted via different route hence reducing network clogging.
Disadvantage
16 It requires a large amount of wiring.
1 socket() creates a new socket, identified by an integer number, and allocates system
resources to it.
2 bind() is used on the server side to associate a socket with a socket address
structure, that is a specified local port number and IP address.
3 listen() is used on the server side and it causes a bound TCP socket to enter listening
state.
4 connect() is used on the client side to assign a free local port number to a socket.
For TCP socket, it causes an attempt to establish a new TCP connection.
5 accept() is used on the server side to accept a received incoming attempt to create a
new TCP connection from the remote client. It creates a new socket associated with the
socket address pair of this connection.
6 send()-recv(), write()-read() or sendto()-recvfrom() can be used to send and receive
data to/from a remote socket.
1 The methods send() and recv() are used for sockets using TCP that is Transmission
Control Protocol like HTTP. This mechanism has error checking and guarantees no data
loss. It is used for all such applications where you can not allow data loss like browsing
websites.
2 The methods sendto() and recvfrom() are used for sockets using UDP (User
Datagram Protocol like Voice over Internet Protocol or VOIP used to make phone calls
using internet. This has lower level of security and does not guarantee that the data will
reach its destination.)
7 close() causes the system to release resources that are allocated to a socket. The
connection is terminated in case of TCP sockets.
8 unlink() removes the file names created for the socket. So now the socket is
removed and new socket with same name can be created when required.
5.3 Internet
IP forwarding also
known as Internet
routing is a process
used to determine
the path for your
data contained in
structures called
datagrams or
packets (refer
glossary
Computers and routers use routing tables (Refer Figure 5.17) to direct IP packets among
locally networked machines. These tables can be constructed manually or automatically
via DHCP (Dynamic Host Configuration Protocol) for an individual computer or a
routing protocol for routers themselves.
5.4 Websites
A website is a set of related web pages containing information in form of text, images,
audio, video etc. A website is hosted on one or more web server(s) and can be accessed
by internet
1 Websites may host static content that remains same for all the viewers or they may
host dynamic content that changes as per the visiting user's preferences.
To access a website, we need its address. For example, www.tcs.com
For example, .com means Commercial Organization, .edu refers to educational sites, .gov
is for government websites, .jobs means job websites
2 A website is accessed using Hypertext Transfer Protocol (HTTP) . It may also use
encryption (HTTP Secure, HTTPS (refer glossary) ) to provide security and privacy.
Text editors
For example, Notepad, Notepad++.
WYSIWYG (refer glossary) offline editors – These provide a GUI interface. The output
is in form of HTML markup generated automatically by the editor software. For example,
Microsoft FrontPage and Adobe Dreamweaver
WYSIWYG online editors – These can be used to create online web pages including
widgets, blogs, and other documents containing images and other media. For example,
SnapEditor.
Template-based editors - These allow quick creation and uploading of web pages to a
web server. A detailed HTML knowledge is not required.
1 For example, RapidWeaver and iWeb.
Dynamic code - The code is executed on the fly based on some user event.
Scripting languages like Javascript, Ajax are used for this. A website with dynamic
code has following characteristics
1 It recalls all the bits of information from a database and consolidates them in a
predefined format.
2 It interacts with users in various ways like using cookies for finding previous
history.
2 Dynamic content - The web page content keeps on varying based on some criteria,
either predefined rules or variable user input.
Any program needs to be loaded in memory (RAM) before it can actually execute.
Random Access Memory (RAM) is a type of computer memory that can be accessed
randomly
i. Fragmentation
It occurs when there are many free small blocks in memory that are
too small to satisfy any request. In computer storage, fragmentation is a
phenomenon in which storage space is used inefficiently, resulting in to reduced
capacity as well as performance. Fragmentation also leads to wastage of storage
space. The term also refers to the wasted space itself.
1 External fragmentation
2 Internal fragmentation
3 Data fragmentation
1 Internal Fragmentation
Internal fragmentation is the space wasted inside the allocated memory block because of
the restriction on allowed sizes of allocated blocks
2 External Fragmentation
External fragmentation happens when a dynamic memory allocation algorithm allocates
some memory and a small piece is left over which cannot be used effectively.
For example, consider a situation wherein a program allocates three continuous blocks of
memory and then frees the middle one. The memory allocator can use this free block of
memory for future allocations. However, this free block cannot be used for allocation if
the memory to be allocated is larger in size than the free block
3 Data Fragmentation
Data fragmentation occurs when a collection of data in memory is broken up into many
pieces that are not close enough. It is typically the result of attempting to insert a large
object into storage that has already suffered external fragmentation
This type of memory management divides primary memory into multiple memory
partitions, usually contiguous areas of memory. Memory management here consists of
allocating a partition to a job or program when it starts and unallocating it, when job or
program ends.
Each partition runs a process (Refer Glossary). Process 1, Process 2, etc. are the
processes allocated to a particular partition in memory. Once the process is completed,
partition gets empty.
A is the base register address. Base register contains the lowest memory address a process
may refer to. We can get length of a partition from Bounds register. Bounds register
stores upper and lower bounds on addresses in a time sharing environment.
ii.
For example, if B represents address 200, then the expressions, B+10 would signify the
address 210. 10 in expression is the offset. To specify addresses using an offset is called
relative addressing because the resulting address is relative to some other point. Offset is
also known as displacement
We use page number as index to page table and the entry gives
corresponding frame number. 'f' in page table represents frame number. Frame
number is concatenated with the offset to get a corresponding physical address.
Segmented Memory Management
Segmented memory means, the division of computer's primary memory into segments or
sections as shown in figure 4.6. In this type of memory management, there is reference to
a memory location that includes a value . This value identifies a segment and an offset
within that segment. We may create different segments for different program modules, or
for different types of memory usage such as code and data segments. Certain memory
segments may even be shared between programs. Segmented memory does not provide
user's program with a linear and contiguous (or continuous) address space.
CPU has
multiple processes running
at a time. CPU always has
certain programs scheduled
in a queue waiting for their
turn to execute. These all
programs must be scheduled by operating system.
1 Preemptive scheduling:
In a computer, tasks are assigned priorities. At times it is necessary to run a certain task
that has high priority before another task (even if the task is in running state). Therefore,
the running task is interrupted for some time, put to either blocked or suspended state and
resumed later, when the priority task has finished its execution. This process is called
preemptive scheduling.
On storage medium, file gets saved in blocks or sectors. To access these files, file
manager and device manager works together. The device manager knows where to find
each sector on disk, but only file manager has a list telling in what sectors either file is
stored. This list is called File Allocation Table (FAT).
With this type of allocation, all blocks of a file can be distributed all
over the storage medium. The File Allocation Table (FAT) lists not only all files,
but also has an entry for each sector the file occupies. As all information is stored
in the FAT, and there is no assumption on the distribution of the file, this method of
allocation, at times, is also known as FAT.
The advantage is that it is very easy to get a single block, because each block has its entry
in the FAT. Also, it is a very simple allocation method where no overhead is produced and
no search method for free blocks is needed. The disadvantage is that FAT can grow to an
enormous size, which can slow down the system
2 Chained allocation:
With chained file allocation only the first block of file gets an entry
in the FAT. A block has sectors in it. Of these, the first sector has got data as well as
a pointer at its end that points to the next sector to be accessed after it (or indicates
that it was the last). That means each sector (if it is not a last sector) has got a
pointer at its end pointing to the next sector that should be accessed.
The advantage again is that the FAT has a single entry for each file,
indicating position of the first sector and file name. There is no need to store the
files contiguously.
The disadvantage of chained allocation is that it takes much time to retrieve a single
block because that information is neither stored anywhere nor can it be calculated. If we
want to access a particular sector, all preceding sectors have to be read in order one after
another.
3 Indexed allocation:
With indexed file allocation also only the first block of file gets an
entry in the FAT. In the first sector, no data is stored. It has only pointers to where
the file is on storage medium. That is why the first block is known as the index
block.
he disadvantage of indexed allocation is that for each file an additional sector is needed to
keep track of the location of a file.
very small file also always occupies at least two blocks, where as the data could have
easily fit in one block. This results in secondary storage space wastage.
Operating system also deals with the access time of these devices. It
helps make the device access fast and in the most efficient way possible.
Dead Lock
Ostrich algorithm, i.e. ignoring the problem altogether. Ostrich algorithm is a strategy of
ignoring potential problems on the basis that they may be exceedingly rare. Ostrich
algorithm assumes that ignoring the problem would be more cost-effective as compared
to allowing the problem to occur and then attempt for its prevention.
The primary task of operating system as discussed above is to keep track of resources like
memory, CPU utilization, storage device, and input output devices, to grant resource
requests, to mediate conflicting requests from different programs, etc.
4.2.1 Multiplexing
A device that performs the task of multiplexing is called a multiplexer (MUX), and a
device that performs the task of demultiplexing is known as a demultiplexer (DEMUX)
Time Multiplexing
When a particular resource is time multiplexed, different programs or users get their turn
to use that resource one after another. Turns for resource usage are decided as per the
predefined operating system algorithm.Printer is one of the best examples of in-time
multiplexing.
Space Multiplexing
When a particular resource is space multiplexed, the resource is shared equally in the
available space. Time period for which a particular resource is used does not matter
anymore. That is each one gets a part of the resource. Hard disk, main memory, etc are
some of the examples of space multiplexing