0% found this document useful (0 votes)
40 views95 pages

ICT Notes 2020

ICT concepts

Uploaded by

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

ICT Notes 2020

ICT concepts

Uploaded by

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

Advanced Level Information and Communication Technologies

I. THE RANGE AND SCOPE OF COMPUTERS 1.4. Supercomputers


Supercomputers are the fastest and most expensive type of computers. They can perform
Introduction hundreds of millions of computations per second and are employed for specialized
Calculations have always been part of man's life. Simpler calculations take less time but applications that require immense amounts of mathematical calculations. Weather
complex calculations take much longer time. With the idea of developing a machine which forecasting, scientific simulations, nuclear energy research, electronic design, and analysis
could perform complex calculations faster and with full accuracy, man invented the of geological data all require supercomputers. Examples of supercomputers are Fujitsu K
‘computer’. Computer is derived from the word “compute” which means “calculate” computer, IBM Blue Gene, Cray Jaguar and NEC Earth Simulator.
meaning that a computer is simply a calculating machine.
2. Generations of Computers
Definition:A computer is an electronic device that can accept, store, and process data to Computers of specific electronic era are often referred to as a generation. Each generation
produce information. is characterized by a major technological development that fundamentally changed the way
It can also be defined as a machine that can take instructions and perform computations computers operate, resulting in increasingly smaller, cheaper, more powerful and more
based on those instructions. efficient and reliable devices.

Computers range from very small to very large machines with some capable of doing Definition: A computer generation is an era or period in the history of computers in which the
millions of calculations in a single second, while others may take long periods of time to do computer was characterized by a major technological development that fundamentally
even the most simple calculations. changed the way computers operate.

1. Classification of Computers 2.1. First Generation (1945-1955)


Computers can be classified into five categories, on the basis of their size and capabilities. First generation computers were made using vacuum tubes. A vacuum tube was a fragile
The size of the computer may refer to multiple factors like, size of the memory, number of glass device that could control and amplify electronic signals. These computers were very
terminals that can be connected to the computer, storage capacity of the hard disk and the large taking up entire rooms, very expensive to operate and in addition to using a great
type of processor used in the computer. These categories are supercomputers, mainframe deal of electricity, generated a lot of heat, which was often the cause of malfunctions.
computers, minicomputers and microcomputers. First generation computers relied on machine language, the lowest-level programming
language understood by computers, to perform operations, and they could only solve one
1.1. Microcomputers problem at a time. Input was based on punched cards and paper tape, and output was
Microcomputers are the smallest category of computers that range in size from servers to displayed on printouts.
handheld devices. They are the type of computers meant for public use. They are designed Some examples of first generation computers are ENIAC (Electronic Numerical Integrator
to be used by one person at a time. Microcomputers, also called personal computers (PC), AndCalculator), EDSAC (Electronic Delay Storage Automatic Calculator) and UNIVAC I
can be further classified into desktop computers, laptop computers. Tablet PCs and (Universal Automatic Computer I).
personal digital assistants (PDAs).
2.2. Second Generation (1955-1965)
1.2. Minicomputers Transistors replaced vacuum tubes and ushered in the second generation of computers.
Minicomputers are larger and faster than microcomputers and are designed to support The transistor was far superior to the vacuum tube, allowing computers to become smaller,
more than one user at a time. They are generally used for processing large volumes of data faster, cheaper, more energy-efficient and more reliable than their first-generation
in an organization. Minicomputers are also used as servers in a local area network. Another predecessors. Though the transistor still generated a great deal of heat that subjected the
name for minicomputers is “mid-range computers.” Two classic examples of computer to damage, it was a vast improvement over the vacuum tube. Second-generation
minicomputers were the Digital Equipment Corporation VAX and the IBM AS/400. computers still relied on punched cards for input and printouts for output.
Second generation computers moved from cryptic binary machine language to symbolic, or
1.3. Mainframe Computers assembly languages, which allowed programmers to specify instructions in words. High-
Mainframes are powerful multi-user computers capable of supporting up to hundreds of level programming languages were also being developed at this time, such as early versions
users simultaneously. They operate at very high speed and have very large storage of COBOL and FORTRAN. These were also the first computers that stored their instructions
capacities. They are used by large organizations like meteorological surveys and statistical in their memory, which moved from a magnetic drum to magnetic core technology.
institutes for performing bulk mathematical computations.

1
2.3. Third Generation (1956-1980) ATMs are known by various other names including automatic/automated banking machine
Third generation computers were designed with the use of integrated circuits (ICs). (ABM), automated transaction machine and cashpoint.
Integrated circuits made it possible to embed a large number of transistors into very small
surface area of silicon known as chip. Instead of punched cards and printouts, users 3.1.2. Stock Control Systems
interacted with third generation computers through keyboards and monitors and The collection of items that a business manufactures or sells is called stock. In a shop for
interfaced with an operating system, which allowed the device to run many different example, the stock includes all of the items on the shelves and out the back in the
applications at one time with a central program that monitored the memory. Computers for storeroom.
the first time became accessible to a mass audience because they were smaller and cheaper It is important that a business does not keep too much stock or too little stock. This is
than their predecessors. because:
 Too much stock costs money as you have to store it all somewhere
2.4. Fourth Generation  Too much perishable stock (e.g. food) means that it may go bad before it is sold
The microprocessor brought the fourth generation of computers, as thousands of  Too little stock means that you might run out of stock before the next delivery
integrated circuits were built onto a single silicon chip. What in the first generation filled an arrives
entire room could now fit in the palm of the hand. As these small computers became more
powerful, they could be linked together to form networks, which eventually led to the Definition: A stock control system is basically a database that keeps track of stock and
development of the Internet. Fourth generation computers also saw the development of informs users of when to re-order along with helpful sales reports.
GUIs, the mouse and handheld devices.
When items are sold or delivered, their codesare input to the system either manually or
2.5. Fifth Generation (1980 - present) using a point-of-sale terminal (barcode scanner or similar technology). The database
Till fourth generation computers, the main stress was on hardware technology. Fourth matches the codes with the items’ names and prices, prints an itemized bill and uses the
generation computers are faster, more accurate, reliable, smaller in size and very cheap, data to update stock levels. It also updatesa sales file which can be used there and then to
still they lack thinking power. Fifth generation computing devices are based on artificial calculate all sorts of statistics.
intelligence. Artificial intelligence will give computers thinking power and capability to Stock control systems make it very easy for stock levels to be monitored, and for stock to be
make decisions like human beings. They are still in development though there are some reordered when it is running low.
applications, such as voice recognition, that are being used today.
3.1.3. EFTPOS Systems
3. Applications of Computers EFTPOS stands for Electronic Fund Transfer at the Point Of Sale. It is a system that
Computers are fast becoming our way of life and one cannot imagine life without combines a business’ stock control system (EPOS) with an electronic fund transfer system,
computers in today’s world. Their importance can be attributed to the fact that almost thereby enabling the business to conduct financial transactions electronically. It allows
every sphere of our life is affected. We find their applications particularly in fields where individuals to pay for goods using credit or debit cards.
computations are required to be done at a very fast speed and where data is so complicated To pay for goods, a customer inserts their debit or credit card into a terminal device and
that the human brain finds it difficult to cope up with. type in a PIN number to verify that it is their card.The system electronically contacts their
bank to check that the card is valid and hasn't been stolen and also that there is enough
3.1. Commercial and General Data Processing Systems fund in their account to pay for the goods. Once payment has been authorized by the bank,
3.1.1. ATM Systems money is removed from the customer’s account and electronically paid into the shop's
ATM stands for Automatic/Automated Teller Machine. Itis a machine that is connected to a account.
bank’s computer system that provides the bank’s customers with access to financial
transactions in a public space without the need for a cashier, human clerk or bank teller. 3.1.4. Reservation Systems
The ATM can be used by the customers to make cash withdrawals, credit card advances or A computer reservation system or central reservation system is a computerized system
check their account balances. used to store and retrieve information and conduct transactions related to air travel, hotels,
On most modern ATM systems, a customer is identified by inserting a plastic ATM card car rental, or activities. They allow users to book hotel rooms, buy airline tickets, rent cars,
with a magnetic stripe or a plastic smart card with a chip, which contains a unique card etc. They also provide access to railway reservations and bus reservations in some
number and some security information. Authentication is provided by the customer markets, although these are not always integrated with the main system.
entering a personal identification number (PIN). Upon successful entry of the PIN, the
customer may perform a transaction.

©A LEVEL ICT/ Csc 2


3.2. Industrial, Scientific and Technical Uses 3.3. Control Systems, Embedded Systems and Robotics
3.2.1. Modeling and Simulation 3.3.1. Control and Monitoring Systems
Many things can be described by a set of mathematical formulas. When these formulas are Control is the process of monitoring activities to ensure that they are being accomplished
included in a computer program, the result is a computer model. as planned and of correcting any significant deviations. A computer control system is a
computerized system designed to control a process. Examples are traffic light control
Definition: A computer model is a computer program that represents the construction and systems, greenhouse control systems, and patient monitoring systems.
working of a real-life situation or system.
a. Traffic Light System
Models are usually produced in order to study the systems they represent. In a traffic light system a computer controls the sequences of lights displayed at a cross-
roads to ensure that cars do not crash. Additionally the computer operates a pedestrian
Definition: Simulation is the manipulation or operation of a model of a system in order to crossing to let pedestrians cross the road when a button is pressed.
study the behavior of the real system.
b. Greenhouse Control System
Modeling and simulation are useful for studying systems which would be impossible, too In a greenhouse system, a computer controls the temperature in a greenhouse to maintain
expensive to build, impractical or dangerous to work with. Examples of situations that can the conditions required for the plants in it to grow. The greenhouse has temperature and
be simulated are: humidity sensors linked to a computer, and the computer has a control program storing
 The training of pilots details of the correct temperature and humidity settings. The greenhouse is fitted with a
 The design of a bridge heater, sprinkler and window motor, also linked to the computer. If the humidity falls
 The design of a building below the values stored in the program, the computer activates the sprinklers and closes
the windows. If the temperature falls outside the values stored in the program, the heater is
3.2.2. Computer-Aided Design activated by the computer.
Computer-aided design (CAD) is the use of computer technology in the design process. A The system monitors the conditions night and day with immediate response to any
CAD software package allows a designer to create technical drawings and schematics which changes. To alter the growing conditions the values in the computer program can of course
can be 2-dimensional or 3-dimensional. be changed.
The benefit of CAD software packages is their ability to provide a digital prototype of the
product at early stages of the design process, which can be used for testing and evaluation. c. Patient Monitoring System
Examples of CAD applicationsareAutoCADused for technical drawings and ARESused for In a patient monitoring system, a computer controls the monitoring system used to
designing printed circuit boards. measure the health condition of patients. If a patient’s condition gets critical, the system
alerts the nurses or a doctor.
3.2.3. Computer-Aided Manufacturing
Computer-aided manufacturing (CAM) is the use of computer technology to assist in the 3.3.2. Embedded Systems
manufacturing process. In CAM, the computer is used to program, direct, and control An embedded system is a small computing device (microcontroller) that is built into a
production equipment in order to manufacture products. Its primary purpose is to create a larger equipment often as a single chip and dedicated to a given task. Embedded systems
faster production process and components and tooling with more detailed dimensions and control many devices in use today such as digital watches, mobile phones, microwave
material consistency, which in some cases, uses only the required amount of raw material ovens, washing machines, vehicles, photocopiers, and very large stationary installations
(thus minimizing waste), while simultaneously reducing energy consumption. For example, like traffic lights, factory controllers or the systems controlling nuclear power plants.
on the production line of a car plant, computers will control the robots that spot-weld the
car body together or the robots that spray-paint the car. 3.3.3. Robotics
Robotics is the branch of technology that deals with the design, construction, operation and
3.2.4. Computer Integrated Manufacturing application of robots. A robot is a machine that is designed to repeatedly do what humans
Computer-integrated manufacturing (CIM) is the manufacturing approach of using can do with speed and precision. An important application of this technology has been to
computers to control the entire production process. It is the total integration of computer- create robots to perform certain functions that are dangerous for human beings, or to do
aided design and computer-aided manufacturing. The computers that design the products tasks that can be more effectively performed by machines than by people. Although it may
are linked directly to the computers that aid the manufacturing process. not have the physical appearance of a human being, a robot may be thought of as a machine
acting as a person while being controlled by a computer.

©A LEVEL ICT/ Csc 3


3.4. Application of Computers in Arts and Media

3.4.1. Computers in Music


a. Notation Software
Notation or composition software is used to speed up the writing of music and allow easy
duplication of scores. Many types of notation software include the ability to connect to II. SOCIAL, ECONOMIC, ETHICAL AND LEGAL
instruments. An instrument can be connected to the computer through MIDI (Musical IMPLICATIONS OF COMPUTERS
Instrument Digital Interface) and by simply playing a part, the software notates it and can
even play it back in some cases. Finale is one of the most popular examples of notation Introduction
software. Computers have had many effects on individuals in society. They have impacted on the way
individuals work, socialize and run their lives. As a result of computers, an individual's
b. Recording Software values are now in constant flux. The moral and ethical framework that guides an individual
Recording software make it possible to record sound using a computer. With recording is constantly changing as is the economic and legal framework within which lives are led.
software, users can record their own music without going to Record Label Companies.
Recording software makes it easy to fix poor recording. Also, one program can perform the 1. Social and Economic Effects of Computers
same number of actions that will be performed with a number of equipment. Protools, The widespread use of computers has affected people and organizations in many ways.
Adobe Audition, Cool Edit Pro and Cubase are common examples. Some of the effects of computers include:
 The introduction of computers have made some jobs outdated leading to
c. Art Design Software unemployment
Art design is vital to the music industry as having good cover art is crucial to success. Art  New jobs have been created like engineering to build machines, software
and graphical design software allow an artist to come up with their own look and feel to programming to write programs for the computers, etc
cover art. This lets the album take on a unique feel to it.  There is reduction in working hours as a result of automation of some tasks which
can lead to reduction of salaries.
d. Advertising  The introduction of computers has led to retraining or reskilling as many employees
Artists use the Internet to advertise new CD releases, tour dates, merchandise, and bonus have to be trained on how to use a computer.
tracks. Samples of new songs are released to entice the listener to buy the album.  Automation of tasks can lead to difficult jobs becoming easy so anyone can do them.
As a result, a skilled employee suddenly is the proud possessor of skills that no-one
3.4.2. Computers in Film-making needs any more.
a. Animation  Automation of tasks has led to an increase in productivity thereby improving the
Animation is the rapid display of a series of images in order to create an illusion of profit of the organization.
movement. Stop motion animation (or frame-by-frame) is an animation technique where  Computers have led to new types of crimes like phishing, identity theft, piracy etc
the artist maneuvers real-world objects and photographs them one at a time. A computer is  The post office has become more of a bill paying center than a communication
then used to combine the photos in a series, thereby creating an illusion of movement. center as it is now faster and cheaper to communicate online through emails and
Cartoons are produced through animation. chats.
 More information can be stored on very little space
Assignment: What isclaymation?  Privacy has become a concern as confidential data stored in computers or
distributed on networks can be intercepted by hackers and crackers.
Answer: A form of stop-motion animation in which each object is sculpted in clay or a
similarly pliable material such as plasticine. 2. Computer Crimes
A computer crime is any illegal act that involves the computer either as the target of the
b. Motion Capture crime or as a tool used in committing the crime. When the computer is the target of the
Motion capture (mocap) is the process of recording a live motion event and translating it criminal act, the crime is said to be a computer-related crime. When it is a tool used to
into actionable data that allows for a 3D recreation of the performance. In film making, commit the crime, the crime is referred to as a computer-assisted crime.
motion capture is used to film an actor’s movements which are turned into 3D movements,
and then mapped to an avatar.

©A LEVEL ICT/ Csc 4


2.1. Types of Computer Crimes
 Spyware
2.1.1. Phishing
Spyware is software that monitors a computer user’s activity without their knowledge and
Phishing is the criminally fraudulent process of acquiring or attempting to acquire sensitive
reports it to a central location. The purpose of spyware ranges from purportedly benign
information such as usernames, passwords and credit card details by masquerading as a
(enforcing copyrights, displaying targeted advertisements) to very malicious (stealing
trustworthy entity in an electronic communication. The phisher sends out an e-mail that
passwords and credit card numbers).The most common way to get spyware on your
pretends to come from a bank or corporation with which the victim has an account.
computer is to install it yourself when you are tricked into installing free software.
The e-mail message tells the victim to click on a link in order to handle some kind of urgent
business. In reality, both the message and the link are counterfeit, and the victim ends up
 Logic bomb
giving their password or credit card information to the phisher, or at the very least, visiting
A logic bomb also known as slag code, is a piece of computer code that executes a malicious
a web site that disseminates malware.
task such as clearing a hard drive or deleting specific files, when it is triggered by a specific
event. It is secretly inserted into the code of a computer's existing software, where it lies
2.1.2. Software Piracy
dormant until that event occurs. This event may be a specific date and time or failure to
Software piracy or copyright infringement is the illegal (unauthorized) reproduction of
input a command at a certain time.
copyrighted or patented software for personal use, for sale or free distribution. It is the
most widely practiced type of computer crime. Software piracy occurs more easily with the
 Software Key loggers
ability to post files for downloading all over the world. However, another more costly
Software key loggers are software that record keystrokes entered by a user, usually to
copyright infringement occurs when trademarks and logos of corporations are posted on
secretly monitor and/or maliciously use this information. They can record instant
non-authorized web sites. Some criminals utilize the trademarks and logos to appear to be
messages, email, passwords and any other information you type at any time using your
a legitimate site to perpetrate fraud. Many corporations have employees or consulting
keyboard. Software key loggers may also be embedded in spyware, allowing your
contractors who constantly crawl the web to sniff out illegal usage of trademarks and logos.
information to be transmitted to an unknown third party over the Internet.

2.1.3. Malware Attacks


2.1.4. Denial of Service
Malware (malicious software) is any software that could harm a computer system,
A denial or degradation of service (DoS) is an attack to a computer system that puts it out
interfere with a user's data, or make the computer to perform actions without the owner's
of action by overloading it with data in a way that the system was never prepared to
knowledge or permission. Examples are virus, worms, Trojan horse, spyware and logic
handle. A DoS attack makes the system unavailable to its intended users. A distributed
bombs.
denial-of-service (DDoS) attack is one in which a multitude of compromised systems attack
a single target, thereby causing denial of service for users of the targeted system.
 Virus
A virus is a computer program that can copy itself and infect a computer where it destroys
2.1.5. Hacking and Cracking
files and disrupts the operation of the computer. A virus can spread from one computer to
another (in some form of executable code) when its host is taken to the target computer.
2.1.6. Social Engineering
Social engineering refers to a non-technical kind of intrusion that relies heavily on human
 Worm
interaction and often involves tricking other people to break normal security procedures. A
A worm is a self-replicating malicious program which uses a computer network to send
person using social engineering to break into a computer network might try to gain the
copies of itself to other computers (nodes) on the network and it may do so without any
confidence of an authorized user and get them to reveal information that compromises the
user intervention. Unlike a virus, it does not need to attach itself to an existing program.
network's security. Social engineers often rely on the natural helpfulness of people as well
Worms cause harm to the network by consuming bandwidth whereas viruses corrupt or
as on their weaknesses.
modify files on a targeted computer.

2.1.7. Cyber Stalking


 Trojan horse
Cyber stalking is a crime in which the attacker harasses a victim using electronic
A Trojan horse is malware that appears to perform a desirable function for the user prior to
communication, such as e-mail or instant messaging (IM), or messages posted to a web site
run or install but instead facilitates unauthorized access of the user's computer system.
or a discussion group. Cyber stalking messages differ from ordinary spam in that a cyber-
Once a Trojan horse has been installed on a target computer system, a hacker may have
stalker targets a specific victim with often threatening messages, while the spammer
access to the computer remotely and perform various operations, limited by user privileges
targets a multitude of recipients with simply annoying messages.
on the target computer system and the design of the Trojan horse.

©A LEVEL ICT/ Csc 5


2.1.8. Cyber Terrorism
Cyber terrorism can be defined as an act of terrorism committed through the use of 3.1.1. Passwords
cyberspace or computer resources. As such, a simple propaganda in the Internet, that there A password is a secret sequence of characters that is required to login to a system, thus
will be bomb attacks during the holidays can be considered cyber terrorism. preventing unauthorized persons from gaining access to the system. When authentication
is done through the use of a password, knowledge of the password is assumed to guarantee
Other types of crimes are: scamming, theft of computer equipment, pharming, spoofing, that the user is authentic. Passwords can be guessed or cracked and so if anyone is using a
and phreaking. password to protect their system, the following guidelines will help make it more secure:
 Don’t choose an obvious password (like your name, date of birth or name of
2.2. Measures to Combat Computer Crimes relative)
The following measures can be used to combat computer crimes:  Keep your password secret. Don’t share it!
 Install strong doors and locks to computer rooms to prevent computer equipment  Change your password regularly but not too often.
theft.  Make your password at least eight characters long.
 Use access control mechanisms that will ensure confidentiality, integrity and  Do not use common or proper words of phrases - these can be found using a
availability. dictionary cracker.
 Encrypt confidential data stored in computers or transmitted over communication  Use a mixture of upper and lower case letters and numbers.
networks.
 Install antivirus software and update it regularly 3.1.2. Smart Card
 Install intrusion detection systems to help detect any unauthorized access to the A smart card is a small card that holds user authentication information. When the card is
system. inserted into a card reader, electrical fingers wipe against the card. The information in the
 Install firewalls to prevent unauthorized access to local networks. card is read and used to authenticate the person. Cards can be stolen and so are not as
reliable as biometrics.
3. Computer Systems Security
Computer system security is the process of preventing and detecting the unauthorized use 3.1.3. Biometrics
of computer systems. Prevention helps stop unauthorized users from accessing any part of Biometrics is the science and technology of measuring and analyzing biological data. In
the computer system by controlling access to the system, while detection helps determine computer security, it refers to the use of measurable biological characteristics such as
whether or not someone attempted to break into the system, if they were successful, and fingerprints, eye retinas, iris patterns, facial patterns, voice patterns, hand measurements
what they may have done. and DNA, to identify a person. It is the safest authentication technique.
Computer security has three main goals, confidentiality, integrity and availability, which
can be conveniently summarized by the acronym "CIA": Assignment: What do you understand by access control?
 Confidentiality ensures that information is not accessed by unauthorized persons. In
other words, it ensures that information is kept secret or private. Answer: The limitation and control of access to a system through identification and
 Integrity ensures that information is not altered by unauthorized persons in a way authentication.
that is not detectable by authorized users. That means that there is an external Or
consistency in the system - everything is as it is expected to be. The process of limiting access to a system only to authorized users. This can be achieved
 Availability ensures that the system is accessible and useable upon appropriate through identification and authentication.
demand by authorized users. In other words, this means preventing denial-of-
service. 3.2. Encryption
Encryption is the process of transforming a message using an algorithm into a form
Different mechanisms used to ensure the security of computer systems are authentication, unreadable by anyone except the intended recipient. The original message is known as
encryption, firewalls, digital signatures, etc. plaintext, the algorithm is cipher and the encrypted text is ciphertext. To read an encrypted
message, one must have access to a key that will enable them to decrypt it.
3.1. Authentication Encryption ciphers can be grouped into two: substitution and transposition ciphers.
Authentication is the process of determining if someone is who they declare to be. In
simple terms, it is proving someone’s identity. Authentication can be obtained by the user
providing something they know (password), something they have (smart card) or
something they are (biometrics).

©A LEVEL ICT/ Csc 6


Example 2:
Sender Recipient
Cipher text: SL IIIFE HSAEC TRN
Hello Encrypted text Hello
%fd$h S L
I I I F E
Encryption Decryption H S A E C
T R N

Plaintext: THIS IS RAIL FENCE


Key Key
3.3. Firewall
Encryption
A firewall is a system designed to prevent unauthorized access to or from a private
network. Firewalls are implemented in either hardware or software form, or a combination
Example 1: of both. They prevent unauthorized Internet users from accessing private networks
Plaintext: ENJOY THE BEAUTY OF SCIENCE connected to the Internet. All messages entering or leaving the network must pass through
the firewall which examines each message and blocks those that do not meet the specified
E N J O Y
security criteria. Some Operating Systems like Windows XP, 7 and Mac OS X, have built-in
T H E B E
A U T Y O firewalls.
F S C I E
N C E 3.4. Intrusion Detection
Intrusion detection is the art and science of sensing when a system or network is being
Cipher text: ETAFN NHUSC JETCE OBYI YEOE used inappropriately or without authorization. An intrusion-detection system (IDS)
monitors system and network resources and activities and, using information gathered
Example 2: from these sources, notifies the authorities when it identifies a possible intrusion.
Key: ORANGE
Plaintext: THE FUTURE IS BRIGHT 3.5. Digital Signatures
A digital signature is a computed digest of a message that is encrypted and sent with the
O R A N G E
message. The recipient decrypts the signature and compares it with the received text. If
T H E F U T
U R E I S B
they match, the message is authenticated and proved intact from the sender.
R I G H T Digital signatures also ensure non-repudiation. Non-repudiation is the prevention of either
the sender or the receiver denying a transmitted message. A system must be able to prove
Ciphertext: TUR HRI EEG FIN UST TB that certain messages were sent and received.

a. Rail Fence Cipher 3.6. Fault Tolerance


Rail fence writes the plaintext in a zig-zag pattern in two or more rows and forms the
ciphertext by reading off the letters row by row from the first. 4. Computer Ethics
Ethics refers to the principles of right and wrong that individuals, acting as free moral
Example 1: agents, use to make choices that guide their own behavior. Ethical principles place a value
Plaintext: WE ARE HAVING FUN on human acts according to whether they are good or bad.
Computer ethics refers to standards of good conduct applied within the use of computers.
R N It defines principles for judging computing acts whether they are good or bad.
A E I G
E H V F N
4.1. Fundamental Principles of Computer Ethics
W A U
The fundamental principles of computer ethics formulated by the Computer Ethics
Cipher text: RN AEIG EHVFN WAU Institute (CEI) as the“ten commandments” of computer ethics are:
1. Thou shall not use a computer to harm other people.
2. Thou shall not interfere with other people’s computer work.
©A LEVEL ICT/ Csc 7
3. Thou shall not snoop around in other people’s files. 2.7. Improve public understanding of computing and its consequences.
4. Thou shall not use a computer to steal. 2.8. Access computing and communications resources only when authorized to do so.
5. Thou shall not use a computer to bear false witness.
6. Thou shall not copy or use proprietary software for which you have not paid. 4.2.2. IEEE Code of Ethics
7. Thou shall not use other people’s computer resources without authorization or We, the members of the IEEE, in recognition of the importance of our technologies in
proper compensation. affecting the quality of life throughout the world, and in accepting a personal obligation to
8. Thou shall not appropriate other people’s intellectual output. our profession, its members and the communities we serve, do hereby commit ourselves to
9. Thou shall think about the social consequences of the program you write or the the highest ethical and professional conduct and agree:
system you design.
10. Thou shall use a computer in ways that show consideration and respect for your 1. To accept responsibility in making decisions consistent with the safety, health and
fellow humans. welfare of the public, and to disclose promptly factors that might endanger the public or
the environment;
4.2. Codes of Ethics and Professional Conduct 2. To avoid real or perceived conflicts of interest whenever possible, and to disclose them
A code of ethics and professional conduct sets the standards for what is expected of a to affected parties when they do exist;
professional. They are promises by professions to regulate themselves in the general 3. To be honest and realistic in stating claims or estimates based on available data;
interest of the society. Code of ethics for information technology professionals encourage 4. To reject bribery in all its forms;
them to behave ethically and responsibly with the tools and information they have in their 5. To improve the understanding of technology, its appropriate application, and potential
control. Examples are the British Computing Society (BCS) code of ethics, the Association consequences;
for Computing Machinery (ACM) code of ethics, and the Institute of Electrical and 6. To maintain and improve our technical competence and to undertake technological tasks
Electronics Engineer (IEEE) code of ethics. for others only if qualified by training or experience, or after full disclosure of pertinent
limitations;
4.2.1. ACM Code of Ethics 7. To seek, accept, and offer honest criticism of technical work, to acknowledge and correct
1.GeneralMoralImperatives errors, and to credit properly the contributions of others;
As an ACM member I will… 8. To treat fairly all persons regardless of such factors as race, religion, gender, disability,
age, or national origin;
1.1.Contribute to society and human well-being. 9. To avoid injuring others, their property, reputation, or employment by false or malicious
1.2.Avoid harm to others. action;
1.3.Be honest and trustworthy.
1.4.Be fair and take action not to discriminate. 4.3. Netiquette
1.5.Honour copyrights and patents. Netiquette is short for network etiquette. It is a set of rules about acceptable behavior
1.6.Give proper credit for intellectual property. when communicating over the Internet. Some basic rules of netiquette are:
1.7.Respect rights to limit access to computing and communication systems.  Avoid flaming i.e. using obscene or inappropriate language in your emails or posts
1.8.Respect the privacy of others.  Avoid using capital letters in your emails/comments, it is considered like YOU
1.9. Honour confidentiality. ARE SHOUTING and it is harder to read.
 Avoid sloppiness i.e. avoid spelling and grammatical errors. Re-read and edit your
2.MoreSpecificProfessionalResponsibilities. emails/comments before you send/post
As an ACM Computing Professional I will . . .  Do not send huge file attachments unless they are requested
 Always fill the subject field of an email before you send
2.1. Strive to achieve the highest quality, effectiveness and dignity in both the process and  Do not format your emails with colored text or background color. They may cause
products of professional work. them hard to read.
2.2. Acquire and maintain professional competence.
2.3. Know and respect existing laws pertaining to professional work. 5. Legislation
2.4. Accept and provide appropriate professional review. Legislation is the act of making and passing laws.Some laws that govern the use of
2.5. Give comprehensive and thorough evaluations of computer systems and their impacts, computers area the Data Protection Act, the Computer Misuse Act, the Copyright, Design
including analysis of possible risks. and Patent Act, and the Health and Safety Act.
2.6. Honor contracts, agreements, and assigned responsibilities.

©A LEVEL ICT/ Csc 8


5.1. The Data Protection Act which must be at the appropriate height, the monitor which must be adjustable and the
It is aimed at protecting the rights of individuals to privacy. Some Data Protection Act rules lighting which must be appropriate.
are:
1. If an organization holds data on individuals, it must be registered under the act.  Moving and Handling Regulations
2. Personal data should be processed fairly and lawfully These regulations lay down the rules for safe moving of heavy objects. All employees
3. Personal data should not be disclosed in anyway other than lawfully and within involved in such activities must receive proper training on avoiding injury when moving
the registered purpose. heavy objects.
4. Personal data should be adequate and relevant and not excessive for the required
purpose.  Control of Substances Hazardous to Health (COSHH)
5. Personal data should be kept accurate and kept up to date These regulations cover the safe storage and use of hazardous materials. This includes
6. Data must be processed in accordance with the right of the data subject items such as laser printer toners and anyone involved in replacing such items must be
7. Appropriate security measures must be taken against unauthorized access made aware of the potentially toxic nature of toners.

5.2. The ComputerMisuse Act Assignment: State what you understand by the following terms.
This act makes it an offence to access any computer to which you do not have an authorized i) Digital inclusion
right to use. It introduces three criminal offences: ii) Digital divide.
1. Unauthorized access to computer material.
2. Unauthorized access with intent to commit or facilitate commission of further Answer:
offences. i) Digital inclusion
3. Unauthorized modification of computer material. Digital inclusion is commonly defined asthe incorporation of information technologies into
the community in order to promote education and improve the quality of life.
5.3. Copyright, Design and Patent Act In other words, it is the ability of individuals and groups to access and use information and
This Act is designed to protect all types of intellectual property and ensure that authors or communication technologies.
creators of a piece of work receive both credit and compensation. Digital inclusion is necessary as we move towards a technology based society to ensure that
all individuals can participate fully in the economic, educational, civic and social activities of
 Copyright is a statutory grant that protects original work. Something that is their community.
copyrighted is not to be reproduced, published or copied without permission from
the copyright holder. Ideas are not protected by copyright; only the specific ii) Digital divide
presentation of the idea is copyrightable. The Digital divide refers to the gap between those who have and those who lack access to
computers and the Internet.
 Design is the appearance or construction of something. A design is not immediately
protected.Itmust be registered with the appropriate institution, 6. Computers in the Workplace
It is important to note that in as much as the computer is a very vital tool for everyone’s
 A Patent is a grant to inventors that give them exclusive monopoly over their daily use, it can also be a very harmful tool if poorly used. Using the computer for
invention. It gives them the right to stop others from producing, selling or using prolonged periods of time can lead to physical health risks. For this reason, users must
their invention. Unlike copyrights, patents protect the ideas or design of the ensure that they follow health measures and apply safety precautions as they use the
invention rather than any tangible form of the invention. computers to avoid computer related disorders.

5.4. Health and Safety Act 6.1. Computer Related Disorders


The original Act and its many added regulations cover the range of hazards an employee CRDs are health problems associated with prolonged computer usage. They include
may face like handling hazardous material. Some of the regulations that apply to the repetitive strain injury, carpal tunnel syndrome, eyestrain and headache.
computing industry are:
6.1.1. Repetitive Strain Injury
 Display Screen Equipment Regulations Medically defined as cumulative trauma disorder (CTD), it is a debilitating health condition
They cover the precautions that must be taken when an employee uses a visual display resulting from overusing the hands to perform a repetitive task such as typing, clicking a
unit. The regulation covers items such as the chair which must be adjustable, the desk mouse or writing. RSI results in damage to muscles, tendons and nerves of the neck,

©A LEVEL ICT/ Csc 9


shoulder, forearm and hand which can cause pain, weakness, numbness or impairment of being overworked. Performing task without a wrist rest may increase the angle to
the motor control. which user’s wrists are bent. Increasing the angle of bend increases contact stress
Symptoms are tightness, discomfort, stiffness, burning sensation in the hands, wrists, and irritation on tendons and tendon sheaths.
fingers, forearms and elbows. Tingling, coldness and numbness of the hand with loss of  Your feet should be fully supported by the floor or a footrest should be used if the
strength and coordination occur. There is pain in the upper back, shoulders and neck and heights of your table and chair are not adjustable.
need for massage.  Your back should be fully supported with a lumbar support when sitting vertical or
leaning back slightly.
6.1.2. Carpal Tunnel Syndrome  Your thighs should be parallel to the floor
6.1.3. Computer Vision Syndrome
Regardless of how good your working posture is, working in the same posture or sitting
6.2. Ergonomics still for prolonged periods is not healthy. You should change your working position
Ergonomics refers to the application of scientific knowledge to the workplace in an effort to frequently by
improve the well-being and efficiency of workers. Simply put, it is the study of human  Making small adjustments to your chair or backrest
factors related to things people use. These factors include workstation layout, sitting  Stretching your fingers, arms and torso
posture, lighting, viewing distance etc.  Walking around a few minutes periodically

6.2.1. Workstation Layout 6.2.3. Lighting


Workstation layout has to do with the arrangement of the computer and related products, When a computer work environment is planned both overall lighting and positioning of
in the workplace. Appropriate placement of workstation components and accessories lights and windows must be considered. Overhead lights and windows are sources of glare
allows one to work in neutral body position which will enable them perform more that may mask whatever is shown on the screen resulting in visual fatigue and discomfort.
efficiently, work more comfortably and safe. The layout for a comfortable and productive There are three types of glare: direct, indirect and masking.
workstation involves the following:  Direct glare occurs when there are bright light sources directly in the operator’s field
of view. Windows are often a source of direct glare.
a. Desk or Work Surface Areas  Indirect glare occurs when light from windows or overhead lights is reflected off
Limited space on the work surface may cause users to place components and devices in shiny surfaces in the field of view.
undesirable positions. This may lead to awkward postures as you reach for a  Light from sources directly overhead causes masking glare on the screen.
mouse/keyboard or look at a monitor that is to the side. Working with your neck turned to
the side prolonged periods load neck muscles unevenly and increase fatigue and pain. The use of light absorbing blinds and curtains will help reduce both direct and indirect
glare. Placing the monitor in an appropriate position can help reduce overhead or masking
b. Areas under the Work surface glare. Glare can also be prevented using an anti-glare screen filter.
Inadequate clearance or space under the work surface due to poor design may result in
discomfort and performance inefficiencies.

c. Placement of components
Placing components e.g. mouse, telephone, far away from you can cause you to repeatedly
reach out for them resulting in strain on the shoulder, arm and neck. III. COMPUTER ORGANISATION AND ARCHITECTURE

6.2.2. Sitting Posture Introduction


Working with the body in a neutral position is important. It reduces stress and strain on Computer architecture refers to those attributes of a system that have a direct impact on
the muscles, tendons and skeletal system thereby reducing your risk of developing thelogical execution of a program like the instruction set, the number of bits used to
musculoskeletal disorders. For a good sitting posture the following points are vital: represent various data types, I/O mechanisms and techniques for addressing memory.
 The monitor should be set so that your neck will be straight On the other hand, computer organization refers to the operational units of the system and
 Your elbows should stay close to the body and be bent at about 90o, with your upper their interconnections that realizethe architectural specifications like control signals,
arms hanging naturally from the side. interfaces between computer and peripherals and the memory technology used.
 Keep your hands in line with the fore arms so your wrists are straight. You may use So, for example, the fact that a multiply instruction is available is a computer
a wrist rest or arm rest to help keep your wrists straight and your arm muscles from architectureissue. How that multiply is implemented is a computer organization issue.

©A LEVEL ICT/ Csc 10


1.1.1. Keyboard
1. The Von Neumann Architecture The keyboard is the standard input device attached to computers. It has keys (buttons) that
The Von Neumann architecture is a stored-programcomputer model that was designed by are pressed to enter data and commands into the computer. These keys represent letters,
the Hungarian born Mathematician, John Von Neumann. It is based on three concepts: numbers, symbols and control characters. The keyboard has a total of 101-104 keys
o Both data and instructions (programs) are stored in a single storage structure divided into different groups or keypads.
called memory  Function keys, labeled F1-F12, perform specific functions based on the software
o The contents of this memory are addressable by location, without regard tothe used. F1 for example is used in most software to display help.
type of data contained there.  Alphabetical keys
o It has a single processing unit which. As such, execution occurs in a sequential  Numerical keys
fashion from oneinstruction to the next.  Navigation keys also called direction keys are used to navigate through documents
and websites. Examples of navigation keys are the up, down, left and right arrows.
Programs being stored in memory ensures that by altering the stored program, the  Action keys
computer can perform a different task – reason why a computer is called a general purpose
machine. There are different keyboard layouts but the best known are QWERTY mainly used by
Neumann divided the computer into four functional units: input, processing, storage and English speakers and AZERTY used by French speakers. Another keyboard layout modified
output. greatly from a standard layout is DVORAK, devised to increase typing speed by placing
frequently used keys more naturally.
Central Processing Unit (CPU) A keyboard connects to the computer through cable PS/2 cable, USB cable or wireless
(cordless).
Control Unit

Input Unit Output Unit 1.1.2. Mouse


Arithmetic A mouse is a handheld device which is moved across a flat surface to control the movement
Logic Unit of a pointer on a computer screen. The mouse has two buttons, the right and the left
buttons, which are clicked (pressed)to enter commands into the computer.
Different actions that can be performed with a mouse are:
 Click: Pressing the left mouse button.
Primary
Storage  Right-click: pressing the right mouse button
 Double-click: pressing the left button two times in quick succession
 Drag: pressing the left button and while holding, moving the mouse
Secondary  Drop: Releasing the left button after dragging
Storage

Storage Unit Drag and drop can be used to move files or documents from one place to another.
A mouse connects to a computer through PS/2 cable (PS/2 mouse), USB cable (USB
Functional Units of a Computer mouse), or wireless (optical mouse).

1.1.3. Scanner
Assignment: What is the difference between a computer with a Von Neumann’s architecture A scanner is an optical device that converts hardcopy image or text into digital form so that
and one with a Harvard architecture? it can be fed into the computer. The common optical scanner devices are the flatbed
scanner, optical mark reader, optical character reader and barcode reader.
1.1. Input Devices  Flatbed Scanner: a scanner in which the object to be scanned is held flat against a
Input devices are hardware components that are used to enter data and instructions into piece of glass.
the computer. Examples are keyboard, mouse, scanner, joystick, light pen, touchpad,  Optical Mark Reader
trackball and microphone.  Optical Character Reader
 Barcode Reader

Other types of input devices are joystick, light-pen, trackball and touch pad.

©A LEVEL ICT/ Csc 11


1.3.1. Control Unit
1.2. Output Devices The control unit acts like supervisor seeing that things are done as they ought to. It locates
Output devices are hardware components that are used to retrieve information from the and retrieves program instructions from memory, interprets them and ensures that they
computer. They provide the results of computations to the person using the computer, in a are executed in proper sequence. It also ensures that data is selected from memory as
way they can understand. Examples are monitor, printer, speaker and projector. necessary and information is stored correctly as well.

1.2.1. Monitor 1.3.2. Arithmetic-Logic Unit


Also referred to as VDU (Visual Display Unit), the monitor is the most popular output The arithmetic-logic unit (ALU) performs arithmetic and logic operations. It contains
device. It displays information generated by a computer on a screen. Such output is known arithmetic circuits that perform arithmetic operations like addition, subtraction,
as softcopy output. Monitors are characterized by the technology they use and their multiplication and division, and logic circuits that perform comparisons like equal to, less
resolution. than, greater than, greater than or equal to and less than or equal to.
 By the technology used, monitors are of two main types: Cathode Ray Tube (CRT)
monitors and Flat Panel Display. 1.3.3. Registers
o CRT monitors are similar to a television set. Registers are special storage locations within the CPU that offer an advantage of speed.
o Flat panel display monitors are of different types: Liquid Crystal Display (LCD), They work under the direction of the control unit to accept and hold data that is being
Electroluminescent Display (ELD), Gas Plasma (GP) and Thin Film Transistor processed. Since the CPU uses registers for the processing of data, the number of registers
(TFT) monitors. in a CPU and the size of each register affect the power and speed of the CPU.
Registers are grouped into two: special purpose registers and general purpose registers.
 Monitor resolution refers to the number of dots (pixels) on the screen. It is expressed
as a pair of numbers that give the number of dots on a line (horizontal) and the  Special purpose registers are dedicated to specific tasks like:
number of lines (vertical). The size of a pixel is known dot pitch. The smaller the dot o the accumulatorwhich collects the result of computations,
pitch, the clearer and sharper the picture appears on the monitor. Most monitors o the memory address register (MAR) which keeps track of where a given
come with a .28 dot pitch. instruction or piece of data is stored in memory
o thememory data register (MDR)which holds data values.
Assignment: State the advantages of flat panel monitors over CRT. o theprogram counter (PC) which holds the address of the next instruction to be
executed.
1.2.2. Printer o Thecurrent instruction register (CIR) which holds the instruction being
A printer is a device that produces computer-generated information on paper. Such output executed.
is referred to as printout or hardcopy. Based on the technology used, printers can be
classified into impact and non-impact printers.  General purpose registers on the other hand have no specific function; they are used
 Impact printers have mechanical contact between paper and printing head (e.g. according to the need of the program being executed.
daisy wheel, dot matrix and line printers).
 Non-impact printers have no mechanical contact between paper and printing head Question: How would you define processing?
(e.g. ink-jet, desk- jet, laser printers).
Answer: Processing is performing arithmetic operations (add, subtract, multiply, divide etc)
Assignment: State the advantages and disadvantages of impact and non-impact printers? or logical operations (comparisons like less than, greater than, equal to etc) on data to
convert it to useful information.
1.3. The Central Processing Unit
The central processing unit (CPU) also called processor, is the brain or heart of the 1.3.4. The Instruction Cycle
computer. It is the part of the computer that interprets and executes program instructions. The instruction cycle describes how program instructions are repeatedly fetched, decoded
It also controls the other components of the system. The CPU is made up of three main and executed, one instruction at a time, until an instruction to HALT is encountered. Before
components: the arithmetic-logic unit (ALU), the control unit (CU) and registers. Examples an instruction can be fetched, it must be placed into memory as well as related data, from
of CPUs are Intel Pentium II, III, IV, Pentium Celeron, and AMD Athlon. an input or secondary storage device. Once the necessary data and instructions are in
memory, the central processing unit performs the following four steps for each instruction:
1. The control unit fetches (gets) data and instructions from memory.

©A LEVEL ICT/ Csc 12


2. The control unit decodes the instructions i.e. determines what they mean, and directs 1.4.1. Primary Storage
that the necessary data be moved to the arithmetic-logic unit. Primary storageis directly accessible to the CPU. It holds programs and data that the CPU is
3. The arithmetic-logic unit then executes the instruction on the data. That is, the ALU is currently working with. Primary storage is also called internal memory, immediate access
given control and performs the actual operation on the data. memory or primary memory. Primary memory consists of random access memory, read
4. The arithmetic-logic unit stores the result of this operation in memory or in a only memory and cache memory.
register.
a. Random Access Memory
Random access memory (RAM) also called “main memory” is the temporary storage space
into which a computer loads programs and user data when it is running. It is the
computer’s working space. It is read/write meaning that data can be read from and written
onto it. RAM is also volatile meaning that everything held in it is lost when power is
switched off. Two types of RAM exist: Static RAM and dynamic RAM.

 Dynamic RAM (DRAM) consists of capacitors that slowly leak their charge over time.
Thus, they must be refreshed every few milliseconds to prevent data loss. DRAM is
The Instruction Cycle
cheap memory owing to its simple design.
Steps 1 and 2 together are called instruction time or I-time and steps 3 and 4 together are
called execution time or E-time. The combination of I-time and E-time is called the machine  Static RAM (SRAM) consists of circuits that retain their charge over time. SRAM is
or instruction cycle or the fetch-decode-execute cycle. The length of time taken to fetch, faster and more expensive than dynamic RAM, and does not need to be refreshed as
decode and execute an instruction is measured in clock cycles. DRAM does. Due to its cost it is not used as main memory but rather to build cache
memory.
1.3.5. System Clock
The CPU has a small quartz crystal circuit called the system clock that controls the timing of b. Read Only Memory
all computer operations. The system clock generates regular electronic pulses, or ticks, that Read only memory (ROM) is a kind of memory whose contents can only be read by the
set the operating pace of components of the system unit. Each tick is known as clock cycle computer. Data found in ROM is written by the manufacturer and cannot be modified by
and the pace of the system clock is called clock speed. Clock speed is measured in the user. ROM is useful for holding data that never changes like the “boot” or start-up
megahertz (Mhz) or gigahertz (Ghz) and refers to the number of clock cycles per second program which is run when the computer is switched on.ROM is non-volatile meaning that
that the CPU runs at. Mega and giga stand for million and billion respectively while hertz its content is preserved even without power. There are four types of ROM:
means cycles per second. Thus,1Ghz means one billion cycles per second. A computer that
operates at 3 Ghz has 3 billion (giga) clock cycles in one second (hertz).  Masked ROM isROM programmed with its data when the chip is fabricated.
The faster the clock speed, the more instructions the processor can execute per second.  Programmable ROM(PROM) isROM that can be programmed once but not
The speed of the system clock has no effect on devices such as a printer or disk drive. The reprogrammed.
speed of the system clock is just one factor that influences a computer’s performance.  Erasable Programmable ROM (EPROM) is ROM that can be erased by strong
Other factors, such as the type of processor chip, amount of cache, memory access time, bus ultraviolet light and new data burnt into it. To do this the chip has to be removed
width, and bus clock speed. from the machine and put back after the changes have been made.
 Electrically Erasable Programmable ROM (EEPROM) isROM whose content can be
1.4. Storage Devices erased electrically. In this case, the chip need not be removed from the machine. The
Storage devices are computer components that hold programs and data for use in the programming is done using special software.
computer. Programs and data can be made available for initial or additional processing
when required.A storage device is made of two parts: the storage medium and the device. c. Cache Memory
 The medium is the surface or substrate that holds actual data Cache memory is a smaller and faster memory between the CPU and main memory, which
 The device reads information from or stores information onto the medium stores copies of data from the most frequently accessed memory locations. The purpose of
cache memory is to speed up accesses by storing recently used data closer to the CPU,
Computer storage can be classified basically into two: primary storage and secondary instead of storing it in main memory. Cache is static RAM and is usually organized in levels:
storage.  Level 1 (L1) cache, Level 2 and Level 3 cache.
 Level 1 cache is closest to the CPU or within it.

©A LEVEL ICT/ Csc 13


 L2 and L3 caches are outside it.

When the CPU needs to access memory, cache memory is examined first. If the data is
found in cache, it is read from it. Otherwise, main memory is accessed. When the CPU refers
to memory and finds the data in cache, it is said to be a HIT. Otherwise, it is a MISS.

1.4.2. Secondary Storage


Secondary storage isnot directly accessible to the CPU. It is used to store programs and
data for backup purposes (future use). It could be placed within the computer or connected
externally. Programs and data from secondary storage must be transferred to main
memory for processing. Secondary storage is also called secondary memory, mass storage, Hard disk
backing storage or external storage. It can be divided into magnetic storage, optical storage
and solid state storage.  Magnetic Tape
A magnetic tape consists of a magnetically coated stripe on which data is stored. Data is
a. Magnetic Storage stored on the magnetic tape in chronological order or sequentially. This means that any
Magnetic storage devices store data as electromagnetic charges on the magnetic surfaces of piece of data is always stored in the next available space on the tape. To access data, the
the storage units. Examples are floppy disks, hard disks and magnetic tape. tape drive has to move through all the preceding data before it can access the desired data.
This mode of access is known as sequential access. Less susceptible to environment, they
 Floppy Disk are suitable for long-term storage and backup.
A floppy disk consists of a round flexible plastic disk coated with a magnetic substance and
protected by a plastic cover lined with a soft material that wipes the disk clean as it spins. b. Optical Storage
The disk is made of two recordable surfaces which are divided into a number of circular Optical storage devices store data as microscopic light and dark spots on the disk surface.
paths called tracks. The number of tracks per surface varies with the particular type of disk. Examples are Compact discs, digital versatile discs and Blu-ray discs. They are less
Each track is in turn divided into a number of smaller units called sectors. A sector is the susceptible to environmental damage.
basic unit of storage on the disk and has a capacity of 512 bytes.
 Compact Disc (CD)
A CD is a round disk coated with a metallic surface on which data can be stored and
accessed via laser technology. To store or access data on a CD, the CD drive focuses a laser
beam on the disc surface. Different variations of CD exist: CD-ROM, CD-R and CD-RW. A CD
can store 650MB to 700MB of data.
Floppy disk o CD-ROM stands for compact disc read only memory. CD-ROMs can only be read
but not recorded on, by the user’s computer. Their content is set during
 Hard Disk manufacture.
A hard disk consists of several metallic platters which store data. Each platter has two sides o CD-R stands for compact disc recordable. It is a type of CD that can be recorded by
and is divided into a number of rings called tracks. Tracks on a platter are numbered 0 the user. Once the user records on the CD, the content is set and cannot be
from the outside and usually go up to 1023. Each track is divided into sectors. A sector is changed. CD-R can be read by CD-ROM drives but to write on them, you need a
the basic unit of storage on the disk and has a capacity of 512 bytes. Sectors are grouped CD-R drive.
together to form clusters. A cluster is the smallest logical amount of disk space that can be o CD-RW stands for compact disc rewritable. It is a type of CD that can be recorded,
allocated to hold a file. A cylinder is a sum set of all the tracks on all the platters that have erased and reused by the user. CD-RW cannot be read by a CD-ROM and CD-R
the same track value. drives. CD-RW drives are required to read and write on them.
Factors that determine the performance of hard disks are, seek time and drive rotational
speed.
o Seek time is the time taken to move the read/write head over the right track and
sector.
o Drive rotational speed is the total number of revolutions the disk platters make
per minute. Higher rotational speed leads to higher transfer rate.

©A LEVEL ICT/ Csc 14


1.4.3. Characteristics of Storage Devices
Four important characteristics of storage devices are:
 capacity
 access time
Compact disc
 access method
 volatility
 Digital Versatile Disc (DVD)
A DVD is similar to a CD in size and thickness but has a higher storage capacity than the CD.
a. Capacity
DVDs use a laser beam of wavelength shorter than used by CDs. This allows for smaller
The capacity of a storage device is the maximum amount of data thatcan be stored on the
indentations and increased storage capacity. Just like the CD, different ions of the DVD
device’s medium.It is expressed in terms of the number of data bytesthedevice can hold.
exist: DVD-ROM, DVD-R and DVD-RW. A DVD can store up to 17GB of data. Common DVD
This simply means the unit of measurement of storage capacity is byte. Units of storage are
storage capacities are:
summarized as follows:

Types Characteristics Capacity


1 bit = 0 or 1
DVD-5 Single-sided, Single-layer 4.7GB
4 bits = 1 nibble
DVD-9 Single-side, Dual-layer 8.5GB
8 bits = 1 byte 1 character
DVD-10 Double-side, Single-layer 9.4GB 1024 bytes = 1 kilobyte (KB) approx. 1/2 page
DVD-18 Double-side, Dual-layer 17.1GB 1024 KB = 1 megabyte (MB) approx. 500,000 pages
1024 MB = 1 gigabyte (GB) approx. 5 million pages
 Blu-Ray Disc 1024 GB = 1 terabyte (TB) approx. 5 billion pages
A Blu-ray disc is an optical disc similar to a DVD and of same size, but read and written with
a blue or violet laser, whose shorter wavelength makes a higher data density possible. Blu- b. Access time
ray discs can hold 25 GB for single layer or 50 GB for double layer. Access time is the average time taken for a storage device to search and read required data
on its medium. In other words, it is how fast data can be read from or written to a memory
c. Solid State Storage device’s medium. It is measured in seconds. Units of time are summarized as follows:
The term solid-state essentially means no moving parts. Solid-state storage devices are Millisecond (ms) =
based on electronic circuits with no moving parts (no reels, no spinning disks). They store Microsecond (µs) =
data using a special type of memory called flash memory. Flash memory is a type of Nanosecond (ns) =
EEPROM that can only be erased in blocks; it cannot be erased one byte at a time. In this Picoseconds (ps) =
regard it resembles a disk that is divided into sectors. Flash memory is usually used for Femtoseconds (fs) =
storing larger amounts of data while EEPROM is used for small amounts of data, such as
machine configuration. Examples of solid state devices are USB memory sticks, memory c. Access Method
cards and secure digital cards. An access method is the technique used to retrieve information from or store information
to a medium. Storage media can be accessed in two ways: sequentially or randomly.
 USB Flash Drive
A flash drive is a small, keychain-sized flash memory device with a USB interface, treated  Sequential Access
by the computer as if it were a disk drive. A flash drive is also called thumb drive, jump The medium is accessed by proceeding from the beginning of the medium until the
drive or memory stick.USB flash drives have practically replaced diskettes as a handy way designated area is reached. Any new data is stored in the next available space on the
to transport data. They can be carried in one’s pocket and plugged into any computer for medium. To read any data stored on the medium, the device has to start from the beginning
immediate access. going through each data until the required data is found. An example of sequential access
medium is magnetic tape.
 Secure Digital Cards
A secure digital (SD) card is a type of flash-memory card that incorporates a cryptographic  Random Access
security system to prevent copyright violations, often used in digital music players and Data is accessed in any order, regardless of its location on the medium. To read any data
digital cameras. stored on the medium, the device does not need to go through all preceding data. It is also

©A LEVEL ICT/ Csc 15


called direct access. Examples of direct access devices are RAM, ROM, CDs, DVDs and 1.5.1. Motherboard Form Factor
magnetic disks. Motherboard types are better described by what we call the motherboard form factor. The
form factor of a motherboard determines the specifications for its general shape and size. It
d. Volatility also specifies what type of case and power supply will be supported, the placement of
Volatility refers to the behavior of the device without power. A device can be volatile or mounting holes, and the physical layout and organization of the board. The most common
non-volatile.Volatile means that the device loses its content when power is switched off. form factors found in modern PCs are:
Examples of volatile devices are Cache and RAM.  Advanced Technology (AT)
Non-volatile means that the device preserves its content even without power. Examples of  Advanced Technology Extended (ATX)
non-volatile devices are ROM, magnetic disks, optical discs and solid state devices.  Low Profile Extension (LPX)
 New Low profile Extended (NLPX)
1.4.4. Memory Hierarchy
Modern computers manage memory by organizing memory into a hierarchy in which large 1.5.2. The System Bus
and slower memories feed data into smaller but faster memories for faster processing of A computer bus is a set of parallel lines that interconnects various components inside the
data. This organization of computer memory is known as memory hierarchy. At the top of computer, allowing the exchange of data between them. It is the pathway between these
the hierarchy are the CPU registers followed by cache memory. The next level in the components, enabling data to be transferred from one component to another. The width or
hierarchy is made up of main memory, which is followed by magnetic disk. size of a bus is determined by the number of lines it has. The system bus is made up of
three different busses: the data bus, the address bus and the control bus.

Registers
a. The Data Bus
Cache Memory The data bus carries data between the CPU and main memory or peripherals. During a
write operation, data is carried from the CPU and during a read operation, data is carried
Faster and Main Memory
Slower and into the CPU. This means that the data bus is bidirectional. The size of the data us
smaller in size
Magnetic Disk larger in size determines how much data can be transferred in a single operation.
Optical Disc/Solid State Devices
b. The Address Bus
Magnetic Tape The address bus carries address information from the CPU to main memory or peripherals.
It is unidirectional. The CPU uses the address bus to send the address of the memory
Memory hierarchy location to be written to or read from. Also, when the CPU reads data from or writes to a
port, it sends the port address out on the address bus. The size of the addressbus
1.5. The Motherboard determines the maximum amount of main memory (RAM) that can be addressed. A
The motherboard is the main printed circuit board in the computer which holds the chipset computer with a 32 bit bus size can address a maximum RAM of 232 bits = 4GB.
and other electronic components that give function to the computer. The motherboard is
indispensable to the computer and provides the main computing capability. c. The Control Bus
The control bus is used by the CPU to send out signals to enable the outputs of addressed
memory devices or port devices. Typical control bus signals are memory read, memory
write, I/O read and I/O write.

When the CPU wants to read data from a memory location, it sends out the memory
address of the desired data on the address bus and then sends out a Memory Read signal on
the control bus. The memory read signal enables the addressed memory device to output
the data onto the data bus. The data from the memory travels along the data bus to the CPU.

1.5.3. Input/OutputInterfaces
The Motherboard The CPU communicates with I/O devices through bus interfaces connected to the system
bus. These bus interfaces also called expansion busesare then connected to ports which

©A LEVEL ICT/ Csc 16


allow the exchange of data and information between the computer and external  The data stream which is the flow of the data on which the instructions are
(peripheral) devices. performed.

a. I/O Ports 2.1. Single Instruction, Single Data Stream


A port isa pathway for data and information to go into and out of the computer from A SISD machine is a uniprocessor machine which receives a single stream of instructions
external devices such as keyboards, monitors and printers. that operate on a single stream of data. At any given moment, a single instruction is being
There are many standard ports as well as custom electronic ports designed for special executed on a given data set. In SISD machines, instructions are executed sequentially. That
purposes. Examples of ports are: is, instructions are executed one after the other, one at a time. Hence these machines are
o PS/2 ports for connecting the keyboard and mouse also called sequential or serial processor machines. They are typical examples of Von
o VGA (Video Graphics Adapter) port for connecting the monitor Neumann’s computer model.
o RJ45 port for connection to an Ethernet network
o RJ14 for connection to the Internet via phone line
Control Unit Processor
o USB port for connecting USB devices like Flash drives, printers, keyboards and IS
mice Instruction Data
o Serial ports for connecting serial devices like PDAs stream stream
Memory
o Parallel port connecting parallel devices like printers
o Firewireis high performance serial bus, for connecting devices to your personal SISD Architecture
computer. FireWire provides a single plug-and-socket connection on which up to
63 devices can be attached with data transfer speeds up to 400 mbps. 2.2. Single Instruction, Multiple Data Stream
SIMD machines are multiprocessor machines which are capable of executing the same
b. I/O Bus Standards instruction on all the processors at the same time. They have nidentical processors which
Ports follow standards that define their use. Examples of such standards are: operate under the control of a single instruction stream issued by a central control unit on
o SCSI(Small Computer System Interface) is a set of ANSI standard electronic different data sets. At any given moment, the control unit broadcasts the same instruction
interfaces that allow personal computers to communicate with peripheral to all processors which operate on different data sets from distinct data streams. SIMD
hardware such as disk drives, tape drives, CD-ROM drives, printers, and scanners machines are also called array processor machines. An example is the CRAY’s vector
faster and more flexibly than previous interfaces. Developed at Apple Computer processing machine.
and still used in the Macintosh, the present set of SCSIs are parallel interfaces.
SCSI ports continue to be built into many personal computers today and are PE 1 DS 1
supported by all major operating systems.
o USB: Universal Serial Bus Control Unit PE 2 DS 2
IS
o RS-232: DS = Data Stream
IS =Instruction Stream
o IDE: Integrated Device Equipment PE n DSn
Instruction PE = Processor Element
o PCI: Peripheral Component Interconnect
stream
o ISA: Industry Standard Architecture
o EISA: Extended ISA Memory
o VESA: Video Electronics Standard Architecture
SIMD Architecture
o SIMM: Single Inline Memory Module
o DIMM: Dual Inline Memory Module
o PCMCIA: Personal Computer Memory Card International Association 2.3. Multiple Data, Single Instruction Stream
MISD machines are multiprocessor machines capable of executing different instructions on
2. Flynn’s Taxonomy of Computer Architecture different processors, but all of them operating on the same data set. They have n
Michael Flynn classified computer architecture into four distinct categories based on the processors, each with its own control unit, that share a common memory. Each processor
notion of stream or flow of information into the CPU. He identified two types of information receives a distinct instruction stream but all operate on the same data stream. Such
streams: machines no longer exist.
 The instruction stream which is the flow of instructions into the processing unit

©A LEVEL ICT/ Csc 17


Some personal computers implement parallel processing with dual-core processors or multi-
core processors. Others have two or more separate processors. Others have two or more
separate processor chips, respectively called dual processor chips, respectively called dual
processor or multiprocessor computers.
1
Control Unit 1 PE 1

2 3. Processor Architecture
Control Unit 2 PE 2
A processor’s architecture refers to the way in which its memory and control are organized.

Control Unit n PE
3.1. Instruction Set Architecture
IS = Instruction Stream
PE = Processor Element Every CPU on the market today has a predefined instruction set which defines the primitive
Data operations that can be performed by thatCPU.
Memory
Stream
Definition: An instruction set is the collection of bit patterns or binary codes for the machine
MISD Architecture operations that a processor has been designed to perform.

An instruction set architecture (ISA) is the interface between the computer's software and
2.4. Multiple Data, Multiple Instruction Stream hardware and also can be viewed as the programmer's view of the machine. Besides
MIMD machines are multiprocessor machines capable of executing multiple instructions on instructions, it defines items in the computer that are available to a program - e.g. data
multiple data sets. They have n processors, n streams of instructions and n streams of types, registers, addressing modes, and memory.
data.Each processor element in this model has a separate instruction stream and data There are two types of fundamental CPU architectures based on the notion of instruction
stream hence such machines are well suited for any kind of application. Examples of MIMD set: complex instruction set computers and reduced instruction set computers.
machines include multi-core computers like the Blue Gene, Fujitsu K computer and CRAY
Jaguar. 3.1.1. Complex Instruction Set Computer(CISC)
CISC (pronounced sisk) is a CPU design with a large amount of different and complex
IS 1 DS1
Control Unit 1 PE 1 instructions. In CISC processors, the control unit contains a number of micro-electronic
circuitry to generate a set of control signals and each micro-circuitry is activated by a
IS 2 DS 2 microcode. Complex instructions are first decoded and the corresponding microcode
Control Unit 2 PE 2 DS = Data Stream
routine dispatched to the execution unit.
IS = Instruction Stream
IS
The standard features of CISC processors are:
ControlUnit PE n DS n
 a large number of different and complex instructions.
 the use of complex addressing modes.
 execution of different machine programs on a CISC machine.
Memory
 the use micro-program control unit.
 limited number of registers.
MIMD Architecture
 variable length instruction encoding
 direct memory access
Assignment: SIMD, MISD and MIMD machines are known as parallel processing machines.
What do you understand by parallel processing? Examples of CISC processors are: Intel 386, 486, Pentium, Pentium Pro, Pentium II,
Pentium III, Motorola’s 68000, 68020, 68040, etc.
Answer: Parallel processing is the use of multiple (independent) processors simultaneously to
execute a single program or task. 3.1.2. Reduced Instruction Set Computers (RSIC)
Parallel processing divides a single problem into portions so that multiple processors work on RISC(pronounced risk) is a CPU design with a small number of basic and simple machine
their assigned portion of the problem at the same time. Parallel processing requires special language instructions, from which more complex instructions can be composed. RISC
software that recognizes how to divide the problem and then bring the results back together instructions are hardwired. That is, they are built into the chip with hardware rather than
again.

©A LEVEL ICT/ Csc 18


programming. Hardware implementation of instructions is much faster and uses less 4.1.1. Operating Systems
silicon than a microcode implementation.
The standard features of RISC processors are:
 a small and limited number of instructions. 4.1.2. Basic Input Output System
 the use of hardwired control unit. Basic input output system (BIOS) is software that contains hundreds of programs that
 consumption of less power and high performance allow for communication between the CPU and devices. It is stored on ROM, which is a
 instructions are very simple and consistent permanent chip on the motherboard.
 the use of simple addressing modes There are three kinds of BIOS for hardware devices:
 fixed length instructions (easier to decode)  Permanent never changing BIOS for never changing hardware like the keyboard
 pipelining possible because fixed length instructions  BIOS for hardware that changes occasionally. It requires extra volatile information so
it is stored on a separate chip called CMOS (Complementary Metal Oxide
Examples of RISC processors are: IBM RS6000, MC88100 Semiconductor).
DEC’s Alpha 21064, 21164 and 21264 processors, Motorola/IBM PowerPC
4.1.3. Utility Software
Assignment: What is pipelining (pipeline processing)? Utility software is used to enhance the operating system, or in some other way improve the
usefulness of the system. They help analyze, configure, optimize and maintain the
3.2. Addressing Modes computer. Rather than providing user-oriented or output-oriented functionality, utility
A machine instruction specifies to the CPU what to do, where the data is located, and where software focuses on how the computer infrastructure operates. Most major operating
the output data (if any) will be put. Every instruction is made up of two parts: Op-code and systems come with several pre-installed utilities. Examples of utility software include: disk
operand. defragmenters, backup utilities, disk compression utilities, disk cleaners, file managers,
 The Op-code (operation code) denotes the basic machine operatione.g. ADD, STORE, disk formatters and virus checkers.
SHIFT, XOR.  Disk defragmenters detect computer files whose contents are broken across several
 The operand (one or more) provides the data which the instruction manipulates. locations on adisk, and move the fragments to one location to increase efficiency.
 Disk cleaners find and delete files that are unnecessary to computer operation, or
For example, ADD A, #0E – ADD is the op-code; A and #0E are operands take up considerable amounts of space. They help users decide what to delete when
MOV AX, 0 – MOV is the op-code; AX and 0 are operands their hard disk is full.
 Backup utilities make copies of all information stored on a disk, and restore either the
Operands can be specified in different ways in an instruction. The way an operand is entire disk (e.g. in an event of disk failure) or selected files (e.g. in an event of
specified in an instruction is known as an addressing mode. accidental deletion).
 Disk compression utilities reduce the space that a file takes up on disk, increasing the
Definition: An addressing mode refers to the way in which the processor locates the data capacity of the disk.
(operand) associated with an instruction.  File managers provide a convenient method of performing routine data management
tasks, such as deleting, renaming, moving, copying, merging, generating and
There are dozens of possible addressing modes, but they all generally fall into one of the modifying files.
following categories: direct addressing, indirect addressing and indexed addressing.  Disk partition utilities divide an individual drive into multiple logical drives, each
with its own file system which can be mounted by the operating system and treated
a. Direct Addressing as an individual drive.
b. Indirect Addressing  Disk formatters
c. Indexed Addressing  Virus checkers prevent, detect, and remove malware.

4.1.4. Device Driver


4. Software A device driver is software that allows interaction between the operating system and a
hardware device. It is an interface for communicating with the device through the specific
4.1. System Software computer bus that the hardware is connected to. Without an appropriate device driver the
system cannot communicate with a device, rendering the device useless. Installation of
device drivers usually happens automatically when hardware is connected (plug n play), or

©A LEVEL ICT/ Csc 19


from a CD provided with the device. Sometimes a device driver needs to be updated to stay
functional. 4.2.2. Special Purpose Software
Special purpose software is designed for a specific task. Examples are web browsers, game
4.1.5. Language Translators applications, weather forecasting applications, media players and flight control software.
A language translator is a computer program that translates program instructions from one
programming language to another. There are three types of language translators: 4.2.3. Custom-Written Software
compilers, interpreters and assemblers. Custom-written software is written to a particular user’s requirements or needs. It is
 Compilers translate instructions written in a high-level language into machine generally not available off-the-shelf and often has to be purchased directly from the
language instructions. software manufacturer. It is also called bespoke software or tailor made software as it is
 Interpreters translate instructions written in a high-level language into machine tailored to the exact requirements of the user or organization.
language instructions and execute them, one line at a time.
 Assemblers translate instructions written in assembly language to machine 4.3. Software Distribution Licenses
language instructions. Software are distributed under different licenses. They include public domain, freeware,
shareware, open source and all rights reserved.
4.2. Application Software
Application software is computer software that causes a computer to perform useful tasks 4.3.1. Public Domain
beyond the running of the computer itself. They provide user-oriented functionality. Public domain software has no owner and is not protected by copyright law. It was either
Application software are used to carry out productive work like typing a letter, designing created with public funds or the ownership was forfeited by the creator. Public domain
and invitation card, surfing the Internet, listening to music or watching a movie. software can be copied, sold and/or modified. It is often of poor quality.
Application software includes a variety of programs that can be subdivided into general
purpose software, special purpose software and custom-written software. 4.3.2. Shareware
Shareware is copyrighted software that allows you to use it for a trial period but you must
4.2.1. General Purpose Software pay a registration fee to the owner for permanent use. Purchasing the right to use the
General purpose software is designed for a variety of tasks. It is not limited to one software may also get you a version with more powerful features and published
particular function. They are also called generic software and can be found off-the-shelf. documentation.
That is, they can be bought from the market.Different types of general-purpose application
software exist. 4.3.3. Freeware
Freeware is copyrighted software that is licensed to be copied and distributed without
a. Word Processing Software charge. Freeware is free but it is still under the owner’s control. Examples are Eudora and
Examples are MS Word, WordPerfect, WordPad, NotePad Netscape.

b. Spreadsheet software 4.3.4. Commercial Software


Examples are MS Excel, Lotus 1-2-3, Quattro Pro, Apple Numbers All rights reserved software is software that must be used by the purchaser according to
the exact details spelt out in the license agreement.
c. Database Software
Examples are MS-Access, Oracle, Dbase, FileMaker Pro 4.3.5. Open Source Software
Open source software is software whose source code is published so that a variety of
d. Presentation Software people can add contribution. Examples are Linux OS, MySQL, Mozilla and OpenOffice.
Examples are MS PowerPoint, HyperStudio, Digital Chisel
e. Desktop Publishing Software
Examples are MS Publisher, Adobe PageMaker, Quark Express

An integrated software package is software that consists of multiple applications bundled


together. They usually have related functions, features and user interfaces, and may be able
to interact with each other. Examples are Microsoft Office, OpenOffice, Lotus Smart suite
and Microsoft works.

©A LEVEL ICT/ Csc 20


IV. SOFTWARE

Introduction a. OS Kernel
A computer system is basically made up of hardware and software. Hardware refers to the The kernel is the central part of an operating system that is running at all times on the
physical components of the computer. They are the parts of the computer that can actually computer. It loads first and remains in memory as long as the computer is on. It consists of
be seen and touched like the keyboard, mouse, monitor and internal circuits.Software on utilities (file manager, memory manager, device drivers, process manager etc.) that
the other hand, refers to the collection of computer programs and data that run on a perform basic required functions. In many operating systems, only the kernel can access
computer, and which make the hardware useful. They are the intangible components of the hardware directly.
computer system.
Computer software has two major categories namely system software and application b. Command Interpreter
software. The command interpreter (processor) is the part of the operating system that understands
and executes commands that are entered interactively by a human being or from a
1. System Software program.In some operating systems the command interpreter is called shell.It provides an
System software control and coordinate computer resources (hardware and operations) so interface between users and the operating system (kernel).When a user logs in, a shell is
that the computer user and applications can smoothly interact. They help the computer started up.
carry out its basic operating tasks. System software are designed to perform computer
related tasks. They include operating systems, firmware, utility programs, device drivers, c. SystemCalls
library programs and language translators. The interface between the OS and the user program is defined by a set of instructions called
system calls. User programs use system calls to talk with the operating system.
1.1. The Operating System
The operating system is the essential software that is required for a computer to become Definition: System call is the mechanism by which a program requests a service from the
operational. Itis the software layer that is on top of the hardware to provide functionality to operating system’s kernel.
computer components, manage the hardware and serve as interface between the computer
user and the computer. The operating system is called a virtual machine as ithides the When a running program needs a service from the operating system, it calls a system call.
complexity of the hardware and presents the user with an interface that is easier to
understand and program. 1.1.2. Memory Management
The operating system is stored on disk, but it needs to be loaded into memory (RAM) once For a program to be executed, it must be found in main memory (RAM). In a
the computer is switched on and before any other program can be run. The term multiprogramming environment in which several programs can reside in memory at the
bootstrapping refers to the process of loading the operating system into a computer’s same time, every program and its data must be protected from the actions of other
memory. This process is done by a program called the bootstrap loader that is stored programs. Memory management keeps track of what programs are in memory and where
permanently in the computer’s electronic ROM chip. Examples of operating systems are in memory they reside.
Windows (95, 98, 2000, XP, Vista, 7 and 8), Macintosh Operating System (Mac OS), Linux Memory allocation determines where a program as well as its related data will be kept in
and UNIX. memory for execution. Memory needs to be allocated efficiently to pack as many jobs in
memory as possible. Memory can be subdivided into segments or frames (pages).
1.1.1. Operating System Structure
The operating system can be divided into two main components: kernel and command a. Segmentation
interpreter (shell). Segmentation is when memory is divided into variable sized units called segments. When
segments are used, memory allocation can be done in three different ways:
o First fit allocates the first free segment that is large enough for the new process.
o Best fit allocates the smallest block among those that are large enough for the
new process.
o Worst fit allocates the largest block among those that are large enough for the
new process.

b. Paging
OS structure
©A LEVEL ICT/ Csc 21
Paging is when memory is divided into fixed-size units called frames. Jobs are broken up In other words, it is the length of time it takes to run a process from initialization to
into blocks of same size as frames called pages which are allocated a number of frames. The termination, including all the waiting time.
OS then uses a page table to map program pages to memory frames. The pages for each job
could be in logical order or they may be scattered about wherever there is a free frame. Assignment: Define the terms scheduler and dispatcher.

c. Virtual Memory Answer:


A program may require more memory than it is available. To solve this problem, virtual i) Scheduler: the part of the kernel in charge with the strategy for allocation/de-
memory is used. Virtual memory is part of the hard disk that is used as an extension of allocation of the CPU to each competing process. It maintains a record of all
RAM. It is slower, but it is considerably bigger. As execution goes on, data is being swapped processes(called process table) in the OS, adds new processes to the process table
between RAM and virtual memory. and removes the ones that are completed.
When a program is running, only the pages that contain the necessary data are kept in RAM
while those that are not needed are kept on disk. For example, a program that has been ii) Dispatcher: the component of the kernel that oversees the execution of the scheduled
minimized for a long time may be transferred to virtual memory so as not to fill up the processes. It performs “process switch” – procedure to change from one process to
main memory. another.
Disk thrashing occurs when the OS has to spend a considerable proportion of its time
swapping data between virtual and real memory. The operating system manages a large amount of data about a process like the program
counter (PC), CPU registers, memory management information, I/O status, scheduling data
1.1.3. Process Management and process state. This data is stored in a data structure called a process control block
A process is a program in execution. It consists of the program’s instructions and the (PCB) also called process descriptor or state vector. Every process has its PCB and each
resources allocated to it for execution. A program is static while a process is active. The time a process is moved to the running state, its register values are loaded into the CPU
operating system performs process management to carefully track the progress of a while register values for the currently running process are stored into its PCB. This
process and all of its intermediate states. exchange of information is called a context switch.
A process changes state as it executes. The different states a process can have are shown in
the diagram below. a. Process Synchronization
In a multi-tasking system, processes compete for resources. A resource is anything that is
required by a process to accomplish its task (processor, memory, I/O device, bus, file etc).
Some resources can only be used in a non-sharable or exclusive mode. That is, they cannot
be used by more than one process at a time. Such resources are known as critical resources.
A critical section is a part of a program where it has access to a non-sharable (critical)
resource. To prevent two or more processes from entering their critical sections over the
same resource, processes must be synchronized.

Definition: Process synchronization is about getting processes to coordinate together in


order to avoid two or more processes entering into critical section over the same resource.
Process states
If processes are not synchronized, it leads to deadlock and starvation.
o New - The process is being created.
o Ready - Process has all needed resources - waiting for CPU only. b. Deadlock
o Running - Instructions are being executed. Deadlock is a permanent blocking of a set of processes competing for resources. It is
o Waiting - Process is waiting for some event to occur (human, hardware or another asituation in which each of two processes is waiting for the other to do something; thus,
process) neither one can proceed. For a deadlock to occur, the following four conditions must hold.
o Terminated - Process has finished execution  Mutual Exclusion: At least one resource must be held in a non-sharable way.
 Hold and Wait: A process must be holding a resource and waiting for another.
Definition: The turnaround time for a process is the amount of time between the time the  No Preemption: No resource can be forcibly removed from a process holding it.
process arrives the ready state and the time it exits the running state for the last time.  Circular Wait: A waits for B, B waits for C, C waits for A.

©A LEVEL ICT/ Csc 22


Deadlock can be prevented by ensuring that one of the above conditions does not hold. For
example using pre-emptive scheduling.

c. Starvation
Starvation is a situation where a task can never finish because it can never get a necessary b. Shortest Job First
resource such as a large block of memory. The operating system should detect such tasks Shortest job first (SJF) algorithm looks at all the processes in the ready state and dispatches
and do its best to allocate the resources that they need. the one with the smallest execution time. It is also generally implemented as a non-
preemptive algorithm. Using the SJF algorithm, we have
1.1.4. Process/CPU Scheduling
CPU scheduling is the act of determining which process in the ready state should be moved
to the running state. It decides which process in memory is to be executed by the CPU at
any given moment. Scheduling decisions may take place when a process:
1. Switches from running to waiting state
Disadvantage
2. Switches from running to ready state
 Some jobs may never be executed as they have a high service time (starvation).
3. Switches from waiting to ready
4. Switches from running to terminated
c. Round Robin
Round-robin algorithm distributes time equitably among all ready processes by
Scheduling can be preemptive or non-preemptive.
establishing a particular time slice (or time quantum), during which each process executes.
At the end of the quantum, the process is preempted. It returns to the ready state to allow
 Preemptive scheduling is scheduling in which the currently executing process is
another process its turn. Using round-robin algorithm with time slice of 50, the above
forced to give up the CPU. Scheduling under (2) and (3) is preemptive.
processes will be scheduled as follows:

 Non preemptive scheduling is scheduling in which the currently executing process


gives up the CPU voluntarily. Scheduling under (1) and (4) is non-preemptive.

There exist different algorithms used for scheduling. Examples are first come, first served,
shortest job first and round robin algorithms.
1.1.5. Management of I/O Devices
a. First Come, First Served
First come first served algorithm moves processes to the CPU in the order in which they a. Interrupts
arrive in the ready queue. It is non-preemptive. As such, when a process has the CPU it runs An interrupt is a signal generated by hardware or software that causes the CPU to suspend
to completion before giving up the CPU. what it is doing to handle another task of higher priority. Any event that will cause an
Consider that the following processes arrive in the order they are given below. interrupt is called an interrupt request (IR). For example, a key pressed on the keyboard.
An interrupt handler or interrupt service routine (ISR) is a program that services an
interrupt request. It contains the actions that will be executed for a given interrupt request.
Process Service time

P1 140 b. Polling
P2 75
c. Buffering
P3
A buffer is an area of memory used to temporarily store data while it is being moved from
P4 280 one place to another.
P5 125
1.1.6. File Management
The file system is the portion of the operating system that manages how files are stored.
Using FCFS algorithm to schedule the processes, we get
Examples of file systems are FAT used in MS DOS, NTFS used in Windows, ext2 used in

©A LEVEL ICT/ Csc 23


Linux and HPFS used in OS/2. The operating system is responsible for the following o Read/write access file permissions.
activities in connection with file management: o Encryption of data
o File creation and deletion. o Virus protection software layers.
o Directory creation and deletion.
o Support of primitives for manipulating files and directories 2. Types of Operating Systems
o Mapping files onto secondary storage. 2.1. Single User OS
o File backup on stable (nonvolatile) storage media. A single user operating system is an operating system which allows only one user to work
on the system at a time. No two or multiple users can work on the system simultaneously.
1.1.7. ProvidingUser Interface Examples are Control Program for Microcomputers (CP/M) and Microsoft Disk Operating
Working on a computer, a user has to interact with the computer. A user interface is the System (MS DOS).
means of communication or interaction between the user and the computer. The operating
system provides this means that enables an individual to see and work when using a 2.2. MultiUser OS
computer. A multi-user operating system is an operating system which allows multiple users to work
Different operating systems provide different types of user interfaces. on the system simultaneously. This type of operating system is larger and more complex
than a single user operating system.
a. Command Line Interface (CLI) Features of multi-user operating systems, which are not provided in single user operating
A command line interface allows the user to interact with the computer by typing the systems, are:
commands in a specified format. It provides a prompt through which the user types the o Time sharing (CPU devotes time to all the users in round robin fashion).
commands. Here the user mostly makes use of the keyboard. o Tight security features.
In this type of interface, the user has to remember the name and format of the commands. o Resource sharing among users.
Spelling mistakes and deviations in format lead to errors and the task is not performed. o System administrator privileges
Examples of operating systems that provide a command line interface are MS DOS, early Examples of multi-user operating systems are Linux, Unix and Virtual Machine System
versions of UNIX and Linux. (VMS).

b. GraphicalUserInterface (GUI) 2.3. Single task OS


A graphical user interface allows the user to interact with the computer through graphical A single task operating system allows a user to execute one and only program at a time. The
items such as icons, menus, dialog boxes, etc. Here, the user mostly makes use of the mouse user cannot run two or more programs at the same time. It is not possible to be preparing a
to point and click on these graphical items. GUI is also known as WIMP system where worksheet on the computer while printing a report or listening to music. Once a user
WIMP stands for windows, icons, menus and pointers. invokes a program, the computer gets dedicated to that task only.
This type of user interface requires a lot of memory space to store the graphics and can CP/M and MS-DOS are examples of single user single task operating systems.
cause machines with low processing power to be slow. Examples of operating systems with
a graphical user interface are Windows, Macintosh operating systems, some versions of 2.4. MultiprogrammingOS
Linux and UNIX. A multi-programming operating system is an operating system that allows multiple
programs to be held in main memory at the same time. The concept of multi-programming
c. Voice Recognition Interface is that the operating system keeps several jobs in memory simultaneously and decides
A speech recognition interface allows the user to give verbal commands to the computer. which can be executed at a given moment.
The user communicates with the computer through natural language. They are also called
natural language interface 2.5. Multitasking OS
A multitasking operating system allows a user to execute more than one program at a time.
1.2. Providing Security It allows a user to be preparing a worksheet on the computer while printing a report or
Security is the most desirable characteristic of any operating system. An operating system listening to music. Multitasking is an extension of multiprogramming as two programs
should provide a means for safeguarding system resources from unauthorized users and cannot be executed simultaneously if they are not found in memory at the same time.
protection of one user's resources from other users of the system. Windows Me, Windows-XP, Macintosh operating system, OS/2 are examples of single user,
Popular operating systems offer security features through incorporation of the following: multitasking operating systems.
o Login name.
o Login password.

©A LEVEL ICT/ Csc 24


2.6. Embedded OS As characters are composed of bits, fields are composed of characters. A field is a group of
An embedded operating system is an operating system that is used in an embedded system. characters that conveys some meaning. For example, a person’s name, a word, the name of
An embedded system is a small computing device that is built into a larger equipment often a place or thing.
as a single chip and dedicated to a given task. Embedded systems control many devices in
use today such as digital watches, mobile phones, microwave ovens, washing machines,  Record
vehicles, photocopiers, cameras and process controllers. A record is a collection of related fields. A record consists of fields, with each field
Embedded OS are ROM based. That is, they cannot be modified as ROM is read only. describing an attribute of an entity.

2.7. Network OS  File


A network operating system is an operating system which includes networking features. It A file is a collection of related records. Files are frequently classified by the application for
contains special functions, protocols and device drivers that enable the computer to be which they are primarily used. A primary key in a file is a field whose value identifies a
connected to a network. record among others in the file.
Examples of network operating systems are Windows-NT, Windows-2000 server, Windows
server 3000, Novell Netware and Artisoft LANstatic.  Databases
Some multi-purpose operating systems like Windows XP, Windows 7 and Mac OS 10, come A database is a collection of files.
with capabilities that enable them to be described as network operating systems.
2. File Formats
Records in a file must be stored in a way that a program that uses the file will be able to
recognize and possibly access it. This is known as file format.

Definition: File format is a particular way that data is encoded for storage in a computer file.
V. FILE FORMAT AND ORGANISATION
A particular file format is often indicated as part of a file's name by a file name extension.
Introduction Conventionally, the extension is separated from the file name by a dot and contains three
Computers process and store all forms of data in binary format. or four letters that indicate the format. A file name is a unique name that is given to a file
within its file directory. For example, lectures.docx is a file with filename “lectures” and
1. Data Hierarchy extension “.docx” indicating that the file is an MS Word 2007 document.
Data items processed by computers form a data hierarchy in which they become larger and There are as many different file formats as there are different programs to process the files.
more complex in structure as we progress from bits, to characters, to fields and to larger A few of the more common file format types are:
data elements. Data elements can be organized in a hierarchical form as follows:
2.1. Graphics File Formats
Bit  Byte (character) Field Record  File  Database Computers store graphic images as either bitmap images or vector graphics.

 Bit 2.1.1. Bitmap Images


The smallest data item manipulated by computers is the bit (short for binary digit). Each A bitmap image is stored as a collection of tiny dots (pixels) of individual colors that make
bit can assume either the value 0 or the value 1. up the image. Pixel is short for picture element.A data file for a bitmap image contains
information about every single pixelin the image. As a result, the file size of a bitmap
 Byte graphic is often quite large.
A single bit is of little or no use as it can represent only two states. To make them Bitmap images are resolution dependent. Resolution refers to the number of pixels in an
important, they are usually used in groups. A group of eight bits is known as a byte. A byte image and is usually stated as dpi (dots per inch) or ppi (pixels per inch).The more the
is the smallest addressable unit of the computer and it is used to represent a character. number of pixels in an image, the more detailed the image will be.
Each character, be it a letter, a digit or a symbol is represented as an eight bits pattern. The Because bitmaps are resolution dependent, it's difficult to increase or decrease their size
word “data” has 4 characters, meaning that it will take up 4 bytes which is 32 bits. without sacrificing a degree of image quality.
Some common bitmap graphic programs are:
 Field  Photoshop
 Paint Shop Pro

©A LEVEL ICT/ Csc 25


 GIMP o 3GPP - Third Generation Partnership Project
 Photo-Paint
 Graphic Converter 2.3. Common Application File Formats
o DOC or DOCX - Document file (ASCII or MS Word)
Examples of bitmap formats include: o PDF - Portable Document Format
o JPEG or JPG - Joint Photographic Experts Group o TXT - ASCII Text file
o GIF - Graphics Interchange Format o XLS (XLSX)- Excel Worksheet file
o TIFF or TIF- Tagged Image File Format o WKS, WK2, WK3- Lotus 1-2-3 or MS Works Worksheet
o BMP - Bitmap graphics file o PPT (PPTX)- PowerPoint presentation file
o PNG – Portable Network Graphic
2.4. Hypermedia File Formats
2.1.2. Vector Graphics o HTML (HTM)- Hypertext Markup Language
Vector images are stored as a collection of shapes (lines, circles, curves) called objects, o XML- Extensible Markup Language
together with information defining how the objects will be produced and where they will o SGML- Standard Generalized Markup Language
be located. The data file for a vector image contains the points where the shapes start and
end, how much the shapes curve, and the colors that either border or fill the shapes. 2.5. Other File Formats
Because vector graphics are not made of pixels, the images can be scaled to be very large o EXE - Executable file (machine-language program)
without losing quality.Programs used with vector graphics are drawing programs. Some of o DLL - Dynamic Link Library
these programs include: o SYS - System file
 Corel Draw o ZIP- Zip compressed file
 Adobe Illustrator
 Adobe Photoshop 3. File Organization
File organization refers to the logical structuring of records in a file. In other words, it is the
Examples of vector formats are: way records are arranged in a file.
o SVG - Scalable Vector Graphic In the context of data processing, files can be grouped into two types: master and
o CDR- CorelDraw graphic transaction files.
o CMX - Corel Meta Exchange  A master file contains the permanent data of a data processing system. Master files
o EPS - Encapsulated Postscript represent the most up to date situation of the system and contain two basic types of
o CGM - Computer Graphics Metafile data:
o PICT - Macintosh Picture o data of a more or less permanent nature which only requires updating
o WMF- Windows Metafile occasionally;
o data which will change every time transactions are applied to a file.
2.2. Multimedia File Formats
Multimedia is any combination of digitally manipulated text, sound, animation and video.  A transaction filecontains data that is necessary to keep a master file up to date. Data
iscollected on a daily, weekly or monthly basis into a transaction file which is then
2.2.1. Audio File Formats used toupdate the master file.

o MP3- MPEG Layer 3 Depending on the arrangement of records in a file, files can be serially, sequentially or
o WMA- Windows Media Audio randomly organized.
o WAV - Waveform audio file
o MIDI- 3.1. Serial File Organization
Serial files are files in which records are stored in chronological order with no particular
2.2.2. Video File Formats sequence. As each record is received it is stored in the next available storage space. In
order to access a particular record, the file must be read record by record from the
o AVI - Audio Video Interleave beginning of the file until the required record is found. This type of access is called serial
o MPEG or MPG - Motion Picture Experts Group access. Serial access is very slow which makes it impossible for serial files to be very useful

©A LEVEL ICT/ Csc 26


if individual records have to be looked up. They are used as temporary files to store 4.1.2. Deleting a Record
transaction data. The process of deleting a record from a serial file is more complex. It involves reading the
records from the beginning of the file and writing them, one by one, to a new file and
3.2. Sequential File Organization simply not writing the record chosen for deletion.
A sequential file is a serial file in which records are stored in order by a record-key field.
That is, the records are sorted according to a given field that identifies each record in the Open file A for reading
file, in a unique way. Sequential files are also accessed serially. However, a sequential file is Open file B for writing
particularly useful when a whole file of data has to be processed as it is faster and more While not at end of file A
efficient than other methods. Sequential files are ideal for master files and batch processing Read a record from file A
applications such as payroll and billing systems in which almost all records are processed If Key_of_A<>Key_to_Delete then
in a single run of the application. Write record A to File B
Serial and sequential files can be stored on both magnetic disk and magnetic tape. They are Endif
particularly suited to tape which is a serial/sequential access medium. Endwhile
Close file A
3.3. Indexed Sequential File Organization Close file B
An indexed sequential file is a sequential file in which an index is added to support random
access. In this type of file, records are stored in blocks and the address of every block is File B now contains the amended data and file A still exists with the original data.
stored in an index. A block address may consist of the key of the first record in the block.
Indexed sequential files therefore combine the advantages of a sequential file with the 4.2. Processing Sequential Files
possibility of direct access. To access any record in the file, the index is searched to 4.2.1. Adding a Record
determine the block to which the record belongs. The record is then searched for In order to maintain the order of the sequential file the new record has to be placed in
sequentially but only within the block in which it is found. thecorrect position in the file. This is done by copying the records from the original file
intoa new file until the position for the new record is found. The new record is written and
3.4. Random File Organization then the remaining records copied after.
A random file is a file in which records are stored in random order. In a random file, the
value of the record key is mapped by a hash function to an address within the file where Open file A for reading
the record will be stored. The function transforms the value of a record key into an index Open file B for writing
that corresponds to a location in the file. This process is called hashing. Any record within While not at end of file A
this type of file can be accessed directly without reference to any other record. Read a record from file A
To create and maintain a random file, a mapping function must be established between the If Key_of_A<=Key_to_Add then
record key and the address where the record is held Write record A to File B
Else
4. Processing Files Write new record to File B
The main processes that can be performed on files are adding records, deleting records and Endif
updating records. Endwhile
Close file A
4.1. ProcessingSerial Files Close file B
4.1.1. Adding a Record
As there is no particular order in a serial file new records are simply added at the end of the 4.2.2. Deletinga Record
file. The process can be expressed in simple algorithm: This is exactly the same process as for a serial file.
Open file A for writing
Move record pointer to end of file A 4.3. Processing Direct Files
Write new record to file A 4.3.1. Addinga Record
Close file A
4.3.2. Deletinga Record

©A LEVEL ICT/ Csc 27


5. File Data Security 4.4.3. Isolation
There is always a chance that data can be compromised though it may appear secure when Isolation refers to the requirement that no transaction should be able to interfere with
confined in a computer. One could suddenly be hit with a malware infection where a virus another transaction. No transactions that affect the same rows can run concurrently since
destroys the files or hackers may gain access into the computer system and steal, delete or their sequence and hence their outcome would be unpredictable.
destroy files. To secure data, some measures need to be taken.
Data security is the practice of keeping data protected from corruption and unauthorized 4.4.4. Durability
access. Measures taken to ensure the safekeeping of data include backup storage, archival Durability means that once a transaction has been committed, it will remain so even in the
storage, data encryption, authentication, logs, antivirus and firewall. event of power loss, crashes or errors.

4.1. Backup Storage 4.5. Virus Checking Software


Backup is the process of making copies of data which may be used to restore the original A virus checking software or antivirus is software that is used to prevent, detect and
data after a data loss event. Copies of data can be made and stored on storage devices like remove malware. Malware are malicious software including but not limited to computer
external hard drives, CDs and DVDs. Backups have two distinct purposes; to recover data viruses, computer worms, Trojan horses, spyware and adware. Malware are designed to
after its loss, be it by data deletion or corruptionand to recover data from an earlier time, cause damage or disruption to a computer system. When an antivirus has been installed on
according to a user-defined data retention policy, typically configured within a backup a system, it is necessary to update it regularly. Examples of antivirus software are Avast,
application. Kaspersky, McAfee, Avira, AVG and Smadav.

4.2. Archival Storage See Encryption, authentication and firewall in Chapter 2.


Data archiving is the process of moving data that is no longer actively used to a separate
data storage device for long-term retention. Data archive is often confused with data
backup, which are copies of data. Data archives protect older information that is not
needed for everyday operations but may occasionally need to be accessed while data
backups are used to restore frequently used data in case it is corrupt or destroyed.

4.3. Audit Logs VI. NUMBER SYSTEMS AND CODES


An audit log is a record of all the actions carried out by the user of a system, stored together Introduction
with their user name. If a file is deleted, modified or copied, the person responsible can be
identified by examining the logs. Getting a computer system to keep logs is one way of 1. Number Systems
deterring authorized users from damaging or stealing data from the system. A number system is a set of symbols and rules used to represent numbers. The number of
different symbols used in a given number system is known as the base or radix of the
4.4. Transaction Logs system. The largest value of a symbol (digit) in a given number system is always one less
A transaction log (also database log or binary log) is a history of actions executed by a than the base or radix of that system. If the base of a system is represented by“ ”, then the
database management system to guarantee ACID properties over crashes or hardware largest value a digit in that system can assume is “ − 1”.
failures. ACID is a set of properties that guarantee that database transactions are processed Examples of number systems include the binary, octal, decimal (denary) and hexadecimal
reliably. ACID stands for atomicity, consistency, isolation and durability. systems.

4.4.1. Atomicity 1.1. The Decimal System


Atomicity requires that database modifications must follow an “all or nothing” rule. This The decimal system has a base value of 10. Its maximum or largest value of digit is
means that,if one part of a transaction fails, the entire transaction fails and the database ( − 1) = 10 − 1 = 9, meaning thatthe decimal system uses the digits
state is left unchanged. This guarantees that a transaction cannot be left in an incomplete 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 to represent any quantity.
state. For any n-digit number, the value each digit represents depends on its position in the
number. Decimal positions (place values) are powers of ten as shown below:
4.4.2. Consistency Least Significant
Most Significant
Consistency ensures that any transaction will bring the database from one valid state to Digit(LSD)
Digit(MSD) 10 …P 10 10 10
another. Any data written to the database must be valid according to all defined rules.
Decimal positions 360
©A LEVEL ICT/ Csc 28
iii. 1001011 − 110101 = 10110 (75 − 53 = 22)

Where, 10 is the ones place 1.2.3. Binary Multiplication


10 is the ten’s place Rules for multiplication:
10 is the hundreds place 0 × 0 = 0; 0 × 1 = 0; 1 × 0 = 0; 1 + 1 = 1

The value of any digit in a given n-digit number is obtained by multiplying the digit by its i. 101 × 10 = 1010 ……………………………….. (5 × 2 = 10)
place value. The value of the number is the sum of the products of the digits and their place ii. 111 × 101 = 100011 …………………………. (7 × 5 = 35)
values. That is, we multiply each digit by its place value, then we add the different products iii. 11011 × 1101 = 101011111 ……………… (27 × 13 = 351)
obtained.
Example: 234 = 2 × 10 + 3 × 10 + 4 × 10 . This means that there are two one 1.2.4. Binary Division
hundreds, three tens and four ones in the number 234. Rules for division:
0/1 = 0; 1/1 = 1; 1/0 = undefined.
Remark Each digit position in decimal has a weight that is ten times the one to its
immediate right. That is, 10 is ten times greater than 10 which is ten times greater 1.3. The Octal System
than 10 . The octal system has a base value of 8. It uses the digits 0-7 to represent any quantity.
Weights in octal are powers of eight as shown below.
1.2. The Binary System Least Significant
Most Significant
The binary system has a base value of 2. Only two digits 0 and 1, are used to represent any 8 … 8 8 8 Digit (LSD)
Digit (MSD)
quantity in binary. These digits are called binary digits or more commonly bits. To express
any quantity in binary we use powers much like in the decimal system but this time, the Octal positions
weights are powers of 2 as shown below.
Where 8 is the one’s place
Least Significant
Most Significant 8 is the eights place
Bit (LSB)
Bit (MSB) 2 … 2 2 2 8 is the sixty fours place

Binary positions for an -bit number


Example: 367 = 3 × 8 + 6 × 8 + 7 × 8
(This means that there are 3 sixty fours, 6 eight’s and 7 one’s in 367)
e.g. the binary number 1101 is expressed as1101 = 1 × 2 + 1 × 2 + 0 × 2 + 1 × 2
This means that there are 1 one, 0 two, 1 four, and 1 eight in the number 1101. 1.4. The Hexadecimal System
The prefix “hex” means 6 and “deci” means 10. The hexadecimal number system is thus a
1.2.1. Binary Addition base-16 number system. Each digit position represents a power of 16. The digits used in
Rules for addition: this system are 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F, where = 10 , = 11 , =
0+0=0; 0+1=1; 1+0=1; 1+1=10; 1+1+1 = (1+1) +1 = 10+1 = 11 12 , = 13 , = 14 , = 15 .

i. 100 + 01 = 101 ………………………………….(4 + 1 = 5)


ii. 1101 + 101 = 10010 …………………………. (13 + 5 = 18) 1.5. Conversion from One Base to Another
iii. 1111 + 110 = 10101 ………………………….. (15 + 6 = 21) 1.5.1. Binary/Decimal Conversion
a. Decimal to Binary
1.2.2. Binary Subtraction To convert a binary number to decimal, we proceed as follows:
Rules for subtraction: Step 1: starting with the 1s place, write the binary place value over each digit in the
0-0 = 0; 1-0 = 1; 0-1 = 0 (we borrow digit); 1-1 = 0 binary number to be converted.
Step 2: add up all the place values that have a “1” in them
i. 10101 − 100 = 10001 (21 − 4 = 17)
ii. 1010 − 101 = 101 …... we borrow a digit worth 2 to continue with the calculation Example 1: Convert 11010 to base 10
(10 − 5 = 5)
©A LEVEL ICT/ Csc 29
16 8 4 2 1
1 1 0 1 0 Therefore, 213 = 11010101

16 + 8 + 2 = 26  Repeated Subtraction Method


Step 1: starting with the 1s place, write down all the binary place values in order until
Convert: 1111 (15), 10011 (19), 10101 (21) to base 10. you get to the first value that is greater than the number to be converted.
Step 2: mark out the largest place value
Example 2: Convert 1101.011 to base 10 Step 3: subtract the new largest place value from the number to be converted. Place a
1101.011 = 1 × 2 + 1 × 2 + 0 × 2 + 1 × 2 + 0 × 2− + 1 × 2− + 1 × 2− “1” under the place value.
= 8+4+0+1+0+1 4+1 8 Step 4: for the rest of the place values, try to subtract each one from the previous
= 13 + 0.25 + 0.125 result. If you can, place a “1” under that place value. If you cannot, place a “0”.
= 13 + 0.25 + 0.125 Step 5: repeat step 4 until all the place values have been processed.
= 13.375 The resulting set of 1s and 0s is the decimal number you started with.

Exercise: Convert the following binary numbers to decimal Example 2: 34110 to base 2
iii) 1010.1012
iv) 10011.0012 512 256 128 64 32 16 8 4 2 1
512is greater 341 so we mark it out. What is left is
b. Binary to Decimal 256 128 64 32 16 8 4 2 1
There are two methods that can be used to convert decimal numbers to binary: 341 − 256 = 85 we place 1 under 256 (MSB)
- repeated division method 85 − 128 = we place 0 under 128
- repeated subtraction method 85 − 64 = 21 we place 1 under 64
21 − 32 = we place 0 under 32
 Repeated Division Method 21 − 16 = 5 we place 1 under 16
The general technique of this method can be used to convert any decimal number to any 5−8 = we place 0 under 8
other number system. 5−4 = 1 we place 1 under 4
Step 1: divide the decimal number you want to convert by 2 in regular long division 1−2 = we place 0 under 2
until you obtain a final remainder 1−1 = 0 we place 1 under 1(LSB)
Step 2: use the remainder as the least significant bit of the binary number
Step 3: divide the quotient you got from the first division operation by 2 until you Therefore, 341 = 10101010101
obtain a final remainder
Step 4: use the remainder as the next digit of the binary number Example 3: Convert 25.75 to binary
Step 5: repeat steps 3 and 4 as many times as necessary until you get a quotient that
cannot be divided by 2. 25 = 11001 ,
Step 6: use the last remainder (that cannot be divided by 2) as the most significant bit 0.75 × 2 = 1.5 1
of the binary number. 0.5 × 2 = 1.0 1
0.75 = 11
Example 1: Convert 213 to base 2
213/2 = 106 remainder 1 LSB ⇒ 25.75 = 11001.11
106/2 = 53 remainder 0
53/2 = 26 remainder 1 Example 4: Convert: 33.33 to decimal.
26/2 = 13 remainder 0
13/2 = 6 remainder 1 1.5.2. Binary/Octal Conversion
6/2 = 3 remainder 0
3/2 = 1 remainder 1
1/2 = 0 remainder 1 MSB

©A LEVEL ICT/ Csc 30


Theorem
If base R1 is the integer power of another base, R2(i.e. R1 = R2d),then every group of d digits Example 2: Convert 450 to binary
in R2 is equivalent to 1 digit in the R1 base. 4 = 100 , 5 = 101 , 0 = 000
For example: ∴ 450 = 100101000
Assume that: R1 = 8 (octal) and R2 = 2 (binary)
1.5.3. Binary/Hexadecimal Conversion
From the theorem, 8 = 23 Assume that:
Hence, 3 digits in base-2 is equivalent to 1 digit in base-8. R1 = 16 (hexadecimal)
R2 = 2 (binary)
From the stated theorem, the following is a binary-octal conversion table.
From the theorem, 16 = 24
Binary Hexadecimal Hence, 4 digits in a binary number is equivalent to 1digit in the hexadecimal
000 0 number system.

001 1
The following is the binary-hexadecimal conversion table
010 2
Binary Hexadecimal Binary Hexadecimal
011 3
0000 0 1000 8
100 4
0001 1 1001 9
101 5
0010 2 1010 A
110 6
0011 3 1011 B
111 7
0100 4 1100 C
a. Binary to Octal
0101 5 1101 D
Step1: make groups of three bits starting from the least significant bit and move towards
the most significant bit. 0110 6 1110 E
Step 2: replace each group of bits by its octal representation. 0111 7 1111 F

Example: 1. Convert 100110 to base 8


100110 = 100 110 a. Binary to Hexadecimal
100 = 4 , 110 = 6 Step1: make groups of four bits starting from the least significant bit and move towards the
∴ 100110 = 46 most significant bit.
Step 2: replace each group of bits by its hexadecimal value representation.
Example 2: Convert 1011101 to base 8
1011101 = 001 011 101 Example 1: Convert 100110 to base 16
001 = 1 , 011 = 3 , 101 = 5 100110 = 0010 0110
0010 = 2 , 0110 = 6
∴ 1011101 = 135
∴ 100110 = 26
b. Octal to Binary
To convert from octal to binary, we replace every octal digit by its 3-bits binary equivalent. Example 2: Convert 1011101 to base 16
1011101 = 0000 0101 1101
Example1: Convert 73 to binary 0000 = 0 , 0101 = 5 , 1101 =
7 = 111 , 3 = 101
∴ 73 = 111101 ∴ 1011101 = 5

©A LEVEL ICT/ Csc 31


3. 2's Complement representation
b. Hexadecimal to Binary 4. Biased representation (Excess- )
To convert from hexadecimal to binary, we carry out the inverse operation. That is, we
replace every hexadecimal digit by its 4-bits binary equivalent. 2.2.1. Sign-Magnitude Representation
In sign-magnitude representation, the most significant bit is the sign bit with 0 for positive
Example: Convert 450 to binary and 1 for negative. The remaining ( − 1) bits represent the absolute value of the integer.
4 = 0100 , 5 = 0101 , 0 = 0000 The absolute value of the integer is interpreted as "the magnitude of the ( − 1)-bit
∴ 450 = 10001010000 pattern".

Example 1: Suppose = 8 and the binary representation 01000001.


Example 2: Convert 6 to base 2 Sign bit is 0 ⇒number is positive
6 = 0110, = 1110 Absolute value is 1000001 = 65
∴ 6 = 1101110 Hence, the integer is 65.

Assignment: Example 2: Suppose = 8 and the binary representation 10001001.


1) Convert the following octal numbers to hexadecimal. Sign bit is 1 ⇒number is negative
i) 658 Absolute value is 0001001 = 9
ii) 538 Hence, the integer is −9

2) Convert the following hexadecimal numbers to octal. The drawbacks of sign-magnitude representation are:
i) 12B16 o There are two representations (0000 0000 and 1000 0000) for the number zero,
ii) F2E16 which could lead to inefficiency and confusion.
o Arithmetic is cumbersome making the design of electronic circuits for this scheme
2. Data Representation difficult.
Computers use binary patterns (fixed number of bits) to represent data, which could be
numbers, letters, videos, images or other symbols. It is important to decide on how these 2.2.2. 1’s Complement Representation
patterns will be interpreted. The interpretation of binary patterns is called data In 1's complement representation the most significant bit is still the sign bit. The remaining
representation or encoding. Different representation schemes exist. ( − 1) bits represent the magnitude of the integer as follows:
o for positive integers, the absolute value of the integer is equal to "the magnitude
2.1. Representation of Unsigned Integers of the ( − 1)-bit pattern".
Unsigned integers can represent zero and all positive integers. The value of an unsigned o for negative integers, the absolute value of the integer is equal to "the magnitude
integer is interpreted as “the magnitude of its underlying binary pattern”. That is, for an of the complement (inverse) of the ( − 1)-bit pattern".
unsigned integer, all the bits in the binary pattern are used to represent the magnitude of
the integer. Example 1: Using 1’s complement, represent the following base 10 numbers on 8 bits.
In binary, an n-bit pattern can represent 2 distinct integers. Therefore, an n-bit pattern i) 26 = 11010
will represent integers from 0 to 2 − 1. Number is positive ⇒ sign bit is 0
⇒26 = 0 0011010
For example:
o A 4-bit pattern will represent the integers 0 to (2 ) − 1 = 3 ii) −25
o An 8-bit pattern will represent the integers 0 to (2 ) − 1 = 255 Number is negative ⇒ sign bit is 1
25 = 11001
2.2. Representation of Signed Integers Complement of 0011001 is 1100110
Signed integers can represent zero, positive integers, as well as negative integers. Four ⇒−25 = 1 1100110
representation schemes are available for signed integers:
1. Sign-Magnitude representation Example 2: Give the decimal equivalent of the following 1’s complement binary
2. 1's Complement representation representations.

©A LEVEL ICT/ Csc 32


i) 0010 0001. Example 1: Using 2’s complement, store the following base 10 numbers.
Sign bit is 0 ⇒ positive i) −24
Absolute value is 010 0001 = 33 Number is negative ⇒ sign bit is 1
Hence, the integer is +33 24 = 11000 = 0011000
1’s complement of 24 is 1100111
ii) 1000 0001 2’s complement of 24 is 1100111 + 1 = 1101000
Sign bit is 1 ⇒ negative ⇒ −24is represented by 1 1101000
Absolute value is the complement of 000 0001, i.e., 111 1110 = 126
Hence, the integer is −126 ii) −13
Number is negative ⇒ sign bit is 1
The problem with this representation is that there are still two representations for zero 13 = 1101 = 0001101
(0000 0000 and 1111 1111). 1’s complement of 13 is 1110010
2’s complement of 13 is 1110010 + 1 = 1110011
a. Addition in 1’s Complement ⇒ −13is represented by 1 1110011
o Add binary representations of the two numbers
o If there is a carry (referred to as end-round carry), add it to the result. Example 2: Give the decimal equivalent of the following 2’s complement binary
representations.
b. Subtraction in 1’s complement i) 01100000
Subtraction is implemented using addition as follows: Sign bit is 0⇒ positive
o Determine the 1’s complement of the negative number Absolute value is 110 0000 = 96
o Add the binary representations of the two numbers Hence, the integer is +96
o If there is any carry, add it to the result
ii) 1 001 0001
Example: subtract 37 from 51 in binary Sign bit is 1 ⇒ negative
37 = 0100101 ⇒ 37 = 1011010 ⇒ −37 = 1101101in 1’s complement Absolute value is the complement of 001 0001 plus 1, i.e.,110 1110 + 1 = 111
(51) 00110011 Hence, the integer is −111 (−27 + 24 + 20 = −128 + 16 + 1 = −111)
(-37) +11011010
-------------- Modern computers use 2's complement in representing signed integers. This is because:
1 00001101 2. There is only one representation for the number zero unlike in sign-magnitude
+ 1 and 1's complement representations.
--------------- 3. Positive and negative integers can be treated together in addition and subtraction.
(14)00001110 Subtraction can be carried out using the "addition logic".

2.2.3. 2’s Complement Representation a. Addition in 2’s Complement


In 2's complement representation, the remaining ( − 1) bits represent the magnitude of o Add binary representations of the two numbers
the integer as follows: o If there is a carry, ignore it
o for positive integers, the absolute value of the integer is equal to "the magnitude
of the ( − 1)-bit pattern". b. Subtraction in 2’s Complement
o for negative integers, the absolute value of the integer is equal to "the magnitude Subtraction is implemented as follows:
of the complement of the ( − 1)-bit pattern plus one". That is, we just add one to o Determine the 2’s complement for the negative number
1’s complement to get 2’s complement. o Add the binary representations of the two numbers
o If there is any carry, ignore it
An alternative and simple way of getting 2’s complement is
o to write the representation of the positive number Example: subtract 37 from 51
o starting from the least significant bit, flip all the bits to the left of the first 1. 37 = 0100101 ⇒ 37 = 1011010 (1’s C) ⇒ − 37 = 1 1011011 (2’s C)
(51) 00110011

©A LEVEL ICT/ Csc 33


(-37) +11011011 1. Represent the following numbers as 32-bit single precision floating-point
- ------------ numbers.
(14) 1 00001110 discard end-round carry a. 32.2
b. −15.37
2.2.4. Excess-n Representation c. 0.125
In excess-n notation, where n is the number of bits used, the value represented is the
unsigned value with a fixed value 2n-1subtracted from it. Solution:
a. We convert the number to binary
2.3. Representation of Real Numbers 32 = 100000
Computers represent real numbers in a form similar to that of scientific notation of 0.2 = 0.2 × 2 = 0.4 0
mantissa (M) and an exponent (E) of a certain radix (R), in the form of × . Both M and E = 0.4 × 2 = 0.8 0

can be positive as well as negative. For example, 1.25 × 10 is expressed in scientific = 0.8 × 2 = 1.6 1
notation where 1.25 represents the mantissa, −1 the exponent and 10, the radix. = 0.6 × 2 = 1.2 1
The IEEE 754 standard for representing floating-point numbers in the computer has two = 0.2 × 2 = 0.4 0
representation schemes: 32-bit single-precision and 64-bit double-precision. = 0.4 × 2 = 0.8 0
= 0.8 × 2 = 1.6 1
 In 32-bit single-precision floating-point representation: = 0.6 × 2 = 1.2 1
 the most significant bit is the sign bit (S), with 0 for negative numbers and 1 for
positive numbers. So a binary representation of 0.2is given by 0.001100110011
 the following 8 bits represent the exponent (E). 64.2is100000.001100110011
 the remaining 23 bits represent the mantissa (M) or fraction (F).
Step 2: we normalize the binary representation
1000000.001100110011becomes 1.00000001100110011 × 2

Step 3: 5 is the true exponent.


In excess-16, we have 5 + 16 = 21
21in 5-bit unsigned representation is 10101

Step 4: The mantissa stored is what is on the right side of the radix point of the normal
o In 64-bit single-precision floating-point representation: form.
 the most significant bit is the sign bit (S), with 0 for negative numbers and 1 for So M is 0000000110011001100110
positive numbers.
Putting all these together we have 64.2 represented as:
 the following 16 bits represent the exponent (E).
 the remaining 47 bits represent the mantissa (M) or fraction (F).
0 10101 00000001[10011001100110]

NB: On 8 bits we see that part of the number will be missing. That is why we say the
In floating-point representation, the mantissa and exponent play two important roles. The
mantissa determines the precision (exactness) of the number.
mantissa affects the precision of the number while the exponent affects the range. Precision
has to do with the exactness of a number while range has to do with the set of numbers that
b. −15.375
can be represented.
Negative number ⇒ sign bit is 1
15 = 1111
For simplicity, we will use a 14-bit pattern for floating point with a 5-bit exponent and an
0.375 × 2 = 0.75 0
8-bit mantissa. In this case, we will use excess-16 representation for the exponent.
0.75 × 2 = 1.5 1
Examples:
0.5 × 2 = 0.96 0
0.5 × 2 = 1.0 1

©A LEVEL ICT/ Csc 34


Fraction is 1.00000001 (with an implicit leading 1) = 1 + 2−
0.375 = 0101 The number is −(1 + 2−8 ) × 2(30−16)

15.375 = 1111.0101 2.4. Representation of Characters


Normalized we have, 1.1110101 × 2 2.4.1. Binary Coded Decimal
= 3 ⇒ 19in excess-16 2.4.2. American Standard Code for Information Interchange
= 10010 2.4.3. Extended Binary Coded Decimal
−15.375is represented as 1 10010 11101010

c. 0.125
Positive number ⇒Sign bit is 0
0 = 0000
0.125 × 2 = 0.25 0
0.25 × 2 = 0.5 0
0.5 × 2 = 1.0 1 VII. DIGITAL ELECTRONICS

0.125 = 0.001 Introduction


Normalized we have, 1.0 × 2−
= −3 + 16 = 13 = 01101
1. Boolean Algebra
0.125 is represented as 0 01100 00000000 Boolean algebra also known as the algebra of logic was developed by an English
mathematician called George Boole. It deals with binary variables and logic operators
2. Suppose the following 14-bit floating-point representation patterns, what decimal operating on these variables. A binary variable has only two possible values 0 or 1. Logic
numbers do they represent? operators operating on these variables are AND (·), OR (+) and NOT (‘). Operations are
defined for the values 0 and 1 as follows:
a. 01000011000000
b. 10111010000000 AND
OR
c. 11111000000001 0·0= 0 NOT
0+0= 0
0·1= 0 0= 1
0+1= 1
1·0= 0 1= 1
Solutions: 1+0= 1
1·1= 1
1+1= 1
a. 010000110 00000 1.1. Laws and Theorems of Boolean Algebra
Sign bit is = 0 ⇒positive number o Commutative law
= 10000 = 16 (in normalized form) · = · | + = +
Fraction is 1.11 (with an implicit leading 1) = 1 + 1 × 2− + 1 × 2− = 1.75
The number is +1.75 × 2( − ) = +1.75 × 2 = +1.75 o Associative law
( · ) · = · ( · )|( + ) + = +( + )
b. 10111010000000
Sign bit = 1 ⇒ negative number o Distributive law
= 01110 = 13 (in normalized form) ( + ) = ( )+( ) | +( ) = ( + )( + )
Fraction is 1.1 (with an implicit leading 1) = 1 + 1 × 2− = 1.5
( )
The number is −1.5 × 2 13−16 = −1.5 × 2−3 = −1.625 o Identity law
·1= | +0=
c. 1 11110 00000001
Sign bit = 1 ⇒ negative number o Redundancy law
= 11110 = 30 (in normalized form) ·0= 0 | +1= 1
©A LEVEL ICT/ Csc 35
Example 3: Use De Morgan’s theorems to simplify the following
o Complement law i) ( + + )
∙ = 0 | + = 1 ii) ( + )

o Idempotence law Example 4: Show that


· = | + = i) + =
ii) ( + ) = ( + )
o Absorption law iii) ( + )( + ) =
( + )= | +( )=
1.3. Constructing Truth Tables
o Involution law A truth table shows the output for all possible values of the input variables. To construct a
= truth table, we evaluate the Boolean expression for all possible combinations of values for
the input variables. The number of possible combinations is always equal to 2 where is
o No name the number of input variables.
+ = + | ( + )=
Example 1: Construct a truth table for the expression +
+ = | ( + )( + ) = We have 2 input variables and ⇒ we will have 2 = 4 different combinations.
+
0 0 1 0 0 o De Morgan’s Theorems
0 1 1 1 1 = + | + = ∙
1 0 0 0 1
1 1 0 0 1
1.2. Simplifying Boolean
Expressions
Simplifying a Boolean expression consists of using the laws of Boolean algebra to write the Example 2: Construct a truth table for the expression +
expression in its simplest form. 3 input variables ⇒ 2 = 8 different combinations

Example 1: Simplify the expression + ( + )+ ( + )


+
Solution:
+ ( + )+ ( + )= + + + + Distributiverule 0 0 0 0 0
= + + + + Idempotence rule = 0 0 1 0 0
= + + + Idempotencerule + = 0 1 0 0 1
= + + Absorption rule + = 0 1 1 0 1
= + Absorption rule + = 1 0 0 0 0
1 0 1 1 1
1 1 0 0 1
Example 2: Simplify the expression
+ ( + )+ ( + ) = + ( )+ ( ) De Morgan’s theorem 1 1 1 1 1
= + +
= + +0 Complement law = 0 Example 3: Construct the truth tables for the following
= + +0 Distributive law, i) +
Redundancy law0 = 0 ii) + [ ( xor C)]
= (1 + ) Redundancy1 + ’ = 1 iii) ( + )( + )
= ∙1 Identity rule ∙1=
= Identity rule ∙1

©A LEVEL ICT/ Csc 36


2. Logic Gates and Circuits
A Output
Logic gates and circuits are simply ways of representing Boolean
functions and expressions 0 1 electronically.
1 0
2.1. Logic Gates d. NAND Gate
A logic gate is an electronic device that implements a simple Boolean function. Logic gates The NAND gate operates as an AND gate followed by a NOT gate. The output is "false" if
carry out the operations that the microprocessor performs. When a microprocessor is both inputs are "true." Otherwise, the output is "true.
designed, a logic gate cell library (collection of all low level logic functions used to implement
the logic) is also deeply planned and developed.
There are seven basic logic gates: AND, OR, NOT, NAND, NOR and XOR.

a. AND Gate
Logic NAND
It is a logic gate whose output is “true” only when both inputs are “true”. If neither or only
one of the inputs is “false”, the output is “false”. The following illustration and table show
the circuit symbol and logic combinations for an AND gate.

A B Output
e. NOR Gate 0 0 1
A B Output
A NOR gate is equivalent to an 0 1 0 OR gate followed by a NOT
0 0 1
Logic AND gate. Its output is "true" if both inputs are "false."
1 0 0
0 1 1 Otherwise, the output is "false."
1 1 0
1 0 1
1 1 0
A B Output
b. OR Gate 0 0 0
It is a logic gate whose output is “true” when either or both of the inputs are “true”. If both Logic NOR 0 1 0
inputs are "false," then the output is "false."
1 0 0
1 1 1
A B Output
f. XOR Gate
0 0 0 Exclusive-OR is a logic gate whose output is “true” when one but not both of its inputs is
Logic OR 0 1 1 “true”. The output is "false" if both inputs are "false" or if both inputs are "true." Another
way of looking at this circuit is to observe that the output is “true” if the inputs are
1 0 1
different, but “false” if the inputs are the same.
1 1 1

A B Output
c. NOT Gate
It is a logic gate whose output is “false” if its input is “true” and vice versa. It is called logical 0 0 0
inverter, because it reverses the state of its input. A NOT gate accepts one input and Logic XOR 0 1 1
produces a single output. 1 0 1
1 1 0

©A LEVEL /ICT&Csc 37
2.2. Logic Circuits 1. Data and Information
Circuits are made by combining two or more logic gates. Gates are combined into circuits Data are raw facts and figures that have no context or purposeful meaning. In computing,
by using the output of one gate as the input for another. data is simply any number, letter or symbol that can be entered into a computer system.
Examples When data has been processed it gives information. Information is data that has meaning
and is presented in a context.
For example, the number 12.5 is data because we do not know why or in what context it is
being used. However, if the number appears on a student’s report card to show that they
have an average of 12.5, then this data has changed into information, because it has
acquired a context (it’s an average) and meaning.
Also, the binary patterns that describe an icon on your desktop are data. They become
information after the operating system software has processed them, because then they
become meaningful to you as the icons representative of your hard disk or Internet
explorer.
In summary,
= +

Exercise 1: Construct logic circuits for the following expressions 1.1. Sources of Data
1) + a. Questionnaire
A questionnaire is a set of questions used for collecting data from people. A questionnaire
2) ( + )( + )
may be in paper format or online.
3) ( + )
4) ( + )(ABC)
b. Interview
5) ( + )
An interview is a meeting during which somebody is asked questions. Interviews allow you
to collect a greater depth of data and understanding from people than is possible by just
Exercise 2: What are the outputs for the following logic circuits
using a questionnaire.

c. Observation
In observation, the data gatherer observes what is happening during a process or event and
produces some kind of data file as a result

d. Data logging
Data logging is an automated method of gathering data by using sensors.

e. Document review
Document review is getting relevant data from a document, an article or a book.
VIII. INFORMATION SYSTEMS
f. Data mining
Introduction
Data mining is the exploration of databases to collect data.
A system is an integrated set of regularly interacting or interdependent components
created to accomplish a defined objective, with defined and maintained relationships
1.2. Characteristicsof Information
among its components. Basically, there are three major units in every system namely input,
Good information is that which is used and which creates value. Experience and research
processing and output. The objective of a system demands that some output be produced
show that good information has numerous qualities.
as a result of processing the suitable inputs.
An information system can therefore be seen as a set of interrelated components that
a. Timeliness
collectdata, process the data to produce information.

©A LEVEL ICT 38
Delay destroys the value of information. For effective decision making, information must
reach the decision-maker at the right time. Timeliness means that information must reach b. Data Validation
its recipients within the prescribed timeframes. Validation is a check on input data to ensure that the data is sensible or reasonable. It
compares the input with a set of rules that the computer has been told the data must
b. Accuracy follow. If the data does not match up with the rules then there must be an error. Validation
Wrong information given to decision-makers would result in wrong decisions. Accuracy only checks that the data is valid. The data may be valid but not correct. Five types of
means that information should be free from mistakes and errors. validation checks are:

c. Current  Type check


For the characteristic of timeliness to be effective, information should be current or up-to- A type check is used to ensure that data entered in a field fits the required data type. For
date. Information must be current as a fact of yesterday may not be a fact of today. example, a person’s name will consist of letters of the alphabet and sometimes hyphens
and apostrophe. Any name that contains numbers will be rejected as invalid.
d. Completeness
Information should have every necessary part or everything that is wanted. If information  Length check
is not complete, it may lead to wrong decisions being made as only half of an entirety of the A length check ensures that an entered value is not longer than a certain number of
information is known. characters. For example, a phone number has 8 digits. Entering fewer or more digits makes
a number invalid.
e. Explicitness
Good information should not require further analysis for decision making. It should be  Range check
clear and obvious, leaving no doubts as to its intended meaning. A range check is used to ensure that the data entered falls between a specified minimum
and maximum values. For example, a mark in an exam is between 0 and 20. Any mark
1.3. Data Collection below 0 or above 20 is rejected as invalid.
All computer systems need to have data input into them otherwise they have nothing to
process. Getting the data for the computer to process is known as data collection. Data  Presence check
collection can be manual or automatic. A presence check ensures that an entry has been made in a particular field. If it has not, the
system will not allow the record to be saved or any entries to be made in later fields. Such
1.3.1. Manual Data Collection fields called mandatory fields are indicated on some systems by the used of an asterisk.
Manual data collection uses forms and questionnaires. Data collected through this method
has to be entered into the computer by typing and clicking.  Check digits
Many different errors can occur when entering data into a system. To try and reduce the A check digit is a digit attached to the end of a string of digits that can be used to check that
amount of input errors, a system designer can build in validation and verification checks the string is correct. It is calculated from the other digits in the string. One example where a
into the software that the data is entered into. check digit is used is in the 10 digit ISBN number which uniquely identifies books. The last
number of the ISBN is actually the check digit for the other numbers. For example, in the
a. Data Verification ISBN 1858134153, the 3 at the end of the number is the check digit.
Verification means checking the input data to make sure it has been entered correctly. The check digit for ISBNs is obtained using a calculation method known as the Modulus-11
Verification tries to ensure there have been no transcription errors. It is a check on weighted check digit calculation.
accuracy.Two methods of data verification are double entry and proofreading.
o Start with original number i.e. 185813415
 Double Entry o Weight each digit by its position in the string and add up the results.
Double entry consists of entering the data twice. The two entries are then compared
against each other and a warning given if they do not match. For example, a new password Position 10 9 8 7 6 5 4 3 2 1
is always entered twice.
Digit 1 8 5 8 1 3 4 1 5

 Proof Reading Weightings 10 72 40 56 6 15 16 3 10


Proofreading consists of reading the data entered either on screen or printout, to be sure
that it matches the data source. It is also known as visual check. Total = 10+72+40+56+6+15+16+3+10= 228

©A LEVEL ICT 39
the keyboard. This method is suitable for capturing data from airline tickets; reading postal
o Divide the total by 11 and then subtract the remainder from 11. The check digit is codes; capturing data from telephone and electric bills.
the result of this operation.
228 / 11 = 20 remainder 8 => Check digit is 11-8 = 3. c. Magnetic Ink Character Recognition (MICR)
o Add the check digit to the end of the original number to get the complete product The device used is a magnetic ink character reader that reads characters written in
number. i.e. 1858134153. magnetic ink, using magnetic stripe readers or card swipe machines that capture the
information on the magnetic card. These are seen on the back of credit cards and bank
To check whether the ISBN is correct, cards.
o Input the number including the check digit.
o Weight each digit by its position in the string and add up the results. d. Barcode Reading
An optical device called barcode reader is used to read the barcode on products and
Position 10 9 8 7 6 5 4 3 2 1 convert them into a form that can be processed by the computer. A bar code is a sequence
of vertical lines and numbers that identify a product. They are used in libraries,
Digit 1 8 5 8 1 3 4 1 5 3
supermarkets and retail shops.
Weightings 10 72 40 56 6 15 16 3 10 3
e. Voice Recognition
Total = 10+72+40+56+6+15+16+3+10+3 = 231 This method converts speech into text or a sequence of computer commands. It is most
common for data entry and word processing environments.
o Divide the total by 11.If the remainder is 0, then the number has passed the
validation check and so it is likely that it has been inputted correctly. 2. Information System Components
231 / 11 = 21 remainder 0 There are six basic components in an information system: hardware, software, procedures,
data and people.
Exercise:
i) Dates are read into a computer in the following format: DDMMMYY e.g. 15DEC92.  Hardware
The following dates were rejected by a validation program: 3JAN71, AUG2166, Hardware refers to the physical devices that make up the system. They are the whole set of
31SEP72. State the validation check used to discover each error. equipment used for input, processing, storage and communication of data.

ii) Calculate the check digitsto complete the ISBNs:019276150-1 and 995640216-8.  Software
Software is the collection of computer programs used in the system. They provide the
iii) Set up a spreadsheet which will calculate and check the validity of Modulo-11 instructions that tell the computer what to do.
weighted check digits for any given ISBN.
 Data
1.3.2. Automatic Data Collection Data are raw, unorganized, potentially useful facts and figures that are processed to
Automatic data collection is a form of data input in which there is no data entry. It uses produce information.
sensors and specialized input devices to collect data that is directly entered into the
computer without any human involvement. It is also called data capture. Different  People
automatic data collection methods are: People are the main actors of the system. They are the users of the information system.
They input data into the computer, give some direction to the computer to perform tasks
a. Optical Mark Recognition (OMR) and review information on the computer for output.
OMR uses a device called an optical mark reader to read marks made with prescribed pens,
pencils or special writing material on OMR forms, and convert them into information in the  Procedures
computer. This system is good for multiple choice examination questions. Procedures are the series of documented actions taken to achieve a particular goal. A
procedure is more than a single simple task. It can be complex and involved, such as
b. Optical Character Recognition (OCR) reinstalling software, performing a backup etc.
This method uses a device called an optical character reader to read characters from
printed or handwritten text and transmit them to the computer as if they were typed from

©A LEVEL ICT 40
3. Organizational Information Systems With batch processing, transaction data is collected over a period of time and all processing
There are three levels at which information can be used in an organisation: strategic, is done as a group. Batch processing is ideal in situations where large amounts of data
tactical and operational levels. This can be represented using the pyramid below. requiring similar processing are to be processed. Examples are:
 Payrollsystems for calculating employee salaries
 Billing systems for calculating consumer bills.

b. Online Transaction Processing


Strategic Executives
With online transaction processing (OLTP) the computer processes transactions as they
Level
are entered. Such systems are ideal for situations where the master file needs to be
Tactical Managers updated each time a transaction is made. Examples are:
Level
 Stock control systems which reduce automatically the number of items in stock once
Operational an item has been bought
Level Workers
 Reservation systems which reduce automatically the number of seats available on a
flight or bus once a seat has been booked.
 At the strategic level, information is needed by senior managers (executives) to help
them with their business plans. Information at this level is used for making long term 3.1.2. Office Automation Systems
decisions. Office automation systems automate office procedures and enhance office communication
 At the tactical level, information is needed by middle managers to help them monitor and productivity. They support a wide range of office activities such as creating and
and control business activities. Tactical planning and decision-making takes place distributing documents, sending messages and scheduling. The software an OAS uses to
within the guidelines set by the strategic plan. support these activities include word processing, spreadsheets, databases, presentation,
 At the operation level, employees with operational roles need information to help graphics, e-mail, Web browsers, personal information management, and groupware. They
them carry out their duties. Results of operational work are passed upwards to let the use communication technologies such as voice mail, facsimile (fax), videoconferencing, and
tactical planners evaluate their plans. electronic data interchange (EDI) for the electronic exchange of text, graphics, audio, and
video. OAS are also called Office Information Systems (OIS).
In order to meet with the information needs of the organization, different types of
information systems exist which can be grouped into two: operations support systems and 3.2. Management Support Systems
management support systems. Management support systems provide information and support needed for effective
decision making by managers. They act at the tactical and strategic levels of the
3.1. Operations Support Systems organization. Major categories of MSS are management information systems, decision
Operation support systems process data generated by business operations. They act at the support systems and executive information systems.
operational level of the organization. Major categories of OSS are transaction processing
systems, office automation systems and process control systems. 3.2.1. Management Information systems
Management information systems generate accurate, timely and organized information
3.1.1. Transaction Processing Systems needed by middle managers to take decisions, solve problems, supervise activities, and
A transaction is any event of interest to an organization. It may be a business activity such track progress. They provide routine information for routine tasks. The source of data for
as a payment, a deposit, a customer’s order, a reservation or a student’s registration. an MIS usually comes from numerous databases. These databases are usually the data
Transaction processing systems capture and process data generated during an storage for Transaction Processing Systems. MIS take information from TPS and
organization’s day-to-day transactions and maintain records about the transactions. They summarize them into a series of management reports. As such, MIS are sometimes called
are vital for any organization or business as they gather all the input necessary for other Management Reporting Systems (MRS).
types of systems. TPS are also called Data Processing Systems. MIS generate three basic types of information or reports: detailed, summary and
exception.
There are two types of TPS: batch processing and online processing systems.  Detailed reports confirm transaction processing activities. A detailed order report is
an example of a detail report.
a. Batch Processing
 Summary reports consolidate data into a format that an individual can review quickly
and easily. To help synopsize information, a summary report typically contains

©A LEVEL ICT 41
totals, tables, or graphs. An inventory summary report is an example of a summary 4. Other Information Systems
report. 4.1. Expert Systems
An expert system is a computer program that tries to emulate the decision making of a
 Exception reports report information that is outside of a normal condition. These human expert. It does this by combining the knowledge of human experts and then,
conditions called the exception criteria, define the range of what is considered following a set of rules, it draws inferences. An expert system is made up of three parts: a
normal activity or status. An example of an exception report is an inventory knowledge base, an inference engine and a user interface.
exception report that notifies the purchasing department of items it needs to reorder.  The knowledge base stores all of the facts, rules and information needed to represent
Exception reports help managers save time because they do not have to search the knowledge of the expert.
through a detailed report for exceptions. Instead, an exception report brings  The inference engine is the part of the system that interprets the rules and facts using
exceptions to the manager’s attention in an easily identifiable form. Exception backward and forward chaining to find solutions to user queries.
reports thus help them focus on situations that require immediate decisions or  The user interface allows the user to enter new knowledge and query the system.
actions.
Non-management employees are the primary users of such systems for job-related
Examples of MIS are: decisions. For example, there are expert systems that can diagnose human illnesses, make
 Sales management systems financial forecasts, and schedule routes for delivery vehicles.
 Inventory control systems
 Budgeting systems Expert systems are one part of an exciting branch of computer science called artificial
 Management reporting systems intelligence (AI). AI is the application of human intelligence to computers. AI technology
can sense your actions and, based on logical assumptions and prior experience, will take
3.2.2. Decision Support Systems the appropriate action to complete the task. AI has a variety of capabilities, including
Decision support systems are designed to help tactical and strategic decision-making in speech recognition, logical reasoning, and creative responses.
situations where there is uncertainty about the possible outcomes of those decisions. They
provide interactive support for non-routine decisions or problems. 4.2. Geographic Information System
TPS and MIS provide information on a regular basis. However, managers need information
not provided in their reports to help them make decisions. Decision support systems
therefore use data from internal (TPS and MIS) and external sources. IX. DATA COMMUNICATION SYSTEMS
o Internal sources of data might include sales, manufacturing, inventory, or
financial data from an organization’s database. Introduction
o Data from external sources could include interest rates, population trends, and The use of computers and data communications networks has been termed the ‘second
costs of new housing construction or raw material pricing. industrial revolution’, because it is revolutionizing the way people work and communicate.
Examples of DSS are:
 Logistics Systems 1. Computer Networks
 Financial Planning Systems A computer network is a collection of computers and other devices that are connected
 Spreadsheet Models together so they can communicate and share resources. The smallest network can be as
simple as two computers linked together. The resources shared include files, folders,
3.2.3. Executive Information Systems printers, disk drives and anything else that exists on a computer. Any computer or device
Executive information systems (EIS) are designed to support the information needs of on a network is called a node.
executive management. Their purpose is to analyse, compare and identify trends to help Networking is the term that describes the processes involved in designing, implementing,
the strategic direction of the organisation. Information in an EIS is presented in charts and upgrading, managing and otherwise working with networks and network technologies
tables that show trends, ratios, and other managerial statistics. Because executives usually
focus on strategic issues, EISs rely on external data sources that can provide current 1.1. Types of Computer Networks
information on interest rates, commodity prices, and other leading economic indicators. Different criteria exist for classifying computer networks. According to geographical area
To store all the necessary decision-making data, DSSs or EISs often use extremely large covered, networks can be classified as local area networks, wide area networks,
databases, called data warehouses. metropolitan area networks, personal area networks etc.

©A LEVEL ICT 42
1.1.1. Local Area Network 1.2.2. Network Interface/Adapter Card
A local area network (LAN) is a network that is used for communication among computer A network interface card (NIC) provides the physical interface (link) between the computer
devices, usually within an office building or home. It enables the sharing of resources such and the communication medium. A NIC manages the communication and network protocol
as files or hardware devices that may be needed by multiple users in an organization. A for the PC.It prepares data, sends data and controls the flow of data. It plugs into the system
LAN is limited in size, spanning a few hundred meters, and not more than a mile. It is fast, board and provides ports for connection to the network. A NIC is also called a LAN card or
with speeds from 10 Mbps to 10 Gbps. An example of LAN is the network in the Multimedia network adapter card. There are two kinds of NIC: wired NIC for wired networks and
Resource Centre. wireless NIC (WNIC) for wireless networks. A NIC may be designed as an Ethernet card, a
Token Ring card, or an FDDI card (but not all three).
1.1.2. Metropolitan Area Network
A metropolitan area network (MAN) is a large computer network that usually spans a city 1.2.3. Hub
or a large campus. It is optimized for a larger geographical area than a LAN, ranging from A hub is a device that works as central connecting point for multiple computers in a
several blocks of buildings to entire cities. A MAN typically covers an area of between 5 and network. It has ports to which the computers in the network are connected. Data sent to
50 km diameter. An example of a MAN is a cable TV network. the hub is broadcasted to all the ports but, only the destination computer receives it. There
are three kinds of hubs:
1.1.3. Wide Area Network  Passive hubs which only split the transmission signal so it can be sent to all the ports
A wide area network (WAN) covers a large geographic area such as a country, a continent  Active hubs (also called Multiport Repeaters) which regenerate data bits to maintain
or even the whole world. It is a distributed collection of LANs. That is, it connects two or a strong signal over extended cable lengths
more LANs together. This is done using devices such as bridges, routers or gateways, which  Intelligent hubs (also called Concentrators) usually have their own microprocessor
enable them to share data. The largest and most well-known example of a WAN is the chips and network operating systems. They can be managed remotely on the
Internet. network.

1.1.4. Personal Area Network 1.2.4. Switch


A personal area network (PAN) is a network that is used for communication among A switch is used at the same place as a hub but the difference between the two is that a
computers and computer devices in close proximity of around a few meters within a room. switch has a switching table within it. A switching table stores the Media Access Control
A PAN usually includes laptops, mobile phones, personal digital assistants, digital cameras (MAC) address of every computer connected to the switch and sends the data only to the
and headsets. It can be used for communication between the devices themselves, or for requested address, unlike the hub which broadcasts the data to all the ports. Switches can
connection to a larger network such as the Internet. The most popular is the Wireless PAN therefore be considered as an advanced form of hubs.
(WPAN), a Bluetooth connection between two laptop computers or phones. A MAC address is a built-innumber (i.e. set by the manufacturer) consisting of 12
hexadecimal digits that uniquely and permanently identifies the network adapter of a
1.2. Computer Network Components computer. Examples of a MAC addressesare 00-14-22-DA-67-15 and 00-13-02-31-E8-
All types of computer networks require special networking software and hardware to BA.MAC address is also called the physical address. Under Windows, the MAC address of a
allow different computers to communicate with each other. The most important software computer can be displayed by typing ipconfig/all at a Command prompt.
component required for a network is the network operating system (NOS) while there are
many types of hardware devices which are either installed or connected to the computer 1.2.5. Repeater
terminals in order to construct a network. A repeater is a device used to expand the boundaries of a wired or wireless network. With
physical media, data transmissions can only span a limited distance before the quality of
1.2.1. Network Operating System the signal degrades. Repeaters are usedto preserve signal integrity and extend the distance
A network operating system is an operating system which includes networking features. It over which data can safely travel by regenerating the signals they receive. Active hubs are
contains special functions, protocols and device drivers that enable the computer to be considered as repeaters (multiport repeaters).
connected to a network. NOS provide the ability to share resources and the ability to
manage a network name directory, security, and other housekeeping aspects of a network. 1.2.6. Bridge
Examples of network operating systems are Windows-NT, Windows-2000 server, Windows A bridge, also called a layer 2 switch, is a device used to create a connection between two
server 3000, Novell Netware and Artisoft LANstatic. separate computer networks or to divide one network into segments. Creating multiple
Some multi-purpose operating systems like Windows XP, Windows 7 and Mac OS 10, come segments in a local network reduces the network traffic making the network to be faster
with capabilities that enable them to be described as network operating systems. and more efficient. A bridge performs its segmenting function by examining the data packet
and forwarding it to other physical segments only if necessary.

©A LEVEL ICT 43
the protocol needed by the destination network. The term gatewayis also sometimes
1.2.7. Router loosely used to describe any device that acts as the entry or exit point for a network.
A router is a device that joins several networks together and is responsible for routing data
from one network to another. It keeps track of the IP addresses of the computers on the 1.3. Network Topologies
networks connected to its network interface cards and directs data packets appropriately. Network topology is the layout or arrangement of the components of a network. It refers to
It is more powerful than a bridge because instead of just choosing network segments based the way in which computers and cables are connected together to build a network.
on previous traffic, a router can look up the best route for a packet to take. Routers can be Different types of topologies exist.
computers with operating systems and special network software, or they can be other
dedicated devices built by network manufacturers. The Internet relies heavily on routers. 1.3.1. BusTopology
In bus topology, all computers are connected to a single cable (trunk or backbone) known
1.2.8. Modem as bus, by a transceiver either directly or by using a short drop cable. Bus transmits in both
A modem (modulator/demodulator) is a device that encodes data for transmission over a directions such that any transmission can be received by all stations. All ends of the cable
particular medium, such as telephone line, coaxial cable, fiber optics, or microwaves. It must be terminated, that is plugged into a device such as a computer or terminator, to
converts digital signals from a computer to analog signals or waveform for transmission avoid signals from bouncing back.
over a medium (modulation) and converts analog signals from the medium to digital
signals understandable by the computer(demodulation).
Common types of modems are:
 Dial-up Modem
 Cable Modem
 DSL Modem Bus topology
 Sat modem a. Advantages
 Easy and inexpensive to set up as little cabling is required
1.2.9. Multiplexer  Easy to include additional stations without disrupting the network
A multiplexer abbreviated MUX, is a device that takes input signals from different sources  Failure of one node does not affect network
and transmits them over a single transmission line. This process is known as multiplexing.
There are different types of multiplexing: b. Disadvantages
 Frequency-division multiplexing (FDM), in which the carrier bandwidth is divided  High rate of data collision
into sub channels of different frequency widths, each carrying a signal at the same  Fails if there is any damage to the bus
time in parallel.  Any break in the bus is difficult to identify
 Time-division multiplexing (TDM), in which the multiple signals are carried over the
same channel in alternating time slots. 1.3.2. StarTopology
 Code-division multiplexing (CDM), in which the multiple signals are carried over the In a star topology, all the computers are connected to a central device which could be a
same channel but every signal is coded differently. computer, a hub or a switch. Any communications between computers in this topology
must pass through the central node. As such, the central node controls all the activities of
Orange and MTN use a combination of FDM and TDM called GSM while Camtel uses CDMA. the network.

1.2.10. Cables
Cables are used to link computers in a LAN. There are three types of cables commonly used:
 Coaxial cable
 Twisted pair cable
 Fiber optic cable
Star topology
1.2.11. Gateway
A gateway is a device that connects two dissimilar computer networks using direct and a. Advantages
systematic translation between protocols. A gateway translates outgoing network traffic to  Breakdown of a node does not affect the network
 No disruption of the network when connecting or removing devices

©A LEVEL ICT 44
 It is easy to detect faults to another and each computer can transmit only while it is holding the token. Information
flows in one direction along the ring from source to destination and back to source. When a
b. Disadvantage station wishes to transmit, it waits for the empty token to pass by. It seizes it and inserts
 Failure of the central node affects the entire network data into it and then releases it to the medium. The token circulates until it gets to the
 It is costly due to the amount of cables required to connect the devices destination computer that picks it and retrieves the data. After retrieving the data, it
regenerates the token and sends it back to the medium.
1.3.3. RingTopology
In ring topology, all the nodes are connected in the form of a closed loop such that each 1.4.3. FiberDistributed Data Interface
node is connected to two others. It uses an empty data packet called a token and a special FDDI is a network technology that uses fiber-optic cables in a ring topology with dual rings
protocol called token ring. Packets travel around the ring in a clockwise direction. To on which information can travel in opposite directions. The media access method for FDDI
transmit, a node requires an empty token. is token passing. The primary ring is used for data transmission, and the secondary ring
remains idle. Because of this double ring topology, if a station fails or a cable becomes
damaged, the dual ring is automatically wrapped around itself, forming a single ring. This
prevents downtime as a result of a failed machine or faulty wiring.

1.4.4. Frame Relay


1.4.5. Asynchronous Transfer Mode
Ring topology

a. Advantage 1.4.6. WirelessNetworkStandards


 No collision as a station needs the token to transmit Wireless networks are established without physical wiring techniques involved. They use
 Each computer acts like a repeater so signals are not attenuated radio and infrared signals and are based around one of these technologies: Bluetooth, Wi-
Fi, WiMax, terrestrial microwaves and satellite.
b. Disadvantage
 If a node in the network fails, the entire network fails a. Bluetooth
 Network is disrupted when additional stations are added Bluetooth is a low power, short-range wireless technology largely used to interconnect
computing devices into a personal area network. It is based on IEEE standard 802.15 which
1.4. Network Standards gives specifications for Wireless Personal Area Network (WPAN).

1.4.1. EthernetNetwork b. Wi-Fi


Ethernet (IEEE 802.3 standard) is the most common and widely used technology to Wi-Fistands for Wireless Fidelity. It is based on a set of wireless networking technologies
establish a local area network. An Ethernet network is formed by physically connecting the known as 802.11. These include 802.11b, 802.11a, 802.11g and 802.11n. The range of Wi-
individual computer units to each other in a bus topology or a star topology. Ethernet’s Fi network transmission is about 30-40m indoors and up to about 100m outdoors.
media access policy is CSMA/CD (Carrier Sense Multiple Access with Collision Detection). The table below shows the different 802.11 standards for wireless networking.
 CS: means that a station listens to (senses) the medium and transmits only if medium
is idle Specification Popular name Frequency Speed Compatible with
 MA: means that any station can use (access) the medium 802.11a Wireless-A 5 GHz 54 Mbps
 CD: means that each station stops transmitting immediately it senses a collision 802.11b Wireless-B 2.4 GHz 11 Mbps Wireless-B
802.11g Wireless-G 2.4 GHz 54 Mbps Wireless-B, -G
When a collision is detected, the two stations involved will retransmit after a random time 802.11n Wireless-N 2.4 GHz 100 Mbps Wireless-B, -G, -N
wait created by a backoff algorithm.
c. WiMax
1.4.2. TokenRing Network
WiMax stands for Worldwide Interoperability for Microwave Access. It is based on IEEE
Token ring (IEEE 802.5 standard) is a network technology developed by IBM in which
standard 802.16 and facilitates high speed wireless network links to both fixed and mobile
computers are connected together in a ring. Token ring’s media-access method is called
devices. The range of a WiMax wireless connection is around 3-10km.WiMax service
token passing. A special message, called token, circulates along the ring from one computer

©A LEVEL ICT 45
providers are now just entering the market, offering customers an alternative to a DSL  If the file server breaks down the files on the server become inaccessible. Email
Internet connection. might still work if it is on a separate server. The computers can still be used but are
isolated.
1.5. Network Architectures  Viruses can easily spread to other computers throughout the network, if one
1.5.1. Client/Server Architecture computer is infected..
Client/server is a network architecture in which a more powerful computer called server is  There is a danger of hacking, particularly with wide area networks. Security
dedicated to serving less powerful computers called clients. Servers hold shared resources procedures are needed to prevent such abuse, eg a firewall.
like files, programs and the network operating system. They provide access to network
resources to all the users of the network. There are many different kinds of servers, and 2. Data Communication
one server can provide several functions. For example, there are file servers, print servers, Data communication refers to the exchange of data between two devices via some form of
mail servers, database servers and Web servers. Users run applications on client communication channel. In data communication the following basic terms are frequently
workstations which rely on servers for resources such as files, devices and even processing used:
power.  Data: a collection of facts in raw form that becomes information after processing.
Internet services are organized according to a client/server architecture. Client programs,  Signal: an electric or electromagnetic encoding of data.
such as Web browsers and file transfer programs create connections to servers, such as  Signaling: propagation of signals across a communication channel.
Web and FTP servers. The clients make requests and the server responds to the requests  Transmission: sending of data from one place to another by means of signals.
by providing the services requested by the client.
There are five basic components in a communication system.
1.5.2. Peer-to-Peer Architecture  Data Source: creates data for transmission
Peer-to-peer (P2P) is a network configuration in which all the workstations (computers)  Transmitter: encodes data for transmission
have equal capabilities and responsibilities. Each workstation acts both as a server and a  Communication channel: connecting medium between communicating devices
client. This means that any computer on the network can provide services to any other  Receiver: decodes transmitted signals back to data
computer. Peer-2-peer is usually implemented where strict security is not necessary.  Destination: the final destination of the transmission
P2Pnetworks are generally simpler and less expensive, but they usually do not offer the
same performance under heavy loads. Example: John calls Peter on phone.
The data source is John, the transmitter is John’s phone, the communication channel is the
Remark A hybrid network combines client/server and peer-to-peer architectures. It is telephone cable or microwave, the receiver is Peter’s phone and the destination is Peter.
the most commonly used network architecture.
2.1. Analog and Digital Signals
1.6. Benefits and Limitations Of Computer Networks Data is transmitted from one point to another by means of electrical signals that may be in
1.6.1. Benefits analogue or digital form.
 Sharing devices such as printers saves money.
 Site (software) licenses are likely to be cheaper than buying several standalone 2.1.1. Analogue Signals
licenses. An analog signal is one in which information is represented as a continuous variation of
 Files can easily be shared between users. some physical property or quantity. Analog signals are continuous waves that carry
 Network users can communicate by email and instant messaging. information by varying the frequency or amplitude of the wave.
 Data is easy to backup as all the data is stored on the file server.  When the amplitude of the signal is varied the technique is called amplitude
 Organizations can organize videoconferences ( videoconferencing) modulation (AM)
 Employees can work from home (telecommuting)  When the frequency of the signals is varied, the technique is called frequency
modulation (FM).
1.6.2. Limitations Human speech is an example of an analog signal. Telephone lines use analog signals
 Purchasing the network cabling and file servers can be expensive. because they were originally designed for speech.
 Managing a large network is complicated.It requires training and a network
manager usually needs to be employed.

©A LEVEL ICT 46
2.3.2. Half Duplex
In half duplex mode, signals can be transmitted in both directions but only one way at a
time. The flow of information is bidirectional but information can only be sent if it is not
2.1.2. DigitalSignals being received. It is suitable for data transmission between a computer and dumb
A digital signal is one in which information is represented as a sequence of binary values 0 terminals. An example is the police radio (walkie-talkie).
and 1.These two values represent two conditions, on or off, corresponding to two known
levels of voltage or current.
A B
Digital signals do not continuously vary as analogue signals. Signals are transmitted within
the computer as digital signals. Systems that use digital technology are known as baseband
systems. 2.3.3. FullDuplex
In full duplex mode, signals can be transmitted in both directions simultaneously. The
communicating devices can transmit at the same time. The flow of information is
bidirectional. It is suitable for interactive systems. An example is the telephone.

A B

Digital signal 2.3.4. Parallel Transmission


Parallel transmission is the method of transferring several bits at the same time over
2.2. Broadband and Baseband Transmissions separate channels. For example, eight separate channels will be required if a block of eight
2.2.1. BasebandSystem bits is to be transmitted in parallel. Parallel transmission is fast but it is suited only for
A baseband system is a single-channel system that supports a single transmission at any short distances as cabling for long distances will be expensive. It is mainly used for
given time. In a baseband system, data is sent as a digital signal through the media as a connections within the computer and for connecting the computer to the printer.
single channel that uses the entire bandwidth of the media. Baseband communication is bi-
directional, which means that the same channel can be used to send and receive signals. In 2.3.5. Serial Transmissions
Baseband, frequency-division multiplexing is not possible. Serial transmission is the method of transferring data one bit at a time through the same
channel. If a block of 8 bits is to be transmitted in series, the bits will be transmitted one
2.2.2. BroadbandSystem after the other on the same channel. Serial transmission can be asynchronous or
A broadband system is a system that supports multiple transmissions via multiple synchronous.
frequency channels. In a broadband system, data is sent in the form of an analog signal
where each transmission is assigned a portion of the bandwidth. Broadband a. Asynchronous Serial Transmission
communication is unidirectional, so in order to send and receive, two pathways are needed. Asynchronous transmission describes the process where transmitted data is encoded with
This can be accomplished either by assigning a frequency for sending and assigning a start and stop bits, specifying respectively the beginning and end of each character. Data is
frequency for receiving along the same cable or by using two cables, one for sending and sent character by character with each character preceded by a start bit and a stop bit is
one for receiving. added to the end. Other control bits like the parity bit are added to the group before the
stop bit and small gabs are inserted to distinguish each group.
2.3. Transmission Modes and Techniques
Transmission modes simply refer to the direction of flow of information between two b. Synchronous Serial Transmission
communicating devices. It could be simplex, half duplex or full duplex. Synchronous transmissiondescribes a continuous and consistent timed transfer of data
blocks. Data is sent as one long bit stream or block of data without start or stop bits and
2.3.1. Simplex with no gabs. Upon reception, the receiver counts the bits and reconstructs bytes. It is
In simplex mode, signals are transmitted in only one direction. The flow of information is essential that the same timing is maintained by both sender and receiver as there are no
unidirectional from transmitter to receiver always. Examples are television broadcasting, start and stop bits and no gaps. Another channel is therefore used to transfer timing signals
computer to the printer connection and CPU to monitor communication. to keep the both parties synchronized. Accuracy is dependent on the receiver keeping an
accurate count of the bits as they arrive.
A B
©A LEVEL ICT 47
Coaxial cable consists of an inner core and an outer flexible braided shield, both of
Serial transmission is slower than parallel transmission but it is suited for long distances. It conductive material separated by an insulator. The braided shield prevents the cable from
is cheaper as only one transmission line is required. Synchronous transmission is faster picking up or emitting electrical noise. There are two types of coaxial cable:
than asynchronous transmission because fewer bits have to be transmitted; only data bits  thinnet and
and no extra control bits. For this reason it is the choice for network communications links.  thicknet.

2.4. Communication Switching Techniques


Long distance transmission is done over a network of switched nodes. Data is routed by
being switched from one node to another. Three switching techniques exist: packet
switching, circuit switching and message switching.

Coaxial cable
2.4.1. PacketSwitching
Packet switching is a switching method in which the message to be transmitted is broken To connect coaxial cable to devices, we need coaxial connectors. The most common type of
into small data packets and sent over the network. Each packet contains a portion of data connectors used today is the Bayone-Neill-Concelman, or BNC connector.
and some control information. The packets may take different routes to arrive their
destination and they may arrive in any other. On arrival, they are put back into order and b. Twisted Pair Cable
the message is reconstituted. Each packet is sent with a header address which tells what its Twisted-pair cable is the most common type of cabling used in LAN networks today. It
destination is. The header address also describes the sequence for reassembly at the consists of a pair or pairs of insulated wires twisted together. Cable twisting helps reduce
destination. One packet contains information on how many packets should be arriving. If a noise pickup from outside sources and crosstalk on multi-pair cables. There are two types
packet fails to arrive, the destination computer sends a message to the sender’s computer of twisted pair cables: shielded twisted pairs (STP) and unshielded twisted pairs (UTP).
asking it to send the missing packet again. This method is suitable for transmission of data.
Twisted pair cable uses RJ-14
2.4.2. Circuit Switching and RJ-45 connectors
Circuit switching is a switching method in which a dedicated communication path in
physical form between two stations within a network is established, maintained and
terminated for each communication session. This channel remains open throughout the Twisted pair cable
communication process and cannot be used by anyone else. It has basically three phases:
circuit establishment, data transfer and circuit disconnect. The message is sent without  Unshielded Twisted Pair
being broken up, so it is received in the order it was sent. This method was designed for UTP cables consist of 2 or 4 pairs of twisted cable. Cable with 2 pair use RJ-11 connector
voice transmissions. Telephone networks use circuit switching for transmission of phone and 4 pair cable use RJ-45 connector. RJ stands for registered jack. There are five levels of
calls. UTP:

2.5. Transmission Media Category 1: These are used in telephone lines and low speed data cable.
A transmission medium is the physical pathway that connects computers and other devices Category 2: These cables can support up to 4 mps implementation.
on a network. Each transmission medium requires specialized network hardware that is Category 3: These cable supports up to 16 mps and are mostly used in 10 mps.
compatible with that medium, and most networks need to use a combination of Category 4: These are used for large distance and high speed. It can support 20mps.
transmission media types selected based on the network's needs.There are two categories Category 5: This is the highest rating for UTP cable and can support up to 100mps.
of transmission media: guided and unguided media.
UTP can be connected as straight through or crossover. A straight-thru cable has identical
2.5.1. Guided Media ends. A crossover cable has different ends.
Guided media are the physical links through which signals are confined to narrow path.
They are made up of an internal conductor bounded by jacket material. They are also called c. Fiber Optic Cable
bounded or conducted media. Three common types of guided media are coaxial cable, Fiber optic cables use optical fibers that carry digital data signals in the form of modulated
twisted pair cable and fiber optical cable. light pulses. An optic fiber consists of an extremely thin cylinder of glass, called the core,
surrounded by a concentric layer of glass, known as the cladding. Each cable has two fibers
a. Coaxial Cable - one to transmit and one to receive.

©A LEVEL ICT 48
There are two types of optic fibers:  traveling in a straight line, the earth’s curvature poses a problem to long distance
 A single mode fiber (SMF) uses a single ray of light to carry transmissions over long microwave transmissions. As such,long distance transmissionsrequiredirectional antennas
distances. (repeaters)to be used at intervals of 25 to 30 kilometers between the transmitting and
 A multi-mode fiber (MMF) uses multiple rays of light simultaneously with each ray receiving end.
of light running at a different reflection angle to carry transmissions over short
distances.  Satellite systems use communication satellites to solve the problem posed by the
earth’s curvature to terrestrial microwave systems. A communication satellite is a
microwave relay station placed in outer space. A microwave signal is transmitted from
earth to the satellite which amplifies the signal and sends it back to earth. The earth station
transmits the signal to the satellite on an up-link, on one frequency and the satellite repeats
those signals on a down link which is on another frequency.

Optic fiber

The light source can be LED (light emitting diode) or LD (laser diode)

2.5.2. UnguidedMedia
Unguided media do not use physical means to define the path to be taken. They provide a
means for transmitting electromagnetic waves but do not guide them. They are also called
unbounded media. Examples of unguided media are infrared waves, radio wavesand
microwaves.  Advantages of microwave systems
o No cables needed
a. Infrared o Multiple channels available
Infrared uses transmitters/receivers (transceivers) that modulate non-coherent infrared o Wide bandwidth
light. Infrared signals do not penetrate walls as such transceivers must be within line-of-
sight either directly or via reflection. Line of sight is a type of propagation that can transmit  Disadvantages
and receive data only where transmit and receive stations are in view of each other without o Line-of-sight will be disrupted if any obstacle, such as new buildings, are in the
any sort of an obstacle between them. way
o Signal absorption by the atmosphere. Microwaves suffer from attenuation due to
b. Radio waves atmospheric conditions.
Radio wave systems transmit signals by modulation of electromagnetic waves with o Towers are expensive to build
frequencies below that of visible light. Radio waves carry information by systematically
changing some property of the radiated waves such as amplitude (AM radio), frequency 2.6. Transmission Checks
(FM radio) and phase. Radiowaves are omnidirectional.This means that signals spread out Network data transmissions often produce errors, such as toggled, missing or duplicated
in all directions and can be received by many antennas. bits. As a result, the data received might not be identical to the data transmitted, which is
obviously a bad thing. Because of these transmission errors, network protocols very often
c. Microwaves use error-detection codes. Examples of error-detection codes include parity checking,
Microwaves are electromagnetic radiations beyond the frequency range of radio and checksums and cyclic redundancy checks.
television. There are two types of microwave systems: terrestrial microwave systems and
satellite systems. 2.6.1. ParityChecking

 Terrestrial microwavesystemsare land-based. Microwaves being line-of-sight and Parity checking refers to the process of using a parity bit to check that data has been
 transmitted accurately. A parity bit is an extra bit transmitted with a data unit that will be
used to check its integrity. There are two types of parity: odd parity and even parity.

©A LEVEL ICT 49
 In odd parity, the parity bit is added such that the total number of bits at 1, in the data 2.7.2. Interrupt
unit, is an odd number. An interrupt is a signal to the processor emitted by hardware or software indicating an
 In even parity, the parity bit is added so that the total number of 1s is an even event that needs immediate attention. An interrupt alerts the processor of a high-priority
number. condition requiring the interruption of the current task the processor is executing.

Example: What are the parity bits for the following data units in odd parity? Interrupts are used to handle such events as data receipt from a modem or network, or a
key press or mouse movement.
i) 111011011 ii) 001001010 iii) 110101010
2.7.3. Polling
Example 2: What are the parity bits for the following data units in even parity? Polling is the process by which the central computer or communications controller in a
network, "polls" or asks each device in the network if it has a message to send and then
i) 011010100 ii) 111001011 iii) 100111000 allows each in turn to transmit data. Access and control of star network typically is
maintained by a polling system.
2.6.2. Checksum
2.7.4. Handshaking
A checksum or hash sum is a count of the number of bits in a transmission unit that is
Handshaking is the process by which two devices initiate communications. It begins when
included with the unit for the purpose of detecting errors that may have been introduced
one device sends a message to another device indicating that it wants to establish a
during transmission. The checksum or hash sum may be computed according to the
communications channel. The two devices then send several messages back and forth that
number of set or unset bits in the message. On reception, the receiver applies the same
enable them to agree on a communications protocol.
checksum function/algorithm to the message. If the checksum obtained matches the one
sent, the transmission is considered to be successful and error-free.
2.8. Communication Protocols
For proper communication in a network, different entities must speak the same language.
2.6.3. CyclicRedundancy Check
There must be mutually acceptable conventions and rules about the content, timing and
A CRC is an error-detection code in which each segment of the original message is
underlying mechanisms. These conventions and associated rules are referred as protocols.
combined with additional bits to make a binary number that is divisible by some previously
chosen divisor.
Definition: A protocol is a set of rules and conventions that govern how devices on a network
 kis the length of the message we want to send, i.e., the number of information bits.
communicate.
 nis the total length of the message we will end up sending the information bits
followed by the check bits. Peterson and Brown call this a code polynomial.
The need for a protocol is obvious: it allows different computers from different vendors
 n-kis the number of check bits. It is also the degree of the generating polynomial. The
and with different operating characteristics to ‘speak the same language’. The same
basic (mathematical) idea is that we're going to pick the n-k check digits in such a
protocols must be followed by each machine involved in the communication in order for
way that the code polynomial is divisible by the generating polynomial. Then we send
the receiving host to be able to understand the message. A protocol may be physical or
the data, and at the other end we look to see whether it's still divisible by the
logical.
generating polynomial; if it's not then we know we have an error, if it is, we hope
there was no error.
2.8.1. Physical Protocols
Physical protocols are concerned with how a device connects to a medium. They ensure
2.7. Peripheral Device Control
that a device connected to a medium can transmit through the medium. They make sure
2.7.1. Buffering
that the layout of pins on the connectors is the same and that devices are correctly
A buffer is an area of memory used to temporarily store data while it is being moved from
connected and configured. Few examples of physical protocols are 802.11 for Wi-Fi
one place to another. Buffers are used to compensate for differences in rate of flow of data
connections and DSL for broadband.
or time of occurrence of events, when transferring data from one device to another.
Routers use buffers to route data packets on the Internet. When a packet is sent from one
2.8.2. LogicalProtocols
router to
Logical protocols are concerned with data handling. They ensure that data are in the right
another via one or more intermediate routers, the packet is received at each intermediate
format for the application, the bit rates match at both ends, and the same error correction
router in its entirety, stored there until the required output line is free, then the packet is
is used. Examples of logical protocols are TCP/IP, HTTP, POP3, FTP, SMTP and WAP.
forwarded.

©A LEVEL ICT 50
2.8.3. The OSI Reference Model It is responsible for path determination, routing, and the delivery of packets across
The Open Systems Interconnection (OSI) reference model or more commonly the OSI internetworks. It is also responsible for addressing (also known as logical addressing) for
model is an ISO standard that defines how network communications take place by example IP addressing. Examples of protocols at this layer are: IP, IPX and ICMP.
providing a framework for standardization. The OSI model divides network Examples of devices that operate at this level are Layer-3 switches and routers. WAPs
communications into seven layers. Each layer is responsible for carrying out specific (wireless access points) with built-in routing capabilities also act at this layer.
functions when transmitting data on the network. The table below shows the layered
architecture of the OSI reference model. Layer 2: Data Link
It is responsible for reassembling bits taken off the wire by the physical layer to frames and
7 Application Layer makes sure they are in the correct order and requests retransmission of frames in case an
error occurs. It provides error checking by adding CRC to the frame. Examples of protocols
6 Presentation Layer
at this layer are: Etherne
5 Session Layer t, Token Ring, PPP and ISDN.
Examples of devices that operate at this layer are: switches, bridges, NICs and WAPs
4 Transport Layer (Wireless Access Points).

3 Network Layer
Layer 1: Ph
2 Data Link Layer These layers can be recalled using the ysical
following mnemonics: All People Seem This layer communicates directly with the communication medium. It is responsible for
1 Physical Layer activating, maintaining and deactivating the physical link. It defines electrical and optical
To Need Data Processing. (Layers 7 - 1)
signaling, voltage levels, data transmission rates, as well as mechanical specifications such
OSI Reference Model
as cable lengths, and connectors, the amount of pins and their functions. Examples of
devices that operate at this layer are: hubs, repeaters, and NICs.
Layer 7: Application
It provides network services directly to the user’s applications such as a web browser or e- These layers can be recalled using the following mnemonics: All People Seem To Need Data
mail client. This layer is said to be “closest to the user”. Examples of protocols that operate Processing. (Layers 7 - 1)
at this layer are: TELNET, HTTP, FTP, SMTP and POP.
3. The Internet
Layer 6: Presentation 3.1. Brief History
The Presentation layer represents the data in a particular format to the Application layer. It Many years ago, the military of the United States of America desired to interconnect or link
defines encryption, compression, conversion and other coding functions. Examples of their computers in order to better understand and manage information and
specifications defined at this layer are: GIF, JPEG, MPEG, MIME and ASCII. communication with respect to enemy attacks in times of crisis. In the year 1969 the
Department of Defense (DoD) then developed an experimental network called the
Layer 5: Session Advanced Research Project Agency Network (ARPANet)
It establishes, maintains and terminates end-to-end connections (session) between two In the year 1980, the National Science Foundation of the United States of America then
applications on two network nodes. It controls the dialogue between the source and developed the technology of ARPANet to produce the National Science Foundation
destination nodes, which node can send when and for how long. Examples of protocols that Network (NSFNet) which now enabled universities and other school establishments in the
operate on this layer are: RPC, NETBIOS and X.225 USA to be interconnected. After a great deal of work, a network which enabled the transfer
of large amounts of information at very high speed which is today called the Internet was
Layer 4: Transport developed.
It is responsible for end-to-end delivery of entire messages. It allows data to be transferred The Internet can be defined as a worldwide/global system of interconnected computer
reliably and uses sequencing to guarantee that it will be delivered in the same order it was networks. It is the network of networks in which users can view information on the World
sent. It also provides services such as error checking and flow control. Examples of Wide Web, exchange electronic mail, participate in electronic discussion forums
protocols at this layer are: TCP, UDP, NETBEUI and SPX. (newsgroups), send files from any computer to any other and even use each other’s
computers directly if they have appropriate passwords. Another name for the Internet is
Layer 3: Network information superhighway.

©A LEVEL ICT 51
3.2. ISP and Internet Access 3.2.4. Wireless Internet Access
An Internet service provider (ISP), also sometimes referred to as an Internet access Wireless Internet access or wireless broadband is particularly useful for mobile users. With
provider (IAP), is a company that offers Internet access to individuals and organizations. handheld devices becoming more advanced and increasingly popular, wireless access is
The ISP connects to its customers using a data transmission technology appropriate for becoming one of the major ways of connecting to the Internet. This method provides an
delivering Internet Protocol Paradigm, such as dial-up, digital subscriber line (DSL), cable “always-on connection” which can be accessed from anywhere as long as you are
modem, wireless or dedicated high-speed interconnects. geographically within network coverage. Wireless Internet access includes deploying Wi-Fi
ISPs may provide Internet e-mail accounts to users which allow them to communicate with hotspots for accessing the Internet. Technologies such as GPRS and UMTS (Universal
one another by sending and receiving electronic messages through their ISP's servers. ISPs Mobile Telecommunication System) allow Smart phones and other handhelds with Internet
may provide services such as remotely storing data files on behalf of their customers, as capabilities to access the Internet using existing cell phone networks.
well as other services unique to each particular ISP.
Different methods exist for connection to the Internet. 3.2.5. Internet over Satellite
Internet over satellite (IoS) allows a user to access the Internet via a satellite that orbits the
3.2.1. Dial-Up Connection earth. A satellite placed at a static point above the earth's surface, communicates with the
A dial-up connection is a connection that is established by dialing a telephone number ISP’s dish giving the user access to the internet.
through a modem. A dial-up connection uses a dial-up modem to transmit digital
information over thePlain Old Telephone System (POTS). POTSrefers to the standard 3.3. The TCP/IP Model
telephone network designed for analog transmission of voice over copper wire. This type The Internet uses a collection of protocols known as the TCP/IP protocol suite. It is called
ofconnection offers relatively slow transfer rates and is established on demand. This TCP/IP after two of its most prominent protocols, but there are other protocols as well. The
method has long been the most widely used method to connect to the Internet but it has TCP/IP model is based on a four-layer model for networking. The layers from top to bottom
been replaced by high-speed broadband and wireless connections. are application layer, transport layer, Internet layer and network access layer.Below is a
comparison between the TCP/IP model and the OSI model.
3.2.2. Digital Subscriber Line
DSL uses the standard copper telephone wires, often already installed in homes and offices Application Layer
to provide a high-speed Internet connection. xDSL means that there are different types of Application Layer HTTP FTP SMTP DNS RIP

DSL: asynchronous DSL (ADSL), synchronous DSL (SDSL), High bit-rate DSL (HDSL), Rate Presentation Layer
Adaptive DSL (RADSL) and ISDN DSL (IDSL). Session Layer Transport Layer
 ADSL allows the telephone wires to be used for analog POTS system and digital data TCP UDP
Transport Layer (Host-to-host)
transfer simultaneously. The download speed (downstream) for ADSL is faster than the

Network Layer Internet Layer ARP IP IGMP ICMP


 SDSL cannot share the physical medium with standard telephone communications and
has a download speed equal to the upload speed. Data Link Layer Network Access
A DSL connection requires a transceiver (DSL modem) which allows an Ethernet UTP or a Ethernet Token Frame ATM
Layer Ring Relay
USB connection directly to a PC, or to a hub, router, or switch to provide Internet access to Physical Layer
an entire network. The transceiver can be integrated into a router or switch.
OSI Model TCP/IP Model
TCP/IP Protocol Suite
3.2.3. BroadbandCable
TV channels only take up 6MHz of cable bandwidth each, which usually leaves several During a transmission, a message travels down all network layers at the source machine.
hundred MHz available. This additional space on cable is used for high-speed Internet Before sending a message to the next layer, each layer places it in an envelope of
connection. Information from the Internet travels through the cable as a single TV channel. overheadinformation related to that layer. This process is called encapsulation.
Just as with DSL, cable Internet requires a special transceiver (cable modem) which allows Encapsulation at each layer produces adata unit called protocol data unit (PDU).
information to be sent and received on frequencies not used by TV channels. The cable At the receiving end, the message travels up through the network layers, each layer
modem provides one or more LAN interfaces, usually Ethernet or USB which connect removing the envelopes added when the message was sent. So, upon its receipt, the
directly to a client or a device such as a hub, switch, or wireless router to allow additional message is in its original state.
clients or entire networks to use the same connection. The cable modem is also equipped
with connections for TV and radio.

©A LEVEL ICT 52
3.3.1. Network Access Layer 3.3.3. TransportLayer
This layer is responsible for sending and receiving TCP/IP packets on the network medium The transport layer is responsible for sequencing and transmission of packets,
(Physical/Data Link). The network Access layer PDUcalled frame, is obtained by adding a acknowledgment of receipts, recovery of packets and flow control. In essence, it engages in
header and a trailer to the PDU from the Internet layer. host-to-host transportation of data packets and the delivery of them to the application
Applicable LAN technologies: Ethernet, Token Ring, FDDI etc. layer. A transport layer PDU is called segment.
Applicable WAN technologies: X.25 (old), Frame Relay, ATM etc. Core protocols at this layer are TCP and UDP.

3.3.2. Internet Layer a. TransmissionControl Protocol


This layer is responsible for packaging, addressing and routing of packets. The PDU at this TCP is aconnection-orientedreliable protocol used in the accurate transmission of large
layer is called datagram or packet. amounts of data. Data packets are verified using checksums and retransmitted if they are
Core Internet layer protocols are: IP, ARP, ICMP and IGMP. missing or corrupted. The application plays no part in validating the transfer.

a. Internet Protocol b. User Datagram Protocol


Internet Protocol (IP) specifies the format of packets and the addressing scheme. All UDPis a connectionless unreliable protocol used for the transmission of small amounts of
computer devices (desktops, laptops, PDAs, phones, tablets) connected to the Internet, data. Data packets are sent without testing to verify whether they actually arrive at the
have IP addresses by which they are identified. destination, nor whether they were corrupted in transit. It is up to the application to
determine these factors and request retransmissions. UDP is faster compared to TCP.
Definition: An IP address is a unique identifying number given to every single computer on a
TCP/IP network. 3.3.4. ApplicationLayer
The application layer provides user applications with the ability to access the services of
Two versions of IP addresses are available: IPv4 that uses 32 bits and IPv6 that uses 128 the other layers. Some protocols of this layer are HTTP, FTP, POP, SMTP, Telnet, IMAP and
bits. WAP.
 An IPv4 is made up of four sets of numbers separated by dots such as 123.23.168.22.
This notation is known as dotted decimal notation. Each of the four numbers a. Hypertext Transfer Protocol
separated by dots can be any number from 0 to 255, making for a total of 4.3 billion HTTPis a standard method of publishing information as hypertext in HTML format on the
potential IPv4 addresses (i.e. 255×255×255×255). Internet. It provides the ability to supply web pages between a browser and the server.
HTTPS is a secure version of HTTP used for accessing secure web servers, whereby all data
 An IPv6 has eight sets of numbers separated by colons such as transferred are encrypted.
3ffe:1900:4545:3:200:f8ff:fe21:67cf.
b. File Transfer Protocol
IP addresses are assigned manually (by an administrator) or automatically (by DHCP or FTP is a standard for transferring files between a server and a client on a TCP/IP network.
APIPA). An IP address is also known as a logical address. It provides the ability to upload and download files between hosts on the network.

b. Address Resolution Protocol c. Simple Mail Transfer Protocol


ARPresolves IP addresses to MAC addresses. SMTP is used for sending e-mails between servers on the Internet and other TCP/IP
networks. It governs the transmission of mail messages and attachments. SMTP is used in
Assignment: Differentiate between an IP address and a MAC address. the case of outgoing messages.

c. Internet Control Message Protocol d. Post Office Protocol


ICMP isresponsible for diagnostics and error reporting. POP is a standard protocol for delivering e-mails to personal computers.There are different
versions of the post office protocol indicated by POPnwhere n = 1, 2, 3 or4.
d. Internet Group Management Protocol
IGMP is responsible for management of group multicast. e. Telnet
Telnet is a protocol that allows a computer on the network to be accessed remotely. It
provides the ability to login into a remote host and administer the machine. Using Telnet a
computer can be used as a terminal on another.

©A LEVEL ICT 53
A website can be accessed by typing its address or URL (Uniform/Universal Resource
f. WirelessApplicationProtocol Locator) into the address bar of a web browser. An example of a URL is
WAP is a protocol which runs on mobile phones and provides a universal open standard for http://www.crtv.cmwhere http is the protocol used and www.crtv.cm, the domain name
bringing Internet content to mobile phones and other wireless devices. (address) of the site.

Assignment: Give the full meaning of the following protocols and state their functions. Example 1: http://www.bgsmolyko.edu/Ls3,4/ict796/intenet.pdf
i) IMAP  http is the protocol used (hypertext transfer protocol)
ii) RIP  www.bgsmolyko.edu is the domain name (the machine at BGS Molyko that hosts the
iii) DNS website)
 Ls3,4/ict796/internet.pdf is the path of the document (resource) on the host
3.4. TCP/IP Ports computer. Ls3,4 is the folder, ict796 is the subfolder and internet.pdf is the
A computer has a single physical connection to the network. All data destined for a file(resource).
particular computer arrives through that connection. However, the data may be intended
for different applications running on the computer. To identify the application for which Example 2: www.minsup.gov.cm
the data is intended, TCP requires port numbers on the host and destination for  gov is the top level domain which specifies that the URL is for a government
communication. institution.
 cm specifies the country in which the URL is hosted or the country in which the
Definition: A communication port is a 16-bit number that identifies an application on the institution is found.
Internet or TCP/IP network.
Assignment: What is a home page?
Popular Internet application protocols are associated with well-knownportsassigned by the Answer: A web page that links a user to the other areas of the website.
Internet Assigned Number Authority (IANA). Sample TCP port numbers are:
a. Domain Name System
Port number Protocol A domain name system (DNS) is a service which performs the function of turning human-
understandable domain names into IP addresses.
20 FTP data channel

21 FTP control channel b. Web Browser


23 Telnet
A web browser (or simply browser) is a computer program that enables a user to read
hypertext in files or on the World Wide Web. Popular browsers include Mozilla Firefox,
25 SMTP Microsoft Internet Explorer, Opera Mini and Netscape.
80 HTTP
c. Search Engine
110 POP A search engine is a computer program that searches for specific words on the World Wide
Web and returns a list of documents in which they were found. Examples of search engines
Ports are usually combined with IP addresses to form a socket. For example include Google and yahoo.
127.102.10.0:80.
3.5.2. Electronic Mail
3.5. Internet Services Electronic mail or e-mail (email) is a means of sending messages, text, and computer files
3.5.1. The World Wide Web between computers via the Internet. To send and receive e-mails, you need an Internet
The World Wide Web (WWW)is a system on the Internet which allows documents to be connection and an e-mail account which can be created within a webmail service such as
connected to other documents by hypertext links, enabling the user to search for Yahoo, Hotmail or Gmail. When you create an e-mail account, you are given a unique email
information by moving from one document to another. It consists of a large number of web address that gives you access to your mail box. An email address is made up of two parts
servers that host websites. A website consists of a number of web pages connected by separated by the symbol @ pronounced “at”. For example [email protected].
hypertext links. A web page is a text file that contains information stored using a structured In the above address,
language called HTML (Hypertext Markup Language).  bgsmolyko is the user ID, user name or login

©A LEVEL ICT 54
 yahoo.com is the domain name. The domain specifies the mail server (computer) users as friends, the ease of sharing pictures, music, text, and links, and built-in chat and
on which the mail box is located. mail features. Examples of social networking sites areFacebook, Twitter and Instagram.

The part of the domain name after the dot is called top-level domain, and specifies the type c. Wikis
of organization or the country the host server is located. Some common top-level domains Wikis are websites that allow visitors to easily add, remove and edit content, hence
are: enabling the collaborative authorship of comprehensive documents. The best example of a
o .com - for commercial enterprises wiki is the multi-lingual, web-based encyclopediaWikipedia, and which currently includes
o .edu - for educational institutions and universities over two million articles.
o .gov - for United States government agencies
o .net - for organizations such as Internet Service Providers d. Viral Video Sites
o .org - for non-commercial organizations A viral video is a video that is distributed by sharing. Viral videosites are websites that
allow anybody to post videos online. Whilst it is now not difficult to put a video on any
3.5.3. Instant Messaging website, the significance of viral video sites is that they provide somewhere to put videos
Instant messaging is a live (or real time) communication which occurs when brief text where it is likely that at least some other people will actually find them. Examples are
messages are exchanged instantly over the Internet. Instant Messaging requires that both YouTube and Kaltura.
users be on-line at the same time. Common IM applications are AOL Instant Messenger,
Yahoo Messenger and Microsoft MSN messaging. 3.5.6. Electronic Commerce
E-commerce refers to the buying and selling on the Internet. Different models of e-
3.5.4. Internet Telephony commerce exists: business-to-business, business-to-consumer, business-to-government
Internet telephony or voice over IP (VoIP) is the transmission of voice telephone and m-commerce
conversations through the Internet or IP networks. It allows users to have voice-talk with
others. The telephone calls are digitized and transmitted through the Internet. Internet a. Business-to-Business
telephone services can be mainly categorized into net-to-net and net-to-phone telephony. B2C model sells goods or services to the consumer, generally using online catalog and
In net-to-net telephony, both caller and receiver must be online. When both are online, one shopping cart transaction systems. For example, an online pharmacy giving free medical
dials the other person’s phone number. If they accept the call, then voice communication is consultation and selling medicines to patients is following B2C model. Amazon is an
established. example of one of the first and still one of the most successful B2C e-commerce
In net-to-phone, only one person has to be online. This person dials the other person’s companies.
phone number and the latter receives a ring on their phone. Yahoo messenger and Skype
provide services for both types. b. Business-to-Business
B2B describes commerce transactions between businesses, such as between a
3.5.5. Interpersonal Computing manufacturer and a wholesaler, or between a wholesaler and a retailer. In this form, the
Interpersonal computing refers to person-to-person interactions facilitated by websites buyers and sellers are both business entities and do not involve an individual consumer.
that enable collaborative content creation, sharing and manipulation. Interpersonal
computing involves: blogs, social networks, wikis and viral video sites. c. Business-to-Government
B2G is a derivative of B2B marketing. B2G sites provide a platform for businesses to bid on
a. Blogs government opportunities which are presented as solicitations requests for proposal
A blog (web log) is a chronological, journal-style website which its author (or "blogger") (RFPs) to tender.
maintains like an online diary, with regular entries of commentary, descriptions of events,
or other material such as graphics or video. Many blogs provide commentary or news on a d. M-Commerce
particular subject; others function as more personal online diaries. They also provide the M-commerce refers to the use of mobile devices for conducting transactions. The mobile
readers with the ability to leave comments in an interactive format. device holders can contact each other and can conduct the business. Even the web design
and development companies optimize the websites to be viewed correctly on mobile
b. Social Networking Sites devices.
Social networking sites are websites that allow user to build personalized communities to
socialize with. Common features include a customizable profile, the ability to add other

©A LEVEL ICT 55
Some e-commerce websites are: www.bruneiair.com for airline ticket bookings, 3.7.1. HTML Documents
www.amazon.com for sales of books and magazines, www.brumedia.com/shop for sales of An HTML document is simply a text file that is saved with the extension .html or .htm. It can
computers, shirts, and cameras be created by a simple text editor like Microsoft Notepad, Notepad++ as well as a
sophisticated web authoring tool like FrontPage or Dreamweaver.
 Some advantages of setting up an e-commerce website are: HTML documents are made up of markup tags (or simply tags). A tag is a code enclosed
o Products can be sold to local customers and those from abroad. within angle brackets that indicates how something is to be interpreted by a web browser.
o It is accessible 24 hours each day. Some examples of tags are <html>, <br> and <em>. Most tags come in pairs: an open tag
o It needs a small number of staff to run. and a closing tag which is written with a slash after the first < (e.g. </html>). A closing tag
o It does not need huge office space. tells the browser where to stop applying the effect of a given tag.
o Products can be sold at cheap prices An HTML document is contained within the <HTML> and </HTML> tags and comprises of
two sections: head and body.
 Some disadvantages of e-commerce are:  The Head contains the page title and meta-tags within the <HEAD></HEAD> tags.
o Credit card fraud - hackers are able to steal credit card numbers on computers. Any JavaScript code that is used, as well as Cascading Style Sheet information is also
o Certain websites spy or track the buying habits of their customers. contained within the Head. This section will not be displayed on the web page.
o Some goods do not arrive after they are paid for.  The Body holds the actual content of the page (text, graphics, lists, etc.) contained
o It lacks human interaction as one only sees pictures and some text descriptions. within the <BODY></BODY> tags.
The <HTML>, <HEAD>, <TITLE>, and <BODY> tags are referred to as document tags while
3.5.7. Online Banking the tags that are used within the body part of the document are known as markup tags.
Online banking (Internet banking) is simply the use of the Internet to perform banking A basic HTML document would look something like this:
operations like opening an account, accessing account information, transferring funds,
getting a bank statement etc. In an Internet banking system, the bank has a centralized <HTML>
database that is web-enabled. All the services that the bank has permitted on the Internet <HEAD>
are displayed in a menu. Any service can be selected and further interaction is dictated by <TITLE>Page title here</TITLE>
the nature of service. </HEAD>
<BODY>
3.6. Intranet and Extranet Page content here.
An intranet is a private network that is set up using the same technology and protocols as </BODY>
the Internet but is restricted to users inside an organization. It provides similar services </HTML>
within an organization to those provided by the Internet without necessarily being
connected to the Internet. An intranet can be seen as a private version of the Internet. To
access an intranet, some form of user authentication is usually required. External access to o <HTML> marks the beginning of an HTML document
an intranet is not always provided. o <HEAD> begins the heading section of the document
An extranet is an interconnection of two or more intranets. It allows an organization to o <TITLE> ... </TITLE> gives a title that will appear on the browser’s menu bar. This
share information with other organizations using Internet standards but with security section must appear between the <HEAD> ... </HEAD> tags and should be straight
features preventing access to others. text, no tags.
o </HEAD> defines the end of the heading
3.7. Web Design with HTML o <BODY> … </BODY> defines the body of the document (text contained within the
HTML stands for Hypertext Markup Language. It is the authoring language that describes <BODY> … </BODY> tags appears in the main browser window). It can be used
how a Web page should be displayed by a Web browser. Hypertext means that it provides with the attribute BGCOLOR.
ways of representing information with links or connections to other information. These o </HTML> defines the end of the document
links are called hypertext links. Markup means that it provides ways to indicate
underlining, italics, paragraph breaks, section headings, and so on, in text. Remark Once an HTML document hasbeen saved, it can now be opened as a web page
using a web browser.
To edit the page, go back to the text document. Make the changes and save the document. In
the web page, click “reload” or “refresh” to apply the changes.

©A LEVEL ICT 56
3.7.2. Text Tags <strong><em><u>This text is bold, underlined and in
Text tags are used to format text within the document.Some tags are used with attributes. italics</u></em></strong>
An attribute is a special code that can enhance or modify a tag. They are generally located </body>
in the starting tag after the tag name. The basic syntax for html tags and attributes is: </html>

<tag attribute=“value”> … </tag> Example 2:

Tags Description <html>


<head>
<b> … </b> or <strong> … Bolds the text between the opening <title>MyPage</title>
</strong> and closing tags </head>
<i>...</i> or <em>...</em> Puts text in italics <bodybgcolor=“cyan”>
<font type=“Monotype corsiva” size= “12” color=“blue”
<u> … </u> Underlines text </body>
<font> … </font> Sets the appearance of the text in </html>
<font size=? color=#0000FF> … your page. Can be used with "size",
</font> "color" and "face" attributes. Remark! Tags are case insensitive but it is advisable to write them in lower case.
All attribute values must be written within double quotes.
<blink> … </blink> Causes text to blink
Centers text or any item or group of 3.7.3. Heading Tags
<center> … </center> items place between its open and Heading tags are used to highlight text by making them bigger and bolder than normal text.
closing tags There are six levels of headings numbered 1 through 6, where 1 is the biggest and 6 is the
<marquee> … </marquee> Causes text to navigate smallest heading. Headings are specified as <h ></h > where h stands for heading and is
the level number (1 to 6).
Sets a paragraph apart from other
<p> … </p>
text and adds a line break after. </p>
<p align=“center”> … </p> Example:
is optional
<html>
Used to insert comments. Comments
<head>
<!--...--> are not displayed by the browser.
<title>Heading</title>
They are footnotes for you.
</head>
Used to insert a line break. It does not
<br> <body>
have a closing tag.
<h1>Level 1 heading</h1>
<h2>Level 2 heading</h2>
</body>
Example 1: </html>
<html>
<head> 3.7.4. List Tags
<title>My First Web Page</title> List tags are used to display items that are arranged in a list. Two types of lists exist:
</head> ordered and unordered lists.
<body> Their respective tags are <ol> … </ol> and <ul> and </ul>. No matter the type of list, the
<strong>This text is bold</strong><br> <li> … </li> tag is used for every item inside the list.
<b>This text is bold too</b><br> Example:
<em>This text is in italics</em><br> <ol> <ul>
<i>This text is in italics too</i><br> <li>item 1</li> <li>item 1</li>
<u>This text is underlined</u><br> <li>item 2</li> <li>item 2</li>
<b><i>This text is bold and in italics</i></b><br> <li>item 3</li> <li>item 3</li>
</ol> </ul>
©A LEVEL ICT/Csc 57
X. DATABASE DESIGN

3.7.5. Anchor (Link) Tag Introduction


A link can be text or an image which when clicked takes one to another part of the A database is an organized collection of related data stored in a way that it can be easily
document, another html document on the same machine or to another website. A link is retrieved and manipulated. A telephone directory, a library catalogue and a class register
introduced using the anchor <a> ... </a> tag. are examples of manual or paper-based database systems. A paper-based database
<a href=“URL or address”> … </a> requires much paper as the database becomes larger, making it difficult to manipulate the
<a href=“www.facebook.com”>Click here to log onto to Facebook</a> database. The problems caused by paper-based systems are solved by the development of
<a href=“mailto:[email protected]”>Send a mail to Josh</a> computer-based systems.
<a href="#top">Back to top of page </a> The capacity for computers to store large amounts of data and their ability to quickly and
efficiently retrieve the data makes them ideal for creating and using electronic or
3.7.6. Image Tag computerized databases. A computerized database refers to a collection of related files that
Images are inserted in the page with the use of the image tag <img>. It has no closing tag are digitized. Computerized databases are created using database software called database
and can be used with the attributes src which specifies the source of the image, align, top management systems (DBMS).
and width.
1. Database Models
Example:
<imgsrc= “image path” align=“top” height=“40” width=“30”> … </img> 1.1. Flat-file Database
<imgsrc=“logo.jpg”> A flat file database is a single table database, with separate copies of data in each part of the
<imgsrc= “mypict.gif> business. An example is a phone directory.
The problems encountered with flat file databases are
3.7.7. Table Tags  Data duplication: data is repeated and hence stored many times. This wastes disk
Tables are defined with the <table> tag. A table is divided into rows with the <tr> tag, and space and slows down query time.
each row is divided into data cells with the <td> tag. The letters td stands for table data,  Maintenance is difficult as every occurrence of a piece of data needs to be updated if
which is the content of a data cell. A data cell can contain text, images, lists, paragraphs, its value changes
forms, horizontal rules, tables, etc.  More manual data entry is required and therefore a greater likelihood of errors
when data is being entered.
Example:
<table>
<tr><td>row 1, cell 1</td> The solution to these problems is to divide the data into logical groups and store the data in
<td>row 1, cell 2</td> multiple tables, then connect (relate) the tables to each other. This results to a Relational
</tr> database.
<tr><td>row 2, cell 1</td>
<td>row 2, cell 2</td> 1.2. Relational Database Model
</tr> In a relational database, data is organized in two dimensional tables called relations, which
</table>
are linked. Arelationhas the following features:
 Name: the name of the table
 Attributes:
3.7.8. Form Tags
3.7.9. F
 Records or tuples:

1.3. Object-Oriented Database Model

An object-oriented database tries to keep the advantages of the relational model and at the
same time allows applications to access structured data.

1.4. Hierarchical Database Model

©A LEVEL ICT/Csc 58
2. Database Modeling
The basic elements of an E-R diagram are entity sets, attributes and relationship types.
2.1. DatabaseNormalization
Database normalization is the process of organizing the fields and tables of a relational
2.2.1. EntitySet
database to minimize redundancy and dependency. Normalization usually involves
An entity is a person, place, concept or thing for which we intend to collect data. For
dividing large tables into smaller and less redundant tables and defining relationships
example, a customer, an employee, a book, an appointment.
between them. Normalization works through a series of stages known as normal forms. In
A group of entities that share the same properties is an entity set.An entity is therefore a
order to achieve one level of normal form, each previous level must be met.
member or an instance of an entity set. In an E-R diagram, an entity set is represented by a
rectangle. In the above E-R diagram, PERSON and HOUSE are entity sets
2.1.1. First Normal Form
A relation (Table) is in first normal form (1NF) if and only if
2.2.2. Attribute
 It contains a primary key. A primary key is an attribute that identifies each entity
An attribute is a fact about an entity or a property that describes an entity. For example, a
in a unique way.
person’s name, date of birth or gender, a vehicle’s model, color or brand. Attributes store
It contains no multivalued field or repeating groups. A multivalued field is one that may
the actual data we want to keep about each entity within an entity set. An attribute is
take several values for a single record. A repeating group is a set of one or more
represented by an ellipse. In the above E-R diagram, name and date of birth are attributes
multivalued attributes that are related.
of the entity set PERSON while Number and Street are attributes of the entity set HOUSE.

2.1.2. Second Normal Form


2.2.3. RelationshipType
A relation is in second normal form (2NF)if and only if
A relationship type is a named association between entities. A person (entity) owns
 it is in 1NF
(relationship) a house (entity), a teacher (entity) teaches (relationship) a subject (entity).
 every non-key attribute is fully dependent on the primary key.
Normally, individual entities have individual relationships of the type between them but in
an E-R diagram, this is generalized to entity sets and relationship types. For example, the
In the above table, Subject does not depend on StudID. In this case, a different table is
entity set PERSON is related to the entity set HOUSE by the relationship type OWNS.A
created for subject with its own primary key and a relationship is created between the two
relationship type is represented by a diamond.
tables.
2.1.3. ThirdNormal Form
A relationship type can be characterized by a degree and cardinality ratio.
A relation is in third normal form (3NF) if and only if
 It is in 2NF
a. Degree of a Relationship Type
 there are no transitive dependencies. Transitive dependency is a situation where The degree of a relationship type is the number of entity sets involved in the relationship. It
a non-key attribute depends on another non-key attribute. can be unary, binary, ternary or n-ary.

2.2. Entity-RelationshipModeling  A unary relationship type is one that involves entities from a single entity set. E.g.
When a relational database is to be designed, an entity-relationship model is drawn at an the relationship MANAGES between entities within the entity set EMPLOYEE.
early stage and developed as the requirements of the database and its processing become
better understood.
Definition: An E-R model is a diagram which uses basic graphic symbols to show the Manages
organization of and relationships between data in a database.

An E-R diagram serves as a schema diagram for the required database. A schema diagram is  A binary relationship type is a relationship between entities from two different
any diagram that attempts to show the structure of the data in a database. entity sets. An example is the relationship OWNS in the E-R diagram above.

Name
Number

PERSON Owns HOUSE PERSON Owns HOUSE

DOB Street

©A LEVEL ICT/Csc 59
An E-R diagram
A subject is taught by one or many teachers. The cardinality of SUBJECT in the
 A ternary relationship type is one that involves entities from three different entity inverse relationship IS_TAUGHT_BY, is many and the optionality is one. This
sets. An example is a LECTURER who teaches a certain COURSE in a DEPARTMENT. relationship is described as many-to-many (M:N).

(1,M) (1,N)
LECTURER Teaches COURSE TEACHER Teaches SUBJECT

(M:N) relationship
DEPARTMENT

Remark In a normalized database, many-to-many relationships are eliminated by


 An -ary relationship type involves entities from different entity sets. creating a link entity between the entities involved in the relationship.
The above TEACHES relationship when normalized becomes
b. Cardinality Ratio of a Relationship Type
Cardinality is the maximum number of entities within each entity type that can take part in (1,1) (1,N) (1,N) (1,1)
TEACHER TEACHES SUBJECT
a relationship. For example, what is the maximum number of houses that a person can
own? On the other hand, the minimum number of entities within each entity that can take
Normalized (M,N) relationship
part in the relationship is the Optionality. For example, what is the minimum number of
houses that can be owned by a person? The primary key of the link entity is a composite key that consists of the primary keys of
The cardinality ratio is a ratio of the cardinalities of the entity sets involved in a the entities TEACHER and SUBJECT.
relationship. It can be one-to-one (1:1), one-to-many (1:N) or many-to-many (M:N).
The above representation of an E-R diagram is the Chen Convention. Another way of
 In the relationship OWNS between PERSON and HOUSE, a person can own zero or representing E-R diagrams is the crow’s foot notation that uses three symbols to show
many houses. Therefore, the cardinality of PERSON in the relationship OWNS is cardinality ratios. Here, a circle means zero, a line means one and a crow’sfoot means many.
many while the optionality is zero. The cardinality is shown next to the entity type and the optionality (if shown at all) is
On the other hand, a house is owned by one person. The cardinality of HOUSE in the shown behind it.
inverse relationship IS_OWNED_BY, is one while the optionality is one. The
relationship OWNS is therefore described as a one-to-many (1:N) relationship.

(1,1) (0,N)
PERSON Owns HOUSE

(1:N) relationship
Where A and B are entity sets and R is the relationship type.
 In the relationship RECEIVES between STUDENT and SLIP, each student receives
one andonly one result slip. The cardinality of student is one and the optionality is Exercise! Exercise! Exercise!
one. Each result slip is issued to one and only one student. The cardinality of SLIP is
one and the optionality is one. This relationship is described as one-to-one (1:1). 1) Identify the cardinality ratios of the following relationships.

(1,1) (1,1)
STUDENT Receives SLIP

(1:1) relationship

 In the relationship TEACHES between TEACHER and SUBJECT, a teacher teaches one
many or subjects. The cardinality of TEACHER is many and the optionality is one.

©A LEVEL ICT/ Csc 60


 A record is an individual entry in a database table. It comprises of one or more
fields, depending on the number of fields defined to the table. For example: if five
books are entered in our books and authors database, the “BOOKS” table would have
five records (one for each book).
2) A database will be made to store information about patients in a hospital. On
arrival, each patient’s personal details (name, address, and telephone number)  Each field in a database table is assigned a data type when the field is created. The
are recorded where possible, and they are given an admission number. They are data type determines the kind and format of the information stored in the field.
then assigned to a particular ward (Accident and Emergency, Cardiology, Example: the “Title” field in the “BOOKS” table will store text that will vary with each
Oncology, etc.). In each ward there are a number of doctors and nurses. A patient book in the database, so the data type in this case will be text or character type.
will be treated by one doctor and several nurses over the course of their stay, and
each doctor and nurse may be involved with several patients at any given time. a. Creating a New Table
To create a new table,
From the description, draw a corresponding E-R diagram showing all entity sets, o Click the Create Tab
attributes, relationship types and cardinality ratios. o Select Table in the Tables group to create a new table in Datasheet view or
Table Design to create a new table in Design view
3. Database Management Systems
A database management system (DBMS) is a computer program that is used to create, b. Adding Fields in a Table
manipulate and access a database. Examples are MS Access, MySQL, Oracle, Sybase, dBase, To add a field to a table in Datasheet View,
Paradox, Objecstore and O2. o Click the Add New Field column label.
A DBMS provides users with: o Click Rename in the Fields & Columns group.
 Data Definition Language (DDL): language which programs the structure (schema) o Type the field name and press Enter. Access creates the field. Continue until
of the database you have created all of the fields in your table.
 Data Manipulation Language (DML): language which changes the contents o Press Enter without entering a field name to end your entries.
(instance) of the database
 Data Control Language (DCL) To add a field to a table in Design View,
o Select a cell in the Field Name column
3.1. Microsoft Access 2007 o Type a name for the first field in the table and press Enter
MS Access 2007 is made up of several components including: o Select a data type and press Enter
 Tables o Type a description and press Enter
 Forms
 Queries c. Naming and Saving a Table
 Reports To name and save a table,
o Click the Save button on the Quick Access toolbar. The Save As dialog box
These components are called database objects. One or more of these components are appears.
formed when a database is created. These components are stored in a single database file. o Type the name you want to give your table.
o Click OK. Access names your table.
3.1.1. Tables
A table is an area of the database where information is stored. Tables organize data into Tip: You can use the Rename option at any time to rename any column. For example, you
columns (called fields) and rows (called records). Example: a database storing information can rename the ID column Author_ID.
about books and authors for a library could have a “BOOKS” table to store information
about books (title, publisher, Year, etc) and an “AUTHORS” table to store information about d. Setting a Primary Key
authors (name, birth date, birth place, etc). A primary key is a field in a table that allows each entry in the table to be identified in a
unique way. No two entries in the database can have the same primary key. For example
 A field is a specific piece of data stored in a table. The above mentioned ‘BOOKS’ your ID card number is unique. By default, Access sets the first field in the table as the
table has fields ‘Title’, ‘Publisher’, ‘Year’ etc. Primary Key field.

©A LEVEL ICT/ Csc 61


To set a Primary Key: o Click the Run Query button
o Switch to Design View
o Position your cursor in the field you wish to set as the Primary Key For example: a query to find the books written by Barack Obama
o Click the Primary Key button on the Ribbon
The result of a query is called a recordset.
e. The Foreign Key
The primary key is used to link the table with other tables in the database. When a primary To Save the Query:
key in one table (known as the source table) is linked to another table (known as the target o Click the Save Icon
table), the connecting field in the target table is called the foreign key. A foreign key must o Enter a name for the query
have the same structure, data type, and field size as the associated primary key, but it must o Click OK
not have the same name. Also, the foreign key in a relationship between two tables need
not be a primary key in its own table. 3.1.4. Forms
A form is an interface that allows users to enter and view data. Forms give the ability to
3.1.2. Relationships choose the format and arrangement of fields. They can be used to enter, edit and display
Relating tables reduces the unnecessary duplication of data (redundancy).The general data. Forms can retrieve data from one or more tables, and display the output on the
procedure for creating relationships in Access is to screen.
o Determine the type of the relationship and identify the source and target tables
o Create the foreign key field(s) in the target table if they are not already present To create a Form using the Form Wizard
o Select the Database Tools tab  Navigate to the table you want to base the form on
o Click on the Relationships command  Click Createon the Ribbon
o Add all the tables involved in the relationship to the window  Click Forms
o Create the relationships by dragging the primary keys from the source table(s) You are able to navigate using the navigation arrows at the bottom of the form.
and dropping them on the associated foreign key(s) in the target table(s).
To enter a record on the Form:
For example: Let’s create a relation between the AUTHORS table and the BOOKS table.  Click the View button on the Ribbon to switch from Layout View to Form View
 Enter the data for each field in the record, pressing the Enter key to move to the
3.1.3. Queries next field
A query is a command that tells the database what data the user wants to see. A query  Press Enter after you have entered data for the last field
allows information to be found and retrieved from one or more tables based on a set of
search conditions you define. For example: a query can be written specifying that the NB. The form feeds the table. If you edit a record on the form, or create a new record, that
database should retrieve all the books from the “BOOKS” table written by William data will be passed to the table it is associated with.
Shakespeare.
3.1.5. Reports
To create a query, A report is an effective way to analyze and present data in printable format using a specific
o Click the Create tab on the Ribbon layout. Reports are the primary method of retrieving and viewing information. Using
o Click the Query Design command queries, reports pull information the user has requested and either print that information
o Double-click Create Query in Design View or display it on screen. The information that appears and the formatting and appearance of
o Select the table that you would like to base your Query on a report are set when the report is created.
o Click Add
o Close the Show Table window To create a Report using the Report Wizard:
 Click the Create tab on the Ribbon
In order to control which records are displayed, you must define criteria in a Query.  Click the Report Wizard command
To define criteria for your query:

o Position your cursor in the criteria row in the field for which you wish to define
 Select the table or query upon which the report will be based
the criteria for
 Select the fields that you want to include on the report by double clicking on them
o Enter the criteria

©A LEVEL ICT/ Csc 62


 Click Next e. String/Text
 Select a style for the report A string is a set of characters grouped together. A string is sometimes just referred to as
 Click Next ‘text’. It can contain a mixture of numbers, letters and, spaces. Numeric data stored as text
 Type a title for the report is only for representation not for calculation. Any type of alphabetic or numeric data can be
Click Finish stored as a string. Examples: “Limbe City”, “10base-2” and “36.85”.

3.2. Structured Query Language f. Date/ Timestamp


Structured query language (SQL) Date and timestamp are data types for storing date and time respectively. The format used
for date is either dd-mm-yy or mm-dd-yy and hh:mm:ss or ss:mm:hhfor time.
XI. ALGORITHM DESIGN AND PROGRAMMING
g. Container
1. Data Types and Structures A container is a data type used for storing images, video, sound or another type of ‘complex’
file. In some languages, binary large object (blob) is used rather than container.
1.1. Data Types
Computers manipulate data of different types like numbers, letters, sound and images. No 1.2. Data Structures. Ilmportopjadkdkj opf tdoat dstiipap /
matter the type, each data is stored as a pattern of binary digits. Numbers can be added, A data structure is a way of organizing and storing data in memory so that it can be used
subtracted, divided and multiplied whereas letters cannot. This implies that data of a given efficiently. Any data structure is designed to organize data so that it can be accessed and
type will be treated differently from data of another type. As such, the type of any data worked with in appropriate ways. A well-designed data structure allows a variety of critical
stored in the computer must be specified so that the correct operations will be performed operations to be performed, using as few resources, both execution time and memory
on it. space, as possible. Data structures include arrays, records, stacks, queues, trees, graphs and
A data type is defined as a set of values and a collection of operations on those values. hash tables.
Examples of data types are integer, real, string and Boolean.
2.1.1. Arrays
a. Integer An array is a data structure, which allows a set of items of identical data type to be stored
An integer is a whole number that can be positive, negative or zero. Examples: -3, 5, 67, - together using the same identifier name. When an array is created, its dimension (size) and
134 and 4231. the type of its elements are specified.

b. Real For example: String Names[5]


A real is a number that contains a decimal point. Computers manipulate numbers with Names :Array [1..5] of string
fractions as floating point numbers. Examples: 3.14, 12.25 and 0.001.
The above statements create an array called “Names” of five elements in C and Pascal
c. Boolean respectively. The size of the array is 5 and its elements are of type string.
A Boolean data type stores one of only two values – true or false, yes or no, or on or off. To reference an element in an array, an index is used. An index is an integer that gives the
Usually these values are stored as 1 for true and 0 for false. element at the indexed position in the array.
For example in C, Names[0] references the first element in the array Names, Names[1]
d. Character references the second element, Names[2] references the third and so on…
A character is any letter, digit, space, punctuation mark, or symbol that can be typed on a In Pascal, the referencing starts from 1 rather than 0.
computer. The word "computer" for example, consists of eight characters. The phrase "data
type" takes up nine characters. A character data type stores only a single character or digit. a. One-dimensional Arrays
Each character requires one byte of space, so "computer" takes up 8 bytes (8 × 8 = A one-dimensional array is an array which is declared using a single index and can be
64 ). Examples: A, 5, -, and !. visually represented as a list. The array “Names” above is one-dimensional.
If the array “Names” contains five elements (names), Raissa, Peter, James, Leticia and Isaac,
it can be visually represented as follows:

Element Raissa Peter James Leticia Isaac

Index [0] [1] [2] [3] [4]


©A LEVEL ICT/ Csc 63
The above Date record has a numeric field Day, a text field Month and a numeric field Year.
Names[0] == Raissa, Names[4] == Isaac The Student record has fields Name, Gender and DOB which is of type Date. The table
below gives examples of student records.
b. Two-dimensional Arrays Name Gender DOB
A two-dimensional array is an array which is declared using two indices and can be visually
represented as a table. Raissa F 01 Apr 1996

For example: Peter M 17 Oct 1995


Records
James M 05 May 1995
int Tab[3][2] or Tab : Array [1..3, 1..2] of integer
3 is the number of rows and 2 is the number of columns in the table Tab. Leticia F 09 Dec 1997

Isaac M 29 Feb 1995


The elements of Tab will be referenced as:
Tab[0][0] Tab[0][1]
Tab[1][0] Tab[1][1] Each row in the table corresponds to a different record. This table has 5 records.
Tab[2][0] Tab[2][1] A field in a record is referenced as follows:

Example: Given the 2-dimensional array Tab[4][2] below, what are the elements given by RecordName.fieldName = “”
the references Tab[0][0], Tab[1][1], Tab[3][0] and Tab[2][1]? Raissa.DOB= 01 Apr 1996
Index [0] [1]
Record data structures are always used in association with arrays. That is, we define an
[0] 5 3 array whose elements are of type record. When this is done, we have an array of records.
[1] 1 4
For example: let’s define an arrayClassList, which stores information about the students in
[2] 3 1
the table above.
[3] 2 8
StudentClassList[5] or ClassList: Array [1..5] of Student
Each individual element can be referenced by its row and column indices. For
example: An element in this type of array is referenced as follows:
Tab[0][0] = 5 ArrayName[index].fieldName
Tab[1][1] = 4
Tab[3][0] = 2 ClassList[0].Gender == F; ClassList[4].DOB == 29 Feb 1995; ClassList[3].DOB.Month == Dec

2.1.2. Record 2.1.3. Stack


A record is a data structure which allows items of different types that define a particular A stack is a linear list in which items are added and removed from the same end (head).
structure or object, to be stored together. The elements of a record are usually called fields Items being added and removed from the same end means that the last item to be added
or members. will be the first to be removed. As such stacks are also called last in, first out (LIFO) lists as
Defining a record includes specifying the data type of each field and a name (label) by they use the LIFO principle. (FILO)
which the field can be accessed. Stack operations are:
For example,  Stack(S): creates an empty stack named S
struct Student  Push(S,x): inserts the element x to the top of the stack S. Inserting an element into a
Date= RECORD Student = RECORD
{ stack that is full leads to a situation known as overflow. (START == NULL)
Day: Integer Name: String
Gender: Character string Name  Pop(S): removes an element from the top of the stack S. Removing an element from
Month: String
Year: Integer DOB: Date char Gender an empty stack leads to a situation known as underflow. (START == HEAD)
End RECORD Date DOB  IsEmpty(S): checks whether the stack S is empty. Returns true if it is empty and false
End RECORD
} otherwise.

©A LEVEL ICT/ Csc 64


2.1.4. Queues Linked list with elements C and D inserted.
A queue is a linear list in which items are inserted at one end (tail/rear) and removed from
the other end (head/front) such the first item added to the queue is the first to be removed. NB: In a double linked list, every node has two pointers: one for its predecessor and
Queues are also called FIFO lists as they use the FIFO principle. (LILO) another for its successor in the list.
Queue operations include:
 Create(Q): creates a queue Q. 2.1.6. BinaryTree
 Enqueue(Q,x): inserts the element x to the tail of the queue Q. A binary tree is a finite set of nodes that is either empty or consists of a root and two
 Dequeue(Q): removes the first element from the head of the queue Q disjoint binary trees called the left sub-tree and the right sub-tree. In other words, it is a
 Top(): checks the next element to be removed (do not remove) non-linear linked list where each node may point to two other nodes. Binary trees are a
 IsEmpty(): checks whether the queue is empty. Returns true if it is empty and very efficient way of storing items that must be searched for and retrieved quickly.
false otherwise. Suppose, for example, that you want to store the following names in a computer using a
binary tree:
Application of queues:
Jones, Stephen, Agbor, William, Bate, Peter, Terence
a. Spooling
It is a method used to place input and output on a fast access storage device, such as a disk, The names can be arranged into a binary tree by using the following two-step procedure:
so that slow peripheral devices do not hold up the processor. For example, print spooler 1. Use the first name on the list as the root of the tree.
stores output to be printed in a queue while waiting for the user’s program to finish 2. To find where to put each subsequent name, start at the root of the tree. If the name you
creating the output. The spooler then sends the stored output to the printer at the proper are dealing with precedes the root name alphabetically, follow the left pointer; otherwise
speed. If new output arrives for printing, it is added to the queue. follow the right pointer. Proceed in this way until you come to an empty pointer; attach the
b. Scheduling name to it.
It is the process of determining which of the jobs in memory will be executed by the CPU.
When a job is created, it is added to a queue, the ready queue. Any other job that arrives is Jones
added to the tail of the queue. A scheduling algorithm like round-robin is then used to
allocate the jobs one by one, to the CPU for execution.

Remark A queue in which elements can be added and removed from any end is known as Agbor Stephen
a double ended queue (Deque).

2.1.5. Linked Lists


A linked list is a linear list in which each element contains a pointer to the next element in Bate Peter William
the list. Each element in a linked list is known as a node and consists of two parts: the data
item and the pointer to the next element.

A C E
Terence
Data Pointer
A binary tree that stores names
A linked list that stores characters

Linked lists make it possible to insert items in the middle of the list without moving other The topmost node in the tree is known as the root node. Each node in a binary tree may
items to make room. have at most two children or child nodes. A node that has a child is called the child's parent
node (or ancestor node, or superior). A node has at most one parent except the root node
A B E that has no parent. Nodes that have the same parent are called siblings. Every node in a tree
can be seen as the root node of the sub-tree rooted at that node.
C D P
©A LEVEL ICT/Csc US 65
Nodes at the bottom most level of the tree are called leaf nodes. Since there are at the o Search: compute ℎ( ) and see if an element exists
bottom most level, they will not have any children. o Insert: compute ℎ( ) and place element in the resulting position
o Delete: compute ℎ( ) and remove element in that position

2.1.7. HashTable Remarks! The size of the array should be preferably a prime number.
A hash table is an array in which data is stored at specific locations designated by a hash With hash tables, there always exists the possibility that two data elements will
function. A hash function is a function that transforms the value of a record key into an hash to the same integer value. This situation is known as collision. Two methods
index that corresponds to a location for storing the record. A hash function maps the set of to solve collision are separate chaining and probing (closed hashing).
input data to a set of integers. Each element to be stored in the array has a unique key that
is mapped by the hash function to a numeric value that represents an index in the array. 3. Algorithms
For example, An algorithm is a well-defined set of step-by-step instructions for solving a problem in a
Index Element finite amount of time. A set of instructions is not an algorithm if there is no definite
stopping place, or if the instructions are too vague to be followed clearly.
0 Null
Key A good algorithm:
1 Agbor - should be explicit (i.e. clear and obvious)
25
- should be precise (i.e. exact and accurate)
36 2 Kome - should be unambiguous (i.e. no doubts about what to do/ only one way of interpreting the
instructions)
3 Eyong
43 - should be effective (i.e. produce good results)
4 Epie
- should be finite (i.e. have a definite stopping place)
44

66 5 Null 3.1. Representation of Algorithms


There are different ways for representing algorithms such as pseudo code, flow chart and
6 Sama structured English.

A hash table 3.1.1. Pseudo code


A pseudo code is an outline of a computer program, written in a mixture of a programming
The above hash table stores the names Agbor, Epie, Sama, Kome and Eyong using the hash language and English. Writing pseudo code is one of the best ways to represent an
functionh(k)= k mod tablesize, where k, the key of each string is the sum of its letters’ algorithm as it allows the programmer to concentrate on how the program works while
positions in the alphabet. This means that if an element p has key k, then p will be stored at ignoring the details of the language.
position h(k) in the table. In a pseudo code, some terms are commonly used to represent the various actions. For
Keys: example, for inputting data the terms may be (INPUT, GET, READ), for outputting data
Agbor = 1+7+2+15+18=43 (OUTPUT, PRINT, DISPLAY), for calculations (COMPUTE, CALCULATE), for incrementing
Epie=5+16+9+5=25 (INCREMENT), in addition words like ADD, SUBTRACT, INITIALIZE are used for addition,
Sama = 19+1+13+1=34 subtraction, and initialization, respectively.
Kome=11+15+13+5=44 For example, here is a pseudo code for an algorithm that reads two numbers, computes and
Eyong=5+25+15+14+7=66 displays their sum:

Applying the function ℎ to each key we get: Begin


Agbor= 43 mod 7=1 Get A
Epie=25 mod 7=4 Get B
Sama=34 mod 7=6 Result = A +B
Kome=44 mod 7=2 Print Result
Eyong=66 mod 7=3 End

Hash table operations are:

©A LEVEL ICT/Csc 66
3.1.2. Flowchart 3.2. Variables, Constants and Literals
A flow chart is a diagram that uses graphic symbols to describe the nature and flow of steps A variable is an object in a program whose value can be modified during the execution of
in an algorithm. Each step in a flowchart is followed by an arrow that indicates which step the program. In the above flow chart, x, y and z are variables.
to go next. The following symbols are used in flow charting:
A constant is an object whose value cannot be modified in the course of the algorithm or
a. Elongated circle: indicates the beginning (start) or end (stop) of the algorithm program. A constant is given a value that remains the same all through the program.

Start/Stop Variables and constants are characterized by:


o an identifier: which is the name of the object
b. Rectangle: indicates instructions or actions o a value: which is the content of the object
o a type: which defines the domain in which the object gets its value

A literal is anything (numbers or text) that is usually written within double quotes. For
c. Diamond: indicates a decision that has to be made example, “Enter a number”, “The result is”.

3.3. BasicInstructions
Three basic instructions used in an algorithm are input, output and assignment
instructions:
d. Arrow: indicates the direction of flow  An input instruction allows information to be typed from the keyboard. Example:
read (a, b), get (number)
 An output instruction allows:
e. Parallelogram: indicates data input and output  display of information on the screen
 printing of information on paper
For example: write “a is greater than b” or print “b is greater than a”

f. Circle: serves as a connector  The assignment statement allows a value to be assigned to a variable.A variable can
be assigned the content of another variable, a constant, a literal, an arithmetic or
Boolean expression. The symbol used is.
Example: flow chart for an algorithm that divides two numbers x and y.
Examples:  / ,  + ,  + 1,  3.14
Start In an assignment statement, the value to the right is assigned to the variable in the left.
In the case of  + , “ + ” is calculated and the result is assigned (kept) in the
variable sum.
Get x, y For  +1, “ +1” is calculatedand the result is assigned to the variable
total,meaning that the value of total has been increased by 1.
E.g. Let = 3
Is y=0
 +1 ⇒ = 3 + 1 = 4.

z = x/y Error Activity: Complete the table below. ← 2 − −


← + 1 − −
Stop ← 1 −
← +
← +

©A LEVEL ICT/Csc 67
Explanation Condition is a Boolean expression meaning that it can take only one of
3.4. Control Structures two values true or false. The
The logic of a program may not always be a linear sequence of statements to be executed in condition is evaluated, if it is true, Action3 is executed. If it is false, Action 2 is executed.
that order. The logic of a program may require execution of a statement based on a Note that actions 2 and 3 could be a block statements.
decision. It may repetitively execute a set of statements unless or until some condition is E Get a, b
met. Control structures specify the statements to be executed and their order ofexecution. if (a = 0) then E get a, b
Print “Error” if a <> 0 then
else if b <> 0 then
3.4.1. Sequential Control
Print b/a print b/a
A sequence control structure executes a set of instructions one after the other from the first else
to the last in the order they are given. print “Answer is 0”
else
It is possible to nest many selection structures.
print “Error: division by 0”
Syntax: begin end
Begin
statement 1 get a statement 1 Syntax: if condition1 then
statement 2 get b if condition2 then
… c a +b
statement 2
statement n print “Sum =”, c statement 1
end End else
statement 2
statement n
else
statement 3
3.4.2. SelectionControl
A selection control structure (condition control structure) chooses the instruction or Explanation If condition1 is true, we move to condition2. If condition2 is true, then
instructions to be executed based on the validity of a certain condition. Examples are IF and statement 1 is executed otherwise, statement 2 is executed. If condition 1 is false,
CASE statements. instruction 3 is executed. Instruction1 or instruction 2 will be executed if and only if
condition 1 is true.
a. The IF Statement
b. The CASE Statement
Syntax: if condition then
statement 1 statement Syntax: case variable of
else case 1: statement 1
statement 2 No Yes case 2: statement 2
?

case n: statement n
statement 1 statement 2 end case

Explanation The value of variable is evaluated, if it matches with case 1, instruction 1 is


executed. If it matches with case 2, instruction 2 is executed and so on. CASE is a multiple
selection structure. It is used when an important number of choices are to be considered
depending on the value of a variable.
E Get a, b Get op caseop of
1: printa+b
2: print a*b
3: print a/b
4: print a-b
end case

©A LEVEL ICT/Csc 68
Explanation The statement(s) is(are) executed and the condition is evaluated. If it evaluates to false, the statement or set statements is/are executed again. If condition
evaluates to true, the program exits the loop.

4.3. RepetitionControl
The repetition (iteration) control structure executes a statement or group of statements many times until a certain condition is reached. Repetition structures define the order of operations
and the number of repetitions. They are also called loops. Examples are, the WHILE, REPEAT and FOR loops.
Get n i 1 repeat
print “This is a repeat loop”
i := i +1
until(i<= n)
a. The WHILE Loop

Syntax: while condition do


statement(s);
end while
Yes

Remark! The repeat loop must be executed at least once as the condition is evaluated only at the end of the loop.
c. The FOR Loop

Explanation The condition is evaluated, if it is true statement(s) is/are executed. Instruction(s) is/are executed as long as condition remains true. When the condition becomes false,
the loop stops.
The condition for the loop to stop comprises of a variable called control or iteration
variable whose value must change at the end of each execution of the loop. In the example above, the control variable is “i”.

E Get n i 1
while (i<= n) do
print “this is a while loop”
ii +1
endwhile

©A LEVEL ICT/Csc 69
Syntax: for varlow_limi tto hi_limit do
statement(s);
end for
Or
For varhi_limit down to low_limitdo
statement(s);
end for

Explanationvar (variable) is given a value low_limit or hi_limit depending on the loop, which is automatically incremented or decremented (by 1) after each iteration of the loop. The loop
stops when low_limit becomes greater than hi_limit. In both cases, if hi_limit is less than low_limit, the loop body is not executed at all.

E Get n
Fori 1 to ndo
print “this is a for loop”
end For
b. The REPEAT Loop Or
Get n
Syntax: repeat statement(s); until (condition)

statement(s)

ori n downto 1 do
print “this is a for loop”
end For

©A LEVEL ICT/Csc 70
Exercise! Exercise! Exercise!

1) Write an algorithm that reads a number and returns the first numbers. n should be a whole number greater than 0.

2) Write an algorithm that reads a number and returns the sum of the first numbers.

3) Write an algorithm to calculate the area of a circle.

4) Write an algorithm to solve a linear equation

5) Write an algorithm that reads a person’s name and sex, and returns the message “good morning Mr. name” if the person is a man and “Good morning Mrs. Name” for a woman.

3.5. Recursion
Some problems are recursive in nature. This means that the solution to such problems involves the repeated application of the solution to its own values until a certain condition is reached.
Algorithms for such problems are known as recursive algorithms.
A recursive algorithm is an algorithm that calls (invokes) itself during its execution. Examples are the factorial function and the sum function.
Recursion can be defined as the calling of a procedure by itself, creating a new copy of the procedure.

3.6. SortAlgorithms
Sorting is a programming technique which is used to arrange a list of pre-stored data in an ascending or descending order according to a preset criterion. There are lots of useful sorting
methods. For example: insertion sort, bubble sort, selection sort, quick sort, merge sort and heap sort algorithms.

a. Bubble Sort
Bubble sort algorithm arranges items in order as follows:
- First, examine the first two items in the list. If they are in order, leave them alone; if not, interchange them.
- Do the same with the second and third items, then with the third and fourth items, until you have reached the last two. At this point you are guaranteed that the item that should
come last in the list has indeed “bubbled” up to that position.
- Now repeat the whole process for the first (n-1) items in the list, then for (n-2)and so
on until the list is sorted.

©A LEVEL ICT/Csc 71
c. Insertion Sort

3.7. SearchAlgorithms
A search algorithm is a method of locating a specific item in a larger collection of data. They can be used to search for items within an array or list. Common search algorithms are sequential
search and binary search.

a. Sequential Search
Sequential search is a simple technique for searching an item in a list by comparing each element with the element searched for, beginning with the first element until the element is found.

b. Binary Search

4. Programming
Programming is the activity of writing computer programs. A computer program is a set of instructions that will be followed by a computer to perform a computation. These instructions are
made up of statements written in some languages specially designed for this purpose. These languages are called programming languages.
In other words, a program is an algorithm expressed in a programming language.

4.1. Programming Languages


A programming language is a set of predefined words, symbols and rules that are used to write computer programs. Programming languages aregrouped intolow-level and high- level
languages.
4.1.1. Low-Level Languages
A low-level language is a language whose instruction set reflects the processor architecture.An instruction set is the set of bit patterns or binary codes for the machine operations that a
processor has been designed to perform. Low-level languages include machine language and assembly language.

a. Machine Language
Machine language is the computer’s language. It is the language the computer understands. Machine language instructions are written in binary (a series of 0s and 1s), and are directly
executable by the computer. Each machine language statement corresponds to one machine action. Machine language is the first generation of programming languages. For example a
short (3 instruction) program might look like this:

b. Selection Sort 0111 0001: 0000 1111


To perform an insertion sort, examine every item in the list except the first. Whenever you 1001 1011: 0001 1010
find an item that should come before the item that immediately precedes it, pick up the 1110 0001: 0011 1110
item, shift its neighbor on the left (predecessor) one step to the right, and see whether you
can put the current item in the space thus vacated. If not, shift that item to the right and try b. Assembly Language
again.

©A LEVEL ICT/Csc 72
Assembly language is a low-level language consisting of mnemonic codes and symbolic o programs may be slower than second generation languages
addresses corresponding to machine language instructions. Assembly language is the o may produce larger program files for same functionality as second generation
second generation of programming languages. For example: languages.
o may not allow for low level hardware access
LOAD R0 Number1 Load number1 in register 0
LOAD R1 Number2 Load Number2 in register 1 4.2. LanguageTranslators
ADD R2 R0 R1 Add register 0 and register 1 and keep result in register 2 To run a program on a computer, the program needs to be translated into the machine
language of the computer on which it will run. A language translator is a computer program
 Advantages of assembly language that translates program instructions from one programming language to another without
o It is easier to write and understand when compared to machine language. loss of original meaning. There are three types of language translators: compiler,
o It can produce small program sizes interpreter and assembler.
o It can produce very fast code as it allows low-level access to hardware features
4.2.1. Assembler
 Disadvantages of assembly language An assembler translates assembly language into machine language. The process is called
o Programs are not as easy to write and understand when compared to high level assembling.
languages.
o Programs are tied to specific computer hardware and can’t be reused on another
kind of computer.
o Writing programs is very time consuming, tedious, and error-prone.

4.1.2. High-Level Languages


High-level languages are closer to human language. Theyallow programmers to write Program assembling
programs without having to understand the inner workings of the computer. One high-
level language statement will generally be translated into several low-level language 4.2.2. Compiler
statements. They are the third generation of programming languages. Examples are C, A compiler translates the entire high-level program into a machine language program. The
BASIC (Beginner’s All-purposeSymbolicInstruction Code), Pascal, Java, FORTRAN (Formula high-level language program is called source program or source code and the generated
Translator) and COBOL (Common Business-Oriented Language). Below is a small code for machine language program is called object program or object code. This process is called
adding two numbers in Pascal and C. compilation. Some compilers convert high-level language into assembly language, then an
assembler is used to create the finished object code.
Pascal C
program addition; #include <stdio.h>
usescrt; intmain()
var number1, number2, sum: integer; { int number1, number2, sum;
begin scanf(“%d”, &number1);
read(Number1); scanf(“%d”, &number2);
read(Number2); sum = number1 +number2;
sum := Number1 +Number2; printf(“%d”, sum); Program compilation
write(sum); return 0;
end. }
 Advantages of a Compiler
o Fast in execution
o The object code produced by a compiler can be distributed or executed without
 Advantages of high-level languages having to have the compiler present.
o easy to understand and write programs as they are user oriented o The object program can be used whenever required without the need of
o they have built in libraries to perform routine tasks recompilation.
o programs can be ported to multiple hardware setups from same code
 Disadvantages of a Compiler
 Disadvantages of high-level languages o Debugging a program is much harder. Therefore not so good at finding errors
©A LEVEL ICT/Csc 73
o When an error is found, the whole program has to be re-compiled 4.3.3. Run-time Errors
A run-time error is an error that occurs during program execution. For example, a run-time
4.2.3. Interpreter error may occur if division by 0 is attempted. A run-time error may cause the program to
An interpreter is a computer program that translates and executes instructions written in a stop execution, or it may be handled by an error-trapping routine.
high-level language into machine language instructions one line at a time. The interpreter
translates an instruction and allows it to be executed before translating the next line. If a 4.3.4. Debugging
program performs a section code 1000 times, then the section is translated into machine An error in a computer program is known as a bug. Debugging is the process of detecting
code 1000 times since each line is interpreted and then executed. and removing bugs. Syntax errors and semantic errors are bugs. A debugger is the software
tool used for this purpose.

4.4. ProgrammingParadigms
A programming paradigm (or technique) is a fundamental style of computer programming.
It describes a programming language’s approach to solving a problem. Paradigms differ in
the concepts and abstractions used to represent the elements of a program and the steps
Program interpretation that compose a computation. High level languages can be classified under four different
paradigms: procedural, functional, object-oriented and declarative paradigms.
 Advantages of an Interpreter
o It is good at locating errors in programs 4.4.1. Procedural Paradigm
o Debugging is easier since the interpreter stops when it encounters an error. In the procedural/imperative paradigm, a program is a collection of statements and
o If an error is corrected, there is no need to retranslate the whole program procedures that affect data. Here, a program can be seen as an active agent that
manipulates passive objects(variables).These objectsarepassive because they cannot
 Disadvantages of an Interpreter initiate an action by themselves, but can only receive actions from active agents.The focus
o It is slow as interpretation and execution is done line by line. in procedural programming is to write good functions and procedures.
o Translation has to be done every time the program is to be executed since no Examples of imperative languages are Pascal, C, Ada, FORTRAN, and COBOL.
object code is produced.
o For the program to run, the interpreter must be present 4.4.2. Object Oriented Paradigm
The object-oriented paradigm presents a program as a collection of classes for interacting
4.3. Program Errors and Correction objects. Unlike in imperative programming, object-oriented programming deals with active
4.3.1. Syntax Errors objects instead of passive objects. These objects are active because the actions to be
Syntax is the set of rules that specify how the symbols of a language can be put together to performed on the objects are included in them (the objects). The objects need only to
form meaningful statements. In other words, syntax defines the structure of legal receive the appropriate stimulus from outside to perform one of the actions.
statements in a language. A syntax error is an error in a program that occurs due to the Examples of object-oriented languages are C++, Java, Visual Basic and Smalltalk.
non-respect of the syntax rules of the language used. A syntax error will cause a Some important concepts related to object oriented programming (OOP) are: class, object,
compiler/interpreter to stop trying to generate machine code and will not create an abstraction, encapsulation, inheritance and polymorphism.
executable. However, a compiler will usually not stop at the first error it encounters but
will attempt to continue checking the syntax of a program right to the last line. For a. Class
example, a misspelled key word, a missing punctuation mark or the incorrect use of an A class is a description of an object or a real life concept. Classes are templates for creating
operator is a syntax error. objects, providing initial values for instance variables (attributes) and the bodies for
methods. All objects generated from the same class share the same methods, but contain
4.3.2. SemanticErrors separate copies of the instance variables. New objects can be created from a class by
Semantics specify the meaning of a well-formed program. A semantic error occurs when applying the new operator to the name of the class.
you write a program that works, but does not do what you intend it to do. Compilation and
interpretation do not detect semantic errors. Semantic or logicerrors are detected from Class Person {
wrong results. Something may be syntactically correct but semantically incorrect. private:
charname[20];
charsex;

©A LEVEL ICT/Csc 74
datebirthdate;
public: Inheritance is usually represented using an inheritance diagram.
updateInfo(); For example: if the classesStudent and Teacher are derived from the superclass Person, this
returnAge(); is represented as:
};
Person Person
The name of the class is person. It has four instance variables (attributes)name,sexand age,
and three methods: updateInfo(),and returnAge(). These methods act on the instance
variables when invoked. Student Teacher

b. Object There are two types of Inheritance: multiple inheritance and multilevel inheritance.
An object is an instance of a class. An object consists of a collection of attributes,
representing the state of the object, and a collection of methods, representing the behavior  Multiple inheritance iswhen a derived class inherits features from more than one
that the object is capable of performing. Attributes are sometimes referred to as the fields superclass. It is illustrated as follows:
of an object. The methods are routines that are capable of accessing and manipulating the
values of the attributes of the object. Objects interact with each other by sending messages. Base class 1 Base class 2
When a message is sent to an object, the corresponding method of the object is executed.

Derived class
c. Abstraction

d. Encapsulation  Multi-level inheritance is when a class inherits from a class which is itself
Encapsulationis the process of combining together the attributes and methods of a class inherited from another class. It is illustrated as follows:
into a single abstract data type with a public interface and a private implementation. The
goal of encapsulation is to protect the implementation from the users of the object. It Base class
ensures that all access to the internal representation of the object pass through the class
methods, which act as an "interface" to the object. This is done by making properties and
methods “private.” Derived class 1

e. Inheritance
Derived class 2
Inheritance is the derivation of one class from another so that the attributes and methods
of the derived class are part of the definition of the initial class. The initial class is often
called the base class, parent class or superclass while thederived class is often referred to
as the child class or sub-class. The subclass usually contains all the attributes and methods f. Polymorphism:
of the superclass plus some of its own. Polymorphism is the use of different methods, each with the same name, which are
For example: the class Student inheriting from the class person will have all the attributes associated with different object types. In other words, it is the ability for different objects to
and methods of Person plus the following: respond to the same message in different, class-specific ways. Polymorphic methods are
used which have one name but different implementations for different classes.
Class Student extends Person { Assume you have a “shape” superclass. This class has a method called “area” which returns
private the area of the shape. Polymorphism allows you to make subclasses like “circle,” “square,”
intadmNumber; and “triangle” which inherit the “area” method, but each subclass would return the correct
intlevel; value even though they have different formulas to calculate their areas.
public
changeLevel(intnewLevel) { 4.4.3. FunctionalParadigm
level=newLevel; In functional (applicative) programming, a program is a collection of function definitions.
} Lambda calculus forms the basis of almost all functional programming languages. Lambda
}

©A LEVEL ICT/Csc 75
calculus is the use of lambda expressions to define functions. A lambda expression is a 4.5.1. Basic Structureof a C Program
formula that defines a function. For example: ( ) = +2 A C program is made up of the following components:
Examples of functional languages are Haskell, LISP, ML and Scheme.  Processor directive
 Declaration of variables
Sum function in Haskell  Declaration of functions
 Function main()
∶: ( , )→
 Definition of functions
( , )= +

a. The Preprocessor Directive


Quick sort in Haskell A preprocessor directive is a statement that begins with the # symbol. It instructs the
:: [ ] → [ ] compiler to include C preprocessors such as header files and symbolic constants before
[ ] = [] compiling the C program. There are two categories of preprocessor directives: the include
( : ) = ++[ ] ++ directive and the define directive.
Where
= [ | ← , ≤ ]  The Include Directive
= [ | ← , > ] An “include directive” is used to include a header file. A header file is a library file that
contains declarations for a special group of functions that can be used in the main body of
4.4.4. DeclarativeParadigm the program. A header file must be included at the beginning of a program, if its functions
In declarative (logic) programming, a program is a collection of facts and rules involving are to be used in the program. The extension of a header file is ".h". A program may contain
relational expressions. Declarative paradigm uses the principle of logical reasoning to many header files. The general syntax to include a header file at the beginning of a program
answer queries. It is based on formal logic defined by Greek mathematicians and later is:
developed into first-order predicate calculus. The point of logic programming is to bring
the style of mathematical logic to computer programming. An example of a declarative #include <name of header file>
programming language is PROLOG (programming logic).
For example:
These facts are given: #include <stdio.h>
human (John) #include <math.h>
mortal (human)
The file “stdio.h” contains standard input and output functions that are used to get input
The user asks the following question: (scanf) and print output (printf). The file “math.h” contains math functions used for
?-mortal (John) mathematic calculations.

The program answers yes.  The Define Directive


The “define directive” is used to define a symbolic constant which is assigned a value that
4.5. CProgramming will remain constant during the execution of the program. Its general syntax is:
C is a high-level programming language developed by Dennis Ritchie and Brian Kernighan
at Bell Labs in the mid-1970s. Although originally designed as a systems programming #define identifier expression
language, C has proved to be a powerful and flexible language that can be used for a variety
of applications, from business programs to engineering. Where
The first major program written in C was the UNIX operating system, and for many years C o Identifier specifies the macro name to which a value will be assigned
was considered to be inextricably linked with UNIX. Now, however, C is an important o Expression specifies the value that is assigned to the identifier. It may be a
language independent of UNIX. constant value, a string or an arithmetic expression.
C is a particularly popular language for personal computer programmers because it is
relatively small - it requires less memory than other languages. For example:
#define Pi 3.14
#define CityLimbe

©A LEVEL ICT/Csc 76
o int sum=0 indicates that variables can be assigned values when they are declared.
b. Declaration of Variables This is called initialization. Therefore, one can initialize a variable at the time of
A variable is a memory location reserved to contain a value that may change during the declaration.
execution of the program. Variables are used for storing input data or values generated as o i and j are integers with j initialized at 2.
result of
Type Description processing. Variable declaration serves two purposes:
1. Char a single ASCII character Variables are o It gives the compiler precise information about the amount of memory that will
2. int standard integers (usually 32 bits) characterized have to be given over to a variable when a program is finally run and what sort of
3. long int (long) long integers by their name, operations will have to be used on it.
4. Float standard floating point or real numbers type and o It provides the compiler with a list of the variables in a convenient place so that it
5. long float (double) long floating point numbers scope. can cross check names and types for any errors.
6. unsigned int positive short integers
unsigned float positive standard floating point  VSome basic C types are:
7. ariable
numbers
8. unsigned long positive long integers Names
unsigned double positive long floating point numbers A variable’s
9.
name or
identifier in C can be anything from a single letter to a word. However, it must begin with a
letter or the underscore character but the other characters in the name can be chosen from
the following sets:
a ..z (any letter from a to z)
A .. Z (any letter from A to Z)
0 .. 9 (any digit from 0 to 9)
_ (the underscore character)

Examples of valid variable identifiers are: x, total, area_of_circle, x1, _a and aX.

Remark! C is case sensitive, so the identifiers sum and SUM are different. Same for total  C fun!
The bank said they couldn’t FLOAT our loan because we were LONG on
and Total. All key words must be in lower case.
debt and SHORT of funds. Our application was UNSIGNED, so the whole
deal was VOID. Can you believe it? The bank rejected us in C-speak!
 Variable Types
Every variable has a type. The type of the variable specifies what sort of data will be stored
in it. The type of a variable is specified during its declaration. To declare a variable in C, one  Scope of a Variable
writes the type followed by the variable name or identifier. The scope of a variable describes where in the program the variable can be legally used.
The general syntax for declaring a variable is: Based on its scope, a variable can be global or local.
A global variable is a variable that can be recognized anywhere in the program. Global
[Type] [Name of variable] variables are declared before the function main().
A local variable is a variable that has meaning only within a particular function or other
For example: program unit. Local variables can be declared anywhere following the opening brace ({) of
int age; a block. The name of a local variable can be used in another block elsewhere in the
float area; program, where it will refer to an entirely different variable.
int sum = 0;
inti,j=2; c. The Function main( )
The function main() indicates the beginning of the actual C program. It is the point at which
o int specifies that the variables age and sum are integers while float specifies that execution of program is started. When a C program is executed, the execution control goes
the variable area is a floating point (real or decimal) number.

©A LEVEL ICT/Csc 77
directly to the function main(). Every C program must have a function main(). The general
syntax is: 4.5.2. Input/Output Statements

int main()
a. The scanf Function
{declaration of local variables;
scanf (print-formatted) is used to interpret characters input to the computer and to store
program statements;
return 0; the interpretation in the specified variable(s).
}
Example:
 The keyword “int” is used before the main() function to indicate the type of the scanf("%d", &x);
value that is returned by the main() function. By definition, a function may accept
no, one or more inputs and returns no or a single value. 'int' means that the program This statement reads a decimal integer from the keyboard and stores the value in the
will return an integer value after its execution. The word “void” can be used in the memory address of the variable x.
place of “int” to indicate that the program will not return any value. In the statement,
It is good practice to always return a value because the operating system uses the  %d is a conversion specifies and specifies that the variable to be readis of type
return value to determine whether the program has been executed successfully or integer. Other conversion specifiers used in C are %f for floating point numbers, %c
not. for characters and %s for strings.

 The body of the main() function must be enclosed in braces (or curly brackets { }).  &gives the address of something in memory. That is, it generates a pointer to the
These braces are called delimiters. The left brace indicates the start of the body of object.The arguments to scanfmust be pointers (addresses), hence the need for &.
the function whereas the matching right brace indicates the end of the body of the
function. Braces are also used to indicate the beginning and ending of block b. The printf Function
(compound) statements. printf(print-formatted) is used to display information on the screen.

Remark! The use of 'void' or 'int' before the function main() is optional. If it is not Example:
specified, the compiler assumes it is int. printf("The radius is %f cm",x);

 The body of the function main() is made up of program statements which in the statement,
represent instructions to be executed by the computer. An instruction may be an  “The radius is %f cm” is the control string. The text in between the double quotes
input/output statement, an arithmetic statement, a control statement, a simple will be displayed except the conversion specifier %f.
assignment statement or any other statement.
 x is the variable to be printed. The value of x will be printed where the conversion
A basic C program looks like this: specifier is placed in the control string.

#include <header.h> #include <stdio.h> Many conversion specifications can be used in a control string. In this case, the
#define symbolic constant
programmer has to ensure that both the number of conversion specifications and the
Global declarations int main()
number of variables to be printed are the same and, of the correct type specified.
void main() {
{ local declarations printf(“Welcome to the world of C!”);
program instructions; return 0; Example:
} } printf(“The sum of %d and %d is %d”, x, y, x+y).

If x=2 and y=3, then what will be displayed on the screen is: The sum of 2 and 3 is 5
 C fun!
C programmers know that the real reason the Roman
empire fell was that, because they had no number zero,
they had no way to successfully return from C programs.

©A LEVEL ICT/Csc 78
c. Common Conversion Specifiers b. Relational Operators
Relational operators are used for comparisons. Expressions that use these operators
Character Form of output produce a true or false value when they are evaluated.
c Character
d Decimal integer Operator Description Example
f Normal floating point If a == 2 and b== 5; a == b evaluates to
1. == Equal to
FALSE
s String
2. < Less than a < b evaluates to TRUE
e Scientific notation floating point
3. > Greater than a > 5 evaluates to FALSE
4. <= Less than or equal to b <= 5 evaluates to TRUE
Examples: scanf(“%s”,
&Name); printf(“Name: 5. >= Greater or equal to a >= 5 evaluates to FALSE
%s”, Name); scanf("%d 6. != Not equal to a != b evaluates to TRUE
%d",&x,&y);
printf("The sum of %d and %d = %d",x,y,z); c. Logical Operators
Logical operators are used to combine logical values.
d. Character Input/Output
getchar and putchar are used for the input and output of single characters respectively. Operator Description Example
getchar() returns an int which is either EOF (indicating end-of-file) or the next character in 1. && Logical AND (a>b) && (a>C)
the standard input stream
2. || Logical OR If ((a ==0) || (a ==1)), printf(“a!=1”);
putchar(c) puts the character c on the standard output stream
3. ! Logical NOT (Negation) If found == 1 (true), !(found) == 0 (false)
#include<stdio.h> 4. & Bitwise AND 4 & 5 = 0100 & 0101 = 0100 = 4
main() 5. | Bitwise OR 4 | 5 = 0100 | 0101 = 0101 = 5
{ charch; 6. ^ Bitwise XOR 3 ^ 9 = 0011 ^ 1001 = 1010 = 10
ch=getchar();
printf(“%c”,ch); Remark! Bitwise operators allow manipulation of the actual bits held in each byte of a
} variable. Other bitwise operators are:

4.5.3. Operatorsand Expressions  Right shift (>>) – binary division by 2


An operator is something which takes one or more values and does something useful with E.g. if = = 0010111 then >>= 0001011.
those values to produce a result. C has different types of operators which can be arithmetic, Also, >>2 = 0000101
relational, logical, assignment operators etc.  Left shift (<<) – binary multiplication by 2
An expression is simply the name for any string of operators, variables and numbers. If = = 0010111 then <<= 0010110.
Also, << 2 = 1011100
a. Arithmetic Operators  One’s complement (~)
Arithmetic operators are used for arithmetic calculations. If = = 0010111 then ~ = 1101000

Operator Description d. Assignment Operators


1. + Addition Assignment is the process of storing a value in a variable. The assignment operator is the
2. − Subtraction equal sign (=).
3. ∗ Multiplication
4. / Division For example:
= 3.14
5. % Remainder after division(modulo arithmetic)
s = +1

©A LEVEL ICT/Csc 79
The variable is assigned the value 3.14 and the variable sum is incremented by 1. Syntax: if(expression)
statement(s);
C has different types of assignment operators.
Operator Description Example and
1. = assign c=2
2. += Assign with add = + ≡ += if (condition)
3. -= Assign with subtract = − ≡ -= {
statement(s);
4. *= Assign with multiply = ∗ ≡ -=
}
5. /= Assign with divide = / ≡ /=
else
6. %= Assign with remainder = % ≡ %= {
7. >>= Assign with right shift >>= b statement(s)
8. <<= Assign with left shift <<= b }
9. &= Assign with bitwise AND = & ≡ &=
In the first form, if the expression specified in the if statement evaluates to true, the
10. |= Assign with bitwise OR = | ≡ |=
statements inside the if-block are executed and then the control gets transferred to the
11. ^= Assign with bitwise XOR = ^ ≡ ^=
statement immediately after the if-block.
In the second form, the else part is required only if a certain sequence of instructions needs
e. Increment and Decrement Operators to be executed if the expression evaluates to false.
Increment and decrement operators give a shorthand method of adding and subtracting 1
from an object respectively. scanf(“%d”,&b);
if (b>0)
++ Increment ++≡ = +1 printf(“Number %d is positive”,b);
-- Decrement -- ≡ = − 1 else
printf(“Number %d is negative”,b);
These operators can be prefix or postfix. With the prefix form the variable is changed
before the value of the expression in which it appears is evaluated, and with the postfix  The expression is always enclosed within brackets.
form the variable is modified afterwards.  If statement(s) is a single statement, the curly brackets can be omitted as in the
= 3; = 3; example above though it is good practice to always enclose them with curly
= +++ 6; /* a = 9, b = 4 */ = ++ + 6; /* a = 10, b = 4 */ brackets.

Sometimes we may want to evaluate more than one thing in an expression. This can be
4.5.4. Control Flow Statements done in C by using the logic operators AND and OR.
Control flow statements make it possible to make decisions, to perform tasks repeatedly or
to jump from one section of code to another. C control flow statements are If statement, For example:
switch statement, while statement, do … while statement, for statement and jump  if (a==0 || b==1)
statements. This expression is TRUE if a is 0 OR b is 1. It is also true if = 0and = 1.

a. The IF Statement  if (a == 1 && b == 2)


The IF statement is a decision-making statement that is used to evaluate an expression and This expression is TRUE if is 0 AND is 1. If one is NOT TRUE, the whole expression is
then take one of two possible actions depending on the validity of the expression. The IF evaluated to FALSE. In other words, must equal 0 and equal 2, for the expression to be
statement has two forms. TRUE.

C Fun!
Shakespeare must have been disappointed to learnthat, whatever
the value of a variable tobe, the result of the question tobe || !tobe,
isalwaystrue. Fortunately, thisis not a question of life or death!
©A LEVEL ICT/Csc 80
case, all the cases after case 3 would also get executed along with case 3. If break is present
only the required case is selected and executed; after which the control gets transferred to
b. Nested IF the next statement immediately after the switch statement. There is no break after
It is also possible to embed or to nest IF statements one within the other. Nesting is useful defaultbecause after the default case the control will either way get transferred to the next
in situations where one of several different courses of action need to be selected. statement immediately after switch.

Example: #include<stdio.h>
#include<stdio.h> int main()
int main() { int a, b; char op;
{ int a, b; printf("Enter two integers: ");
scanf(“%d %d ”, &a,&b); scanf(“%d %d”, &a, &b);
if(a>b) printf("Enter an operator: ");
{ scanf("%c", &op);
printf("%d is greater.", a); switch(op)
} {
else case+: printf("%d +%d = %d ", a, b, a+b); break;
if(a==b) case-: printf("("%d - %d = %d ", a, b, a-b); break;
{ case*: printf("("%d * %d = %d ", a, b, a*b); break;
printf("%d and %d are the same: ", a,b); case/: printf("%d / %d = %f ", a, b, a/b "); break;
} default: printf("Error!");
else }
{ return 0;
printf("%d is greater.", b); }
}
return 0; Remark! If you need to select among a large group of values, a switch statement will run
} much faster than a set of nested IFs.
The switch differs from the IF in that switch can only test for equality, whereas IF can
c. SWITCH Statement evaluate any type of Boolean expression.
A switch statement is used for multiple way selections that will branch into different code
segments based on the value of a variable. d. WHILE Statement
The While statement or while loop is an iteration statement. Iteration statements are used
Syntax:switch(variable) to execute a particular set of instructions repeatedly until a particular condition is met or
{ for a fixed number of iterations.
casevalue1 : code segment1; break;
casevalue2 :code segment2; break; Syntax:while (condition)
… {
casevalueN : code segment N; break; statements;
default: statement(s); }
}
The statement or statements are only executed if the expression is true (non-zero). After
If the value of the variable equals ‘value1’, code segment1 is executed. Otherwise, if it every execution of the statements, the expression is evaluated again and the process repeats
equals value2, code segment2 is executed and so on. if it is true.
The statement break is used after every case in order to prevent execution from continuing
into the code segment of the next case without even checking its value. Example:
For example, supposing a switch statement has five cases and the value of the third case inti=1;
matches the value of expression. If no break statement were present at the end of the third while(i<=10)

©A LEVEL ICT/Csc 81
{ Example: A program to print the sum of the digits in a number.
printf(“%d”, i);
i++; #include<stdio.h>
} int main()
This code will loop 10 times writing the numbers 1 to 10. { int n, a,sum=0;
printf("Enter a number:");
Example: A program that counts the number of blank spaces in a line of text. scanf("%d", &n);
do{
#include <stdio.h> a =n%10;
int main() sum=sum+a;
{ charch; short count = 0; n=n/10;
printf("Type in a line of text\n"); } while(n>0);
while((ch = getchar()) != '\n') printf("Sum of the digits = %d",sum);
{ return 0;
if(ch == ' ') }
count++;
} A practical use of the do-while loop is in an interactive menu-driven program where the
printf("Number of spaces = %d\n",count); menu is presented at least once and then depending upon the choice of the user, the menu
return 0; is displayed again or the session is terminated. Consider the same example that we saw in
} switch-case. Without using an iteration statement like do-while, the user can choose any
option from the menu only once. Moreover, if a wrong choice is entered by mistake the user
e. DO… WHILE Statement doesn’t have the option of entering his choice again. Both these faults can be corrected by
The do-while statement evaluates the condition at the end of the loop after executing the using the do-while loop.
block of statements at least once. If the condition is true the loop continues, else it
terminates after the first iteration. f. FOR Statement
The FOR statement or the FOR loop repeatedly executes a set of instructions that comprise
Syntax:do { the body of the loop until a particular condition is satisfied.
statements to be executed;
} while(expression); Syntax: for(initialization; termination; increment/decrement;)
{
Remark! statements to be executed;
 Pay attention to the semicolon which ends the do-while statement. }
 The difference between while and do-while is that the while loop is an entry-
controlled loop - it tests the condition at the beginning of the loop and will not  The initialization expression initializes the looping index which controls the looping
execute even once if the condition is false, whereas the do-while loop is an exit- action. The initialization expression is executed only once, when the loop begins.
controlled loop - it tests the condition at the end of the loop after completing the  The termination expression represents a condition that must be true for the loop to
first iteration. continue execution.
 The increment/decrement expression is executed after very iteration to update the
value of the looping index.

Example: A program to multiply two numbers by successive additions.

#include <stdio.h>
int main()
{ int a, b, i, prod=0;
scanf(“%d”,&a);

©A LEVEL ICT/Csc 82
scanf(“%d”,&b); printf(“%d”, A[1]); //prints the second element of the array.
printf(“%d”, A[2]); //prints the third element of the array.
for (i=1;i<=b;i++) …
prod=prod+a; printf(“%d”, A[n-1]); //prints the last element of the array.

printf(“%d”,prod); Using a loop to display the elements of an array.


return 0; for(i=0; i<=n; i++)
} printf(“%d”, A[i]);

4.5.5. Arrays b. Two-Dimensional Arrays


An array isa collection of data items of the same type that are given a single name Two dimensional arrays are declared using two indices (subscripts).
(identifier) and distinguished by numbers (subscripts).In simple terms, an array is a list of For example:
elements of the same type. When an array is created (declared), its size (dimension) and int A[3][2], int B[5][3], int M[3][4]
the type of its elements are specified. Arrays can be one dimensional or multidimensional.
int M[3][4] declares a 3x4 array where 3 is the number of rows and 4 the number of
a. One-Dimensional Arrays columns. The elements of the array M can be visually represented as a table as follows:
One-dimensional arrays are declared using a single index (subscript).
For example: M[0][0] M[0][1] M[0][2] M[0][3]
int A[10], char Name[10], intvect[20] M[1][0] M[1][1] M[1][2] M[1][3]
M[2][0] M[2][1] M[2][2] M[2][3]
int A[10] creates an array called “A” of 10 integers. The elements of array A are referenced
as: The elements of a 2-dimensional array can be assigned using nested loops or as separate
A[0], A[1], [2], … A[8], A[9] variables.

Where A[0] is the first element in the array, A[1] the second element, A[2] the third  As separate variables
element and A[9] the last element.
M[0][0] = 2; //element on row 1, column 1
Values can be assigned to the array as if each element were a separate variable. M[1][2] = 5 //element on row 2, column 3
A[0] =3; A[1] =1; A[2] =0; … A[9] =-5
 Using nested loops
A loop can as well be used.
For example: int main( )
int main() { inti, j, n=3, m=4;
{ inti, n=10, A[n] for(i=0; i<n; i++)
i=0; for(j=0; j<m; j++)
while(i<=n) {
{ printf(“M[%d][%d] = ”, i, j);
printf(“Enter element at position %d”, i); scanf(“%d %d”,&M[i][j]);
scanf(“%d”,&A[i]); }
i++; return 0;
} }
return 0;
} The elements of a 2-dimensional array can be displayed using nested loops or as separate
variables.
To display the individual elements of the array A, we can proceed as follows. Using nested loops, we have
printf(“%d”, A[0]); //prints the first element of the array.

©A LEVEL ICT/Csc 83
int main( ) For example:
{ inti, j, n=3, m=4;
for(i=0; i<n; i++) FloatareaCircle(int r) int square(int r)
for(j=0; j<m; j++) { float area; { intsqr;
printf(“M[%d] [%d]=%d ”, i, j, M[i][j]); area = 3.14*r*r; sqr=r*r;
return 0; return (area); return (sqr);
} } }
A function that has been defined can be called within the function main()or within any
4.5.6. User-Defined Functions other function.
A user defined function is a subprogram written by the user to perform a specific task. User
defined functions have to be declared and defined. They are declared before the function For example:
main but, may be defined (written)at declaration or after the function main().
#include<stdio.h> #include<stdio.h>
Float areaCircle(int) //prototype int square(int) //prototype
a. Function Declaration
A function declaration (also called function prototype) is simply a statement which
int main() int main()
specifies the function’s type, name and parameter or argument list. Function names follow
{ float area; int rad; { int a, b;
the same rules as variable names. The general syntax for declaring a function is:
scanf(“%d”, &rad); scanf(“%d”, &a);
area = areaCircle(rad); b = square(a);
TypefunctionName(parameter list, if any)
printf(“The area is %f”,area); printf(“The square of %d is %d”,a,b)
return 0; return 0;
 Type refers to the type of the value the function returns.
} }
 Parameters or arguments refer to the function’s inputs. A function may take no
parameter, one or more parameters and returns no or a single value. If a function
returns no value, it is of type “void”. If the function takes in any parameters, their Remarks!
types and names are specified (declared) within the brackets.  If the type of a function is not specified, C will always assume that the function is of
Example: typing.
intsquare(int n) a function which takes an integer and returns its square ( ).  Notice that the function area Circle was declared in the variables section of the
intpower(int b, int n) a function which takes two integers and and returns function main(). Thesis because, if a function whose type is not int is not declared in
chargetchar() a function that takes no parameter and returns a character. the variables section of the function in which it is called, compilation errors will
occur.
Remark! Parameter names are optional in a function prototype, so for the above  The names used by a function for its parameters are local to the function, and are
prototypes we could have written: not visible to any other function: other routines can use the same names without
int square(int) conflict. This is also true of the variables declared within the function.
int power(int, int)  When a function is called, parameters are passed to the function as inputs. In the
above examples, and are passed to the functions area Circle and square
b. Function Definition respectively.
Function definition consists of writing the actual statements of the function. A function  These parameters which replace the formal parameters when a function is called
definition has the form: are passed either by value or by reference. A parameter is passed by value when the
value of the parameter is calculated and this is passed into the function. A parameter
TypefunctionName(parameter list, if any) is passed by reference by using pointers. Pointers are addresses.
{
localdeclarations; declaration of local variables
statements; function statements
}

©A LEVEL ICT/Csc 84
1.2. System Analysis
Systems analysis is an in-depth study of end user information needs which produces
XII. SYSTEM DEVELOPMENT AND PROJECT MANAGEMENT functional requirements that are used as the basis for the design of a new information
system. System analysis describes what a system should do to meet the information needs
Introduction of users. It involves:
Most computer-based information systems are conceived, designed, and implemented
using some form of systematic development process called software development process. 1.2.2. Analysis of the Old System
In this process, end users and system analysts design systems based on an analysis of the Analysis of present system involves:
information requirements of the information system to be built. The software development  Collecting factual data about the present system (questionnaires, interviews,
process is also called system development life cycle. observations, etc.)
 Identifying how input, processing, storage and output are being accomplished.
1. Software Development Life Cycle  Analyzing how the present system uses resources (hardware, software and people)
SDLC is a structured step-by-step approach for creating and maintaining information to convert input data into useful information
systems. It consists of a number of stages that describe the activities involved in an  Understanding information flow within the system
information system development process. SDLC involves the following stages: system  Identifying problems with the system
study, system analysis, system design, development and testing, implementation, and
maintenance. 1.2.3. Functional Requirements Analysis
Functional requirements explain what has to be done by identifying the necessary tasks,
System Study
actions or activities that must be accomplished.
It involves:
 Determining specific information needs
Maintenance System Analysis  Determining the information processing capabilities required for each system
activity (input, processing, output, storage, and control) to meet the needs. The goal
here is to identify “what” should be done not “how” to do it.
Implementation System Design  Determining functional requirements (information requirements that are not tied to
the hardware, software, and people resources that end users presently use or might
use in the new system).
Development
and Testing 1.2.4. Feasibility Analysis
Feasibility analysis is a study which investigates the information needs of prospective users
System Development Life Cycle
and determines the resource requirements, cost, benefits, and workability of a proposed
project. Its goal is to evaluate alternative systems and propose the most feasible and
1.1. System Study desirable system for development.
System study is a brief investigation of the system under consideration that gives a clear Feasibility of a system can be evaluated in terms of four major categories: organizational
picture of what actually it is. During this phase, the system is evaluated and deficiencies are feasibility, technical feasibility, economic feasibility and operational feasibility.
identified. This can be done by interviewing users of the system and consulting with a. Organizational feasibility focuses on how well a proposed information
support personnel. Main activities at this stage are: system supports the objectives of the organization and its strategic plan for
 Determining whether a business problem or opportunity exists. i.e. identifying information systems.
problems and opportunities. b. Technical feasibility focuses on the reliability/capabilities of the hardware
o A problem is a basic condition that is causing undesirable results and software to meet the needs of the proposed system, and whether they
o An opportunity is a basic condition that presents the potential for desirable can be acquired or developed in the required time.
results. c. Economic feasibility focuses on whether the tangible costs and benefits of the
 Conducting a preliminary feasibility study to determine whether a new or improved proposed system will exceed the costs of developing and operating it.
information system is a feasible solution. d. Operational feasibility focuses on the ability of the end users to operate, use,
 Developing a project management plan and obtaining management approval. and support the proposed system.

©A LEVEL ICT/Csc 85
o Detailed specifications of the procedures needed to meet the user interface and
The outcome of a feasibility analysis is a feasibility report which is presented to the user data design specifications.
management for approval. It may be accepted or accepted with modifications or rejected. o Detailed specification of the database schema (E-R diagram, object diagrams)

1.2.5. Documenting System Analysis The design stage is very important because it is the place where quality is fostered in
The outcome of systems analysis is a system proposal or requirements specification software engineering. Design provides us with representations of software that can be
document which describes what the new system should do without specifying how to do it. assessed for quality. Design is the only way that we can accurately translate a customer's
At the end of systems analysis phase, the system analyst produces a system proposal that requirements into a finished software product or system.
will be used as basis for the design phase.
1.4. Development and Testing
1.3. System Design Once the design of the system is complete, it has to be converted into a computer
Systems design consists of design activities, which produce systems specifications understandable form.
satisfying the functional requirements developed in the systems analysis stage. While
system analysis specifies what is to be done by the new system, system design describes 1.4.1. Coding (programming)
how the system will accomplish what is to be done. Coding is an important activity by which a programmer converts the systems specifications
System design focuses on three main activities: user interface design, data design and from the design stage into computer instructions referred to as programs. It is generally felt
process design. that the programs must be modular in nature. This helps in fast development, maintenance
and future change if required.
1.3.1. User Interface Design
A user interface is a means of interaction between the user and the computer-based 1.4.2. Prototyping
application. This activity focuses on designing how data will be introduced into the system Prototyping is the rapid development and testing of a working model of a product in an
and how the information generated will be retrieved. It produces detailed specifications for interactive and iterative process involving both systems analysts and end users. This
information products such as: working model or prototype, is a partially developed product that enables customers and
o Display screens developers to examine some aspects of the proposed product and decide if it is suitable for
o Interactive user/computer dialogues a finished product.
o Forms (on-screen forms for data input and output) Various types of prototyping exist.
o Reports (on-screen and printed)
a. Throw-away Prototyping
1.3.2. Data Design In throw-away prototyping, the prototype is discarded once the actual requirements have
Data design focuses on the design of the structure of data and files to be used by the been understood and the final system is developed with a much clear understanding of
proposed (new) system. It provides detailed descriptions of: user requirements.
o Attributes (characteristics) of the entities about which the proposed system needs
to maintain information. b. Evolutionary Prototyping
o Relationships between these entities (E-R diagrams, data flow diagrams) In evolutionary prototyping, a functional prototype with minimal functionality is built in
o Specific data elements (databases, files, records, etc.) that need to be maintained the beginning and is refined over time, as requirements are better understood.
for each entity.
o Data dictionary c. Incremental Prototyping
o Integrity rules (data validation and verification) that govern how each data In incremental prototyping, functional prototypes of the various subsystems are built and
element is specified and used in the system. then integrated to form a complete system. In other words, the product is built as separate
prototypes which are later merged into a final product.
1.3.3. Process Design
Process design focuses on the design of software resources, that is, computer programs and 1.4.3. Testing
of procedures needed by the proposed system. It concentrates on developing detailed Testing is the process of executing a program with the intent of finding an error. During
specifications for the program modules that will have to be purchased as software testing, trial runs are done to check for errors and whether or not the new system meets
packages or developed by custom programming. Process design produces: the users' needs. Once source code has been generated, the software must be tested to
o Detailed specification of algorithms (pseudo-codes, flow charts, etc.) uncover and correct as many errors as possible before delivery.

©A LEVEL ICT/Csc 86
There are three sets of data that can be used to test the system: normal data and abnormal User documentation is a complete description of the system from the user’s point of view
data. detailing how to use or operate the system. It could be a paper-based user manual or help
o Normal data is data which the system will accept. incorporated into the software that can be accessed when the software is installed. User
o Abnormal (erroneous) data is invalid data which the system will reject. documentation always covers the following:
o Extreme data are data values that are chosen at the absolute limits of the normal o A guide that describes what the system is supposed to do in non-technical terms
range. This is to ensure that all normal values will be accepted and processed o Instructions for installing and running the program
correctly. o Definition for hardware and Operating System requirements
o The format of the output data
Using these test data, the following test runs can be carried out: o Explanation of common error messages and how to recover from them
o Description of how to make backups against accidental data loss
a. Unit Testing
The individual units or modules are tested separately with prepared test data so that any b. Technical Documentation
errors can be corrected. Technical documentation is a description from the designer’s point of view. Technical
documentation often contains:
b. Integration Testing o Detail functioning of the software showing algorithms, formulae, source codes etc.
The complete system is tested after the individual units have been tested and put together. o Description of data structures
This tests that separately developed modules/units work together as planned without o Test plans and testing procedures
error. o User interface and reports
o Location and version of the software
c. System Testing
The integrated system is tested to evaluate the system's compliance with specified 1.5. Implementation
requirements. Implementation is the conversion from the use of the present (old) system to the operation
of the new system. It involves:
d. Black-Box Testing  Installation of new system
Black-box testing is a test that relies on the input/output behavior of the system, without  Loading of data into new system
any assumptions to what is happening within the system. It examines some fundamental  Education and training of users of the system
aspects of a system with little regard for the internal logical structure of the system. Black-
box tests are used to demonstrate that system functions are operational, that input is There are different types of conversions:
properly accepted and output is correctly produced, while at the same time searching for
errors in each function. a. Direct cutover
The old system is completely replaced by the new one. Its disadvantage is that, if the new
e. White Box Testing system fails, there is no back-up system, so data can be lost.
White-box testing, also called glass-box testing, is a test that relies on information about
how the system has been designed and constructed. It requires knowledge of the internal b. Pilot run
structure or implementation of the system. White-box tests are conducted to ensure that The new system is installed in one part of the business or organization. This allows the new
internal operations are performed according to specifications and all internal components system to be fully developed and tested. Once the pilot system is running successfully, the
have been adequately exercised. new system is introduced to all of the business/organization.
o Its advantages are that, if something goes wrong with the new system, only a small
1.4.4. Documentation part of the organization is affected, and the staff that were part of the pilot scheme
The job of the programmer does not end with the code or software instructions. The can help train other staff.
organization or users need to know how to get the best out of the system. This is done o As a disadvantage, there is no back-up system for the office/department doing the
through documentation. System documentation ensures continuity of the system. pilot, if things go wrong.
There are two types of documentation; user documentation and technical documentation.
c. Parallel run
a. User Documentation The old and new systems are operated alongside each other (in parallel) until new system
is proven capable.

©A LEVEL ICT/Csc 87
o It is advantageous in that, if the new system fails, the old system will act as a back- 2.1. Waterfall Model
up. Also, the outputs from the old and new systems can be compared to check that The waterfall model is the most common and classic of SDLC models. It illustrates the
the new system is running correctly. software development process in a linear sequential flow; hence it is also referred to as a
o Its disadvantage is that, entering data into two systems, and running two systems linear-sequential life cycle model. In the waterfall model, each phase must be completed in
together, takes a lot of extra time and effort. its entirety before the next phase can begin. At the end of each phase, a review takes place
to determine if the project is on the right path and whether or not to continue or discard
d. Phased implementation the project.
The new system is installed in phases (stages or steps) gradually replacing parts of the old
system until eventually, the new system takes over. Requirements

o Its advantages are that, it allows users to gradually get used to the new system, and
training of staff can be done in stages. Analysis
o Its disadvantage is that, if a part of the new system fails, there is no back-up
system, so data can be lost Design

1.6. Maintenance Implementation


Maintenance is the general process of changing a system after delivery to correct faults,
improve performance or adapt the system to a changing environment or business Testing
requirements. Maintenance is necessary to eliminate errors in the system during its
working life and to tune the system to any variations in its working environment. Maintenance
Maintenance can be adaptive, preventive, corrective or perfective.
Waterfall Model
a. Adaptive Maintenance  Advantages
Adaptive maintenance focuses on adjusting a software product to properly interface with a o Simple and easy to use.
changing environment. Changes are made to the system to provide a closer fit between the o Easy to manage due to the rigidity of the model – each phase has specific
system and its environment. deliverables and a review process.
o Phases are processed and completed one at a time.
b. Preventive Maintenance o Works well for smaller projects where requirements are very well understood.
Preventive maintenance aims in retaining the system’s capabilities before the occurrence
of any problem (e.g. system failure). It locates weaknesses in the system and provides  Disadvantages
repairs in order to avoid any eventual breakdown of the system. o Adjusting scope during the life cycle can kill a project
o No working software is produced until late during the life cycle.
c. Corrective Maintenance o High amounts of risk and uncertainty.
Corrective maintenance aims in restoring a defective system to a required state. This o Poor model for complex and object-oriented projects.
implies that repairs are made after a breakdown of the system.
2.2. V-Shape Model
d. Perfective Maintenance The V-shape model is an SDLC model where execution of processes happens in a sequential
Perfective maintenance refers to enhancements to the product in order to either add new manner in V-shape. It is also known as Verification and Validation model.
capabilities or modify existing functions.
Requirement Acceptance
Analysis Testing
2. SDLC Models
There are various SDLC models defined and designed which are followed during software
development processes. These models are also referred to as "Software Development System Design System Testing
Process Models". Each model follows a series of steps unique to its type, in order to ensure
success in the process of software development.
Architecture Design Integration Testing

©A LEVEL ICT/Csc Module Design Unit Testing 86


3. Software Design
Software design is the process of defining the architecture, components, modules,
interfaces, and data for a software to satisfy specified requirements. It is the activity within
the software development life cycle, where software requirements are analyzed in order to
produce a description of the internal structure and organization of the system that will
serve as the basis for its construction.
V-shape model is an extension of the waterfall model and is based on association of a A software design must describe the architecture of the system, that is, how the system is
testing phase for each corresponding development stage. This means that for every single decomposed and organized into components and must describe the interfaces between
phase in the development cycle there is a directly associated testing phase. This is a highly these components. It must also describe these components into a level of detail suitable for
disciplined model and next phase starts only after completion of the previous phase. allowing their construction.

 Advantages 3.1. The Design Model


o Simple and easy to use. The design model encompasses the representation of data, architecture, interfaces, and
o Each phase has specific deliverables. procedures of the software.
o Higher chance of success over the waterfall model due to the development of test
plans early on during the life cycle. 3.1.1. Data Design
o Works well for small projects where requirements are easily understood. Data design selects logical representations of data objects (data structures) identified
during requirements definition and specification. Well-designed data can lead to better
 Disadvantages program structure and modularity, and reduced procedural complexity.
o Very rigid, like the waterfall model.
o Little flexibility and adjusting scope is difficult and expensive. 3.1.2. Interface Design
o Software is developed during the implementation phase, so no early prototypes of 3.1.3. Architecture Design
the software are produced. 3.1.4. Procedure Design
o Model doesn’t provide a clear path for problems found during testing phases.
3.2. Design Strategies and Methods
2.3. The Spiral Model Various general strategies can be used to help guide the design process. Common examples
The spiral model has four phases: Planning, Risk Analysis, Engineering and Evaluation. A are top-down design and stepwise refinement.
software project repeatedly passes through these phases in iterations (called Spirals in this
model). In the baseline spiral, starting in the planning phase, requirements are gathered 3.2.1. Top-down Design
and risk is assessed. Each subsequent spiral builds on the baseline spiral. Looking at some problems as a whole can make them seem impossible to solve because
Requirements are gathered during the planning phase. In the risk analysis phase, a process they are so complex. For example, writing a word processor program or an operating
is undertaken to identify risk and alternate solutions. A prototype is produced at the end of system. Such complex problems can be solved by breaking them into smaller parts which
the risk analysis phase. are solved individually and the smaller solutions are assembled into a big solution. This
process is called decomposition, divide and conquer, or more commonly top-down design.
 Advantages
o High amount of risk analysis Definition: Top-down design is the process of designing a solution to a problem by
o Good for large and mission-critical projects. systematically breaking the problem into smaller, more manageable parts.
o Software is produced early in the software life cycle.
The problem is broken down into smaller problems called sub-problems, which in turn are
 Disadvantages broken into smaller sub-problems, continuing until each sub-problem can be solved in a
o Can be a costly model to use. few steps.
o Risk analysis requires highly specific expertise.
o Project’s success is highly dependent on the risk analysis phase. Top-down design leads to modular development. Modular development is the process of
o Doesn’t work well for smaller projects. developing software modules individually then combining the modules to form a solution
to an overall problem.

©A LEVEL ICT/ Csc 87


Definition: A module is a self-contained entity that results when a problem is divided into 3.3.3. State Transition Diagrams
sub-problems; each module corresponds to a sub-problem. They are used to show the flow of control from state to state in a state machine.

Modular development of computer software:


 Makes large projects more manageable. S0 S1 S2 S3
Smaller and less complex tasks are easier to understand than larger ones and are
less demanding of resources.
3.4. Software Reuse
 Is faster for large projects. Software reuse is the process of implementing or updating software using existing software
Different people work on different modules at the same time which speeds up the assets. Reusable software assets include more than just codes. Requirements, designs,
overall project. models, algorithms, tests, documents, and many other products of the software process can
be reused.
 Leads to a higher quality product Software reuse makes programming easier because you only need to develop the solution
Programmers with knowledge and skills in a specific area can be assigned to the to a problem once; then you can call up that code whenever you need it. Modules developed
parts of the project that require those skills. as part of one project, can be reused later as parts of other projects, modified if necessary
to fit new situations. Most computer systems are filled with layers of short programming
 Makes it easier to find and correct errors modules that are constantly reused in different situations.
It is easy to isolate the part of the software that is causing trouble, making it easy to Software reuse can be horizontal or vertical.
fix it.
3.4.1. Horizontal Reuse
 Increases the reusability of solutions Horizontal reuse refers to software components used across a wide variety of applications.
Solutions to smaller problems are more likely to be useful elsewhere than solutions This type of reuse includes library of components, string manipulation routines, or
to bigger problems. graphical user interface functions.

3.2.2. Stepwise Refinement 3.4.2. Vertical Reuse


Stepwise refinement is the process of breaking a problem down through successive steps Vertical reuse, in another way, deals with the reuse of system functional areas, or domains
into smaller problems. It is an iterative process where each problem is decomposed and that can be shared between systems with similar functionality.
refined step by step. In stepwise refinement, the solution to a problem is first described in
terms of high level functions, then, each function is broken down into details that are 3.4.3. Advantages of Software Reuse
refined in successive steps until the whole problem is fully defined. The main advantages of software reuse include:
3.3. Design Notations  Increase in software productivity
A large number of notations and languages exist to represent software design artifacts.  Reduced software development time
Some are used mainly to describe the structural organization of a design, whereas others  Reduced software development and maintenance costs
are used to represent the behavior of such software systems. Notations for describing the  Improved software system interoperability
structural organization of the system are static. For example, entity relationship diagrams,  Software is developed with fewer people
structure charts, class and object diagrams. Notations for describing the behavioral  Easy movement of personnel from project to project,
organization of the system are dynamic. Examples are data flow diagrams, flow charts,  Production of more standardized software,
sequence diagrams, state transition diagrams and pseudo-code.  Production of better quality software

3.3.1. Data Flow Diagrams 4. Project Management


A data-flow diagram (DFD) is a graphical representation of the "flow" of data through a A project is an endeavor to accomplish a specific objective through a unique set of
system. A DFD shows the flow of data among a set of processes. interrelated tasks and the effective utilization of resources. A project has a definite start
and finish time, well-defined outcomes or performance goals, and consumes scarce
3.3.2. Flowcharts resources such as money, personnel, material, and equipment.
They are used to show the flow of control and the associated actions to be performed. A project is considered constrained by three functions:

©A LEVEL ICT/ Csc 88


 Scope: what it is intended to accomplish. In other words, the customer’s  Deliverable: some concrete thing which is to be delivered, to the client or internally
requirements for the project. to the development team.
 Time allocation: the time schedule for the project.  Leveling: the process of adjusting tasks to match resources available. There are two
 Cost: the money, budget, and resources for a project. techniques for leveling: task delay and task split.
 Critical path: a sequence of dependent tasks that have the largest sum of most likely
These three functions are called the Triple Constraint. The relationship between them is durations. The critical path determines the earliest possible completion date of the
represented using the Project Management Triangle. project.
 Critical task: a task found on the critical path. A critical task cannot be delayed
without delaying the entire project schedule.
Time Cost  Work Breakdown Structure: a hierarchical decomposition of the project into phases,
activities, and tasks.
 Project management plan (PMP): a document that describes how the project is to
Scope beexecuted, monitored and controlled, which includes creating a project
work breakdown structure, identifying and planning to mitigate risk,
The Project Management Triangle visualizes the fact that time, cost and scope of a project identifying manners in which to effectively communicate with stakeholders and other
are interdependent; changing one of them causes changes in the other two. For example, if project team members, and developing a plan to manage changes.
you want to shorten a schedule, you can hire more resources which would increase cost, or
reduce customer requirements which would affect quality. This simply means “you can 4.2. Project LifeCycle
have any two of quick, good or cheap, but not all three.” The activities related to a project can be structured and grouped into stages according to
the aim of the activities. A typical project goes through the following stages called project
Projects are implemented through project management. Project management is defined as life cycle: initiation, planning, execution, monitoring and control, and closing.
the application of knowledge, skills, tools and techniques to activities of a project for the
achievement of the project’s objectives/requirements. Project management ensures that an 4.2.1. Initiation
acceptable system is developed within time and budget. Project initiation determines the main objective of the project and forms a clear
understanding about the necessity and suitability of the project. This stage answers the
4.1. Project Management Terms questions “what?” and “why?” Common activities at this stage are:
 Task/Activity: anything that needs to be done that requires time and consumes  Identification and initial analysis of the business needs.
resources.  Determination of the main objective(s).
 Dependent task: a task that can only begin after a previous one is finished. For  Resource analysis (people, equipment, financial; needs and availability).
example, roofing a house depends on the construction of the walls.  Composition of the project charter.
 Slack time or float time: the amount of delay that can be tolerated between the (Project charter - document issued by the project initiator or sponsor that formally
starting time and completion time of a task without causing a delay in the completion authorizes the existence of a project, and provides the project manager with the
date of the entire project. If we have tasks A and B that start at the same time and authority to apply organizational resources to project activities.)
task C that is dependent on both tasks A and B. If task A takes 3 days and task B takes
5 days, then task A has 2 days slack time. That is, it can run for 2 days before it affects 4.2.2. Planning
the planned starting time for task C. Project planning involves the project plan development and approval. It determinesan
 Lag time: the delay or amount of time that passes between the end of one activity optimal scheme/algorithm for project execution. This stage answers the question “how?”
and the beginning of another if the two are dependent. For example, if task A is laying The main activities at this stage are:
of cement blocks and dependent task B is building the walls of the house, there would  Needs analysis
be some lag time between the end of task A and the start of task B to let the blocks get  Description of the project (including determination of activities and necessary
dry. resources)
 Lead time: occurs when a task should theoretically wait for its predecessor to finish,  Composition of project plan
but can actually start a little early. The time that the tasks overlap is lead time.  Planning and performing necessary PR-activities.
 Milestone: an event that signifies the accomplishment or completion of a major (PR is the practice of managing the spread of information between an individual or an
deliverable during a project. organization and the public. Public relations activities include: launchings, media

©A LEVEL ICT/ Csc 89


conferences, sales promotions, open day, product testing, websites, press release,  communicating the closure of the project to all stakeholders
newsletters.)
4.3. Project Analysis and Scheduling
4.2.3. Execution Project scheduling is the process of converting a general or outline plan for a project into a
Project execution is the phase within which the deliverables are physically constructed and time-based schedule based on the available resources and time constraints. Different
presented to the customer for acceptance. It integrates people and other resources to carry techniques exist for analyzing and scheduling project activities.
out the project management plan for the project. The activities undertaken to construct
each deliverable will vary depending on the type of project being undertaken. Main 4.3.1. Critical Path Method(CPM)
activities are: CPM is an analysis technique used to predict project duration by analyzing which sequence
 Starting up the execution. of activities (which path) has the least amount of scheduling flexibility (the least amount of
 Building the deliverables total float). Early dates are calculated by means of a forward pass using a specified start
 Day-to-day management and reporting date while late dates are calculated by means of a backward pass starting from a specified
completion date, usually the forward pass’s calculated project early finish date.
4.2.4. Monitoring and Control  Forward pass: The calculation of the early start and early finish dates for the
Project control measures and monitors progress to identify variances from the project uncompleted portions of all network activities, determined by working forward through
management plan so that corrective action can be taken when necessary to meet project the schedule network logic from the project’s start date.
objectives. Control occurs throughout the duration of the project and has a range relatively  Backward pass: The calculation of late finish and late start dates for the uncompleted
similar to that of execution. While the project is being executed, a series of management portions of all schedule activities, determined by working backward through the schedule
processes are undertaken to monitor and control the deliverables being output by the network logic from the project’s end date.
project. This includes:
 Requesting, evaluating and approving changes to the project scope, deliverables, CPM models the events and activities of a project as a network. Activities are depicted as
timescales or resources (change management) nodes on the network and events that signify the beginning or ending of activities are
 Controlling the amount of time spent undertaking each activity within the project depicted as arcs or lines between the nodes.
(time management) a)
 Identifying, approving and paying cost/expenses incurred on project (cost
management)
 Reviewing deliverable quality (quality management)
 Identifying, quantifying and managing risks to the project (risk management)
 Identifying and handling issues currently affecting the ability of the project to produce
the required deliverables (issue management)
 Measuring each deliverable produced against acceptance criteria (acceptance
management) b)
 Handling sourcing of products from an external supplier (procurement management)
 Identifying, creating, and reviewing communication messages within the project
(communication management)
 Performing a phase review at the end of execution to ensure the project has achieved
its objectives as planned.

4.2.5. Closing Network diagrams


Once all the deliverables have been produced and the customer has accepted the final
solution, the project is ready for closure. In the above network diagram,
Project closure involves:  Tasks are lettered from A to J. There are two ways of representing the activities on a
 releasing the final deliverables to the customer network diagram: (a) activity on node and (b) activity on arc.
 handing over project documentation to the business  Joining task A to E shows that task A must be completed before task E can be started.
 terminating supplier contracts,  Joining tasks A and B to E shows that both task A and B must be completed before
 releasing project resources task E can be started.
©A LEVEL ICT/ Csc 90
 The number marked on each arc (arrow) shows the duration of the task from which Activity Duration Precedence
the arc starts. A 3 -
B 3 A
The critical path can be identified by determining the following four parameters for each C 4 -
activity: D 1 C
 ES – earliest start time: the earliest time at which an activity can begin given that its E 3 B, D
predecessor activities must be completed first. F 2 A, B, D
 EF – earliest finish time, equal to the earliest start time for the activity plus the time
G 2 C, F
required to complete the activity.
H 4 G
 LF – latest finish time: the latest time at which an activity can be completed without
I 1 C
delaying the project.
 LS – latest start time, equal to the latest finish time minus the time required to J 3 E, G
complete the activity. K 5 F, H, I

Activities with the same earliest and latest start times (ES=LS) or with same earliest and 1. Draw the corresponding PERT diagram for this project
latest finish times (EF=LF) define the critical path. This means that these activities have a 2. Determine the critical path
float time of 0. 3. Calculate the total estimated duration of the project
4. State the float time for all non-critical activities
For the above network diagram, we have:
Exercise 2: Find the critical path for each of the activity networks below.
Start times Float a.
Activity Duration
Earliest Latest time
A 7 0 0 0
B 2 0 5 5
C 15 0 12 12
E 10 7 7 0
D 8 17 17 0 b.
F 2 25 25 0
G 5 17 19 2
H 8 22 24 2
I 2 27 27 0
J 3 29 29 0
c.
Finish 32 32

The critical path is A-E-D-F-I-J


The total estimated duration of the project = sum of duration of critical tasks =
7 + 10 + 8 + 2 + 2 + 3 = 32

Exercise 1: Given the task description table below:


Remark! CPM was developed for complex but fairly routine projects with minimal
uncertainty in project completion times. For less routine projects there is more
uncertainty in the completion times, and this uncertainty limits the usefulness of the

©A LEVEL ICT/ Csc 91


deterministic CPM model. An alternative to CPM is the PERT (Program Evaluation and Definition: A PERT chart/diagram is a graphic illustration of a project as a network diagram
Review Technique) project planning model. consisting of numbered nodes (either circles or rectangles) representing events, or milestones
in the project linked by labeled vectors (directional lines) representing tasks in the project.
4.3.2. Program Evaluation and Review Technique (PERT) The direction of the arrows on the lines indicates the sequence of tasks.
PERT is an event-oriented network analysis technique used to estimate project duration
when there is a high degree of uncertainty with the individual activity duration estimates. ComparisonbetweenCPMandPERT
Each activity is assigned three time estimates CPM task durations are known with certainty. CPM is therefore said to be deterministic
m= most likely time estimate, (mode) while PERT is probabilistic.
a = optimistic time estimate (best case)
b = pessimistic time estimate (worst case) CPM PERT
These three estimates are then used to calculate a weighted duration for each task by using 1 Uses network, calculate float
the formula = ( + 4 + )/6 or slack, identify critical path
The weighted durations are then used as a more realistic estimate of task durations for and activities, guides to Same as CPM
constructing a PERT chart (network diagram). monitor and controlling
Using PERT, the probability of completing the project by a certain date t, can now be found project
by finding 2 Requires 3 estimates of activity time
− − Uses one value of activity time Calculates standard deviation and
( ≥ )= =
σ σ variance of time
Where 3 Used where times can be Used where times cannot be estimated
is the expected completion time of the project estimated with confidence, with confidence.
And familiar activities Unfamiliar or new activities
− 4 Minimizing cost is more Meeting time target or estimating
σ = important percent completion is more important
6
is the variance of T = (variances of activities on the critical path).

Example: 4.3.3. Gantt Chart


If a project’s expected completion time is = 246 with its variance σ = 25, then A Gantt chart is a horizontal bar graph that helps plan and monitor project development or
what is the probability that the project resource allocation on a horizontal time scale. It depicts project tasks against a calendar.
a) is actually completed within 246 days? A Gantt chart is constructed with a horizontal axis representing the total time span of the
b) is actually completed within 240 days? project, broken down into increments (days, weeks, or months) and a vertical axis
c) is actually completed within 256 days representing the tasks that make up the project. Horizontal bars of varying lengths
represent the sequences, timing, and time span for each task. The bar spans may overlap,
Solution as, for example, you may conduct research and choose software during the same time span.
a) = 246, = 246 and σ = 25 As the project progresses, secondary bars, arrowheads, or darkened bars may be added to
246 − 246 indicate completed tasks, or the portions of tasks that have been completed. A vertical line
( ≥ )= = 0
25 is used to represent the report date.

b) = 240, = 246 and σ = 25


240 − 246 − 6
( < )= = = − 0.24
25 25
∴ ( ≤ ) = 1 − ( ( < 0.24)) = 1 − 0.24 = 0.76

c) = 256, = 246 and σ = 25


256 − 246 6
( ≥ )= = = 0.24
25 25

©A LEVEL ICT/ Csc 92


resigning minister
1` 20 mins. None
C - Get reactions from Cannot start until A and B are
25 mins.
regions completed
D - Review possible Cannot start until B is
40 mins
replacements completed
E- Review the Cannot start until A is
25 mins
minister’s career completed
F- Prepare film for Cannot start until E and
20 mins.
archives C are completed
A Gantt chart
Cannot start until A, B, C, D, E
G- Edit 20 mins.
and F are completed
The critical path is A-C-D-F-H = 5+6+4+2 = 17 days

Exercises! a. Construct an activity network for this problem and by finding the critical path in
Exercise 1: A project has been defined to contain the following list of activities along with your network, show that the news item can be ready before 6 pm that day.
their required times for completion. b. Construct the corresponding Gantt chart for this project

Activity Time Immediate References


Activity
No. (weeks) Predecessors [1] D. Kahn, “The Code breakers, Macmillan Publishing Company, 1976”.
1 Collect requirements 3 [2] A. Menezes, P. van Oorschot, and S. Vanstone, “Handbook of Applied Cryptography, CRC
2 Analyze processes 2 1 Press, 1997”.
3 Analyze data 2 2 [3] M. Gardner, “Codes, Ciphers, and Secret Writing, Dover Publications, Inc., 1972”
[4] L. Smith, “Cryptography the Science of Secret Writing, Dover Publications, Inc., 1943”.
4 Design processes 6 2
[5] John D. Carpinelli, “Computer Systems Organization & Architecture”
5 Design data 3 3
6 Design screens 2 3,4
7 Design reports 4 4,5
8 Program 5 6,7
9 Test and Document 7 7
10 Install 2 8,9

a. Draw a network diagram for this project.


b. Calculate the earliest completion time of the project
c. Show the critical path.
d. What would happen if activity 6 were revised to take 6 weeks instead of 2 weeks?
e. Construct a Gantt chart for this project

Exercise 2: At 4:30 pm one day CRTV news team hears of a Government Minister
resigning. They wish to prepare an item on the event for that evening’s 6 o’clock news.
The table below list the jobs needed to prepare this news item, the time each job takes
and the constraints on when the job can commence.
Time
Job Constraints
needed
A - Interview the 15 mins. Starts at 4:30 pm

©A LEVEL ICT/ Csc 93

You might also like