Computer Notes 2019
Computer Notes 2019
INTRODUCTION TO COMPUTERS
A COMPUTER is an electronic machine that can accept data through input devices and can
process the given data through CPU and can display the result through one of the output
devices.
Computer performs both simple and complex operations, with speed and accuracy. All
computers regardless of their size, capacity, speed and cost perform 4 basic functions which are
as follows:
Acceptance of data
Processing of data
Giving out processed data
Storing data
Characteristics of Computer
Speed The computer can process data very fast, at the rate of millions of instructions per
second.
Accuracy Computer provides a high degree of accuracy.
Diligence when used for a longer period of time, the computer does not get tired or fatigued.
Storage Capability Large volumes of data and information can be stored in the computer and
also retrieved whenever required.
Versatility Computer is versatile / multipurpose in nature. It can perform different types of
tasks with the same ease.
Limitations of computers
Computer can only perform tasks that it has been programmed to do.
Computer cannot do any work without instructions from the user.
It executes instructions as specified by the user and does not take its own decisions.
HARDWARE
A computer system is made up of hardware and software.
o Hardware: Physical components of a computer (something you can touch)
o Software: Programs that run on the computer (you can't hold them in your hand)
o Systems software: Set of programs needed to control the hardware(Operating System)
o Applications software: Programs that allows the user to carry out a task or produce
something.
Following are few of the important input devices, which are used in Computer Systems:
1
Miss gwenzi form 1 notes
Keyboard
Mouse
Joystick
Light pen
Track Ball
Scanner
Graphic Tablet
Microphone
Magnetic Ink Card Reader (MICR)
Optical Character Reader (OCR)
Bar Code Reader
Optical Mark Reader
Keyboard
The keyboard helps in inputting the data to the computer. The layout of the keyboard is like
that of traditional typewriter.
Keyboards are of two sizes 84 keys or 101/102 keys, but now 104 keys or 108 keys keyboard is
also available for Windows and Internet.
The keys are following
Keys Description
These keys include the letter keys (A-Z) and digits keys (0-9) which generally
Typing Keys
give same layout as that of typewriters.
It is used to enter numeric data or cursor movement. Generally, it consists of a
Numeric Keypad set of 17 keys that are laid out in the same configuration used by most adding
machine and calculators.
The twelve functions keys are present on the keyboard. These are arranged in
Function Keys a row along the top of the keyboard. Each function key has unique meaning
and is used for some specific purpose.
These keys provide cursor and screen control. It includes four directional
Control keys arrow key. Control keys also include Home, End, Insert, Delete, Page Up, Page
Down, Control(Ctrl), Alternate(Alt), Escape(Esc).
Special Purpose Keyboard also contains some special purpose keys such as Enter, Shift, Caps
Keys Lock, Num Lock, Space bar, Tab, and Print Screen.
Mouse
Mouse is most popular Pointing device. It is a very famous cursor-control device. It is a small
palm size box with a round ball at its base which senses the movement of mouse and sends
corresponding signals to CPU on pressing the buttons.
Generally, it has two buttons called left and right button and scroll bar is present at the mid.
Mouse can be used to control the position of cursor on screen, but it cannot be used to enter
text into the computer.
Advantages
Easy to use
Not very expensive
Moves the cursor faster than the arrow keys of keyboard.
2
Miss gwenzi form 1 notes
Joystick
Joystick is also a pointing device, which is used to move cursor position on a monitor screen. It
is a stick having a spherical ball at its both lower and upper ends. The lower spherical ball
moves in a socket. The joystick can be moved in all four directions.
The function of joystick is similar to that of a mouse. It is mainly used in Computer Aided
Designing (CAD) and playing computer games.
Light Pen
Light pen is a pointing device, which is similar to a pen. It is used to select a displayed menu
item or draw pictures on the monitor screen. It consists of a photocell and an optical system
placed in a small tube.
When light pen's tip is moved over the monitor screen and pen button is pressed, its photocell
sensing element, detects the screen location and sends the corresponding signal to the CPU.
Track Ball
Track ball is an input device that is mostly used in notebook or laptop computer, instead of a
mouse. This is a ball, which is half inserted and by moving fingers on ball, pointer can be moved.
Since the whole device is not moved, a track ball requires less space than a mouse. A track ball
comes in various shapes like a ball, a button and a square.
Scanner
Scanner is an input device, which works more like a photocopy machine. It is used when some
information is available on a paper and it is to be transferred to the hard disc of the computer
for further manipulation.
Scanner captures images from the source which are then converted into the digital form that
can be stored on the disc. These images can be edited before they are printed.
Digitizer
Digitizer is an input device, which converts analog information into a digital form. Digitizer can
convert a signal from the television camera into a series of numbers that could be stored in a
3
Miss gwenzi form 1 notes
computer. They can be used by the computer to create a picture of whatever the camera had
been pointed at.
Digitizer is also known as Tablet or Graphics Tablet because it converts graphics and pictorial
data into binary inputs. A graphic tablet as digitizer is used for doing fine works of drawing and
images manipulation applications.
Microphone
Microphone is an input device to input sound that is then stored in digital form. The
microphone is used for various applications like adding sound to a multimedia presentation or
for mixing music.
4
Miss gwenzi form 1 notes
OUTPUT DEVICES
They output work, which has been done by the computer in a form readable to users.
Output devices provide output to the user, which is generated after processing the input data.
Following are few of the important output devices, which are used in Computer Systems:
Monitors
Graphic Plotter
Printer
Monitors
Monitor commonly called as Visual Display Unit (VDU) is 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 the pixels.
There are two kinds of viewing screen used for monitors:
Cathode-Ray Tube (CRT)
Flat-Panel Display
Plotters
Plotters are used to produce high quality line drawings.Most plotters are vector plotters. They
move a pen using point to point data.
Color vector plotters have a rack with several pens.
Advantages:
Can handle large paper sizes
08/0322 FORM 1RED LESSON NOTES PRINTERS
5
Miss gwenzi form 1 notes
Printers
Printer is the most important output device, which is used to print information on paper.
There are two types of printers:
Impact Printers
Non-Impact Printers
Impact Printers
The printers that print the characters by striking against the ribbon and onto the paper, are called
impact printers.
Characteristics of Impact Printers are the following:
Very low consumable costs
Impact printers are very noisy
Useful for bulk printing due to low cost
There is physical contact with the paper to produce an image
These printers are of two types:
Character printers
Line printers
Character Printers:
Character Printers are printers, which print one character at a time.
These are of further two types:
Dot Matrix Printer (DMP)
Daisy Wheel
Dot Matrix Printer
In the market, one of the most popular printer is Dot Matrix Printer because of their ease of printing
features and economical price. Each character printed is in form of pattern of Dot's and head
consists of a Matrix of Pins of size (5*7, 7*9, 9*7 or 9*9) which comes out to form a character that is
why it is called Dot Matrix Printer.
Advantages
Inexpensive
Widely Used
Other language characters can be printed
Disadvantages
Slow Speed
Poor Quality
Daisy Wheel
Head is lying on a wheel and Pins corresponding to characters are like petals of Daisy (flower
name) that is why it is called Daisy Wheel Printer. These printers are generally used for word-
processing in offices which require a few letters to be send here and there with very nice quality
representation.
Advantages
More reliable than DMP's
Better quality
The fonts of character can be easily changed.
Disadvantages
6
Miss gwenzi form 1 notes
Slower than DMP's
Noisy
More expensive than DMP's
Line Printers
Line printers are printers, which print one line at a time.
Non-impact Printers
The printers that print the characters without striking against the ribbon and onto the paper are
called Non-impact Printers. These printers print a complete page at a time, also called as Page
Printers.
These printers are of two types:
Laser Printers
Inkjet Printers
Characteristics of Non-impact Printers:
7
Miss gwenzi form 1 notes
Faster than impact printers.
They are not noisy.
High quality.
Support many fonts and different character size.
Laser Printers
These are non-impact page printers.
Laser printers fuse powdered ink/toner onto the paper by heat and pressure.
Advantages
Very high speed.
Very high quality output.
Gives good graphics quality.
Supports many fonts and different character sizes.
Disadvantages
Running costs are higher than those of impacts printers
Cannot be used to produce multiple copies of a document in a single printing.
Inkjet Printers
Inkjet printers are non-impact character printers based on a relatively new technology.
Ink jet printers work bydirecting a fine jet of ink at the paper.
Advantages:
Low set up cost
Quiet
High quality printing
More reliable
Full colour capacity
Disadvantages:
Slow print speed
Printing consumables can be expensive
Large areas of colour can warp the paper
Storage Devices
CD-ROM
Advantages:
Good storage capacity
8
Miss gwenzi form 1 notes
Modest transfer rate
Fairly robust
Disadvantages:
Only the manufacturer can store data
Relatively large for the portable market
CD-R (WORM)
Allows data to be written once to the CD.
Advantages:
Inexpensive method for data storage
Can be read by CD-ROM drives
Excellent for archiving
Disadvantages:
Cannot be reused (although in some cases this may be an advantage)
Capacity too small for entire HD backup
CD-RW
Can write data out several thousand times.
Advantages:
Could be a replacement for a floppy disk
Disadvantages:
Cannot be read by some older CD-ROM drives
DVD-ROM
Stores more using two layers on each side.
Advantages:
Increased storage capacity
Marginally faster data transfer than CD-ROM drives
Disadvantages:
Cost of manufacture is higher (currently)
COMPUTER MEMORY
A memory is just like a human brain. It is used to store data and instructions. Computer
memory is the storage space in computer where data is to be processed and instructions
required for processing are stored.
The memory is divided into large number of small parts. Each part is called cell. Each location or
cell has a unique address, which varies from zero to memory size minus one.
For example, if computer has 64k words, then this memory unit has 64 * 1024=65536 memory
location. The address of these locations varies from 0 to 65535.
Memory is primarily of three types:
Cache Memory
Primary Memory/Main Memory
Secondary Memory
9
Miss gwenzi form 1 notes
Cache Memory
Cache memory is a very high speed semiconductor memory, which can speed up CPU. It acts as
a buffer between the CPU and main memory.
It is used to hold those parts of data and program which are most frequently used by CPU. The
parts of data and programs are transferred from disk to cache memory by operating system,
from where CPU can access them.
Advantage
Cache memory is faster than main memory.
It consumes less access time as compared to main memory.
It stores the program that can be executed within a short period of time.
It stores data for temporary use.
Disadvantage:
Cache memory has limited capacity.
It is very expensive.
Secondary Memory
This type of memory is also known as external memory or non-volatile. It is slower than main
memory. These are used for storing Data/Information permanently.
CPU does not directly access these memories; instead they are accessed via input-output
routines. Contents of secondary memories are first transferred to main memory and then CPU
can access it. For example, disk, CD-ROM, DVD, etc.
Characteristics of Secondary Memory
These are magnetic and optical memories.
It is known as backup memory.
It is non-volatile memory.
Data is permanently stored even if power is switched off.
It is used for storage of the data in the computer.
10
Miss gwenzi form 1 notes
Computer may run without secondary memory.
Slower than primary memories.
RAM
A RAM constitutes the internal memory of the CPU for storing data, program and program result. It
is read/write memory. It is called random access memory (RAM).
Since access time in RAM is independent of the address to the word that is, each storage location
inside the memory is as easy to reach as other location & takes the same amount of time. We can
reach into the memory at random & extremely fast but can also be quite expensive.
RAM is volatile, i.e., data stored in it is lost when we switch off the computer or if there is a power
failure. Hence, a backup uninterruptible power system (UPS) is often used with computers. RAM is
small, both in terms of its physical size and in the amount of data it can hold.
RAM is of two types:
Static RAM (SRAM)
Dynamic RAM (DRAM)
11
Miss gwenzi form 1 notes
Lesser in size
Less expensive
Less power consumption
ROM stands for Read Only Memory. The memory from which we can only read but cannot write on
it. This type of memory is non-volatile. The information is stored permanently in such memories
during manufacture.
A ROM stores such instructions as are required to start computer when electricity is first turned on,
this operation is referred to as bootstrap. ROM chip are not only used in the computer but also in
other electronic items like washing machine and microwave oven.
12
Miss gwenzi form 1 notes
Not volatile Volatile (lose its content when there is a power
cut)
Cannot be altered Allows changes to be made
Cache memory
Is a high speed memory mainly used to complement the RAM.
Cache memory is faster than RAM and it stores frequently used pages.
The cache memory is between the RAM and the CPU and the CPU searches for data or programs
in the cache first, if it’s not found, the CPU then searches in the RAM.
The CPU uses certain algorithms to determine which data should be stored in the cache, which
will help the CPU to predict the next instruction to be executed and hence making processing
faster.
Virtual Memory
It helps the computers RAM to be freed up with inactive applications to make way for loading
current applications being used.
It works merely by checking for data stored in RAM not being used recently and have it stored
in the computer’s hard disk, thereby freeing useful space in RAM for loading other applications.
Secondary Storage
Due to the fact that the primary storage is limited, in order to store massive programs and data,
the secondary storage is needed to supplement it
Used when there is insufficient primary memory. Examples of secondary storage are CDs, DVDs,
memory sticks, memory cards etc
PRIMARY SECONDARY
Less storage capacity Extensive storage capacity
Volatile in nature Not volatile
Access speed is fast Access speed is slow
Expensive to purchase Cheaper to purchase
Usually not portable Portable (that is it can be carried from one
place to another)
PROCESSOR COMPONENTS
Central Processing Unit (CPU) or the processor is also often called the brain of computer. CPU
consists of Arithmetic Logic Unit (ALU) and Control Unit (CU) and registers.
ALU
It performs the arithmetic and logic operations on the data that is made available to it.
13
Miss gwenzi form 1 notes
It’s responsible for all mathematical operations.
The arithmetic part is responsible for addition, subtraction, division and subtraction while the
logic part is responsible for comparison.
CU
Is responsible for supervising the operations of the processor.
CU controls and coordinates the activity of the other units of computer.
Fetch, decode and execute jobs, thus retrieving instructions from memory and executing them
accordingly.
Registers
Are temporary storage areas for holding data, and instructions?
This is a storage location inside the processor.
Registers in CU keep current instructions and the operands of instruction.
There are also ALU registers that store data items that are to be added, subtracted, multiplied,
divided or compared.
CPU uses the registers to store the data, or instructions during processing.
Registers are very high-speed storage areas located inside the CPU.
After CPU gets the data and instructions from the cache or RAM, the data and instructions are
moved to the registers for processing. Registers are manipulated directly by the control unit of
CPU during instruction execution. That is why registers are often referred to as the CPU’s
working memory.
Since CPU uses registers for the processing of data, the number of registers in a CPU and the
size of each register affect the power and speed of a CPU.
The more the number of registers (ten to hundreds) and bigger the size of each register (8 bits
to 64 bits), the better it is.
Structure of Processor
SOFTWARE
SOFTWARE
This is a general term used to describe all the programs that run on a computer. A computer
system consists of hardware and software. The computer hardware cannot perform any task on
its own. It needs to be instructed about the tasks to be performed.
Software is a set of programs that instructs the computer how tasks are to be performed.
Software tells the computer how the tasks are to be performed and hardware carries out these
tasks.
14
Miss gwenzi form 1 notes
Types of Software
Software can be broadly classified in two categories:
System Software, and
Application Software.
APPLICATION SOFTWARE
Is the software that a user uses for completing a specific task i.e. it is user oriented
Designed to carry out some tasks for the user that is primarily independent of computers such
as writing a letter
A set of programs that are written for a specific purpose and provide the required functionality
is called software package.
Application software is written for different kinds of applications—graphics, word processors,
media players, database applications, telecommunication, accounting purposes etc.
Application software run under System Software, and are made to do a specific task i.e.
(WordProcessingetc), which have indirect access to the hardware (i.e. Behind System
Software).
Examples are Web browsers, word processing software, spreadsheet software, database
software, presentation graphics software. Opera (Web Browser), Microsoft Word (Word
Processing), Microsoft Excel (Spreadsheet software), MySQL (Database Software), Microsoft
PowerPoint (Presentation Software), iTunes (Music / Sound Software), VLC Media Player
(Audio / Video Software ), World of Warcraft (Game Software), Adobe Photoshop (Graphics
Software).
15
Miss gwenzi form 1 notes
Many such packages can be tailored so that they can be adopted to fit a specific solution. For
example, word processors, spread sheets, database management systems, presentation
designers, etc.
Also known as the generic software (or off the shelf)
Advantages
They are generally cheaper to buy than bespoke packages which are to develop.
They are available almost immediately.
Any system bugs should have been discovered by other users and eliminated.
These are written by software specialists and of a high quality.
Good packages are likely to come with good training programs and well documentation.
New updated versions of the software are likely to be available on a regular basis.
The package can be used by large number of organizations.
There are likely to be a number of people with expertise in the relevant package that are
already employed by the organization or who can be recruited, training is likely to be readily
available.
The computer user doesn't need to employ his own specialist staff to develop, write, and test
the programs. It will save time and money.
In-house tailored made development is only feasible for large organizations with their MIS
department.
Disadvantages
The computer user gets a standardized solution to a data processing task.
The standard solution may not fit precisely the needs of the organization.
The users may need to compromise what they want with what is available.
The organization is dependent upon an outside supplier for the maintenance, updating
updating and providing assistance in the event of problems of the software.
Changing are not possible.
Advantages
Error detection and correction before producing a hardcopy.
Automatic word wrap - any word that extends beyond the right margin is automatically moved
to the next line.
Formatting and enhancing document presentation.
Flexibility
Inclusion of graphs within a document.
Production of multiple copies.
Mail Merging
Electronic Filing.
Electronic Transmission – emailing.
SPREADSHEETS
This is an electronic computer application which is used for budgeting, summaries of accounts,
stock level analysis and forecast planning.
16
Miss gwenzi form 1 notes
Database Software: Allows users to store and retrieve vast amount of data. Example: MS
Access, MySQL, Oracle etc.
Presentation Graphic Software: Allows users to create visual presentation. Example: MS
Power Point
Multimedia Software: Allows users to create image, audio, video etc. Example: Real Player,
Media Player etc.
Applications are programs that you as the user use to perform specific tasks.
Word Processing. Enables users to create, edit, Microsoft Word 2010, Corel Word Perfect,
format and edit textual documents such as letters Lotus
Spreadsheet. Enables users to manipulate a table
Microsoft Excel 2010, Lotus 1-2-3, Corel
of data usually making numerical and business
Quattro Pro
calculations and projections
Database. Enables the user to create and maintain
Microsoft Access 2010, Microsoft Visual
a database in which data is organized for ease of
FoxPro, Lotus Approach
use and manipulation
Presentation Graphics. Enables users to create
images for group presentations, self-running slide Microsoft PowerPoint 2010, Lotus
shows and for other situations that require the Freelance Graphics, Corel Presentations
presentation of organized, visual information
Web Browsers. Enables users to view web pages
Microsoft Internet Explorer, FireFox
and allows for communication on the Internet
Photo-Editing. Enables users to edit, crop,
Adobe Photoshop, PhotoImpact, Microsoft
manipulate photos that were scanned in or
PictureIt
imported from a digital camera
17
Miss gwenzi form 1 notes
Is computer programs written to meet the processing needs of an individual or an organization.
They are produced in-house or commissioned from an outside software company. Examples are
payroll, inventory, accounts, sales, production, marketing, etc.
Advantages
The software is designed to meet what the user wants
The software can be designed to run on specific hardware
The system can be integrated with other applications within the organization.
The system can be modified to fit changing needs.
You will receive much better support and can in many cases talk directly to the developers
concerned
The use of professionally developed bespoke software applications can give you a significant
business advantage over your competition
Disadvantages
Development takes a long time.
Delays the implementation of the system.
Costly to develop and test.
Greater probability of bugs.
May be poorly documented..
It can be difficult to get support for bespoke software, unless the developers themselves offer
support services.
NB System software: controls the operations of the computer (computer oriented) and application
software perform user required functions (user oriented)
SYSTEM SOFTWARE
The set of programs needed to control and monitor the operation of the hardware (and
applications software) of a computer.
System software is a collection of programs which control the overall function of the computer.
Software is program that acts as an interface between the user and the computer
Is a set of computer programs that manage the hardware and software resources of a computer
so that they can work together harmoniously?
System software is required for the working of computer itself.
The user of computer does not need to be aware about the functioning of system software,
while using the computer
System Software has direct control and access to computer hardware, and memory locations i.e.
it is computer oriented
Examples Unix, Linux, Windows, DOS and Windows NT
Utility software
Is system software designed to help analyze, configure, optimize or maintain a computer?
Performance monitoring programs can also be classified as utility software – this is software that is
used to monitor disk, memory and processor use. Utility programs are generally fairly small. Each
type has a specific job to do. Below are some descriptions of utilities:
Anti-virus applications
Protect your computer from the damage that can be caused by viruses and similar programs.
18
Miss gwenzi form 1 notes
Virus scanning software iscriticalto use, due to the number of computer viruses (small
computer programs created to disrupt and destroy computer files and/or operating system
software).
Virus scanning software needs to be updated on a regular basis (usually monthly). Updates
insure that your virus scanning software will protect you from the most recent viruses.
Disk cleaners
Can find files that are unnecessary to computer operation, or take up considerable amounts of
space.
Disk cleaner helps the user to decide what to delete when their hard disk is full.
Disk partitions
Can divide an individual drive into multiple logical drives, each with its own file system which
can be mounted by the operating system and treated as an individual drive.
Registry cleaners
Clean and optimize the Windows registry by removing old registry keys that are no longer in
use.
Hardware represents the physical and tangible components of the computer, i.e., the components
that can be seen and touched.
Examples of Hardware are following:
Input devices -- keyboard, mouse, etc.
Output devices -- printer, monitor, etc.
Secondary storage devices -- Hard disk, CD, DVD, etc.
Internal components -- CPU, motherboard, RAM, etc.
19
Miss gwenzi form 1 notes
Software is a set of programs, which are designed to perform a well-defined function. A program is
a sequence of instructions written to solve a particular problem.
There are two types of softwares:
System Software
Application Software
System Software
The system software is a collection of programs designed to operate, control and extend the
processing capabilities of the computer itself. System software are generally prepared by computer
manufacturers.
These softwares comprise of programs written in low level languages which interact with the
hardware at a very basic level. System software serves as the interface between hardware and the
end users.
Some examples of system software are Operating System, Compilers, Interpreter, Assemblers, etc.
20
Miss gwenzi form 1 notes
Difficult to manipulate.
Generally written in low-level language.
Application Software
Application softwares are the softwares that are designed to satisfy a particular need of a particular
environment. All softwares prepared by us in the computer lab can come under the category of
Application Software.
Application software may consist of a single program, such as a Microsoft's notepad for writing and
editing simple text. It may also consist of a collection of programs, often called a software package,
which work together to accomplish a task, such as a spreadsheet package.
Examples of Application softwares are the following:
Payroll Software
Student Record Software
Inventory Management Software
Income Tax Software
Railways Reservation Software
Microsoft Office Suite Software
Microsoft Word
Microsoft Excel
Microsoft Powerpoint
OPERATING SYSTEM
Is a part of system software
The operating system is an integrated set of programs that is used to control and manage the
resources and overall operations of a computer.
The Operating System is the software that controls the operation of the hardware and hides its
complexities from the user.
Is a program which monitors, controls and maintains the computer.
Intermediates between the user of computer and the computer hardware. For example, the user
gives a command and the OS translates the command into a form that the machine can
understand and execute.
It hosts the several applications that run on a computer and handles the operations of computer
hardware.
21
Miss gwenzi form 1 notes
OS acts as an interface between the application programs and the machine hardware.
Examples Windows, Linux, UNIX and Mac OS
Functions of OS
Operating system is large and complex software consisting of several components. Each component
of the operating system has its own set of defined inputs and outputs. Different components of OS
perform specific tasks to provide the overall functionality of the operating system . Main functions
of the operating system are as follows:
Memory Management
It keeps track of primary memory, i.e., what parts of it are in use by whom, what parts are
not in use, etc.
Allocates the memory when the process or program requests it.
Processor Management
Allocates the processor (CPU) to a process.
De-allocate processor when processor is no longer required.
Device Management
Keeps tracks of all devices. This is also called I/O controller.
Decides which process gets the device when and for how much time.
File Management
Allocates the resources.
Deallocates the resource.
Decides who gets the resources.
Security
By means of passwords & similar other techniques, preventing unauthorized access to
programs & data.
Job accounting
Keeping track of time & resources used by various jobs and/or users.
Control over system performance
Recording delays between requests for a service & from the system.
Error handling
An operating system responds to errors. When an error occurs, operating system must take
appropriate actions.
The operating system should be able to ‘freeze’ the program that causes an error and
display a message to the end user.
User InterfaceorCommand Interpreter— Operating system provides:
The user interface via which the user interacts with the applications and the hardware.
Communication management:
The OS ensure communication between computers linked together in a LAN or WAN
Interprets commands for downloading and uploading
Types of OS
OS are classified into different types depending on their capability of processing:
1. Single UserOS
22
Miss gwenzi form 1 notes
Provides a platform for only one user at a time.
No user accounts are required since it support one user.
Single operating system designed to manage one task at a time, for example, if the user is
editing a document, then a document cannot be printed on the printer simultaneously.
MS-DOS is an example of single user OS.
2. Multitasking OS
Allows execution of more than one task or process concurrently. Thus they can perform
multiple tasks simultaneously
The processor time is divided amongst different tasks. This division of time is also called
time sharing.
The processor switches rapidly between processes. For example, the user can listen to
music on the computer while writing an article using word processor software.
The user can switch between the applications and also transfer data between them
Windows 95 and all later versions of Windows are examples of multitasking OS.
3. MultiuserOS
Support two or more users simultaneously.
Is used in computer networks that allow same data and applications to be accessed by
multiple users at the same time.
Provides regulated access for a number of users by maintaining a database of known users.
The users can also communicate with each other.
Linux, UNIX, and Windows 7 are examples of multiuser OS.
4. Batch OS
In a batch OS a job runs from beginning to end without intervention from the user
The running of batch jobs is normally controlled by a program written in Job Control
Language (JCL)
Is software which replicates identical jobs over and over again?
A batch operating system keeps itself eventful; it does this by taking jobs from a batch
queue, instead of waiting for people to submit jobs.
Batch processing is typically used for: • processing OMR forms such as those that contain
answers to a multiple-choice exam; • payroll; • utility billing.
5. Networking OS
Also referred to as the Dialoguer,
A network operating system (NOS) is one that is able to share its resources (such as hard
disk or printer) and use the resources of others.
Is the software that runs on a server and enables the server to manage data, users, groups,
security, applications, and other networking functions?
The network operating system is designed to allow access to shared files and printers
among multiple computers in a network, typically a local area network (LAN), a private
network or to other networks.
The most popular network operating systems are MicrosoftWindows Server 2003,
MicrosoftWindows Server 2008, UNIX, Linux, Mac OS X, Novell NetWare, and BSD.
6. Real Time OS
Are designed to respond to an event within a predetermined time.
Data input to the computer is processed immediately
Processing is done within a time constraint.
Deal with events which happen at unpredictable moments in time;
Deal with multiple events that occur simultaneously;
Support application programs which are non-sequential in nature
Examples of real-time operating systems: • Airline flight reservation; • Missile guidance; •
Temperature/pressure control; • Process control.
23
Miss gwenzi form 1 notes
Operating System Comparison
An OS is a fundamental component of a computer system that manages activities and resources
on the machine.
There are essentially four operating systems commonly used today: DOS, Linux, Windows and
Mac OS X.
LINUX
WINDOWS
24
Miss gwenzi form 1 notes
Multitasking since it allows use of more than one application at a time
It has a high Java support, thus, giving an ultimate/crucial gaming experience to users. Symbian
smoothly displays games without any buffering like in most online games.
In contrast, this OS does not work well when it comes to downloading games, although it is
more preferred for online gaming.
The Symbian OS, on the other hand, does not have an integrated network accelerator for clearer
video calling.
Symbian-powered smart phones, such as the Nokia N8, have been reported to attain certain
glitches when opening large web files.
The Symbian browser, on the other hand, could only download one file at a time
Symbian based handsets offers good multimedia features.
Android
Android is the version of Google's mobile operating system
Android software runs on tablet computers and smart phones
It can support multiple users without the need for logging out.
It has smart keyboard with gesture typing.
Its multitasking
Wireless display of images and videos on big-screen HDTVsets.(High Definition Television Sets)
Instant processor acceleration when users touch the screen.
Wireless image and video sharing among multiple units in close proximity.
Automatic resizing and relocation of screen widgets for optimum display readability.
Enhanced screen magnification functions.
Support continuous information updates (news, weather, travel data, etc.) through Google.
Voice-activated Web search with support for more than 30 languages.
Photo sphere camera for creating navigable panoramic images encompassing all directions in
3D space.
Android has a wide array of features, Optimized graphic, Accelerometer, Compass, GPS, and
several applications like maps, calendar, email client, contacts, and Java programming. It also
supports videos, still images, common audio files, and other complicated formats.
Android have a very poor support for Web games, making it quite unusable for online playing
Android is easy to use and has a non-complex interface.
Android-powered handsets have support for wireless Internet
User Interfaces
Is a way in which human and computer communicate
The type of user interface that is used on a computer system is determined by the operating
system. For example most programs that run on computers using a Microsoft Windows
operating system have a graphical user interface.
The users can interact with the computer using the following interfaces:
Command Line Interface (CLI)
Graphical User Interface (GUI)
Job Control Language
Advantages
25
Miss gwenzi form 1 notes
Quicker since it does not use as much CPU processing time as others
Greater variety of commands
Use less memory
A low resolution, cheaper monitor can be used with this type of interface
Very flexible with the use of “switches” (options)
More useful error messages
Disadvantages
Not user friendly
Difficult for beginner
Requires the user to learn “complex” commands or language
Commands have to be typed precisely. If there is a spelling error the command will fail
Advantages
easier for novices to use since its more intuitive
only valid options are available
consistency of layout and command representation in applications
comprehensive on-line help available
You get the benefits of WYSIWYG.This stands for What You See Is What You Get.
This interface can also open multiple sessions in multiple windows and put them next to each
other on the computer screen
Disadvantages
They need significantly more memory (RAM) to run than other interface types
requires more powerful processor and better graphics display
slower when executing a command because much more interpretation takes place
can be irritating for simple tasks because greater number of operations are required
26
Miss gwenzi form 1 notes
what to do if program fails
APPLICATION OF COMPUTERS
Business
Computer is used in business organisation for:
Payroll Calculations
Budgeting
Sales Analysis
Financial forecasting
Managing employees database
Maintenance of stocks, etc.
Banking
Banks provide following facilities:
Bank on-line accounting facility, which includes current balances, deposits, overdrafts,
interest charges, shares and trustee records.
ATM machines are making it even easier for customers to deal with banks.
27
Miss gwenzi form 1 notes
Electronic funds transfer (EFT)the process by which money is transferred from one bank
account to another, by computer
Electronic funds transfer at the point of sale (EFTPOS)The process by which money is
transferred at the checkout from a customer’s bank account to the shop’s bank account, by
computer
Insurance
Insurance companies are keeping all records up-to-date with the help of computers. The Insurance
Companies, Finance houses and Stock broking firms are widely using computers for their concerns.
Insurance Companies are maintaining a database of all clients with information showing:
how to continue with policies
starting date of the policies
next due installment of a policy
maturity date
interests due
survival benefits
bonus
Education
The computer has provided a lot of facilities in the Education System.
The uses of computer provide a tool in the Education system known as CBE (Computer
Based Education).
CBE involves Control, Delivery and Evaluation of learning.
The computer education is very familiar and rapidly increasing the graph of computer
students.
There are number of methods in which educational institutions can use computer to
educate the students.
It is used to prepare a database about student performance and analyses are carried out.
Computer-assisted learning (CAL) The process of using computers to learn at a self-paced
rate from presentations, oft en with computer-based assessment questions and feedback of
results.
Computer-based learning The use of computers for interactive learning activities, including
computer assisted learning and computer-based training.
Computer-based training (CBT) Similar to computer assisted learning, but usually for
training in work skills rather than academic learning.
Marketing
In Marketing uses of computer are following:
Advertising: With computers, advertising professionals create art and graphics, write and
revise copy, and print and disseminate adverts with the goal of selling more products.
At Home Shopping: Home shopping has been made possible through use of computerized
catalogues that provide access to product information and permit direct entry of orders to
be filled by the customers.
E-commerceThe use of the Internet for commercial activities such as Internet banking and
shopping.
28
Miss gwenzi form 1 notes
o Electronic Data Interchange (EDI), the business-to-business exchange of data
o E-mail and fax and their use as media for reaching prospects and established customers (for
example, with newsletters)
o Business-to-business buying and selling
o The security of business transactions
Health Care
The computers are being used in hospitals to keep the record of patients and medicines. It is also
used in scanning and diagnosing different diseases. ECG, EEG, Ultrasounds and CT Scans, etc., are
also done by computerized machines.
Some of major fields of health care in which computers are used:
Diagnostic System: Computers are used to collect data and identify cause of illness.
Lab-diagnostic System: All tests can be done and reports are prepared by computer.
Patient Monitoring System: These are used to check patient's signs for abnormality such
as in Cardiac Arrest, ECG, etc.
Pharmacy Information System: Computer checks Drug-Labels, Expiry dates, harmful drug
side effects, etc.
Nowadays, computers are also used in performing surgery.
Engineering Design
Computers are widely used in engineering purposes. One of major areas is CAD (Computer aided
design). CAD provides creation, edition, and modification of image. Some fields are:
Structural Engineering: computers are used for stress and strain analysis required for
design of Ships, Buildings, Budgets, Airplanes, etc.
Industrial Engineering: Computers deal with design, implementation and improvement of
Integrated systems of people, materials and equipment’s.
Architectural Engineering: Computers help in planning towns, designing buildings,
determining a range of buildings on a site using both 2D and 3D drawings.
Computer-aided design (CAD) The process of using a computer to design an item.
Computer-aided engineering (CAE) The process of using computer simulation to check
the design of a structure before construction or manufacture.
Computer-aided manufacture (CAM) The process of using a computer to control the
automatic manufacture of an item.
Military
Computers are largely used in defense. Modern tanks, missiles, weapons, etc., employ computerized
control systems. Some military areas where a computer has been used are:
Missile Control
Military Communication
Military operation and planning
Communication
Communication means to convey a message, an idea, a picture or speech that is received and
understood clearly and correctly by the person for whom it is meant. Some main areas in this
category are:
E-mail
Chatting
Usenet
FTP
29
Miss gwenzi form 1 notes
Telnet
Video-conferencing
Government Applications
Computers play an important role in government applications. Some major fields in this category
are:
Budgets
Sales tax department
Income tax department
Male/Female ratio
Computerization of voters lists
Computerization of Driving Licensing system
Computerization of PAN card
Weather Forecasting.
High productivity - factories are able to produce more goods in less time.
De-skilling - organizations use computers and software to do skilled work, no longer
Relying on experts.
Companies save money by out-sourcing jobs or re-siting operations to other countries.
30
Miss gwenzi form 1 notes
Allow faster retrieval of information that would take a long time, or be impossible with manual
searching.
DATA STRUCTURE
Data Structure is a way of storing and organizing data, effectively.
There are two major categories of Data Structures called ˜’Static Structures’ and ‘˜Dynamic
Structures’. Each has its own set of advantages and disadvantages.
31
Miss gwenzi form 1 notes
Data types
A data type is a method of interpreting a pattern of bits.
Integer
An integer is a positive or negative number that does not contain a fractional part.
Integers are held in pure binary for processing and storage. Note that some programming
languages differentiate between short and long integers (more bytes being used to store long
integers).
In REALbasic an integer uses 4 bytes of memory – this allows it to take a whole number value
between ± 2, 147, 483, 648.
Real
A real is a number that contains a decimal point.
In many systems, real numbers are referred to as singles and doubles, depending upon the
number of bytes in which they are stored.
In REAL basic, a single uses 4 bytes of memory and can have a value between –1.175494 e-38
and 3.402823 e+38; a double uses 8 bytes of memory and can have a value between
2.2250738585072013 e-308 and 1.7976931348623157 e+308.
Boolean
A boolean is a data-type that can store one of only two values – usually these values are True or
False.
Booleans are stored in one byte – True being stored as 11111111 and False as 00000000.
Many of the properties of objects (windows, text-boxes, buttons etc.) in REAL basic have
Boolean values – e.g. the visibility of an object will be set to either True (visible) or false
(Hidden). These values are often set using check-boxes.
String
A string is a series of alphanumeric characters enclosed in quotation marks.
A string is sometimes just referred to as ‘text’. Any type of alphabetic or numeric data can be
stored as a string: “Harare City”, “3/10/03” and “36.85” are all examples of strings.
Each character within a string will be stored in one byte using its ASCII code; modern systems
might store each character in two bytes using its Unicode.
The maximum length of a string is limited only by the available memory.
Notes:
• If dates or numbers are stored as strings then they will not be sorted correctly; they will be sorted
according to the ASCII codes of the characters – “23” will be placed before “9”;
32
Miss gwenzi form 1 notes
• Telephone numbers must be stored as strings or the leading zero will be lost.
Character
A character is any letter, number, punctuation mark or space, which takes up a single unit of
storage (usually a byte).
MEMORY UNITS
It is the amount of data that can be stored in the storage unit.
The storage capacities are expressed in terms of Bytes.
Following are the main memory storage units:
Unit Description
Bit (Binary A binary digit is logical 0 & 1 representing a passive or an active state of a
Digit) component in an electric circuit.
Nibble A group of 4 bits is called nibble.
A group of 8 bits is called byte. A byte is the smallest unit, which can represent
Byte
a data item or a character.
A computer word like a byte, is a group of fixed number of bits processed as a
unit which varies from computer to computer but is fixed for each computer.
Word The length of a computer word is called word-size or word length and it may be
as small as 8 bits or may be as long as 96 bits.
A computer stores the information in the form of the computer words.
33
Miss gwenzi form 1 notes
3 Decimal Number SystemBase 10. Digits used: 0 to 9
Hexa Decimal Number SystemBase 16. Digits used: 0 to 9, Letters
4
used: A- F
Example
Binary Number: 101012
Calculating Decimal Equivalent:
Step Binary Number Decimal Number
1 101012 ((1 x 24) + (0 x 23) + (1 x 22) + (0 x 21) + (1 x 20))10
2 101012 (16 + 0 + 4 + 0 + 1)10
3 101012 2110
Note: 101012is normally written as 10101.
Example
Octal Number: 125708
Calculating Decimal Equivalent:
Step Octal Number Decimal Number
((1 x 84) + (2 x 83) + (5 x 82) + (7 x 81) + (0 x
1 125708
80))10
2 125708 (4096 + 1024 + 320 + 56 + 0)10
3 125708 549610
Note: 125708is normally written as 12570.
34
Miss gwenzi form 1 notes
Calculating Decimal Equivalent:
Ste Hexadecimal
Decimal Number
p Number
((1 x 164) + (9 x 163) + (F x 162) + (D x 161) +
1 19FDE16
(E x 160))10
((1 x 164) + (9 x 163) + (15 x 162) + (13 x 161)
2 19FDE16
+ (14 x 160))10
3 19FDE16 (65536+ 36864 + 3840 + 208 + 14)10
4 19FDE16 10646210
Note: 19FDE16 is normally written as 19FDE.
Hexadecima Octal
Binary Denary
l
0 0000 000 0
1 0001 001 1
2 0010 010 2
3 0011 011 3
4 0100 100 4
5 0101 101 5
6 0110 110 6
7 0111 111 7
8 1000 8
9 1001 9
A 1010 10
B 1011 11
C 1100 12
D 1101 13
E 1110 14
F 1111 15
35
Miss gwenzi form 1 notes
Divide the binary number into groups of four digits
starting at the LSB.
Step 2
Write down the hexadecimal equivalent for each group of 7 5
digits.
011101012 = 7516
Conversion of binary to octal and hex
Conversion of binary numbers to octal and hex simply requires grouping bits in the binary numbers
into groups of three bits for conversion to octal and into groups of four bits for conversion to hex.
Groups are formed beginning with the LSB and progressing to the MSB.
Thus, 11 100 1112 = 3478
11 100 010 101 010 010 0012 = 30252218
1110 01112 = E716
36
Miss gwenzi form 1 notes
Easy to convert binary to BCD.
No error due to round off.
Disadvantages
Occupies more memory.
Can be harder to perform arithmetic operations.
Note: the answer is read from bottom to top as (261) 8, the same as with the binary case. Conversion
of decimal fraction to octal fraction is carried out in the same manner as decimal to binary except
that now the multiplication is carried out by 8.
For example:
Convert 0.6875 to binary
0.6875 x 2 = 1.375 1
0.3750 x 2 = 0.750 0
0.7500 x 2 = 1.500 1
0.5000 x 2 = 1.000 1
This process gives the binary number 0.1011. The zero before the decimal point is assumed
because the number is obviously less than 1.
37
Miss gwenzi form 1 notes
For example:
Add the binary numbers 1010 (ten) and 0110 (six) together
1010
0110 +
-----
10000 (sixteen)
An overflow may occur if the sum of the two original numbers exceeds the size available to store
the number. The above 4-bit numbers produce a sum which has 5 bits. If the numbers were being
stored in 4-bit bytes, an overflow error would occur.
For example:
Take away the binary number 0110 (six) from 1100 (twelve)
Overflow - when a number is too large for the exponent to be expressed (positive exponent)
Underflow - when a number is too near zero for the exponent to be expressed (negative
exponent)
38
Miss gwenzi form 1 notes
BCD Addition
Whenever the sum of any two BCD digits is greater than 1001 2 then 01102 has to be added to the
result to skip over the unused codes.
39
Miss gwenzi form 1 notes
NOTE: Hexadecimal is used as it is shorthand for binary and easier for people to remember. It DOES
NOT take up less space in computer memory, only on paper or in your head! Computers still have to
store everything as binary whatever it appears as on the screen.
Exercise: Hexadecimal
Convert the following Hex numbers into decimal/denary:
A1
Answer :
16 1
A 1
16 * 10 + 1 * 1 = 16110
FF
Answer :
16 1
F F
16 * 15 + 1 * 15 = 25510
0D
Answer :
16 1
0 D
16 * 0 + 1 * 13 = 1310
37
Answer :
16 1
3 7
16 * 3 + 1 * 7 = 5510
128 64 32 16 8 4 2 1
0 0 0 1 0 0 1 0 = 16+2 = 18 (decimal)
A516
Answer :
A 5 (Hex)
40
Miss gwenzi form 1 notes
1010 0101 (Binary)
128 64 32 16 8 4 2 1
1 0 1 0 0 1 0 1 = 128+32+4+1 = 165 (decimal)
7F16
Answer :
7 F (Hex)
0111 1111 (Binary)
128 64 32 16 8 4 2 1
0 1 1 1 1 1 1 1 = 64+32+8+4+2+1 = 127 (decimal)
1016
Answer :
1 0 (Hex)
0001 0000 (Binary)
128 64 32 16 8 4 2 1
0 0 0 1 0 0 0 0 = 16(decimal)
1101112
Answer :
0011 0111 (Binary)
3 7 (Hex)
101011112
Answer :
1010 1111 (Binary)
A F (Hex)
1110101000012
Answer :
1110 1010 0001 (Binary)
E A 1 (Hex)
NB:To convert from denary to hexadecimal, it is recommended to just convert the number to binary
first. In summary, we can use the following rule: Hexadecimal <-> Binary <-> Denary
41
Miss gwenzi form 1 notes
5 7 (Hex)
1210
Answer:
12(decimal)
0000 1100 (Binary)
0 C (Hex)
11710
Answer:
117(decimal)
0111 0101 (Binary)
7 5 (Hex)
NETWORKING
A computer network is an interconnection of two or more computers that are able to exchange
information.
The computers may be connected via any data communication link, like copper wires, optical
fibers, communication satellites, or radio links.
The computers in a network may be located in a room, building, city, country, or anywhere in
the world.
TYPES OF NETWORKS
Computer network is broadly classified into three types:
o Local Area Network (LAN),
o Metropolitan Area Network (MAN),
o Wide Area Network (WAN).
A 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.
42
Miss gwenzi form 1 notes
Piconet is an example Bluetooth enabled Personal Area Network which may contain up to 8 devices
connected together in a master-slave fashion.
Client-Server Networks
A client-server arrangement involves a server, which is a computer that controls the network.
The clients are all the other computers, which are connected to the server in the network.
It allow central computer to be used for administrative tasks such as network management.
Peer-to-Peer networks
The word peer denotes one who is equal in standing with another.
A peer-to-peer LAN is one in which all microcomputers on the network communicate directly
with one another without relying on a server.
Peer-2-peer networks are less expensive than client/server computing but slow under heavy
use.
They are appropriate for networking in small group.
Advantages of LANs:
Hardware such as printers can be shared so individual workstations do not need their own
printer.
All the users’ work can be stored in a central place (the dedicated file server) so a user can
access their work through any computer on the network.
Software can be shared; software packages are stored on the server and downloaded to
workstations as requested.
Data can be shared because database files stored in the server are available to users around the
network; data from CD-ROMs can also be shared across the network.
Central back-up can take place automatically at regular intervals.
Messages can be sent to people working at other computers on the network which can save
time and paper.
There is control over users’ access rights to programs and data.
43
Miss gwenzi form 1 notes
Disadvantages of LANs:
Printing can be slow. Where a lot of workstations are served by only one or two printers, long
print queues may develop.
A virus can spread more easily. If a virus gets into one computer, it is likely to spread quickly
across the network because it will get into the central backing store.
As data is shared there is a greater need for security. Users of the network have to have
authentication techniques such as user ids and passwords.
If the server fails, all the workstations are affected.
The cost of installing the equipment is greater. Cabling can be expensive to buy and to install.
Damage to cables can isolate computers. Some sections of the network can become isolated
and will not be able to communicate with the rest of the network.
Advantages
The data transfer is high at 1000 mbps.
The expense is relatively economical in metropolitan network.
Rapid transfer and sharing of files
Easy upgrade of programs at a relatively lower cost
Security of programs and other important information
Centralized software management,
Easy share of resources,
email,
Flexible access and workgroup computing
Disadvantages
complex technology and installation
Fiber optical cable, adaptors and concentrators are costly
44
Miss gwenzi form 1 notes
Internet
Is a network of networks
There is no single authority that controls the net overally.
Disadvantages of WANs:
Again these are similar to those of LAN's except that issues such as security become even more
important as potential hackers could break into a computer system from anywhere in the
world.
Encryption to secure data such as financial transactions is necessary because it is even easier to
intercept data.
45
Miss gwenzi form 1 notes
NETWORK TOPOLOGIES
Refers to the way in which computers and other networked devices are interconnected
The following are types of network topologies:
o Bus
o Star
o Ring
o Mesh
o Hybrid
Bus Topology
It is also known as a linear bus because computers are attached or connected to a single linear
cable called a trunk or backbone.
Computers on the bus network communicate by sending packets of data to each other.
A computer will send a packet of data to all computers on the network (broadcast). Each
computer listens and examines every packet on the wire to determine if the packet is intended
for it, and accepts only packets addressed to it.
The bus topology is a passive topology because computers on the network are not actively
involved in the movement of data. The number of computers on the network affects network
performance. Performance degrades as more computers are added to the bus network.
An Ethernet bus (the most common type of local area network) can have a maximum length of
185 metres and a maximum of 30 nodes. Note that there must be ‘terminators’ at either end of
the cable – preventing the signals being reflected back down the cable.
Backbone/trunk
Terminator Terminator
Advantages
It uses the least amount of cable and is easy to expand without disrupting the network.
It is relatively simple, inexpensive and reliable.
Failure of one node does not bring the whole network down.
Disadvantages
The whole network goes down if the main cable fails at any point.
Network performance degrades under a heavy load (maximum computers on an Ethernet bus is
30)
It is difficult to troubleshoot and isolate problems.
Vulnerable to collisione.g Ethernet
46
Miss gwenzi form 1 notes
Star Topology
A star topology is one in which each node is connected directly to a central hub using its own,
dedicated cable.
All communications between workstations go through a central device, which can be a hub,
switch or repeater.
It is now the most common topology used within LANs and many WANs
Cabling faults are easy to locate because the hubs usually use Light Emitting Diodes (LED) to
indicate working connections;
There is greater security of transmissions if a ‘switch’ is used as the hub
The network requires more cables because each computer requires a cable segment to connect
to the central device.
If a computer fails or the cable segment that connects the computer to the hub is broken, only
that link is affected the rest of the network continues to function normally.
Advantages
If one cable fails, the other stations are not affected
Simple to isolate faults
Consistence performance even when the network is being heavily used
Reliable, market proven system
No problems with ‘collisions’ of data since each station has its own cable to the server
Easy to add new stations without disrupting the network
Disadvantages
May be costly to install because of the length of cables required.
When the hub or central terminal fails the whole system will be disrupted
Ring Topology
A ring network is one in which the nodes are linked in a closed loop and the data is transmitted
in a single direction around the loop.
There are Repeaters at each node to ‘boost’ the data signals as they pass around the ring.
The use of repeaters allows a ring network to cover larger distances than other types of local
area network, and if using optical fibre cable, ring networks can span a distance of up to 100
kilometres
Computers on the ring network use a signal called a token to carry the data from one computer
to the other.
The access method used by the computers to put data on the communication medium is called
token passing.
47
Miss gwenzi form 1 notes
Unlike the bus topology, the ring is an active topology. Each computer on the ring acts as a
repeater to regenerate/boost the signal and pass it to the next computer until it reaches the
destination computer.
The receiving computer strips the data from the token and returns the token to the sending
computer with an acknowledgement.
After verification, the token is released for use by any other computer requiring data transfer.
While the token is in use by one computer, other computers on the ring cannot transmit,
because only the computer with the token can transmit data.
This ensures that there are no collisions and hence no times spend waiting for computers to
resend data after a collision.
Advantages
There is no dependence on the central computer or file server
Each node controls transmission to and from itself
Transmission of messages around the ring is relatively simple and avoids ‘collisions’ because
the transmission is in only one direction
Very high data transmissions are possible
Disadvantages
Extending an existing ring can be difficult because of the rewiring required.
Not very secure because data travels all the way around the ring and so there are plenty of
opportunities for messages to be intercepted.
If one computer fails, the whole network goes down.
Example of ring topology is token ring
Mesh Topology
Apart from the three primary topologies, we also have the mesh topology.
Each computer has a point-to-point connection to every other computer on the network.
Use a significantly larger amount of network cabling than the other network topologies, which
makes it more expensive.
Every computer has multiple possible connection paths/routes to the other computers on the
network as a result; a single cable break will not stop network communications between any
two computers.
48
Miss gwenzi form 1 notes
The total number of connections required can be calculated using the following formula:
Number of connections = n*(n-1)/2
Where n is the number of stations.
Hybrid Topology
A hybrid topology is a combination of any two or more network topologies in such a way that
the resulting network does not have one of the standard forms.
A hybrid topology is always produced when two different basic network topologies are
connected.
Hybrid networks use a combination of any two or more topologies in such a way that the
resulting network does not exhibit/show one of the standard topologies (e.g., bus, star, ring,
etc.).
Two common examples for Hybrid network are: star ring network and star bus network
A Star ring network consists of two or more star topologies connected using a multi-station
access unit (MAU) as a centralized hub.
A Star Bus network consists of two or more star topologies connected using a bus trunk (the
bus trunk serves as the network's backbone).
Bridge
A bridge is a device that allows you to segment a large network into two smaller, more efficient
networks.
A bridge monitors the information traffic on both sides of the network so that it can pass
packets of information to the correct location.
A bridge monitors the information traffic on both sides of the network so that it can pass
packets of information to the correct location.
Most bridges can "listen" to the network and automatically figure out the address of each
computer on both sides of the bridge.
49
Miss gwenzi form 1 notes
The bridge can inspect each message and, if necessary, broadcast it on the other side of the
network.
The bridge manages the traffic to maintain optimum performance on both sides of the network.
It keeps information flowing on both sides of the network, but it does not allow unnecessary
traffic through.
used to extend networks by maintaining signals and traffic
In a comparison with switches, they are slower because they use software to perform switching.
They do not control broadcast domains and usually come with less number of ports.
Bridges can be used to connect different types of cabling, or physical topologies but must be
used between networks with the same protocol.
OSI: Bridges are on the data link layer so in principle they are capable to do what switches do
like data filtering and separating the collision domain, but they are less advanced.
Routers
Are used to interconnect networks that use different technologies
Have the ability to break broadcast domains and collision domains
A router translates information from one network to another; it is similar to a super intelligent
bridge.
They can have both LAN and WAN interfaces.Routers are used to connect different LANs or a
LAN with a WAN (e.g. the internet).
Routers can direct signal traffic efficiently
Can route messages between any two protocols
Routers control both collision domains and broadcast domains. . If the packet’s destination is on
a different network, a router is used to pass it the right way, so without routers the internet
could not functions.
Connects all computers from a LAN to internet using same IP.
OSI: Routers work on the network layer so they can filter data based on IP addresses.
They have routing tables to store network addresses and forward packets to the right port.
Hubs
Receives a signal, regenerates it, and sends the signal over all ports
The ports use a shared bandwidth approach and often have reduced performance in the LAN
due to collisions and recovery
A hub is a very simple (or dumb) device, once it gets bits of data sent from computer A to B, it
does not check the destination, instead, it forwards that signal to all other computers (B, C, D…)
within the network. B will then pick it up while other nodes discard it. This amplifies that the
traffic is shared.
There are mainly two types of hubs:
o Passive: The signal is forwarded as it is (so it doesn’t need power supply).
o Active: The signal is amplified, so they work as repeaters. In fact they have been called
multiport repeaters. (use power supply)
Hubs can be connected to other hubs using an uplink port to extend the network.
OSI Model: Hubs work on the physical layer (lowest layer). That’s the reason they can’t deal
with addressing or data filtering.
Gateways
Gateway is a generic term used to represent devices that connect two dissimilar networks. Acts
as translator.
50
Miss gwenzi form 1 notes
Are very intelligent devices which connect and translate data between networks with different
protocols or architecture, so their work is much more complex than a normal router? For
instance, allowing communication between TCP/IP clients and AppleTalk.
OSI: Gateways operate at the network layer and above, but most of them at the application
layer.
Token Passing
In CSMA/CD and CSMA/CA the chances of collisions are there. As the number of hosts in the
network increases, the chances of collisions also will become more.
In token passing, when a host wants to transmit data, it should hold the token, which is an
empty packet. The token is circling the network in a very high speed.
51
Miss gwenzi form 1 notes
If any workstation wants to send data, it should wait for the token. When the token has reached
the workstation, the workstation can take the token from the network, fill it with data, mark the
token as being used and place the token back to the network.
Contention
Contention is concerned with the competition of resources in a given network.
The term is used especially in networks to describe the situation where two or more nodes
attempt to transmit a message across the same wire at the same time.
This is a type of network protocol that allows nodes to contend/compete for network access.
That is, two or more nodes may try to send messages across the network simultaneously. The
contention protocol defines what happens when this occurs.
The most widely used contention protocol is CSMA/CD, used by Ethernet. Also see polling and
token passing. This is a condition that occurs when two or more stations on a network try to
access the network media simultaneously. In other words, the stations are contending for
control of the media.
There are different ways of resolving contention issues on a network. One way is to use a single
station as the master or primary station that controls all communication on the network. Other
devices on the network function as slave, or secondary, stations. The entire system is known as
a master-slave system. The master station normally functions in transmit mode, while the slave
stations operate in receive mode. The master station tells individual slave stations when they
should switch to transmit mode in order to transmit information over the network.
In Ethernet networks, the Carrier Sense Multiple Access with Collision Detection (CSMA/CD)
method is used to resolve contention on the network by allowing collisions to occur, and then
resolving them successfully.
DATA TRANSMISSION
Transmission Medias
The data is sent from one computer to another over a transmission medium.
The transmission media can be grouped into guided media, and unguided media.
Guided media,
The data signals are sent along a specific path, through a wire or a cable.
Copper wire and optical fibers are the most commonly used guided media.
Copper wire transmits data as electric signals.
Copper wires offer low resistance to current signal, facilitating signals to travel longer
distances.
The guided types of transmission media are mostly cables. It's called "guided" because the
signal passing through it can only go in one direction: from the source to the receiver.
There are several subtypes, such as coaxial, which is most commonly associated with cable
products. Twisted-pair cables, such as those in phone lines and Ethernet cables are a second
subtype.
Fiber optics is another example of guided transmission media, but these use light pulses instead
of electrical signals, which make them faster.
The most common type of cable used in data communications is copper.
There are different types of copper cable but they all share the feature of transmitting data as
an electrical signal. This gives rise to one of the weaknesses of this type of media, which is that
sending an electronic signal causes heat that is absorbed by the media as the signal travels thus
causing signal loss, i.e. attenuation.
The faster the data transfer rate over copper cable the greater the possibility of signal loss and
interference.
52
Miss gwenzi form 1 notes
There are two main categories of copper cable:
o Coaxial
o Twisted pair
Coaxial Cable
In early networks coaxial cable was the cable of choice because it was relatively inexpensive,
reliable and robust. It consists of:
o A central conductor
o An insulator
o A braided metallic shielding
o An outer jacket
Advantages
It provides better immunity than twisted pair.
This cable is able to transmit data at higher rates.
Sufficient frequency range to support multiple channels, which allows for much greater
throughput.
Disadvantages
High installation cost
High maintenance cost.
The thicker the cable, the more difficult to work with.
Consists of glass or plastic fibres that carry data in the form of light signals. Unlike copper cable
there is no electricity, but it uses pulses of light.
The cable cannot be tapped to detect signals.
Fibre-optic cable is perfect for high speed, high quality data transmission, although it suffers
from a form of attenuation
The reliability, security and distances covered by fibre optic cable make it the natural choice as
backbone cabling within buildings and between buildings.
53
Miss gwenzi form 1 notes
The glass or plastic used in fibre-optic cable is manufactured to be pure and without any
imperfections/faults/defects so that the light signal can travel without hindrance/impediments
over long distances, e.g km.
How it works?
The fibres or threads are extremely thin strands; about as thick as human hair, coated with two
layers of highly reflective plastic that creates an internal mirror around the strand.
The outer sheath works as mirror causing an internal reflection that light cannot escape from
and is thus guided along bouncing off at shallow angles. This principle is known as total internal
reflection.
At both ends of the fibre link there are photodiodes which must be in exact alignment in order
to prevent signal reflection. The means of placing the signal on the fibre can be carried out by
Light Emitting Diode (LED) or an Injection Laser Diode (ILD).
Advantages
Immune to noise, electromagnetic interference and radio frequency interference. Thus optical
fiber systems are not affected by external noise.
It can cover greater distances more reliably than wire (high bandwidth and capacity)
It can handle greater speeds, e.g. 1000Mbps and upwards
It cannot be compromised by signal tapping
Lower signal attenuation (loss)
Less restrictive in harsh environments
The error rate for the data transmitted across fiber optic cable is very low.
Disadvantages
It is not as robust/strong as wire
It is more expensive to buy
Fibers fragility/delicateness makes it more difficult to handle.
It is more expensive to install
It has to be installed by specialists
The lack of standardization/consistency in the industry has also limited the acceptance of fiber
optics.
54
Miss gwenzi form 1 notes
Unshielded Twisted Pair (UTP) Cable
A common implementation of UTP is 100BaseT, which allows for a maximum cable length
segment of 100 metres.
There are different categories of UTP cable and one differentiation factor is the number of
twists per metre of cable.
The more twists the higher quality the cable, i.e. there are less twists per foot in Cat3 compared
to Cat5 UTP cable.
Cat5 UTP cable is a popular choice for network cable because it meets the European standard
for allowing data transfer speeds of 100Mbps.
In unshielded twisted pair cabling, the twisted pair cable is not shielded.
This telephone wiring is usually unshielded twisted pair cable. The main disadvantage
associated with this is low noise immunity. During a telephone conversation, noise and
interference from other electronic equipment takes the form of static and is rarely loud enough
to disrupt the call. But that same line can scramble a data transmission and require the sending
device to retransmit. An excessive number of such retransmissions will reduce network
efficiency.
Advantages
Inexpensive
Easy to install
Can accommodate up to 1000 devices.
Handled a data flow of up to approximately one megabit per second (Mbps) over several
hundred feet
Disadvantages
Easy to tap
Susceptibility/vulnerability to signal distortion errors
Provide relatively low transmission rates over long distances.
Unguided Media
They are called unguided because it's possible to interrupt, or even walk through the signal, in
most cases without disrupting it.
A wireless router broadcasts a constant radio signal over the air to your receiver. A satellite
does the same thing using microwaves. There are also laser-based transmitters, which work
like fiber optics, but without any physical cabling.
Unguided media relates to data transmission through the air and is commonly referred to as
wireless. The transmission and reception of data is carried out using antenna. There are two main
ways that antenna work:
55
Miss gwenzi form 1 notes
Directional (in a beam)
Omni directional (all around)
WirelessWireless media do not use an electrical or optical conductor. In most cases the earth’s
atmosphere is the physical path for the data. The common types of wireless media that transmit
data use electro-magnetic waves and are:
• Radio waves – the distances that can be covered by radio waves are dependent upon the
frequency, but can be hundreds of miles.
• Microwaves – these are transmitted at much higher frequencies than radio waves and will provide
better performance. Satellite dishes are often used with microwave transmission where
communication can be directly between two systems within the same geographical area or it can
make use of a satellite in geosynchronous orbit 50 000 km above the earth.
• Infrared – this uses ‘invisible’ infrared light to transmit the data. Most household remote controls
(used with televisions and videos, etc.) use infrared transmissions. Infrared transmissions are
either ‘point-to-point’ or they can be reflected off walls and ceilings; they cannot travel more than a
few metres and they cannot pass through walls.
Bluetooth is one of the latest radio technologies that enables devices such as computers,
mobilephones, hands-free kits and other peripherals to be connected without cables up to 30 feet
away.Like many modern wireless devices (including portable phones and wireless computers) it
useswaves with a frequency of 2.4 GHz.
Radio Transmission
Radio transmission works with or without line of sight.
If line of sight is possible then transmission can take place between sending antenna and
receiving antenna.
The placement of antenna has to take into account the curvature of the Earth with antenna
being built taller accordingly. This will also allow for greater transmission distances.
If line of sight cannot be implemented then signals can be broadcast to the upper layers or the
atmosphere or space and then transmitted back to Earth.
Bluetooth
Bluetooth is a wireless protocol for exchanging data over short distances from fixed and mobile
devices, creating personal area networks.
There are two important parameters of Bluetooth devices - class and supported profiles.
"Class" signifies the distance at which a Bluetooth connection is possible. Most mobile devices
are Class 2, which means they have a range of up to 10 m. Class 1 devices are rare and have a
range of up to 100 feet.
A "profile" is a type of Bluetooth connection. The most common are the Headset (HSP) and
Handsfree (HFP) profiles that enable the device to connect to a wireless headset or handsfree.
Created by telecom vendor Ericsson in 1994, it was originally conceived as a wireless
alternative to RS-232 data cables.
It can connect several devices, overcoming problems of synchronization.
Used for connecting mobile phones to other devices without cables.
Bluetooth specification is for a complete system from physical layer to application layer.
56
Miss gwenzi form 1 notes
The basic unit of a Bluetooth system is a piconet, which consists of a master Node and up to
seven active slave nodes within a distance of 10 meters.
57
Miss gwenzi form 1 notes
Capacity: determining how much amount of information you need to communicate and the
speed with which you need to communicate that information will determine which
communications media you require.
Reliability: addresses the guarantee of perfect service of your network.
Cost: Communication media with greater capacity and reliability are more expensive.
Distance: Knowing the extent of geographic distance that your network must cover will also
help you determine the most appropriate communication media. Some communications media
such as wire pair and microwave systems, only work well over small distances, where as optical
fiber, microwave, and satellite communications media work well over great distances.
Mobility: Finally, you need to consider the mobility of network users. Many organizations today
are equipping telecommuters with cellular phones so that they can work anywhere without
contact to an actual phone line.
Data Communication
Data communication is the transmission of electronic data over some media. The media may be
cables, microwaves.
Data Transmission
Data may be transfered from one device to another by means of some communication media. The
electromagnetic or light waves that transfer data from one device to another device in encoded
form are called signals. Data transmissions across the network can occur in two forms i.e.:
Analog signal.
Digital signal.
Analog Signal: The transfer of data in the form of electrical signals or continuous waves is called
analog signal or analog data transmission. An analog signal is measured in volts and its frequency is
in hertz (Hz).
Advantages of AnalogSignaling
Allows multiple transmissions across the cable.
Suffers less from attenuation.
Disadvantages of AnalogSignaling
Suffers from EMI.
Can only be transmitted in one direction without sophisticated equipment.
58
Miss gwenzi form 1 notes
Digital Signal: The transfer of data in the form of digits is called digital signal or digital data
transmission. Digital signals consist of binary digits 0 & 1. Electrical pulses are used to represent
binary digits. Data transmission between computers is in the form of digital signals.
Parallel Transmission. In parallel transmission each bit of character / data has a separate channel
and all bits of a character are transmitted simultaneously. Here the transmission is parallel
character by character.
Serial Transmission. In serial transmission, the data is sent as one bit at a time having a signal
channel for all the bits, i.e.:
Synchronous Transmission
In this method a clock signal is used and the sending as well as the receiving devices are
synchronized with this clock signals. It doesn’t use start and stop bits but the character are sent in
character groups called block
59
Miss gwenzi form 1 notes
Simplex Mode
In simplex mode, data is transmitted in only one direction.
A terminal can only send data and cannot receive it or it can only receive data but cannot send
it. Simplex mode is usually used for a remote device that is meant only to receive data.
It is not possible to confirm successful transmission of data in simplex mode.
This mode is not widely used. Speaker, radio and television broadcasting are examples of
simplex transmission, on which the signal is send from the transmission to your TV antenna.
There is no return signal.
Advantages of Simplex
Cheapest communication method.
Disadvantage of Simplex
Only allows for communication in one direction.
Half Duplex.
In half duplex mode, data can be transmitted in both directions but only in one direction at a
time.
During any transmission, one is the transmitter and the other is receiver. So each time for
sending or receiving data, direction of data communication is reversed, this slow down data
transmission rate.
In half duplex modes, transmission of data can be confirmed.
Wireless communication and Internet browsing are examples of half duplex.
60
Miss gwenzi form 1 notes
Only one device can transmit at a time.
Full Duplex.
In full duplex mode, data can be transmitted in both directions simultaneously. It is a faster
mode for transmitting data because no time is wasted in switching directions.
Example of full duplex is telephone set in which both the users can talk and listen at the same
time.
The Open System Interconnection (OSI) reference model describes how information from a
software application in one computer moves through a network medium to a software application
in another computer. The OSI reference model is a conceptual model composed of seven layers,
each specifying particular network functions. The model was developed by the International
Standardization Organization (ISO) in 1984, and it is now considered the primary architectural
model for inter-computer communications.
A computer network is a very complex system. It becomes very difficult to implement as a single
entity. The layered approach divides a very complex task into small pieces each of which is
independent of others and it allow a structured approach in implementing a network. The basic
idea of a layered architecture is to divide the design into small pieces. Each layer adds to the
services provided by the lower layers in such a manner that the highest layer is provided a full set
of services to manage communications and run the applications.
61
Miss gwenzi form 1 notes
Increase the interoperability and compatibility of various components build by different
vendors.
Protocols
The Transmission Control Protocol/Internet Protocol (TCP/IP) suite was created by the U.S.
Department of Defense (DoD) to ensure that communications could survive any conditions and
that data integrity wouldn’t be compromised under malicious attacks.
The Open Systems Interconnection Basic Reference Model (OSI Model) is an abstract
description for network protocol design, developed as an effort to standardize networking.
62
Miss gwenzi form 1 notes
The acronyms TCP and IP stand for Transmission Control Protocol and Internet Protocol,
respectively.
TCP/IP is a four-layer reference model.
All protocols that belong to the TCP/IP protocol suite are located in the top three layers of this
model.
The best way to begin understanding TCP/IP is to draw parallels with the OSI model, as shown
in the diagram below:
It should be noted that the names of the four layers in the TCP/IP stack vary in documentation. It is
the principle, rather than the rather semantic view of naming, that is important.
Application layer
Deals with representation, encoding and dialog control issues.
Telnet is an application that allows remote login to another computer. Typically, such a remote
logon will provide command-line access. Of course, using Telnet requires both client and server
components.
FTP stands for File Transfer Protocol. An FTP session allows a user to upload files to, or
download files from a remote computer. As with Telnet, both client and server components are
necessary.
SMTP stands for Simple Mail Transfer Protocol and is used for transferring email. For example,
a typical mail account in MS Outlook may use SMTP for handling mail.
DNS - Domain Name System - allows IP addresses to be mapped to domain names, such as
http://www.just2good.co.uk.
Transport layer
Its responsibilities include application data segmentation, transmission reliability, flow and error
control.
Within the TCP/IP stack, transport control is either handled by TCP - Transmission Control
Protocol, or by UDP - User Datagram Protocol.
The important difference is that TCP uses virtual circuits. I.e. connections between end-points
are established, allowing data to flow reliably between them.
UDP, on the other hand, does not use pre-established circuits, and is thus termed a
connectionless transport protocol. Since circuits do not need to be established in advance, UDP
transport requires fewer networks overhead and is therefore faster. For example, TFTP - Trivial
63
Miss gwenzi form 1 notes
File Transfer Protocol - uses UDP. However, connectionless protocols are inherently unreliable.
However, if the application itself implements some form of reliability checking, then UDP will
clearly be preferable to TCP.
Internetwork layer
Their purpose is to route packets to their destination independent of the path taken.
IP is responsible for transporting UDP or TCP segments (packets) from end-point to end-point,
based on their IP addresses.
ICMP (Internet Control Message Protocol) is used to request the status of network hardware, or
to respond to such a request. For example, the Ping command uses an ICMP packet.
Network Access:
The network access layer deals with all the physical issues concerning data termination on
network media.
It includes all the concepts of the data link and physical layers of the OSI model for both LAN
and WAN media.
Circuit switching
is a methodology of implementing a telecommunications network in which two network nodes
establish a dedicated communications channel (circuit) through the network before the nodes
may communicate.
The circuit guarantees the full bandwidth of the channel and remains connected for the
duration of the communication session.
The defining example of a circuit-switched network is the early analog telephone network.
In circuit switching, the bit delay is constant during a connection, as opposed to packet
switching, where packet queues may cause varying and potentially indefinitely long packet
transfer delays.
No circuit can be degraded by competing users because it is protected from use by other callers
until the circuit is released and a new connection is set up.
64
Miss gwenzi form 1 notes
It is easier to double the capacity of a packet switched network than a circuit network – a circuit
network is heavily dependent on the number of channel available.
It is cheaper to expand a packet switching system.
Advantages:
Secure
Bandwidth used to full potential
Devices of different speeds can communicate
Not affected by line failure (re-diverts signal)
Availability – do not have to wait for a direct connection to become available
During a crisis or disaster, when the public telephone network might stop working, e-mails and
texts can still be sent via packet switching
Disadvantages
Circuit-switching
Take four times as long to double their performance
Cost, force ISPs to buy many boxes to keep up. This is why everyone is looking for ways to get
Internet traffic off the telephone network.
Advantages:
Disadvantages:
Inefficient – the equipment may be unused for a lot of the call, if no data is being sent, the
dedicated line still remains open
Takes a relatively long time to set up the circuit
During a crisis or disaster, the network may become unstable or unavailable.
It was primarily developed for voice traffic rather than data traffic.
WHAT IS SYSTEM?
65
Miss gwenzi form 1 notes
A combination of resources working together to transform inputs into usable outputs.
Basically there are three major components in every system, namely input, processing and
output.
In a system the different components are connected with each other and they are
interdependent. For example, human body represents a complete natural system.
The objective of the system demands that some output is produced as a result of processing the
suitable inputs.
A well-designed system also includes an additional element referred to as ‘control’ that
provides a feedback to achieve desired objectives of the system.
Developing a business information system involves much more than just programming .Systems
developers must:
o Conduct a feasibility study
o Analyse current system (if any)
o Establish requirements for new system
o Design an overall solution (the structure of the system) based on user requirements
o Design the data storage structure
o Plan the Human-computer Interface (HCI)
During and after the implementation of a system, the systems developer must:
o Integrate the system into the business / current system
o Test the system
o Provide training
o Provide user support (documentation)
o Use and evaluate the system
o Maintain system
Most IT projects use the System’s Life-cycle approach to develop a new system. This approach
consists of several distinct stages, which follow one after the other. During the development life-
cycle, a team is not permitted to go back to a previous stage – this could cause the project to over-
run in terms of both cost and time.
66
Miss gwenzi form 1 notes
Note that each stage of the System’s Life-cycle has a distinct end-point, which can be shown to the
customer and ‘signed off’. This helps to ensure that the final product is what the customer actually
wanted!
An accurate problem definition is needed so that the developers know exactly what is expected
from the system. This means that the system that is delivered is going to be what the customer
expected. Without an accurately defined problem, it is likely that the software that is developed will
not fully satisfy the needs of the end users.
Note that there has to be a two-way dialogue between the analyst and the users because:
The users do not know a lot about computers and their capabilities;
Programmers will not know very much about the way the business works, for which they are
developing the software.
FEASIBILITY STUDY
A feasibility study is an initial investigation of a problem in order to ascertain whether the
proposed system is viable/feasible/practicable, before spending too much time or money on its
development.
After the problem/task has been defined and before a complete detailed study of exactly what is
needed within a new system, a feasibility study is undertaken to verify that the system that is
required is, in fact, viable/possible and that it is worth proceeding.
There are five factors that are considered in a feasibility study:
Technical feasibility – this investigates whether the hardware and software exists to create
the system that is wanted.
Economic feasibility – this investigates the cost of developing a new system (including the
purchase of new hardware) and then determines whether the benefits of a new system would
outweigh the costs.
Legal feasibility – investigates if there is a conflict between what is wanted and the law. For
example, would the new system satisfy the requirements of the Data Protection Act?
Operational feasibility – investigates whether the current working practices within the
organization are adequate to support the new computer system. It is possible that the new
system would require employees to perform duties in a different way –this may not be
acceptable!
Schedule feasibility – this investigates the amount of time that the new system is likely to take
to develop and determines whether it can be developed within the timescale that is available.
67
Miss gwenzi form 1 notes
The analysis is a detailed, fact-finding, investigation of the existing system in order to
ascertain/determine its strengths and weaknesses and to produce the list of requirements for the
new system.
When attempting to create a new IT system, it is very important that sufficient information is
gained about the way the present system operates. The usual methods of obtaining this information
include:
• Interviewing staff
• Observation of current procedures
• Examination of paperwork
• Surveying (with questionnaires)
Interviewing
It involves a one to one question and answer session between the analyst and the
employee/customer. Interviews are time-consuming, but very effective.
Advantages
It gives the opportunity to motivate the interviewee into giving open and honest answers to the
analyst’s questions
It allows the analyst to probe for more feedback from the interviewee, as it is easier to extent a
question
It is possible to modify questions as the interview proceeds and ask questions specific to the
interviewee
It is a good method if the analyst wants to probe deeply into one specific aspect of the existing
system
Disadvantages
It can be rather time consuming
It is relatively expensive, due to the use of the analyst’s time
Users may feel intimidated/demoralized and not tell the truth of the user’s answers to the
original questions about what they feel is lacking in the existing system
Observation
Involves watching personnel using the existing system to find out exactly how it work.
Time and motion studies could be undertaken to see how data and documents move around the
existing system and to detect where bottlenecks occur and determine where measures could be
made more efficient.
Advantages
The analyst obtains reliable data
It is possible to see exactly what is being done
It is relatively inexpensive method
Allows the analyst to see the current system at site
More advantageous than just interviewing them, because it may uncover/expose processes that
they do sub-consciously and do not remember to tell the analyst about during interview.
Disadvantages
Users may work differently if they know that they are being watched.
Examination of paperwork:
68
Miss gwenzi form 1 notes
The paperwork will include documents that are received from an organization’s customers –
such as membership application forms or orders.
They will also include documents that are produced by the current system – such as the
invoices sent to customers and the current reports that are produced for the management team.
This will help to show the inputs and outputs of the current system and so help determine the
inputs and outputs required by the new one.
Advantages
Analyst can get an idea of the volume of data
Analyst can determine the inputs and outputs required by the new system.
Analyst can see how data is currently validated
Disadvantages
Can be time consuming if there is a large volume of files to go through
Questionnaires
If there are many users of the system then surveying staff by asking them to complete a
questionnaire would be a more efficient method of gathering information than conducting
personal interviews.
Advantages
Efficient in terms of time
Answers can be anonymous
Disadvantages
Responses to questions are less flexible than in an interview
There is often a low return rate of answered questions
It can be difficult to design a good questionnaire.
Requirements analysis
Candidates should be able to:
8. Describe what is involved when analysing the requirements of a system, explaining the nature of
the requirements specification and its content, including current data structures, inputs, outputs
and processing represented in diagrammatic form (data flow diagrams, system flowcharts), identify
inefficiencies / problems in the current system.
The deliverable at the end of analysis is documentation that shows an investigation into the current
system and a list of system requirements for the new one. These requirements need stated in a
clear, specific and measurable way. In order to ascertain these requirements, the systems’ analyst
needs to examine the current data structures and relationships between them. They must also trace
the flow of data through the existing system – this will begin by determining the source of the
various data, identifying the ways in which the data is processed; and finish by identifying the
destinations of the final outputs. The analysis documentation will contain the following:
o Identification of existing and prospective/potential users;
o Identification of current data and its structure;
o Identification of inputs, outputs and processes within the current system;
o Identification of data flows including the sources and destinations of the data;
o Identification of the strengths and the weakness of the current system;
o Listing of objectives.
69
Miss gwenzi form 1 notes
Current data and its structures
This is the description of the current data within the system – its data type, validation
techniques used, relationships with other data within the system.
The analysis data dictionary is usually presented in tabular form, with each different category of
data being described in its own table.
DFDs contain a system boundary which contains the whole "system". Data flows can cross that
boundary into the "environment". Objects outside the system are known as "terminators".
There must be a limit regarding what data it processes otherwise it will continually expand,
never being a finished and complete system. This can lead to problems in the operation of the
system as it becomes more complex and the probability of large system errors being introduced
increases. Data stored about objects or people should only be relevant data.
When developing a system a statement of purpose must exist. This is simply a short concise
statement about the purpose of system. For clarity, this may also include what is NOT to be
included in the system.
The Context Diagram which is the Topmost DFD (level 0) has one process only and shows the
inputs and outputs of the system.
Within stores, the structure of the data has to be described. This can be done using UML and
Class Diagrams. These involve the representation of simple classes (by a rectangle) and
Associations (lines) drawn between them that show what type of relationship is involved.
Cardinality describes the number of classes associated with another class. The cardinality is
shown by numbers written above the association lines near the class.
DFD Elements
Processes transform data.
Stores retain data until needed. They are usually named after the data entity.
Terminators (or entities) can represent customers or people etc... within a system.
Data Flows are instantaneous and the names of the flows are typically listed in the data dictionary
along with information about each one.
System flowcharts:
A system flowchart shows an outline of how a system operates.
70
Miss gwenzi form 1 notes
DESIGN
Design is the production of diagrams, tables and algorithms, which show how the new system is to
look and work. The design will show: • how the interfaces and reports should look;
• the structure of and relationships between the data;
• the processing to be used to manipulate/transform the data;
• the methods to be used for ensuring the security and validity of the data.
The deliverable at the end of the design stage is documentation that could be used,
independently, by a third-party programmer to create the system as the designer intends/aims.
This means that each section of the design must be detailed and clear.
Explanations of what must be done and why this method is chosen need to be included. The
design documentation will contain the following:
o user interface designs (input forms and menus);
o specification of data structures (including the relationships between different types of
data);
o validation procedures;
o output/report designs;
o algorithms;
o security methods.
User interfaces:
Humans will need an interface that allows them to:
o Give instructions – Print, Save, Open, Delete, Copy, Paste etc.
o enter data – file names, number of pages to print;
o Make choices – Yes, No, Cancel etc. Computers need ways to:
o notify errors – illegal operation, invalid data input, printer out of paper, wrong password:
o tell on progress – copying, deleting, installing, and downloading:
o display the results of processing
o ask for options – e.g. number of pages to be printed, which file to open.
o provide help with performing tasks – this help could be in the form of Status bar text, yellow Tip
boxes, an Office Assistant or even a full-blown help file accessed via the Help menu.
CODING
Coding is the creation and editing of the interfaces, code and reports so that they look and work as
indicated in the design stage. Note that user and technical documentation will also be produced
during the coding stage.
71
Miss gwenzi form 1 notes
TESTING
Testing is the process to ensure that the system meets the requirements that were stated in the
analysis and also to discover (and eliminate) any errors that might be present.
Testing is undertaken to ensure that a system satisfies the user’s requirements and to discover
any errors that might be present.
This phase is important for testing needs to be undertaken by both the programming team and
by the end-users.
Note that. Testing a program can never adequately prove or demonstrate the correctness of the
system – it can only reveal/disclose the existence of errors. The Testing by the programming team
is on-going as the system is developed, but it is still very important to undertake tests at the end,
after the programming team believes that the system is finished. This formal testing at the end of
development is known as alpha-testing.
Alpha-testing:
This is the formal testing at the end of development. It:
is undertaken by the programming team;
uses data that the programmers perceive/see to be realistic;
Is designed to ensure that the requirements/objectives have been met.
Beta-testing:
Beta testing is when the software is tested under real conditions, using real data, by a selection
of real end-users.
This phase of testing is necessary because software developers will probably not anticipate all
the combinations of conditions that will occur when the software is in use in its ‘real’
environment.
This is the stage of testing where problems with different hardware combinations are usually
discovered, as are problems with ‘clashing’ software.
During beta testing, users generally agree to report problems and bugs to the developers. These
will then be corrected and the software may then undergo a second round of beta testing before
the package is eventually released. These end-users who test the system during beta-testing:
o use the system with realistic volumes of real data;
o use the system with a variety of different hardware and configurations;
o report faults/errors back to analyst;
o check that there is a reasonable response time;
o ensure that the user interface is clear;
o Ensure that the output is as expected.
Acceptance testing:
Acceptance testing is where the customer specifies tests to check that the supplied system
meets his/her requirements as specified at the analysis stage and that the system works in their
own environment.
Note that the tests and data are specified by the customer, but the testing itself may be carried
out by the customer or by the developer under the scrutiny of the customer.
CONVERSION:
72
Miss gwenzi form 1 notes
Conversion is the process of installing the new system into the customer’s organisation and training
the employees to use it.
Conversion is the process of changing from an existing system to a new system.
Note that conversion may take place within a day, or it might be that it is several months before
all parts of the new system have replaced the old. There are problems which may arise when
converting / changing over. Converting from an existing system to a new one is not always
smooth. The following problems could arise:
o Data may have to be converted because the format in the new system may be different to
the format of the old system.
o Users will have to be trained so that they will be able to use the new system – the
organization may even need to employ additional staff.
o Data may be lost during conversion – must make sure there is a full backup made before
changing to the new system;
o Hardware may need to be replaced/upgraded – if it does not satisfy the demands of the new
system;
o System software may need to be replaced/upgraded – i.e. new system may be created to
take advantage of the features within Windows XP and so will not run correctly on an
earlier operating system.
o Old data may need to be archived;
Methods of conversion/changeover:
The change from the use of an existing system to the use of a new system cannot always be
immediate / instantaneous. There are several different methods of converting to a new system, the
four most common are:
o Parallel;
o Direct;
o Pilot;
o Phased.
Parallel:
The old and the new systems are run side by side for a time before the new system takes over
altogether.
Advantages
If the new system fails, the old system is still available as a backup.
It is possible to train staff gradually
Staff have time to get used to the new system
Disadvantages
It is more expensive than direct changeover, since extra staff are needed to run both systems
together
Direct:
The old system is stopped overnight and the new system introduced immediately.
Advantages
The benefits are immediate
Costs are reduced – since only one system is used there is no need to pay for two sets of staff
There is less likelihood of a malfunction since the new system will have been fully tested
Disadvantages
73
Miss gwenzi form 1 notes
This method can be disastrous if the new system fails
Pilot:
The new system is introduced into one part of the company (e.g. into a warehouse of a
supermarket) and its performance assessed.
Advantages
If the new system fails, only one part of the company is affected
It is possible to train staff in one area only, which is much faster and less costly than parallel
running
The costs are also less than parallel running, since only one part of the system is being used in
the pilot
Disadvantages
It is more expensive than direct changeover, since each pilot scheme needs to be evaluated
before the next stage is introduced
Phased:
Initially, only part of the new system is introduced. Only when it proves to work satisfactorily is
the next part introduced, and so on, until the old system is fully replaced
Advantages
If the latest part fails, it is only necessary to go back into the system to the point of failure, hence
failure is not disastrous
It is possible to ensure the system works properly before expanding
Disadvantages
This more expensive than direct changeover, since it is necessary to evaluate each phase before
moving to the next stage.
EVALUATION (REVIEW)
Post-implementation review (also known as evaluation) is a critical examination of a system after it
has been in operation for a period of time.
Purpose:
The purpose of an evaluation is to assess the success of a system.
Specifically, it will assess the suitability, effectiveness, usability and maintainability of the
system. The evaluation will ask many questions including:
o Can it carry out the all the requirements that were set?
o Is it an improvement on the existing system?
o Is it cost effective?
o Is it easy to use?
o Is the new system compatible with the existing systems?
o Is the system easy to maintain?
Timing:
74
Miss gwenzi form 1 notes
The evaluation will occur after a new system has been in operation for some time – usually a
period of between three and six months.
The waiting period allows users and technical staff to learn how to use the system, get used to
new ways of working and understand new procedures required.
It allows management a chance to evaluate the usefulness of the reports and on-line queries
that they can make and go through several month-end periods when various routine reports
will have been produced. Shortcomings of the system, if they exist, will be becoming apparent at
all levels of the organization.
System documentation
There are two types of documentation that are necessary:
Technical documentation – aimed at a future system developer
User documentation/Manual – aimed at the end user.
Technical documentation:
Note that technical/system documentation is very valuable for the maintenance process. This is
because it will show how each part of a system has been constructed and the reasons why
certain choices have been made.
The technical documentation should include:
o Annotated program listing – if the system is coded.
o Data flow diagram
o System flow diagram
o Structure charts/pseudo code/algorithm designs
o Test plan
o Data dictionary – i.e. the field definitions (including data-type, field length, validation)
o Entity relationship diagrams
User Documentation:
As well as a contents page and index, the user documentation should include:
o Overview of the system
o Instructions on how to install
o Instructions on how to back up the data
o Instructions on how to operate the program
o Details on possible errors and how to deal with them
o Glossary of terms used within the documentation.
MAINTENANCE
Maintenance is the process of making improvements to a system that is in use. The reasons for
maintenance could be to fix bugs, to add new features or to make the system run quicker.
75
Miss gwenzi form 1 notes
o Some in-built parameters change – e.g. VAT rate;
o Hardware is changed – the system will be updated to take advantage of new hardware
developments. This could be a new input device, output device or even communications
device.
o The performance needs tuning – often some of the original code, although working without
error, uses some quite cumbersome/bulky routines that are slow to execute. System
performance can often be improved by finding more efficient algorithms for such routines.
o Operating system is upgraded – the system will be modified to take advantage of the
additional capabilities of the operating system.
Types of maintenance:
There are three types of maintenance:
corrective maintenance;
adaptive maintenance;
Perfective maintenance.
Corrective maintenance:
Corrective maintenance is the removal of some of the known bugs in a program. Software that
has been released to the public will still contain bugs. Some of these bugs will be previously
unknown to the developers while others will be known to exist, but solutions will not yet have
been discovered. The software will be released with these ‘known bugs’ because of the
necessity to meet pre-set target dates and the need to gain some income from the software to
continue to pay the developers. Eventually some of the bugs will be fixed and the solutions will
need to be incorporated into the public’s version of the programs. This type of maintenance is
often done by releasing a ‘patch’ which is a very small program that actually changes lines of
code within the main program. These patches are available from Internet sites or from the CD-
ROMs that are provided with computer magazines.
Adaptive maintenance:
Adaptive maintenance is the addition of new features to a program because of a change in
users’ requirements.
The new version of the program may contain an added (or modified) feature or it may contain a
change in the interface. Adaptive maintenance could be needed because of:
o a change in the organizations/users requirements;
o a change in the law;
o a change in processes such as the method of tax calculation;
o to take account of new technologies.
Perfective maintenance:
Perfective maintenance is when internal routines are changed to make them more efficient, so
that the application operates faster.
In the initial release of the software some of the processes, although error-free, may have used
long and slow routines. Perfective maintenance will make improvements in the way that the
software performs by ‘tidying up’ some of the internal routines. Changes to the interface may
also be made.
76
Miss gwenzi form 1 notes
DFDs that are drawn up need to be correct. If they have errors in them or the wrong symbols
are used they are useless. Some further possible errors include:
o Data flows cannot exist between stores or terminators (processes are needed to retrieve
and move the data)
o Processes must be given a number and name in the appropriate places
o Data flows must be named
o All stores must be given numbers.
o Stores should typically have an input data flow so that it can be updated as well as an output
flow otherwise the data is not being used for anything
o Processes must have at least one input and one output
Successful systems development will involve breaking the system down into components or
modules. If there is "low coupling" between sections or modules in a system, this means that
there is little data flow between them.
These sections can therefore be developed independently quite easily without large problems
occurring when bringing them together to form the system as a whole.
The system's outputs must also be relevant and necessary for the user. Irrelevant and useless
output creates complications.
Sequential or linear structure is the construct where one statement is executed after another.
In simple terms it is a linear progression where one task is performed sequentially after
another.
Selection (Decision) structure allows the program to make a choice between two alternate
paths, whether it is true or false. Thus is the construct where statements can be executed or
skipped depending on whether a condition evaluates to TRUE or FALSE. There are three
selection structures in C:
1. IF
2. IF – ELSE
3. SWITCH
77
Miss gwenzi form 1 notes
Repetition (Looping) structure is the construct where statements can be executed repeatedly
until a condition evaluates to TRUE or FALSE. Causes an interruption in the normal sequence of
processing and directs the system to loop back to a previous statement in the program,
repeating the same sequence again.There are three repetition structures in C:
1. WHILE
2. DO – WHILE
3. FOR
Recursion A recursive method is a method that calls itself either directly or indirectly.There
are two key requirements to make sure that the recursion is successful:
o Every recursive call must simplify the computation in some way.
o There must be special cases to handle the simplest computations.
ALGORITHM
A sequence of steps to solve a problem.
Characteristics of an Algorithm
Well-ordered: the steps are in a clear order
Unambiguous: the operations described are understood by a computing agent without further
simplification
Effectively computable: the computing agent can actually carry out the operation
Flowcharts
A graphical tool that diagrammatically depicts the steps and structure of an algorithm or
program
The steps are drawn in the form of different shapes of boxes and the logical flow is indicated by
interconnecting arrows.
The boxes represent operations and the arrows represent the sequence in which the operations
are implemented.
78
Miss gwenzi form 1 notes
Symbols used
Process – Any type of internal operation: data transformation, data movement, logic operation,
etc.
Connector – connects sections of the flowchart, so that the diagram can maintain a smooth,
linear flow
Input/Output – input or output of data
Terminal – indicates start or end of the program or algorithm
Decision – evaluates a condition or statement and branches depending on whether the
evaluation is true or false
Flow lines – arrows that indicate the direction of the progression of the program
FLOWCHART
A flowchart is a pictorial representation of an algorithm in which The boxes represent
operations and the arrows represent the sequence in which the operations are implemented.
Benefits of Flowcharts
o Makes Logic Clear
o Clear Communication
o Effective Analysis
o Useful in Coding
o Proper Testing and Debugging
o Appropriate Documentation
Limitations of Flowcharts
o Complex
o Costly
o Difficult to modify
o Difficult to update
Flowchart Symbols
• A flowchart uses special shapes to represent different types of actions or steps in a process.
• Some standard symbols, which are frequently required for flowcharts, are:
79
Miss gwenzi form 1 notes
Focuses on the logic (sense) of the algorithm or program
Avoids language-specific elements
Written at a level so that the desired programming code can be generated almost automatically
from each statement
Steps are numbered. Subordinate numbers and/or indentation are used for dependent
statements in selection and repetition structures4.
It is an outline of a program, written in a form, which can easily be converted into real
programming statements.
Benefits of Pseudocode
o Pseudocode provides a simple method of developing the program logic as it uses everyday
language to prepare a brief set of instructions in the order in which they appear in the
completed program.
o Language independent
o Easier to develop a program from pseudocode than a flowchart
o Easy to translate pseudocode into a programming language
o Pseudocode is compact and does not tend to run over many pages
o Pseudocode allow programmers who work in different computer languages
LINEAR SEARCH
used if items are not in any particular order
items searched one by one until required item is found or end of list is reached
inefficient for all but a few items
maximum number of comparisons for a structure of size n is n
BINARY SEARCH
used for searching an ordered array
maximum number of comparisons for a structure of size n is log 2n
A binary search tree of size 9 and depth 3, with root 8 and leaves 1, 4, 7 and 13
80
Miss gwenzi form 1 notes
Generally, the information represented by each node is a record rather than a single data
element. However, for sequencing purposes, nodes are compared according to their keys rather
than any part of their associated records.
The major advantage of binary search trees over other data structures is that the related sorting
algorithms and search algorithms such as in-order traversal can be very efficient.
Binary search trees are a fundamental data structure used to construct more abstract data
structures such as sets, multisets, and associative arrays.
SORTING
Sorting is the process of placing elements from a collection in some kind of order.
For example, a list of words could be sorted alphabetically or by length. A list of cities could be
sorted by population, by area, or by zip code.
Like searching, the efficiency of a sorting algorithm is related to the number of items being
processed.
BUBBLE SORT
used to sort a small no. of items (i.e. less than 50)
to sort an array of n items, maximum no. of passes is (n - 1)
Because of bubble sort's simplicity, it is one of the oldest sorts known to man. It’s based on the
property of a sorted list that any two adjacent elements are in sorted order.
In a typical iteration of bubble sort each adjacent pair of elements is compared, starting with
the first two elements, then the second and the third elements, and all the way to the final two
elements.
Each time two elements are compared, if they are already in sorted order, nothing is done to
them and the next pair of elements is compared. In the case where the two elements are not in
sorted order, the two elements are swapped, putting them in order.
is a simple sorting algorithm that works by repeatedly stepping through the list to be sorted,
comparing each pair and swapping them if they are in the wrong order.
The pass through the list is repeated until no swaps are needed, which indicates that the list is
sorted.
Consider a set of data: 5 9 2 8 4 6 3. Bubble sort first compares the first two elements, the 5 and the
9. Because they are already in sorted order, nothing happens and the next pair of numbers, the 9
and the 2 are compared. Because they are not in sorted order, they are swapped and the data
becomes: 5 2 9 8 4 6 3. To better understand the "bubbling" nature of the sort, watch how the
largest number, 9, "bubbles" to the top in the first iteration of the sort.
(5 9) 2 8 4 6 3 --> compare 5 and 9, no swap
5 (9 2) 8 4 6 3 --> compare 9 and 2, swap
5 2 (9 8) 4 6 3 --> compare 9 and 8, swap
5 2 8 (9 4) 6 3 --> compare 9 and 4, swap
5 2 8 4 (9 6) 3 --> compare 9 and 6, swap
5 2 8 4 6 (9 3) --> compare 9 and 3, swap
5 2 8 4 6 3 9 --> first iteration complete
The bubble sort got its name because of the way the biggest elements "bubble" to the top. Notice
that in the example above, the largest element, the 9, got swapped all the way into its correct
position at the end of the list. As demonstrated, this happens because in each comparison, the larger
element is always pushed towards its place at the end of the list.
81
Miss gwenzi form 1 notes
In the second iteration, the second-largest element will be bubbled up to its correct place in the
same manner:
(5 2) 8 4 6 3 9 --> compare 5 and 2, swap
2 (5 8) 4 6 3 9 --> compare 2 and 8, no swap
25 (8 4) 6 3 9 --> compare 8 and 4, swap
25 4 (8 6) 3 9 --> compare 8 and 6, swap
25 4 6 (8 3) 9 --> compare 8 and 3, swap
25 4 6 3 8 9 --> no need to compare last two
In the next pass through the list, the 6 would bubble up to its position, then the 5, the 4, the 3, and
finally the 2. Here is a complete trace of the bubble sort algorithm on a ten element data set:
Step-by-step example
Let us take the array of numbers "5 1 4 2 8", and sort the array from lowest number to greatest
number using bubble sort algorithm. In each step, elements written in bold are being compared.
First Pass:
( 51 4 2 8 ) ( 15 4 2 8 ), Here, algorithm compares the first two elements, and swaps them since 5
>1
( 1 54 2 8 ) ( 1 45 2 8 ), It then compares the second and third items and swaps them since 5 > 4
( 1 4 52 8 ) ( 1 4 25 8 ), Swap since 5 > 2
( 1 4 2 58 ) ( 1 4 2 58 ), Now, since these elements are already in order (8 > 5), algorithm does
not swap them.
The algorithm has reached the end of the list of numbers and the largest number, 8, has bubbled to
the top. It now starts again.
Second Pass:
( 14 2 5 8 ) ( 14 2 5 8 ), no swap needed
( 1 42 5 8 ) ( 1 24 5 8 ), Swap since 4 > 2
( 1 2 45 8 ) ( 1 2 45 8 ), no swap needed
( 1 2 4 58 ) ( 1 2 4 58 ), no swap needed
Now, the array is already sorted, but our algorithm does not know if it is completed. The algorithm
needs one whole pass without any swap to know it is sorted.
Third Pass:
( 12 4 5 8 ) ( 12 4 5 8 )
( 1 24 5 8 ) ( 1 24 5 8 )
( 1 2 45 8 ) ( 1 2 45 8 )
( 1 2 4 58 ) ( 1 2 4 58 )
QUICK SORT
The Quick Sort is a recursive algorithm which is very similar to the Merge Sort.
It takes an element in a list and uses that element as a pivot value to divide the whole list into
two parts. This division is done so that one of the parts contains elements less than the pivot.
The other part contains elements that are larger than the pivot.
This process is then repeated recursively on these two resultant parts. When the algorithm
arrives at a single element to be sorted, nothing is done as this single element is "sorted".
82
Miss gwenzi form 1 notes
The role of the pivot value is to assist with splitting the list. The actual position where the pivot
value belongs in the final sorted list, commonly called the split point, will be used to divide the
list for subsequent calls to the quick sort.
Figure 12 shows that 54 will serve as our first pivot value. Since we have looked at this example a
few times already, we know that 54 will eventually end up in the position currently holding 31. The
partition process will happen next. It will find the split point and at the same time move other
items to the appropriate side of the list, either less than or greater than the pivot value.
Partitioning begins by locating two position markers—let’s call them leftmark and rightmark—at
the beginning and end of the remaining items in the list (positions 1 and 8 in Figure 13). The goal of
the partition process is to move items that are on the wrong side with respect to the pivot value
while also converging on the split point.
We begin by incrementing leftmark until we locate a value that is greater than the pivot value. We
then decrement rightmark until we find a value that is less than the pivot value. At this point we
83
Miss gwenzi form 1 notes
have discovered two items that are out of place with respect to the eventual split point. For our
example, this occurs at 93 and 20. Now we can exchange these two items and then repeat the
process again.
At the point where rightmark becomes less than leftmark, we stop. The position of rightmark is
now the split point. The pivot value can be exchanged with the contents of the split point and the
pivot value is now in place (Figure 14). In addition, all the items to the left of the split point are less
than the pivot value, and all the items to the right of the split point are greater than the pivot value.
The list can now be divided at the split point and the quick sort can be invoked recursively on the
two halves.
Figure 14: Completing the Partition Process to Find the Split Point for 54
Quicksort
quick for long lists of numbers
84
Miss gwenzi form 1 notes
The principles of top-down design dictate that a program should be divided into a main module
and its related modules.
Each module should also be divided into sub modules according to software engineering and
programming style.
The division of modules processes until the module consists only of elementary processes that
are intrinsically (basically) understood and cannot be further subdivided.
Top-down algorithm design is a technique for organizing and coding programs in which a
hierarchy of modules is used, and breaking the specification down into simpler and simpler
pieces, each having a single entry and a single exit point, and in which control is passed
downward through the structure without unconditional branches to higher levels of the
structure.
top-down programming tends to generate modules that are based on functionality, usually in
the form of functions or procedures or methods.
In C, the idea of top-down design is done using functions. A C program is made of one or more
functions, one and only one of which must be named main. The execution of the program always
starts and ends with main, but it can call other functions to do special tasks.
PROGRAMMING PARADIGMS
Programming paradigm refers to how a program is written in order to solve a problem.
Programming can be classified into three categories:
Unstructured Programming
Structural Programming
85
Miss gwenzi form 1 notes
Object-Oriented Programming
Unstructured Programming
Unstructured style of programming refers to writing small and simple programs consisting of
only one main program.
All the actions such as inputs, outputs, and processing are done within one program only.
Structural Programming
Using structural programming, a program is broken down into small independent tasks that are
small enough to be understood easily, without having to understand the whole program at once.
Each task has its own functionality and performs a specific part of the actual processing.
These tasks are developed independently, and each task can carry out the specified task on its
own, without the help of any other task.
When these tasks are completed, they are combined together to solve the problem.
Object-Oriented Programming
Object-oriented programming is a style of computer programming, which promotes building of
independent pieces of code that interact with each other.
It allows pieces of programming code to be reused and interchanged between programs.
Object class - collection of characteristics and procedures that an object within the classification can
have or perform
Inheritance - a relationship among classes wherein one class shares the structure and behaviour of
another class
Polymorphism - two or more classes derived from the same base class but with some unique
features of their own
86
Miss gwenzi form 1 notes
Inherited polymorphism - objects of different classes process same message because they inherit it
from common ancestor
Independent polymorphism - different classes use same field or method name for different values
or activities
Syntax Errors
Syntax errors are those that appear while you write code. Visual
Basic checks your code as you type it in the Code Editor window and alerts you if you make a
mistake, such as misspelling a word or using a language element improperly.
Syntax errors are the most common type of errors. You can fix them easily in the coding
environment as soon as they occur.
Note
The Option Explicit statement is one means of avoiding syntax errors. It forces you to declare, in
advance, all the variables to be used in the application. Therefore, when those variables are used in
the code, any typographic errors are caught immediately and can be fixed.
Run-Time Errors
Run-time errors are those that appear only after you compile and run your code.
These involve code that may appear to be correct in that it has no syntax errors, but that will
not execute. For example, you might correctly write a line of code to open a file. But if the file is
corrupted, the application cannot carry out the Open function, and it stops running.
You can fix most run-time errors by rewriting the faulty code, and then recompiling and
rerunning it.
Logic Errors
Logic errors are those that appear once the application is in use.
They are most often unwanted or unexpected results in response to user actions. For example, a
mistyped key or other outside influence might cause your application to stop working within
expected parameters, or altogether.
Logic errors are generally the hardest type to fix, since it is not always clear where they
originate.
FILE ORGANISATION AND DATABASE CONCEPTS
FILE ORGANIZATION
o Serial
o Sequential
o Indexed Sequential
o Direct Access /Random Access
87
Miss gwenzi form 1 notes
A collection of records with no particular sequence
Cannot be used as master but as temporary transaction file
Records are stored in the order they are received. This means that new records are stored at
the end of the file.
The entries were received in the order: Kettlewood, Queens Park, St Mary’s, Wilton High, and
WestOrling.
Note that the key field in this file would be Centre Number (it uniquely identifies each school)
Both disks and tapes can be used to store a file serially.
As with a serial file, both tape and disks can be used to store a file sequentially and access to the
records must take place from the beginning of the file.
Sequential files allow the records to be displayed in the order of the key field – this makes the
process of adding a record slower, but significantly speeds up searches.
All records are stored in some sort of order (ascending, descending, alphabetical).
The order is based on a field in the record. For example a file holding the records of
employeeID, date of birth and address. The employee ID is used and records stored is group
accordingly (ascending/descending).
Can be used with both direct and sequential access.
88
Miss gwenzi form 1 notes
Advantages
Simple file design
Very efficient when most of the records must be processed e.g. Payroll
Very efficient if the data has a natural order
Can be stored on inexpensive devices like magnetic tape.
Disadvantages
Entire file must be processed even if a single record is to be searched.
Transactions have to be sorted before processing
Overall processing is slow
Hashing
Hashing is a calculation that is performed on a primary key in order to calculate the storage
address of a record.
A hashing algorithm will typically divide the primary key by the number of disk blocks that
are available for storage, work out the remainder and add the start address. The answer will
be the storage address of the record.
Example
If a file was to be stored on the first 5000 blocks of a disk then: [disk address] = [primary key] MOD
5000
89
Miss gwenzi form 1 notes
That is, the primary key of each of the records would be divided by 5000 and the remainder would
be the disk address for the record.
This means that a record with primary key of 27102 would be stored at the disk address
calculatedas follows:
27102 MOD 5000= 5 remainder 2102
This means that the disk address for this record will be 2102.
The table shows some other disk addresses calculated using the same hashing algorithm:
Centre Number Centre Name No of Candidates Disk Address
27102 Kettlewood 85 2102
38240 Queens Park 103 3240
64715 St Mary’s 121 4715
30446 Wilton High 156 446
12304 West Orling 105 2304
Advantages
Any record can be directly accessed.
Speed of record processing is very fast.
Up-to-date file because of online updating.
Concurrent processing is possible.
Disadvantages
More complex than sequential
Does not fully use memory locations
More security and backup problems
90
Miss gwenzi form 1 notes
Indexed sequential files are important for applications where data needs to be accessed.....
o sequentially
o Randomly using the index.
An indexed sequential file can only be stored on a random access device e.g. magnetic disc, CD.
The records is stores in some order but there is a second file called the index-file that indicates
where exactly certain key points. Cannot be used with sequential access method.
Advantages
Provides flexibility for users who need both type of accesses with the same file
Faster than sequential
Disadvantages
Extra storage space for the index is required
o Direct/Random Access
o Sequential Access
o Serial Access
Direct Access
In this access method the information/data stored on a device can be accessed randomly and
immediately irrespective to the order it was stored.
The data with this access method is quicker than sequential access. This is also known as
random access method. For example Hard disk, Flash Memory
Direct Access
• Also known as Relative Access
• Fixed length logical records
• No particular order for read and write
• Based on disk model of a file
• File viewed as a numbered sequence of blocks or records
91
Miss gwenzi form 1 notes
Direct Access
• Useful for immediate access to large volumes of data
• Most suitable for database applications
• Easy to read, write and delete a record
Sequential Access
In this access method the information/data stored on a device is accessed in the exact order in
which it was stored.
Sequential access methods are seen in older storage devices such as magnetic tape.
Sequential Access
• Simplest access method
• Information processed in order
• Most common
• Used by editors and compilers
• Based on a tape model of a file
Serial Access
When a serial access medium is being used, the head that reads data from the storage medium
has limited freedom of movement. The only serial access medium is magnetic tape.
To read a particular record/file from a serial access medium, all of the data that comes before
the record/file must be scanned through. The tape head cannot move to a particular record/file
on the tape without reading through all of the other records that come before it.
Because of this it can take a very long time to locate a record/file on a tape and so tapes are only
used for specific applications such as backup and batch processing. For these applications the
speed of locating data is not important and the other advantages of magnetic tapes outweigh
the slow access speed.
92
Miss gwenzi form 1 notes
The main advantage in this type of access is that both direct and sequential access of files is
possible.
DATABASE CONCEPTS
Database: A collection of related information stored in a structured format.
DBMS: Database management system. Is a program which lets you manage information in
databases.
Conceptual data model - describes how data elements in the system are to be grouped
Entity - thing of interest about which data is to be held e.g. student
Attribute - property or characteristic of an entity
Relationship - link or association between entities
Entity-relationship diagram - diagrammatic way of representing the relationship between the
entities in a database
Field: Fields describe a single aspect of each member of a table. A student record, for instance,
might contain a last name field, a first name field, a date of birth field and so on.
Foreign key: A key used in one table to represent the value of a primary key in a related table.
While primary keys must contain unique values, foreign keys may have duplicates. For instance,
if we use student ID as the primary key in a Students table (each student has a unique ID), we
could use student ID as a foreign key in a Courses table: as each student may do more than one
course.
Primary key: A field that uniquely identifies a record in a table.
RDBMS: relational database management system. a program which lets you manage
structured information stored in tables and which can handle databases consisting of multiple
tables.
Record: a record contains all the information about a single ‘member’ of a table, in a students’
table, each student’s details (name, date of birth, contact details, and so on) will be contained in
its own record. Records are also known as tuples in technical relational database parlance.
Relational database: A database consisting of more than one table. In a multi-table database, you
not only need to define the structure of each table, you also need to define the relationships
between each table in order to link those tables correctly.
Report: A form designed to print information from a database (either on the screen, to a file or
directly to the printer).
Table: A single store of related information. A table consists of records, and each record is made
up of a number of fields. Just to totally confuse things, tables are sometimes called relations.
Schema - different levels or views from which a database may be considered
Secondary Key - not unique to each record but may be used to quickly locate a group of
records
93
Miss gwenzi form 1 notes
What makes computerized databases much more popular than paper based or traditional
file approach?
Computerized Paper based/traditional file approach
Can hold vast amount of data Limited by physical storage space available
Very fast to find a specific record Time consuming to manually search through all
of the records
Easy to search for a specific record Difficult to search for a specific record
Can be used to analyse the data Very difficult to analyse the data
Data can be sorted using multiple criteria e.g. Difficult to sort data in more than one criteria
ascending order
Easier to update or amend a record e.g. Changes have to be done manually and data may
customer address after moving house end up untidy
Records are stored safely and they are available Records can be lost or misfiled making it hard to
when needed find them
The database can be kept secure by use of The only security would be locking up the
passwords records
Easy to make a back-up in case of data loss Difficult to make back-up because every page
would have to be rewritten
Databases – Advantages
Data independence - changes to the data structure do not affect the programs that access the
data.
No data duplication.
Data is updated via a single input.
Data consistency - because it is easier to update
Ad hoc enquiries are possible through the use of a query language.
It is easier to control access to the data by the users since data is in one place.
Databases – Disadvantages
Databases are complex systems so they require considerable skills and expertise to design and
manage them.
There will be greater impact if the system fails since every application that uses it is affected.
94
Miss gwenzi form 1 notes
More complex recovery procedures are needed when then the system corrupts.
Larger size than conventional file approach so may require more powerful computer systems.
If the data entered is wrong then all applications see the wrong data!
Lack of security - all data in the database is accessible by all applications
The purpose of the three-level architecture is to separate the user applications and the physical
database. The reasons of this separation are:
o Different users need different views of the same data.
o Users should not have to deal directly with the physical database storage details.
o The DBA should be able to change the database storage structure or storage device without
affecting other user's views and applications.
Figure 2.1 shows the three-level architecture of the database system.
User view 1 User view 2 User view n
External schema
Conceptual schema
Internal schema
Database
95
Miss gwenzi form 1 notes
Describes a part of the database that is relevant to a particular user.
Represent each user’s view according to his or her needs and access rights
It hides the conceptual, internal, and physical details from the user.
It excludes irrelevant data as well as data which the user is not authorized to access.
Internal Level
The internal level is also referred to as physical / storage level.
The internal level describes how the data is stored in the database.
Concerned with file organization and access methods on storage devices
It also describes how the data is actually stored in the database and on the computer hardware.
Database Schema
The database schema provides an overall description of the database structure (not actual data).
There are three types of schema which relate to the 3 Level Database Architecture.
External Schemas or sub schemas relate to the user views. The Conceptual Schema describes all the
types of data that appear in the database and the relationships between data items. Integrity
constraints are also specified in the conceptual schema. The Internal Schema provides definitions
for stored records, methods of representation, data fields, indexes, and hashing schemes etc...
Internal-Conceptual mappings
Enable the DBMS to find records within the database storage medium that correspond to the
logical record in the conceptual schema.
External-Conceptual mappings
Enable the DBMS to match names of data items etc... In the user's view with the parts of the
conceptual schema that correspond to those items.
96
Miss gwenzi form 1 notes
Data Independence
Data Independence means that the higher levels of the database model are designed to be
unaffected by changes to the lower levels (internal and physical). There are two types of Data
Independence.
Advantages of DBMS
Due to the centralised management and control, the database management system (DBMS) has
numerous advantages. Some of these are as follows:
Minimal data redundancy: unnecessary duplication of data is avoided, since views of
different data files are integrated during database design into a single, logical, centralised
structure.
97
Miss gwenzi form 1 notes
Program-data independence: In the database environment, it allows for changes at one level
of the database without affecting other levels. These changes are absorbed by the mappings
between the levels.
Efficient data access: DBMS utilizes a variety of sophisticated techniques to store and retrieve
data efficiently.
Improved data sharing: Since, database system is a centralised repository of data belonging to
the entire organisation it can be shared by all authorized users. Existing application programs
can share the data in the database.
Improved data consistency: Inconsistency (variation) is the outcome to redundancy. So, if the
redundancy is removed or controlled, chances of having inconsistence data is also removed and
controlled.
Improved data integrity: Data integrity means that the data contained in the database is both
accurate and consistent.
Improved security: Database security is the protection of database from unauthorised users.
The database administrator (DBA) ensures that proper access procedure is followed, by
defining user names and passwords to identify people authorised to use the database.
Enforcement of standards: With central control of the database, a DBA defines and enforces
the necessary standards.
Economy of scale: Centralising of the entire organisation’s operational data into one database
results in drastic cost savings.
Balance of conflicting requirements: Knowing the overall requirements of the organisation
the DBA resolves the conflicting requirements of various users and applications.
Improved data accessibility and responsiveness: As a result of integration in database
system, data that crosses departmental boundaries is directly accessible to the end-users.
Increased concurrency: DBMSs manage concurrent (simultaneous) databases access and
prevents the problem of loss of information or loss of integrity.
Reduced program maintenance: The problems of high maintenance effort required in file-
oriented system are reduced in database system.
Improved backup and recovery services: DBMS provides facilities for recovering from
hardware or software failures through its backup and recovery subsystem.
Improved data quality: The database system provides a number of tools and processes to
improve data quality.
Disadvantages of DBMS
In spite of the advantages, the database approach entails involves) some additional costs and risks
that must be recognized and managed when implementing DBMS. The following are the
disadvantages of using DBMS:
Increased complexity: A multi-user DBMS becomes an extremely complex piece of software
due to expected functionality from it.
Requirement of new and specialized manpower: Because of rapid changes in database
technology and organisation’s business needs, the organisation need to hire, train or retrain its
manpower on regular basis to design and implement databases.
Large size of DBMS: The large complexity and wide functionality makes the DBMS an
extremely large piece of software. It occupies many gigabytes of storage disk space and requires
substantial amounts of main memory to run efficiently.
Increased installation and management cost: The large and complex DBMS software has a
high initial cost. It requires trained manpower to install and operate and also has substantial
annual maintenance and support costs.
Additional hardware cost:due to the DBMS’s complexity the hardware need to be upgraded
time and again
Conversion cost: The cost of conversion (both in terms of money and time) from legacy system
98
Miss gwenzi form 1 notes
(old file-oriented and/or older database technology) to modern DBMS environment is very
high.
Need for explicit (precise) backup and recovery: For a centralised shared database to be
accurate and available all times, a comprehensive procedure is required to be developed and
used for providing backup copies of data and for restoring a database when damage occurs.
Organisational conflict: A centralised and shared database requires a consensus on data
definitions and ownership as well as responsibilities for accurate data maintenance. Sometimes
there are conflicts on data definitions, data formats and coding, rights to update shared data,
and associated issues, which are frequent and often difficult to resolve.
Data Dictionary:
Is that part of the database that holds data about the database?
It is an important part of the DBMSit contains data about data (or metadata). It means that data
dictionary contains the actual database descriptions managed by the DBMS.
Data dictionary is automatically updated as data is inserted and updated with the passage of
time.
A table is given below, which shows the description of a table structure of database.
Field Size Type Value Range or Value Used In Tables
Format
Roll-No 2 Integer 1 - 99 Student,
Defaulters
Name 15 Character a - z, A - Z Student,
Defaulters
Class 3 Character A-Z Student,
Defaulters
Date-of- 8 Date MM, DD, YYYY Student
Birth
The sub-language is further divided into two major parts. These are:
o Data Definition Language.
o Data Manipulation Language.
99
Miss gwenzi form 1 notes
The mappings between the two schemas may be defined in this language.
The DBMS has a DDL compiler, which compiles the DDL statements and stores it in the DBMS
catalog known as data dictionary.
There are two main types of Data Manipulation Language (DML) These are:
o Non-Procedural DML
o Procedural DML
Non-Procedural DML:
A high-level or non-procedural DML allows the user to specify what data is required without
specifying how it is to be obtained.
The end-users use a high-level query language to specify their requests to DBMS to retrieve
data.
The part of a non-procedural DML, which is related to data retrieval from databases, is known
as Query Language.
Procedural DML:
A low-level or procedural DML allows the user, i.e. programmer to specify what data is needed
and how to obtain-it.
This type of DML typically retrieves individual records from the database and processes each
separately.
100
Miss gwenzi form 1 notes
o SQL can create views in a database
o SQL can set permissions on tables, procedures, and views
DATA MODELS:
A model is an abstract of a real system
A data model (or database model) is a collection of concepts that can be used to describe the
structure of a database. It means that the data types, relationships between data, and
constraints that should hold on the data are described.
The purpose of a data model is to represent data and to make the data understandable. By using
the data model, you can easily design a database.
101
Miss gwenzi form 1 notes
102
Miss gwenzi form 1 notes
Cardinality of Relationship
While creating relationship between two entities, we may often need to face the cardinality
problem. This simply means that how many entities of the first set are related to how many entities
of the second set. Cardinality can be of the following three types.
One-to-One
Only one entity of the first set is related to only one entity of the second set.
E.g. A teacher teaches a student. Only one teacher is teaching only one student. This can be
expressed in the following diagram as:
One-to-Many
Only one entity of the first set is related to multiple entities of the second set.
E.g. A teacher teaches students. Only one teacher is teaching many students. This can be
expressed in the following diagram as:
Many-to-One
Multiple entities of the first set are related to multiple entities of the second set.
E.g. Teachers teach a student. Many teachers are teaching only one student. This can be
expressed in the following diagram as:
Many-to-Many
Multiple entities of the first set is related to multiple entities of the second set.
E.g. Teachers teach students. In any school or college many teachers are teaching many students.
This can be considered as a two way one-to-many relationship. This can be expressed in the
following diagram as:
103
Miss gwenzi form 1 notes
3. Provide a precise and appropriate name for each entity, attribute, and relationship in the
diagram. Terms that are simple and familiar always beats vague, technical-sounding words. In
naming entities, remember to use singular nouns. However, adjectives may be used to
distinguish entities belonging to the same class (part-time employee and full time employee, for
example). Meanwhile attribute names must be meaningful, unique, system-independent, and
easily understandable.
4. Remove vague, redundant or unnecessary relationships between entities.
5. Never connect a relationship to another relationship.
6. Make effective use of colors. You can use colors to classify similar entities or to highlight key
areas in your diagrams.
ER Diagram Templates
Below are some ER diagram templates so you can get started quickly. Clicking on the image and in
the new page that opens click the “Use as Template” button.
Benefits of ER diagrams
ER diagrams constitute a very useful framework for creating and manipulating databases.
First, ER diagrams are easy to understand and do not require a person to undergo extensive
training to be able to work with it efficiently and accurately. This means that designers can use
ER diagrams to easily communicate with developers, customers, and end users, regardless of
their IT proficiency.
Second, ER diagrams are readily translatable into relational tables which can be used to quickly
build databases. In addition, ER diagrams can directly be used by database developers as the
blueprint for implementing data in specific software applications.
Lastly, ER diagrams may be applied in other contexts such as describing the different
relationships and operations within an organization.
104
Miss gwenzi form 1 notes
Database Security Threats and Countermeasures
Databases need to have level of security in order to protect the database against both malicious
and accidental threats.
A threat is any type of situation that will adversely affect the database system. Some factors that
drive the need for security are as follows:
o Theft and fraud
o Confidentiality
o Integrity
o Privacy
o Database availability
Threats to database security can come from many sources. People are a substantial source of
database threats. Different types of people can pose different threats.
Users can gain unauthorised access through the use of another person's account. Some users
may act as hackers and/or create viruses to adversely affect the performance of the system.
Programmers can also pose similar threats.
The Database Administrator can also cause problems by not imposing an adequate security
policy.
Threats can exist over the communication networks that an organisation uses. Techniques such as
wire tapping, cable disruption (cutting / disconnecting), and electronic interference can all be used
to disrupt services or reveal private information.
Countermeasures
Some countermeasures that can be employed are outlined below:
o Access Controls (can be Discretionary or Mandatory)
o Authorisation (granting legitimate access rights)
o Authentication (determining whether a user is who they claim to be)
o Backup
o Journaling (maintaining a log file - enables easy recovery of changes)
o Encryption (encoding data using an encryption algorithm)
o RAID (Redundant Array of Independent Disks - protects against data loss due to disk
failure)
o Polyinstantiation (data objects that appear to have different values to users with different
access rights / clearance)
o Views (virtual relations which can limit the data viewable by certain users)
Distributed data processing system:
Is a configuration in which many geographically dispersed computer systems are connected by
a telecommunication network, where messages, tasks, programs, data, and other resources are
transmitted between cooperating processors and terminals.
Such an arrangement enables the sharing of many hardware and significant software resources
among several users who may be sitting far away from each other.
105
Miss gwenzi form 1 notes
Advantages:
It allows greater flexibility in placing true computer power at the location where it is needed.
Better computers resources are easily available to the end users.
It facilitates quick and better access to data and information especially where distance is a
major factor.
The availability of multiple processors in the network permits peak load sharing and provides
backup facilities in the event of equipment failure.
User with access to nearby computer and databases may be able to react more rapidly.
Disadvantages:
There are lack of proper security controls for protecting the confidential user programs that are
stored online and transmitted over network channels.
Due to lack of adequate computing standard, it is not possible to link different equipment
produced by different vendors into a smoothly functioning network.
Due to decentralization of resource at remote sites, management from central control point
becomes very difficult. This normally result in increased complexity.
System reliability, flexibility, response time, vendor support, and the cost of
telecommunications facilities used, are some of the important factors that may disappoint
network users in some cases.
Budget (availability of finance purchase equipment)
106
Miss gwenzi form 1 notes
Real-Time Processing/ Online Processing/ Interactive Processing:
Each transaction is processed as soon as at it received, there is no waiting time for
accumulation of a batch of transactions.
Complete which can receive and process data quickly are capable for real-time processing. It is
used where immediate response is required like, banks, inventory systems, etc
Online processing
Advantages Disadvantages
A higher level of customer The system is relatively high-
satisfaction is achieved cost (in terms of hardware and
Information needed is obtained software)
by adopting very simple A high level of security is
procedures required
Prompts and early information System failure could causes
assists in improving and great organization problems
maintaining the quality of
management decisions
Overflow - when a number is too large for the exponent to be expressed (positive exponent)
Underflow - when a number is too near zero for the exponent to be expressed (negative exponent)
COMPUTER LANGUAGES:
Since the invention of the computers, three types of computer language have evolved:
Machine language
Assembly language (Low Level Language) and
High-level languages
107
Miss gwenzi form 1 notes
Basic instruction set of the computer consists of add, subtract, multiply, divide, load, store, read,
write, and shift. Although machine language provides economy of instructions but they are
inconvenient to the user. They also require thorough knowledge of computer hardware.
Assembly language:
In assembly language, instructions, data and addresses are given in “mnemonics”, symbols and
labels that are readily understood by the human brain.
This language uses symbolic codes for different operations.
Assembly language can be translated into a machine language. A program which performs this
translation is called an “Assembler”.
Machine and assembly languages, being machine dependent languages, they are called “low-
level “languages.
108
Miss gwenzi form 1 notes
Machine and assembly languages, being machine dependent languages, they are called “low-
level “languages.
In other words, the computer manufacturers started providing English-like words abbreviated
as mnemonics (a technique of improving the memory) that are similar to binary instructions in
machine languages. The program is in alphanumeric symbols instead of 1s and 0s. The ADD,
SUB, MUL, and DIV are some symbols called mnemonics.
The programs written in other than the machine language need to be converted to the machine
language. Translators are needed for conversion from one language to another. Assemblers are
used to convert assembly language program to machine language
109
Miss gwenzi form 1 notes
The computer cannot directly understand a high-level language. It is translated into machine
language before it is executed by the computer. A set of programs used for translation is called a
“compiler” and “interpreter”.
These languages are employed for easy and speedy development of a program.
The programmer does not need to remember the architecture and registers of a CPU for
developing a program.
Testing and debugging a program is easier than in the assembly language.
110
Miss gwenzi form 1 notes
It is difficult to write computer program directly in machine code. The source code cannot be
executed directly by the computer.
Every language has its own language processor (or translator). Therefore, language processor is
defined as: The special translator system software that is used to translate the program written
in high-level language (or Assembly language) into machine code
The language processors are divided into three types.
Compiler
Is a language processor that translates a complete source program as a whole into machine
code before execution?
The C and C++ compilers are best examples of compilers.
The program translated into machine code is called the object program.
The source code is translated to object code successfully if it is free of errors.
If there are any errors in the source code, the compiler specifies the errors at the end of
compilation. The errors must be removed before the compiler can successfully compile the
source code.
The object program can be executed a number of times without translating it again.
Interpreter
Is the language processor that translates (converts) each statement of source program into
machine code and executes it immediately before it translates the next statement
Interpreter reads the program line by line, whereas in compiler the entire program is read by
the compiler, which then generates the object codes
If there is an error in the statement the interpreter terminates its translating process at that
statement and displays an error message.
The OWBASIC is an example of interpreter.
The Interpreter differs from compiler that translates the entire source program into object
program before execution.
The main advantage of Interpreter is that it makes easy to trace out and correct errors in the
source program.
It is a time consuming process of translating and executing statements one by one.
Assembler
It is used to translate the program written in Assembly language into machine code.
An assembler performs the translation process in similar way as compiler. But assembler is the
translator program for low-level programming language, while a compiler is the translator
program for high-level programming languages.
111
Miss gwenzi form 1 notes
Source Code:
1. Source Code is in the form of Text.
2. Source Code is Human Readable.
3. Source Code is generated by Human.
4. Source Code is Input Given to Compiler.
Object Code:
1. Object Code is in the form of Binary Numbers.
2. Object Code is in Machine Readable.
3. Object Code is generated by Compiler.
4. Object code is Output of Compiler.
The problem with using a compiler is that it uses a lot of computer resources
When an error in a program occurs it is difficult to pin point its source in the original program
Compilation stages
Whether a compiler or interpreter is used, the translation from a high level language to machine
code has to go through various stages and these are shown below:
Source Program
Lexical Analysis
Syntax Analysis
Semantic
Analysis
112
Intermediate
Language
Miss gwenzi form 1 notes
Lexical Analysis
Aka "linear analysis", "scanning"
The first stage of processing a language where stream of characters making up the source
program is read one at a time and grouped into lexemes (or "tokens") - word-like pieces such as
keywords, identifiers, literals and punctuation.
The lexemes are then passed to the parser (to analyze (a string of characters) in order to
associate groups of characters with the syntactic units of the underlying grammar.)
Compiler:
Compiler takes high level human readable program as input and convert it into the lower level
code.
This conversion takes place using different phases.
1. Analysis Phase :
Lexical analysis
Syntax analysis
Semantic analysis
113
Miss gwenzi form 1 notes
4. Different Lexical Classes or Tokens or Lexemes
o Identifiers
o Constants
o Keywords
o Operators
5. Example : sum = num1 + num2 ;
Syntax Analysis:
1. It is Second Phase of Compiler after Lexical Analyzer
2. It is also called Hierarchical Analysis or Parsing.
3. It Groups Tokens of source Program into Grammatical Production
4. In Short Syntax Analysis Generates Parse Tree
114
Miss gwenzi form 1 notes
Now Consider above C Programming statement. In this statement we Syntax Analyzer will create a
parse tree from the tokens.
Syntax Analyzer will check only Syntax not the meaning of Statement
115
Miss gwenzi form 1 notes
Reverse Polish notation (RPN)
Is a mathematical notation in which every operator follows all of its operands, in contrast to
Polish notation, which puts the operator in the prefix position?
It is also known as postfix notation and is parenthesis-free as long as operator arities are fixed.
During the 1970s and 1980s, RPN was known to many calculator users, as it was used in some
handheld calculators of the time designed for advanced users: for example, the HP-10C series
calculators.
In computer science, postfix notation is often used in stack-based and concatenative
programming languages. It is also common in dataflow and pipeline-based systems, including
Unix pipelines.
In reverse Polish notation the operators follow their operands; for instance, to add 3 and 4, one
would write "3 4 +" rather than "3 + 4". If there are multiple operations, the operator is given
immediately after its second operand; so the expression written "3 − 4 + 5" in conventional
notation would be written "3 4 − 5 +" in RPN: first subtract 4 from 3, then add 5 to that.
An advantage of RPN is that it obviates the need for parentheses that are required by infix.
While "3 − 4 * 5" can also be written "3 − (4 * 5)", that means something quite different from
"(3 − 4) * 5".
In postfix, the former could be written "3 4 5 * −", which unambiguously means "3 (4 5 *) −"
which reduces to "3 20 −"; the latter could be written "3 4 - 5 *" (or 5 3 4 - *, if you wish to keep
similar formatting), which unambiguously means "(3 4 -) 5 *".
Despite the name, reverse Polish notation is not exactly the reverse of Polish notation, for the
operands of non-commutative operations are still written in the conventional order (e.g. "/ 6 3"
in Polish notation and "6 3 /" in reverse Polish both evaluating to 2, whereas "3 6 /" in reverse
Polish notation would evaluate to ½).
In comparison testing of reverse Polish notation with algebraic notation, reverse Polish has
been found to lead to faster calculations, for two reasons. Because reverse Polish calculators do
not need expressions to be parenthesized, fewer operations need to be entered to perform
typical calculations. Additionally, users of reverse Polish calculators made fewer mistakes than
for other types of calculator.
Later research clarified that the increased speed from reverse Polish notation may be attributed
to the smaller number of keystrokes needed to enter this notation, rather than to a smaller
cognitive load on its users.
However, anecdotal evidence suggests that reverse Polish notation is more difficult for users to
learn than algebraic notation.
Example
The infix expression "5 + ((1 + 2) * 4) − 3" can be written down like this in RPN:
512+4*+3-
The expression is evaluated left-to-right, with the inputs interpreted as shown in the following table
(the Stack is the list of values the algorithm is "keeping track of" after the Operation given in the
middle column has taken place):
116
Miss gwenzi form 1 notes
2 Push value 2
1
5
+ Add 3 Pop two values (1, 2) and push result (3)
5
4 Push value 4
3
5
* Multiply 12 Pop two values (3, 4) and push result (12)
5
+ Add 17 Pop two values (5, 12) and push result (17)
3 Push value 3
17
− Subtract 14 Pop two values (17, 3) and push result (14)
Result (14)
When a computation is finished, its result remains as the top (and only) value in the stack; in
this case, 14.
The above example could be rewritten by following the "chain calculation" method described by
HP for their series of RPN calculators
As was demonstrated in the Algebraic mode, it is usually easier (fewer keystrokes) in working a
problem like this to begin with the arithmetic operations inside the parentheses first.
12+4*5+3−
Code generators
code generation is the process by which a compiler's code generator converts some
intermediate representation of source code into a form (e.g., machine code) that can be readily
executed by a machine.
run time support routines
ARCHITECTURE
The way in which various components of the computer system are connected with one another
is called computer architecture.
It was named after the mathematician and early computer scientist John Von Neumann.
Its design is simpler than that of Harvard architecture
This has one shared memory for instructions (program) data with one data bus and one
address bus between CPU and memory
Instructions and data have to be fetched in sequential order (known as the Von Neumann
Bottleneck), limiting the operation bandwidth (instructions are fetched and executed one at a
time in a serial manner)
It is mostly used to interface to external memory
117
Miss gwenzi form 1 notes
Processor needs two clock cycles to complete an instruction. Pipelining the instructions is not
possible with this architecture.
In the first clock cycle the processor gets the instruction from memory and decodes it. In the
next clock cycle the required data is taken from memory. For each instruction this cycle repeats
Harvard Architecture:
The name is originated from "Harvard Mark I" a relay based old computer.
The computer has two separate memories for storing data and program with dedicated buses
for each of them.
Instructions and operands can be fetched simultaneously
Processor can complete an instruction in one cycle if appropriate pipelining strategies are
implemented.
In the first stage of pipeline the instruction to be executed can be taken from program memory.
In the second stage of pipeline data is taken from the data memory using the decoded
instruction or address.
Most of the modern computing architectures are based on Harvard architecture. But the
number of stages in the pipeline varies from system to system.
Two separate memory systems can perform better, but would be difficult to implement.
Pipelining
A pipeline is a set of data processing elements connected in series, so that the output of one
element is the input of the next one.
The elements of a pipeline are often executed in parallel or in time-sliced fashion; in that case,
some amount of buffer storage is often inserted between elements.
Pipelining is an implementation technique where multiple instructions are overlapped in
execution.
The computer pipeline is divided in stages. Each stage completes a part of an instruction in
parallel. The stages are connected one to the next to form a pipe - instructions enter at one end,
progress through the stages, and exit at the other end.
118
Miss gwenzi form 1 notes
Pipelining does not decrease the time for individual instruction execution. Instead, it increases
instruction throughput. The throughput of the instruction pipeline is determined by how often
an instruction exits the pipeline.
Because the pipe stages are hooked together, all the stages must be ready to proceed at the
same time. We call the time required to move an instruction one step further in the pipeline a
machine cycle. The length of the machine cycle is determined by the time required for the
slowest pipe stage.
Pipeline categories
Linear and non-linear pipelines
A linear pipeline processor is a series of processing stages which are arranged linearly to
perform a specific function over a data stream. The basic usages of linear pipeline are
instruction execution, arithmetic computation and memory access.
A non-linear pipeline (also called dynamic pipeline) can be configured to perform various
functions at different times. In a dynamic pipeline there is also feed forward or feedback
connection.
Buses
are circuits or highways used transmit data and instructions between system components
A system bus is a set of parallel wires connecting two or more components of the computer
The CPU is connected to the main memory by three separate buses. When the CPU wishes to
access a particular memory location, it sends this address to memory on the address bus. The
data in that location is returned to the CPU on the data bus. Control signals are sent along the
control bus
Every bus has a clock speed measured in MHz. A fast bus allows data to be transferred faster,
which makes applicationsrun faster. On PCs, the old ISA bus is being replaced by faster buses
such as PCI.
Computer buses are divided into three categories:
Address bus
Data bus
Control bus
Data and control signals travel in both directions between the processor, memory and I/O
controllers. Addresses on the other hand, travel only one way along the address bus. The
processor sends the address of an instruction, or of data to be stored or retrieved, to memory or
to an I/O controller as shown below.
119
Miss gwenzi form 1 notes
Address bus
Carries the location (address) the data is sent from, and the address it is going to
Each part of the system is numbered. We call this number the address. The address bus carries
addresses, i.e. it carries a number that identifies a particular part of the system. Most addresses
apply to memory locations but it is also possible to have address for interface.
The number of wires in an address bus determines the amount of memory that can be used in
the system
When a processor wishes to read a word (say 8, 16 or 32bits) of data from memory, it first puts
the address of the desired word on the address bus
The width of the address bus determines the maximum possible memory capacity of the
system. e.g. if the address bus consisted of only 8 lines, then the maximum address it could
transmit would be (in binary) 11111111 or 255 – giving a maximum memory capacity of 256
(including address 0)-28.
The address bus is also used to address I/O ports during input/output operations
It is unidirectional
Used to specify a physical memory address/location. This can include primary memory (e.g.
RAM and ROM) secondary memory (e.g. hard disk drives) and any other connected devices.
Monitors, printers, scanners, and keyboards will all be mapped to memory.
The width of the address bus determines the amount of memory that can be addressed. A 32-bit
bus can address 4,294,967,296 (2 ^ 32) bytes of memory. This explains the 4 GB memory
restriction on 32-bit operating systems.
Data bus
Carries the data to and from the processor
This is used to transfer data from one device to another. Each wire in the bus transfer one
binary digit (bit), so the number of wires determines the amount of data that can be transferred
at one time.
Is a bi-directional path for moving data and instructions between system components?
The width of the data bus determine overall system performance
It connects the microprocessor (CPU) with other devices mapped onto the system. This is often
described pictorially using a memory map.
Unlike the address bus, the data bus is two-way (it supports read and write operations).
The data bus is not limited to transferring data; it is also used to transfer program instructions.
Control bus
120
Miss gwenzi form 1 notes
Sends instructions ( control signals) from the Control Unit to processor to allow
synchronization of commands
The physical connection that carry control information between the CPU and other devices
within the computer
Carries signals that control the operation of each device. There will be a clock signal to provide
synchronization (management).
There will be control signals that command the memory to read or write to ensure that the
system operate successfully.
Is a bi-directional bus meaning that signal can be carried in both directions
Ensure access to and use of the data and address buses by the different component of the
system does not lead to conflict.
The purpose of the control bus is to transmit command, timing and specific status information
between system components
Carries commands from and returns status signals to the microprocessor.
The control unit inside a CPU manages the internal control bus and the external control bus.
Some control signals are Read, Write and Op code fetch etc. Various operations are performed
by microprocessor with the help of control bus.
This is a dedicated bus, because all timing signals are generated according to control signal.
Fetching:
The control unit fetches (gets) the instruction from the memory.
The fetched instruction is placed in the Instruction Register.
For this to happen the CPU makes use of a vital hardware path called the address bus
Data from this address then moves from main memory into the CPU by travelling along another
hardware path called the data bus
Program Counter holds the address of next instruction to be fetched and is incremented after
each fetch.
Decoding:
121
Miss gwenzi form 1 notes
The control unit decode the instructions (decides what it means) and directs the necessary data
moved from memory to the arithmetic logic unit.
These first two steps together are called instruction time, or I-time.
The instruction that is fetched is broken down into parts or decoded.
The next step is for the CPU to make sense of the instruction it has just fetched
Decides what the instruction means
The instruction is translated into commands so that they correspond to those in the CPU’s
instruction set
Executing:
The decoded instruction or the command is executed.
This is part of the cycle when data processing actually takes place
The ALU performs the operation implied by the program instruction. For example, if it is an
ADD instruction, addition is performed.
The instruction is carried out upon the data. The result of this processing is stored in yet
another register
Storing
CPU writes back the results of execution, to the computer’s memory. The arithmetic logic unit
stores the result of this operation in memory or in a register.
Step c and d together are called execution time, or E-time.
The control unit eventually directs memory to release the result to an output device or a
secondary storage device.
The combination of I-time and E-time is called the machine cycle.
122
Miss gwenzi form 1 notes
The program counter copies its contents into the memory address register. The memory
address register then sends the address along the address bus to main memory and the
contents of the memory location specified by the address are sent along the data bus to the
memory buffer register.
The contents of the memory buffer register are then copied to the current instruction register
where they are decoded and executed.
Fetch Phase
1. The address of the next instruction to be executed is copied from the SCR to the MAR
2. The instruction held at that address is copied to the MDR
3. Simultaneously the contents of the SCR is incremented so that it holds the address of the next
instruction
4. The contents of the MDR are copied to the CIR
Execute Phase
5. The instruction held in the CIR is decoded
6. The instruction is executed
Memory mapping
A technique whereby computer peripherals may be addressed as though they formed part of
the main memory of the computer
A memory map is a structure of data (which usually resides in memory itself) that indicates
how memory is laid out.
A memory map is a massive table, in effect a database that comprises complete information
about how the memory is structured in a computer system. A memory map works something
like a gigantic / massive office organizer.
In the map, each computer file has a unique memory address reserved especially for it, so that
no other data can accidentally overwrite or corrupt it.
In order for a computer to function properly, its OS (operating system) must always be able to
access the right parts of its memory at the right times.
When a computer first boots up (starts), the memory map tells the OS how much memory is
available. As the computer runs, the memory map ensures that data is always written to, and
read from, the proper places. The memory map also ensures that the computer's debuggers can
resolve memory addresses to actual stored data.
If there were no memory map, or if an existing memory map got corrupted, the OS might (and
probably would) write data to, and read data from, the wrong places. As a result, when data was
read, it would not always pertain to the appropriate files or application programs.
The problem would likely start out small and unnoticeable, worsen with time, and become
apparent only after considerable damage had been done to stored data and programs. In the
end, some or all of the applications would fail to run, and many critical data files would be
ruined.
Interrupts
123
Miss gwenzi form 1 notes
Is a signal from a device or source seeking the attention of the processor
When an interrupt occurs, the OS saves the state of the interrupted process and passes control
to the appropriate routine
The interrupt signal is sent along a control bus to the processor, and the currently executing
program is suspended while control is passed to an interrupt service routine.
Types of interrupt
o generated by running process - e.g. process may need to perform I/O
o I/O interrupts - generated by I/O hardware to signal to CPU that status of a channel or device
has changed
o external interrupts - e.g. expiry of time-slice
o restart interrupts - when operator presses restart button
o program check interrupts - e.g. division by zero
o machine check interrupts - caused by malfunctioning/faulty hardware
An operating system usually has some code that is called an interrupt handler. The interrupt
handler prioritizes the interrupts and saves them in a queue if more than one is waiting to be
handled.
The operating system has another little program, sometimes called a scheduler , which figures
out which program to give control to next.
In general, there are hardware interrupts and software interrupts. A hardware interrupt occurs,
for example, when an I/O operation is completed such as reading some data into the computer
from a tape drive. A software interrupt occurs when an application program terminates or
requests certain services from the operating system
124
Miss gwenzi form 1 notes
o Indirect
o Immediate
o Indexed
o Relative
Immediate addressing
Means that the data to be used is hard coded into the instruction itself
This is the simplest and fastest method of addressing as it does not involve main memory at all
For example, if you want to add 2 to the content of accumulator, the instruction is:
ADC 2
Nothing has been fetched from memory; the instruction simply adds 2 to the accumulator
immediately
Immediate addressing is very useful carry out instructions involving constants (as opposed to
variables). For example you might want to use PI as a constant 3.14 within your code.
The data is located within the operands of the instruction itself, not in a separate memory
location.
This is the least flexible of the addressing modes to execute and is the least used of the five in
practice.
Direct addressing
For direct addressing, the operands of the instruction contain the memory address where the
data required for execution is stored.
For the instruction to be processed the required data must be first fetched from that location.
Indirect addressing
When using indirect addressing, the operands give a location in memory similarly to direct
addressing.
However, rather than the data at this location, there is instead another memory address given
where the data actually is located.
This is the most flexible of the modes, but also the slowest as two data lookups are required.
125
Miss gwenzi form 1 notes
The number of locations which can be addressed using direct addressing is limited because only
say, 10 out of 16 bits are available to hold the address, and often more than one word is used to
for holding the address.
This type of instruction is slow, for locating the data it involves 3 or maybe 4 memory
operations, 3 to load the 3-byte instruction and then another to go and get the data to be
operated on.
Indexed addressing – this is a variation on indirect addressing, where the operand address is
calculated by adding to a base address the value held in an index register. Using this mode of
addressing, the address of the operand can be modified by operating on the contents of the index
register.
For example, suppose we wish to set to set to zero the contents of TABLE to TABLE + 99. Using
an index register X, the following instruction can be used:
LDA #0 ; load 0 into the accumulator
LDX #0 ; load 0 into the index register
LOOP STA TABLE (X); store contents of accumulator in TABLE + X
INX ; increment the index register
CPX #99 ; compare X with 99
BNE LOOP ; branch if not equal to LOOP
Relative addressing – this type of addressing is often used branch instructions to specify where
the next instruction is located relative to the instruction whose address is held in the PC. An
example is:
JMP +10 ; branch to the instruction 10 bytes on
A ‘jump relative’ with a one-byte operand can only jump forwards or backwards 127 bytes. Relative
jumps allow the code to be re-locatable anywhere in memory.
Registers
126
Miss gwenzi form 1 notes
A register is a small area of memory, within the processor itself, where data or control
information is temporarily stored. Registers are used because transferring data to and from a
register is much quicker than transferring the data between the processor and main memory.
These are used to store data and instructions during program execution. The size of the register
is 2 or 4 or 8 bytes or more.
Is a special storage location in the CPU circuitry used to hold information temporarily while it is
being decoded or manipulated
A series of special on-chip memory that monitor, store binary data and control the information
being Fetched & Executed
PC - Program Counter:
Holds the address of the next instruction to be executed. It is also known as the sequence
control register (SCR) or the sequence register
Determines the sequence in which the program instructions are executed
It ensures that the CPU always knows where it has reached and is able to resume at the correct
point following the execution of an instruction
127
Miss gwenzi form 1 notes
The flag register is specially designed to contain all the appropriate 1-bit status flags, which are
changed as a result of operations involving the arithmetic and logic unit.
It contains 'bits' that are set or cleared based on the result of an instruction. (also known as
Program Status Words or PSWs)
Status registers also contain information about interrupts
This is used to hold the current instruction in the processor while it is being decoded and
executed, in order for the speed of the whole execution process to be reduced.
This is because the time needed to access the instruction register is much less than continual
checking of the memory location itself.
Index register
Is a special register used to adjust the address part of an instruction
Logic Gates
Logic gateA relatively simple, digital, electronic circuit that processes two-state signals
according to a logicalrule. It has one or more inputs and a single output.
Binary information is represented using signals in two states off or on which correspond to 0 or
1, respectively.
The manipulation/treatment of the binary information is done using logic gates.
Logic gates are the hardware electronic circuits which operate on the input signals to produce
the output signals.
Each logic gate has a unique symbol and its operation is described using algebraic expression.
For each gate, the truth table shows the output that will be outputted for the different possible
combinations of the input signal.
Most logic gates have two inputs and one output.
At any given moment, every terminal is in one of the two binary conditions low (0) or high (1),
represented by different voltage levels.
In most logic gates, the low state is approximately zero volts (0 V), while the high state is
approximately five volts positive (+5 V).
There are seven basic logic gates: AND, OR, XOR, NOT, NAND, NOR, and XNOR.
Logic gates process signals which represent true or false. Normally, the positive supply voltage
+5V represent true and 0V represents false.
Other terms which are used for the true and false states are shown in the table. It is best to be
familiar with them all.
128
Miss gwenzi form 1 notes
Logic
States
True False
1 0
High Low
On Off
+5V 0V
NB: Gates are identified by their function: AND, OR, NOT, NAND, NOR, EX-OR and EX-NOR. Capital
letters are normally used to make it clear that the term refers to a logic gate.
The above said logic gates can be classified into following categories:
1. Basic Logic Gates
a. AND Gate
b. OR Gate
c. NOT Gate
2. Universal Gates
a. NAND Gate
b. NOR Gate
3. Combinational Gates
a. X-OR Gate
b. X-NOR Gate
The basic operations are described below with the aid of truth tables.
OR Gate
If at least one of the inputs is high the output is high
A plus (+) is used to show the OR operation.
NOT gate
129
Miss gwenzi form 1 notes
If the input is high the output is lowor if the input is low the output is high It is also known
as an inverter. If the input variable is A the inverted output is known as NOT A. This is also
shown as A', or A with a bar over the top, as shown at the outputs.
Universal Gates
NAND Gate
This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate. The outputs of all
NAND gates are high if any of the inputs are low. The symbol is an AND gate with a small circle on
the output. The small circle represents inversion.
**If at least one of the inputs is low then the output is high
NOR Gate
This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate. The outputs of all NOR
gates are low if any of the inputs are high. The symbol is an OR gate with a small circle on the
output. The small circle represents inversion.
**If all the inputs are not equal then the output is high
X-NOR Gate
The 'Exclusive-NOR' gate circuit does the opposite to the X-OR gate. It will give a low output if
either, but not both, of its two inputs are high. The symbol is an X-OR gate with a small circle on
the output. The small circle represents inversion.
130
Miss gwenzi form 1 notes
**If all the inputs are equal then the output is high
Table 2 is a summary truth table of the input/output combinations for the NOT gate together with
all possible input/output combinations for the other gate functions.
131
Miss gwenzi form 1 notes
132
Miss gwenzi form 1 notes
133
Miss gwenzi form 1 notes
134
Miss gwenzi form 1 notes
135
Miss gwenzi form 1 notes
136
Miss gwenzi form 1 notes
137
Miss gwenzi form 1 notes
138
Miss gwenzi form 1 notes
139