NOTES COMP 111 Fundamentals of Computing COMPLETE
NOTES COMP 111 Fundamentals of Computing COMPLETE
INTRODUCTION
This unit covers a foundational understanding of computer hardware, software, operating
systems, peripherals etc. along with how to get the most value and impact from computer
technology.
Course outline
1. Definition
2. Functionalities of a computer
3. Advantages
4. Disadvantages
5. Application areas
6. Computer Generations
7. Computer - Types
8. Computer - Components
9. Computer - Input Devices
10. Computer - Output Devices
11. Computer - Memory
12. Computer - Random Access Memory
13. Computer - Read Only Memory
14. Computer – Motherboard
15. Computer - Memory Units
16. Computer - Ports
17. Computer - Hardware
18. Computer - Software
19. Computer - Number System
20. Computer - Number Conversion
21. Computer - Data and Information
22. Computer - Networking
23. Computer - Operating System
24. Computer - Internet and Intranet
Definition
Computer is an advanced electronic device that takes raw data as input from the user and
processes it under the control of set of instructions (called program), gives the result
(output), and saves it for the future use.
Communication
Communication means to convey a message, an idea, a picture or speech that is received
and understood clearly and correctly by the person for whom it is meant for. Some main
areas in this category are:
E-mail
Chatting
Usenet
FTP
Telnet
Video-conferencing
Government
Computers play an important role in government. Some major fields in this category are:
Budgets
Sales tax department
Income tax department
Male/Female ratio
Computerization of voters lists
Computerization of driving licensing system
Computerization of PAN card
Weather forecasting
Computer Generations
Generation in computer terminology is a change in technology a computer is/was being
used. Initially, the generation term was used to distinguish between varying hardware
Input Unit
This unit contains devices with the help of which we enter data into computer. This unit
makes link between user and computer. The input devices translate the information into
the form understandable by computer.
CPU (Central Processing Unit)
CPU is considered as the brain of the computer. CPU performs all types of data processing
operations. It stores data, intermediate results and instructions (program). It controls the
operation of all parts of computer.
CPU itself has following three components
ALU(Arithmetic Logic Unit)
Memory Unit
Control Unit
Output Unit
Output unit consists of devices with the help of which we get the information from
computer. This unit is a link between computer and users. Output devices translate the
computer's output into the form understandable by users.
Computer – CPU (Central Processing Unit)
CPU consists of the following features:
CPU is considered as the brain of the computer.
CPU performs all types of data processing operations.
It stores data, intermediate results and instructions (program).
It controls the operation of all parts of computer.
Mouse
Mouse is most popular pointing device. It is a very famous cursor-control device having a
small palm size box with a round ball at its base which senses the movement of mouse and
sends corresponding signals to CPU when the mouse buttons are pressed.
Generally it has two buttons called left and right button and a wheel is present between the
buttons. Mouse can be used to control the position of cursor on screen, but it cannot be
used to enter text into the computer.
Advantages
Easy to use
Not very expensive
Moves the cursor faster than the arrow keys of keyboard.
Joystick
Joystick is also a pointing device which is used to move cursor position on a monitor
screen. It is a stick having a spherical ball at its both lower and upper ends. The lower
spherical ball moves in a socket. The joystick can be moved in all four directions.
The function of joystick is similar to that of a mouse. It is mainly used in Computer Aided
Designing (CAD) and playing computer games.
Light Pen
Light pen is a pointing device which is similar to a pen. It is used to select a displayed
menu item or draw pictures on the monitor screen. It consists of a photocell and an optical
system placed in a small tube. When the tip of a light pen is moved over the monitor screen
and pen button is pressed, its photocell sensing element detects the screen location and
sends the corresponding signal to the CPU.
Track Ball
Track ball is an input device that is mostly used in notebook or laptop computer, instead of
a mouse. This is a ball which is half inserted and by moving fingers on ball, pointer can be
moved. Since the whole device is not moved, a track ball requires less space than a mouse.
A track ball comes in various shapes like a ball, a button and a square.
Scanner
Scanner is an input device which works more like a photocopy machine. It is used when
some information is available on a paper and it is to be transferred to the hard disc of the
LECTURER MR.JONAH K.NGETICH TEL:0720254951/0780254951 Page 11
COMP 111 Fundamentals of Computing
computer for further manipulation. Scanner captures images from the source which are
then converted into the digital form that can be stored on the disc. These images can be
edited before they are printed.
Digitizer
Digitizer is an input device which converts analog information into digital form. Digitizer
can convert a signal from the television or camera into a series of numbers that could be
stored in a computer. They can be used by the computer to create a picture of whatever the
camera had been pointed at. Digitizer is also known as Tablet or Graphics Tablet because
it converts graphics and pictorial data into binary inputs. A graphic tablet as digitizer is
used for doing fine works of drawing and image manipulation applications.
Microphone
Microphone is an input device to input sound that is then stored in digital form. The
microphone is used for various applications like adding sound to a multimedia presentation
or for mixing music.
Magnetic Ink Card Reader (MICR)
MICR input device is generally used in banks because of a large number of cheques to be
processed every day. The bank's code number and cheque number are printed on the
cheques with a special type of ink that contains particles of magnetic material that are
machine readable. This reading process is called Magnetic Ink Character Recognition
(MICR). The main advantages of MICR is that it is fast and less error prone.
Optical Character Reader(OCR)
OCR is an input device used to read a printed text. OCR scans text optically character by
character, converts them into a machine readable code and stores the text on the system
memory.
Bar Code Readers
Bar Code Reader is a device used for reading bar coded data (data in form of light and dark
lines). Bar coded data is generally used in labelling goods, numbering the books etc. It may
be a hand held scanner or may be embedded in a stationary scanner. Bar Code Reader scans
a bar code image, converts it into an alphanumeric value which is then fed to the computer
to which bar code reader is connected.
Optical Mark Reader (OMR)
OMR is a special type of optical scanner used to recognize the type of mark made by pen
or pencil. It is used where one out of a few alternatives is to be selected and marked. It is
specially used for checking the answer sheets of examinations having multiple choice
questions.
Computer - Output Devices
Following are few of the important output devices which are used in a computer.
Monitors
Graphic Plotter
Printer
Monitors
Monitors, commonly called as Visual Display Unit (VDU), are the main output device of
a computer. It forms images from tiny dots, called pixels that are arranged in a rectangular
form. The sharpness of the image depends upon the number of pixels.
There are two kinds of viewing screen used for monitors.
Cathode-Ray Tube (CRT)
Computer - Ports
What is a Port?
A port:
Is a physical docking point using which an external device can be connected to the
computer.
Can also be programmatic docking point through which information flows from a
program to computer or over the internet.
Characteristics
A port has the following characteristics:
External devices are connected to a computer using cables and ports.
Ports are slots on the motherboard into which a cable of external device is plugged
in.
Examples of external devices attached via ports are mouse, keyboard, monitor,
microphone, speakers etc.
Following are few important types of ports:
Serial Port
Used for external modems and older computer mouse
Two versions : 9 pin, 25 pin model
Data travels at 115 kilobits per second
Parallel Port
Used for scanners and printers
Also called printer port
25 pin model
Also known as IEEE 1284-compliant Centronics port
PS/2 Port
Used for old computer keyboard and mouse
Also called mouse port
Most of the old computers provide two PS/2 port, each for mouse and keyboard
Also known as IEEE 1284-compliant Centronics port
Universal Serial Bus (or USB) Port
It can connect all kinds of external USB devices such as external hard disk, printer,
scanner, mouse, keyboard etc.
It was introduced in 1997.
Most of the computers provide two USB ports as minimum.
Data travels at 12 megabits per seconds
USB compliant devices can get power from a USB port
VGA Port
Step 2 14 / 2 7 0
Step 3 7 / 2 3 1
Step 4 3 / 2 1 1
Step 5 1 / 2 0 1
As mentioned in Steps 2 and 4, the remainders have to be arranged in the reverse order so
that the first remainder becomes the least significant digit (LSD) and the last remainder
becomes the most significant digit (MSD).
Decimal Number : 2910 = Binary Number : 111012.
Other base system to Decimal System
Steps
Step 1 - Determine the column (positional) value of each digit (this depends on the
position of the digit and the base of the number system).
Step 2 - Multiply the obtained column values (in Step 1) by the digits in the
corresponding columns.
Step 3 - Sum the products calculated in Step 2. The total is the equivalent value in
decimal.
Example
Binary Number : 111012
Calculating Decimal Equivalent:
Step Binary Number Decimal Number
Step 1 111012 ((1 x 24) + (1 x 23) + (1 x 22) + (0 x 21) + (1 x 20))10
Step 2 111012 (16 + 8 + 4 + 0 + 1)10
Step 3 111012 2910
Binary Number : 111012 = Decimal Number : 2910
Other Base System to Non-Decimal System
Steps
Step 1 - Convert the original number to a decimal number (base 10).
Step 2 - Convert the decimal number so obtained to the new base number.
Example
Octal Number : 258
Calculating Binary Equivalent:
Step 1 : Convert to Decimal
Step Octal Number Decimal Number
Step 1 258 ((2 x 81) + (5 x 80))10
Step 2 258 (16 + 5 )10
Step 3 258 2110
Octal Number : 258 = Decimal Number : 2110
Step 2 : Convert Decimal to Binary
Step Operation Result Remainder
Step 1 21 / 2 10 1
Step 2 10 / 2 5 0
Step 3 5 / 2 2 1
Step 4 2 / 2 1 0
Step 5 1 / 2 0 1
Decimal Number : 2110 = Binary Number : 101012
Octal Number : 258 = Binary Number : 101012
Shortcut method - Binary to Octal
Steps
Step 1 - Divide the binary digits into groups of three (starting from the right).
Step 2 - Convert each group of three binary digits to one octal digit.
Example
Binary Number : 101012
Calculating Octal Equivalent:
Step Binary Number Octal Number
Step 1 101012 010 101
Step 2 101012 28 58
Step 3 101012 258
Binary Number : 101012 = Octal Number : 258
Shortcut method - Octal to Binary
Steps
Step 1 - Convert each octal digit to a 3 digit binary number (the octal digits may be
treated as decimal for this conversion).
Step 2 - Combine all the resulting binary groups (of 3 digits each) into a single
binary number.
Example
Octal Number : 258
Calculating Binary Equivalent:
Step Octal Number Binary Number
Step 1 258 210 510
Step 2 258 0102 1012
Step 3 258 0101012
Octal Number : 258 = Binary Number : 101012
Shortcut method - Binary to Hexadecimal
Steps
Step 1 - Divide the binary digits into groups of four (starting from the right).
Step 2 - Convert each group of four binary digits to one hexadecimal symbol.
Example
Binary Number : 101012
Calculating hexadecimal Equivalent:
Step Binary Number Hexadecimal Number
Step 1 101012 0001 0101
Step 2 101012 110 510
Step 3 101012 1516
Binary Number : 101012 = Hexadecimal Number : 1516
Shortcut method - Hexadecimal to Binary
Input - In this step the input data is prepared in some convenient form for
processing. The form will depend on the processing machine. For example, when
electronic computers are used, the input data could be recorded on any one of
several types of input medium, such as magnetic disks, tapes and so on.
Computer Network
What is a Computer Network?
A computer network is a system in which multiple computers are connected to each other
to share information and resources.
Types of Network Topology
Network Topology is the schematic description of a network arrangement, connecting
various nodes (sender and receiver) through lines of connection.
BUS Topology
Bus topology is a network type in which every computer and network device is connected
to single cable. When it has exactly two endpoints, then it is called Linear Bus topology.
Distributors
A computer can be connected to another one via a serial port but if we need to connect
many computers to produce a network, this serial connection will not work. The solution
is to use a central body to which other computers, printers, scanners etc. can be connected
and then this body will manage or distribute network traffic.
Router
A router is a type of device which acts as the central point among computers and other
devices that are part of a network. A router is equipped with holes called ports and
computers and other devices are connected to a router using network cables. Now-a-days
router comes in wireless modes using which computers can be connected without any
physical cable.
Network Card
Network card is a necessary component of a computer without which a computer cannot
be connected over a network. It is also known as network adapter or Network Interface
Card (NIC). Most branded computers have network card pre-installed. Network cards are
of two types : Internal and External Network Cards.
Internal Network Cards
Motherboard has a slot for internal network card where it is to be inserted.
There are seven to get familiar with and these are the physical layer, data link layer,
network layer, transport layer, session layer, presentation layer, and the application layer.
Physical Layer, is just that the physical parts of the network such as wires, cables,
and there media along with the length. Also this layer takes note of the electrical
signals that transmit data throughout system.
LECTURER MR.JONAH K.NGETICH TEL:0720254951/0780254951 Page 32
COMP 111 Fundamentals of Computing
Data Link Layer, this layer is where we actually assign meaning to the electrical
signals in the network. The layer also determines the size and format of data sent
to printers, and other devices. Also I don't want to forget that these are also called
nodes in the network. Another thing to consider in this layer is will also allow and
define the error detection and correction schemes that insure data was sent and
received.
Network Layer, this layer provides the definition for the connection of two
dissimilar networks.
Transport Layer, this layer allows data to be broken into smaller packages for data
to be distributed and addressed to other nodes (workstations).
Session Layer, this layer helps out with the task to carry information from one node
(workstation) to another node (workstation). A session has to be made before we
can transport information to another computer.
Presentation Layer, this layer is responsible to code and decode data sent to the
node.
Application Layer, this layer allows you to use an application that will
communicate with say the operation system of a server. A good example would be
using your web browser to interact with the operating system on a server such as
Windows NT, which in turn gets the data you requested.
Intranet
Intranet is system in which multiple PCs are connected to each other.
PCs in intranet are not available to the world outside the intranet.
Usually each company or organization has their own Intranet network and
members/employees of that company can access the computers in their intranet.
Each computer in Intranet is also identified by an IP Address which is unique
among the computers in that Intranet.
By using different bit patterns, the non-numeric information, such as letters of the English
alphabet A-Z can be represented.
E.g., letter A is represented as: 110001, while the equal (=) sign is represented as 001011.
In addition, the Digital computers that are frequently used in many business environments
use binary digits to operate, i.e., they accept data & instructions in terms of 1’s and 0’s,
work upon them and produce information, which is immediately stored in the form of 0’s
& 1’s before they are communicated to the end users.
This means that coding in computers is done to achieve the following objectives:
1). To convert numeric & alphanumeric information into binary digits of 0 & 1.
2). To transmit correct data to the computer.
3). To detect and correct errors, if any, during the transmission of data.
The following are the various methods of representing data in Binary Number systems in
a computer:
1. BCD (Binary Coded Decimal).
2. EBCDIC (Extended Binary Coded Decimal Interchange Code).
3. ASCII (American Standard Code for Information Interchange) Code.
What is a Code?
A set of rules, outlining the way in which data may be represented.
Rules used to convert data from one representation to another, e.g. from ASCII to
EBCDIC.
BCD Code.
BCD stands for Binary Coded Decimal.
Usually, there are 2 types of BCD coding;
4-bit BCD Coding.
Extended BCD Code.
(1). 4-bit BCD Coding.
This method uses 4 binary digits to represent an individual decimal digit.
Example;
3 9 8(10)
EBCDIC Code.
EBCDIC stands for Extended Binary Coded Decimal Interchange Code.
This is an 8-bit coding system, with 4 zone bits, 4 data bits and an extra parity bit (in total
it consists of 9 bits, when the parity bit is included).
The EBCDIC coding system is an extension of the 6-bit BCD coding system. It allows for
the representation of more characters, i.e., 256 (28 ) characters as compared to the 64 (26)
characters that can be represented in the 6-bit BCD coding system.
The EBCDIC uses unique combinations of 4 zone bits & 4 numeric bits to represent
specific data characters.
The EBCDIC code format for a given character would look like:
x
Exercise I.
1. (a). What is computer coding systems? (5
marks).
(b). Name and briefly explain TWO computer coding systems. (4
marks).
(c). State advantages of using Extended BCD code over 4-bit BCD code. (6
marks).
(d). Explain the purpose of zone bits, and parity bit in a computer coding system. (4
marks).
Exercise II.
1. (a). What is meant by the term Character codes? Give examples.
(b). Explain the principal characteristics of the following by the help of suitable
examples:
(i). 4-bit BCD code.
(ii). Parity bit.
(iii). ASCII code.
(iv). EBCDIC code.
Exercise III.
1. State THREE methods of representing data in Binary number system.
STORAGE ORGANISATION.
2 bytes
Fig 2: Character machine representation of 2468 (packed).
2 4 6 8
0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 1 0 0 0
1 byte 1 byte 1 byte 1 byte
4 bytes
The arrangement of the locations of a Byte machine provides for a unique identifier for
each byte, which can be used for write and retrieval operations on these locations.
The Byte machines can also be described as Variable Word length machines. This is
because, several bytes can be grouped to form words of required length.
The Byte machines are more advantageous for they combine both the capabilities of the
Character and the Word addressable machines.
Exercise I.
1. Expand the following abbreviations:
(a). BIT. (1
mark)
(b). BCD. (1
mark)
(c). ASCII. (1
mark)
(d). EBCDIC. (1
mark)
2. Explain the concept of storage organization.
3. Define/Explain the following terms:
(i). Word machine.
(ii). EPROM.
(iii). Byte machine.
(iv). Character machine.
(v). Packed binary field.
(vi). Impacked binary field. (20
marks).
4. Write short notes on:
(i). Character machines and impacked binary fields.
(ii). Word machines.
DATA TYPES.
Data is a term used to describe a set of facts. A single fact is known as Datum.
Data can be in 3 types or forms.
Alphabetic data:
This is data made from combination of alphabetic characters, such as names, title, marital
status, e.g. “John”, “Prof.”, “Married”.
Exercise.
1. Explain the terms Numeric and Alphanumeric. Illustrate your answers with appropriate
examples.
THE BYTE.
The capacity of a computer memory can be measured in terms of Bits (individual memory
cells), Bytes (groups of cells or bits) or Words (arrangement of the bytes).
A Bit (Binary digit) is the number 0 or 1 in the representation of a value in binary
notation.
A Byte is a fixed number of adjacent bits that are operated on as a unit.
Usually, a byte is a group of 8 adjacent bits and can store one character, i.e. 1-byte
stores 1 character.
The Byte is the most commonly used unit of measuring the capacity of a computer
memory.
A Word is a group of bits that the computer recognizes and executes (processes) at a
time.
Exercise.
1. Data in a computer is represented in one major form. Define the term “Data
representation” in a computer system.
2. Define the following terms:
(i). Bit.
(ii). Byte.
(iii). Character.
(iv). Word.
3. Explain the term “NIBBLES” as used in data representation in computers.
CODING OF DATA.
A computer can understand only one language consisting of two symbols, 0 & 1(Binary
digits).
Since the computer cannot understand data represented in human languages (i.e. numerals
0 - 9, alphabets A – Z, and special symbols such as +, -, /, *, etc), it became necessary to
change the data to binary form, a process known as Coding of data.
In other words, to make communication possible between computers and human beings,
data must be coded in the form that can be understood by the computer and the information
supplied by a computer (after processing) must be coded in the form that can be understood
by the user.
The coding and decoding of data in a computer is done by the Input/Output devices.
Codes used in Computer systems.
Human readable
Human Computer works -OR-
message Input Code converted to in CPU Code CPU Code converted Machine readable
Computer Code by Input devices to Output Code by
Code
Output devices
NUMBER SYSTEMS.
The design and organization of a computer depends on the number system. The 4 number
systems are:-
1. Binary number system (Base 2).
2. Octal number system (Base 8).
3. Decimal number system (Base 10).
4. Hexadecimal number system (Base 16).
Binary numbers are numbers to base 2, and use only two digits; 0 & 1.
Octal numbers, are numbers to base 8, and consists 8 digits (0 to 7).
The decimal number system consists of 10 digits, 0 to 9.
Hexadecimal numbers are numbers to base 16 and there must be 16 digits. The sixteen
symbols used in the Hexadecimal system are; digits 0 to 9 & alphabets A to F.
Decimal point.
The value of each digit in a number depends on the following:
(i). The digit itself, i.e. the face value of the digit.
(ii). The base of the number system.
(iii). The position of the digit in the number.
Example,
Let us consider the number 8888. All the digits represent the same value of 8. However,
the positional values are the absolute values multiplied by 10 raised to the positional
power.
103 102 101 100
8 8 8 8
= (8x103) + (8x102) + (8x101) + (8x100)
= (8x1000) + (8x100) + (8x10) + (8x1)
= 8000 + 800 + 80 + 8
= 8888
Since the positional increment is a power of 10, the value 10 is known as the Base of the
number system.
Therefore, the Base of a number system is the value whose positional power is used to
represent another value. Therefore, in the decimal system, the base is 10.
Example 1. To represent 5621 in the decimal system, it will be:
103 102 101 100
5 6 2 1
= (5x103) + (6x102) + (2x101) + (1x100)
= (5x1000) + (6x100) + (2x10) + (1x1)
= 5000 + 600 + 20 + 1
= 5621
Note. In the Decimal system, the position value of each digit in a number increases 10
times as we move from right to left starting with the rightmost digit.
Example 2: Fractional numbers.
(i). 0.839
100 10-1 10-2 10-3
0 · 8 3 9
It is clear that, the positional values of the numbers increase 2 times as we move from right
to left. This is because the base is 2.
Points.
Bit (Binary digit) – The digit 0 or 1 in the representation of a value in Binary notation.
Binary numbers are very important in the design, organization, and understanding of
computers.
The Binary system is more convenient because the computer storage systems are based on
a 2- state principle (digits 1 & 0).
For example;
(i). Magnetic storage media use the magnetic principles to imitate the states of 1’s & 0’s.
A magnetized spot represents a 1, while the non-magnetized spot represents a 0.
(ii). The computer’s Internal memory uses magnetic polarity in one direction to represent
a ‘1’ and in the reverse direction to represent a ‘0’.
(iii). The computer logical operations are also affected by pulse trains, where a pulse
represents a ‘1’ and no pulse represent a ‘0’.
In addition, the Binary code is used only for mathematical applications (it is not intended
to handle alphabetic data).
Exercise I.
1. State the FOUR types of Number systems.
2. Define and explain Decimal notation.
3. (a). What is the Binary system of numbers?
(b). Explain the main features of Binary notation.
(c). State one reason why computers use binary numbers.
4. Write out what A,B,C, and D represent in the table below.
Number System Values
A 0,1
B 0,1,2,3,4,5,6,7
C 0,1,2,3,4,5,6,7,8,9
D 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
A __________________________ B ______________________________
C __________________________ D ______________________________
5. (a). Explain the main characteristics of Octal notation.
(b). Explain the advantages of using Octal numbers over binary numbers.
6. Write a short note on Hexadecimal notation.
BASE CONVERSIONS.
Human beings normally work with the base 10 notation, i.e. all the data passed to go as
computer input is usually in decimal notation. Subsequently, the results of the computer
operations are communicated to the users in a form they can understand, i.e. in base 10
(decimal) notations.
The Base Conversion is therefore used to help computer users understand how data and
information is communicated between the computer and the user.
2 3 1
2 1 1
1 1
12110 11110012
Example 2: Convert the following decimal integers into their binary equivalents.
(i). 36
2 36 REM
2 18 0
2 9 0
2 4 1 Copy
2 2 0
2 1 0
1 1
12110 1001002
(ii). 247
2 247 REM
2 123 1
2 61 1
2 30 1
2 15 0 Copy
2 7 1
2 3 1
2 1 1
1 1
24710 111101112
Fractional numbers.
For a fractional number, the no. is divided into 2 parts; the whole number part & the
fraction part.
The whole no. is then converted to binary individually as shown above. The fraction
part is repetitively multiplied by 2, noting the complete units of two. This is done
until the fraction becomes a 0 or starts recurring.
The complete units of the fraction part are then copied downwards.
Example 1: Convert a decimal number such as 26.2510 to its binary equivalent.
2 26 REM Fractional part
2 13 0
2 6 1 0.25 x 2 = 0.50 0 Copy
2 3 0 Copy 0.50 x 2 = 1.00 1
2 1 1 0.00x2 (not necessary, hence stop)
1 1
0.25 0.01
2610 110102
Therefore, 26.2510 11010.012
Fractional numbers.
For a fractional number, the whole no. is converted to decimal as above.
The digits in the fraction part are divided by multiples of 2, starting from the decimal
point.
Example 1: Convert a binary no. such as 11010.012 to its decimal equivalent.
24 23 22 21 20 2-1 2-2 Weights.
1 1 0 1 0 . 0 1
Sum = 16 + 8 + 0 + 2 + 1+ ½ + 0 + ⅛
= 27 + 0.5 + 0.125
Therefore, 11011.1012 27.62510
Fractional numbers.
To convert decimal fractions into their equivalent octal fractions, the whole part of
the decimal number is repeatedly divided by 8.
The fractional part is repetitively multiplied by 8, noting the complete units of 8, until
the fractional part becomes zero or up to the required number of digits. The complete
units are then copied downwards.
Example 1: Convert a decimal number such as 98.12510 to its octal equivalent.
8 98 REM Fractional part
8 12 2
8 1 4 Copy 0.125 x 8 = 1.00 1 Copy
1 1 0.00 x 8 (not necessary)
Fractional numbers.
16 46 9
16 2 E (=14 in decimal) Copy
2 2
Fractional numbers.
For a fractional decimal number, the fraction part is repetitively multiplied by 16,
noting the complete units of 16’s. The complete units are then copied downwards.
Example 1: Convert 32.12510 to hexadecimal.
16 32 REM Fractional part
16 2 0
2 2 Copy 0.125 x 16 = 2.00 2 Copy
0.00 x 16 (not necessary)
3210 2016
0.12510 0.216
Therefore, 32.12510 20.216
Fractional numbers.
For a fractional hexadecimal value, the whole part is converted to decimal as above.
The digits in the fraction part are divided by multiples of 16.
Example 1: Convert 20.216 to decimal.
161 160 16-1 Assign the powers to base 16.
2 0 . 2
NOTE. You can convert an Octal number to Binary, Hexadecimal to Binary or from Octal
to Hexadecimal.
To do this, first convert the given number to base 10 (decimal), then from base 10 to the
required base.
23110 111001112
Therefore, 3478111001112
(x). FROM HEXADECIMAL TO BINARY.
Example 1: Convert 6DC16 to its binary equivalent.
Solution.
Step 1: Convert the hexadecimal (base 16) number given to its decimal (base 10)
equivalent.
6DC
= (6x162)+ (Dx161)+ (Cx160)
= 6x162 + 13x161 + 12x160
Exercise I.
1. (A). What are Base Conversions?
(B). Explain the following conversions:
(i). From decimal to binary.
(ii). From binary to decimal.
(iii). From decimal to Octal.
(iv). From octal to decimal.
(v). From decimal to hexadecimal.
(vi). From hexadecimal to decimal.
2. Perform the following computer arithmetic. In each case, show how you arrive at your
answer.
(A). Convert the following decimal numbers to their binary equivalent.
(i). 11
(ii). 001
(iii). 255
(iv). 2346
(v). 322.6875 (3
marks).
(B). Convert the following binary numbers to decimal.
(i). 110111001 (2
marks)
(ii). 10101.1011 (2
marks)
Exercise II.
1. Convert the following to Hexadecimal.
NEGATIVE NUMBERS.
Both positive and negative numbers can be represented in the computer memory during
processing.
The input numbers whether positive or negative are all represented in binary form.
The negative numbers are used to carry out subtraction in the computer’s arithmetic
operations. This is based on the fact that, subtracting a number is the same as adding its
negative to the other.
The following are the various methods used to represent negative numbers in the
computer:-
(i). One’s Complement (1C) method.
(ii). Two’s Complement (2C) method.
(iii). Signed Magnitude method.
2 8 1
2 4 0 Copy
2 2 0
2 1 0
1 1
1710 100012
Therefore, -1710 1 0 0 0 12
Complementing each bit
0 1 1 1 02
-1710 011102 (1C method).
Exercise.
2. (a). What are Negative numbers?
(b). Explain the main methods of using negative numbers.
BINARY ARITHMETICS.
ADDITION:
Adding binary numbers is the same as adding decimal numbers. The difference is that, any
complete units of two’s are carried and added to the next significant digit.
Binary addition rules.
During binary addition (i.e. when adding two digits) the following rules need to be noted.
Sum Carry
0 + 0 = 0 0
0 + 1 = 1 0
1 + 0 = 1 0
1 + 1 = 0 1
Example 1:
1 0 0 1
+ 0 1 0 1
1 1 1 0
Example 2:
1 1 0 1 02
+ 1 0 1 02
1 0 0 1 0 02
Explanation:
Addition of two binary numbers starts from the Least Significant Digits.
Zero (0) is added to 0 to get a sum of 0.
The next significant digits, 1 and 1 are added to get a sum of 0 plus a carryout of 1.
The Carryout is given by any complete units of two got after the digits of the same
significance are added.
The carryout from the previous addition becomes the Carry in of the next significant
digits, to which the carry is added.
The procedure continues until the overall sum of the two binary numbers is got.
Note. During arithmetic operations, the data to be worked upon are usually held on
locations (cells) of predefined length or capacity. If the results cannot fit in any of the
spaces that contain the values to be executed, then there is usually an excess bit in the
answer.
SUBTRACTION:
Binary subtraction rules.
When subtracting two numbers (i.e. when getting the difference between two numbers),
the following rules must be observed.
Difference Borrowed
(from the next significant digit)
0 - 0 = 0 0
1 - 0 = 1 0
0 - 1 = 1 1
1 - 1 = 0 0
Example 1:
1 1 1 0 12
- 1 0 1 02
1 0 0 1 12
NB. The one (1) you have borrowed is equivalent to 2.
Explanation:
The subtraction starts with the least significant digits towards the most significant digits.
In the first subtraction, a 0 is subtracted from a 1, and the difference is a ‘1’.
In the 2nd subtraction, 1 cannot be subtracted from a 0, and hence a 1 containing 2 is
borrowed from the next significant digit from which a 1 is subtracted and a difference
of 1 is got.
Note that, borrowing 1 from 1 leaves a 0 in the 3rd digit of the number being subtracted
from.
The procedures proceed until the subtraction is complete.
Example 2:
11110011 – 1100000 (base 2).
11110011
1100000 -
10010011 (base 2)
Note. Subtraction of binary numbers can also be carried out using the Compliments and
Signed magnitude methods.
Overflow
Step 3: Add the overflow digit to the Least Significant Digit of the sum to get the difference.
1 1 1 0 1
+1 0 1 0 1
1 0 0 1 0
1+
1 0 0 1 1 Difference
MULTIPLICATION:
When two numbers are multiplied, the output is the Product.
Binary multiplication rules.
The following rules must be used when carrying out a multiplication procedure.
Product
0 x 0 = 0
0 x 1 = 0
1 x 0 = 0
1 x 1 = 1
Example 1:
1 0 1 0 Multiplicand
x 1 0 1 Multiplier
1 0 1 0
0 0 0 0 partial products
1 0 1 0
1 1 0 0 1 02 Product
Explanation:
Example 2:
(i). 11100 x 10010 (base 2).
11100
10010 x
11100
00000
00000
11100
00000
111111000 (base 2)
DIVISION:
Computers carry out binary division by repetitive subtraction.
Example 1:
11102 REM 1002
101 1001010
-101
1000
-101
0111
-101
0100
Explanation:
Since the divisor is made up of 3 digits, we start by grouping the dividend bits into groups
of 3’s from the Most Significant Digit.
In the first grouping, 100 is got, which cannot be divided by 101, and hence extend to
4 digits and 101 goes into 1001 once. The 1 is copied on top.
The remainder 100 cannot divide into 101, and hence the next digit 0 is added to it
forming 1000, that divides into 101 once, and 1 is copied on top.
The procedure repeats until all the digits of the dividend are exhausted and a remainder
of 11102 is got.
Example 2:
110
101 11110
101
Exercise II.
1. Perform the following binary arithmetic:
(A). (i). 10111 multiply by 1001
COMPUTATIONAL ERRORS.
The main computation errors are:
1). Overflow:
Overflow occurs whenever the results of an arithmetic operation are bigger than the
assigned work area.
Exercise.
1. Name and explain the four types of computation errors. (20 marks).
Review Questions
1. Differentiate between private and confidential data.
2. Why is information called a resource?
3. (a) Explain the term ‘Information security’.
(b) Recently, data and information security has become very important. Explain.
4). THEFT
The threat of theft of data & information, hardware & software is real. Some
information is so valuable such that business competitors or some governments can
decide to pay somebody a fortune so as to steal the information for them to use.
Review Questions
1. Explain any three threats to data and information.
2. Give two control measures one would take to avoid unauthorized access to data and
information.
3. Explain the meaning of ‘industrial espionage’.
4. (a) Define a computer virus.
(b) Give and explain two types of computer viruses.
(c) List three types of risks that computer viruses pose.
(d) List and explain five sources of computer viruses.
(e) Outline four symptoms of computer viruses.
(f) Explain the measures one would take to protect computers from virus attacks
5. How can one control the threat of user’s errors to data and information?
COMPUTER CRIMES
A computer crime is a deliberate theft or criminal destruction of computerized data.
The use of computer hardware, software, or data for illegal activities, e.g., stealing,
forgery, defrauding, etc.
Committing of illegal acts using a computer or against a computer system.
Types of computer crimes.
The following are the major types of computer crimes:
1. Trespass.
2. Hacking.
3. Tapping.
4. Cracking.
5. Piracy.
6. Fraud (Theft of money)
Sabotage.
Sabotage is the illegal or malicious destruction of the system, data or information by
employees or other people with grudges with the aim of crippling service delivery or
causing great loss to an organization.
Sabotage is usually carried out by discontented employees or those sent by competitors to
cause harm to the organization.
The following are some acts of saboteurs which can result in great damage to the
computer centres:
Using Magnets to mix up (mess up) codes on tapes.
Planting of bombs.
Cutting of communication lines.
Alteration.
Alteration is the illegal changing of stored data & information without permission with
the aim of gaining or misinforming the authorized users.
Alteration is usually done by those people who wish to hide the truth. It makes the data
irrelevant and unreliable.
Alteration may take place through the following ways:
a). Program alteration:
This is done by people with excellent programming skills. They do this out of
malice or they may liaise with others for selfish gains.
b). Alteration of data in a database:
This is normally done by authorized database users, e.g., one can adjust prices on
Invoices, increase prices on selling products, etc, and then pocket the surplus
amounts.
Security measures to prevent alteration:
i) Do not give data editing capabilities to anybody without vetting.
ii) The person altering the data may be forced to sign in order for the system to accept
altering the information.
Theft of computer time.
Employees may use the computers of an organization to do their own work, e.g., they
may produce publications for selling using the computers of the company.
Theft of data (i.e., commercial espionage).
Employees steal sensitive information or copy packages and sell them to outsiders or
competitors for profit.
This may lead to a leakage of important information, e.g., information on marketing
strategies used by the organization, research information, or medical reports.
Review Questions
1. (a) Define the term ‘Computer crime’.
Data encryption
Data being transmitted over a network faces the dangers of being tapped, listened to, or
copied to unauthorized destinations.
To protect such data, it is mixed up into a form that only the sender & the receiver can be
able to understand by reconstructing the original message from the mix. This is called
Data encryption.
The flow diagram below shows how a message can be encrypted and decrypted to
enhance security.
Log files
These are special system files that keep a record (log) of events on the use of the
computers and resources of the information system.
Each user is usually assigned a username & password or account. The information
system administrator can therefore easily track who accessed the system, when and what
they did on the system. This information can help monitor & track people who are likely
to violate system security policies.
Firewalls
A Firewall is a device or software system that filters the data & information exchanged
between different networks by enforcing the access control policy of the host network.
A firewall monitors & controls access to or from protected networks. People (remote
users) who do not have permission cannot access the network, and those within cannot
access sites outside the network restricted by firewalls.
LAWS GOVERNING PROTECTION OF INFORMATION
Laws have been developed that govern the handling of data & information in order to
ensure that there is ‘right of privacy’ for all people.
The following rules must be observed in order to keep within the law when working with
data and information.
1. Data & information should be kept secure against loss or exposure.
2. Data & information should not be kept longer than necessary.
3. Data & information should be accurate and up-to-date.
4. Data & information should be collected, used & kept for specified lawful purposes
(i.e., it should not be used for unlawful gain).
5. The owner of the data has a right to know what data is held by the person or
organization having it.
6. Data should not be transferred to other countries without the owner’s permission.
7. Do not collect irrelevant and overly too much information for a purpose.
Review Questions
1. What do the following control measures against computer crimes involve?
(i) Audit trail.
(ii) Data encryption.
(iii) Log files.
(iv) Firewalls.
2. Give four rules that must be observed to keep within the law when working with data
and information.
COMPUTER SECURITY
1). Fire.
Fire destroys data, information, software & hardware.
Security measures against fire:
Use fire-proof cabinets & lockable metal boxes for floppy disks.
Use of backups.
Install fire fighting equipments, e.g., fire extinguishers.
Have some detectors.
Training of fire-fighting officers.
Observe safety procedures, e.g., avoid smoking in the computer rooms.
Have well placed exit signs.
Contingency plans.
2). Water, floods & moisture.
This causes rusting of the metallic components of the computer.
Security measures against water, floods & moisture:
Set up computer rooms on higher grounds to avoid floods & humidity.
Avoid installing computer components in the basement.
There should be adequate drainage system.
Security measures:
Install facilities to control power fluctuations, e.g., use of Uninterrupted power
source (UPS)
Use power stabilizers.
Have standby power generators/sources.
Have lightening arresters in the building.
4). Excessive Heat or Temperature.
Excessive heat or temperature from the computer itself or from the surrounding
environment can destroy computer storage media or devices.
Security measures:
There should be efficient ventilation system.
Use a cooling system in the computer rooms, e.g., cooling fans & air conditioners.
5). Computer virus attack.
A virus is a rogue software program that spreads rampantly through computer
systems, destroying data or causing the system to break down.
Security measures against computer virus:
Make backup copies of software, and store the copies off-site.
Restrict access to programs & data on a ‘need-to-use’ basis.
Check all programs regularly for change of size, as this could be a sign of virus
infiltration.
Be careful with ‘Shareware’ and ‘Freeware’ programs, as they are the major entry
points for viruses.
Make sure all purchased software is in its original sealed-disk containers.
6). Smoke and Dust.
Dust and Smoke particles settle on storage devices and may scratch them during
Read/write operation.
Security measures:
Have dust mats or carpets to prevent entry of dust.
Fit the computer room with special Curtains to reduce entry of dust particles.
Cover the devices with Dust covers when cleaning the room.
Remove shoes before entering the room to prevent dust.
7). Terrorist attack.
This includes activities such as:
Review Questions
2. Computer viruses:
A computer virus destroys all the data files & programs in the computer memory by
interfering with the normal processes of the operating system.
Precautions against computer viruses:
a) Anti-virus software.
Use Antivirus software to detect & remove known viruses from infected files.
Some of the commonly used Antivirus software are: Dr. Solomon’s Toolkit,
Norton Antivirus, AVG Antivirus, PC-Cillin, etc
Review Questions
1. Describe two ways of preventing data loss due to power outage.
2. (a) What is a Computer virus?
(b) What are Anti-viruses? Explain how they detect and remove viruses.
3. Accidental erasure:
Commands such as DELETE & FORMAT can be dangerous to the computer if used
wrongly.
Both commands wipe out the information stored on the specified secondary storage
media, e.g., formatting the Hard disk (drive C:) will destroy all the software on that
system.
Precautions against Accidental erasure:
a) Use of Undelete utilities.
Use the Undelete facilities in case you accidentally delete your files.
There are two Undelete facilities depending on the operating system you are
using.
MS-DOS 6.0 Undelete facility:
To undelete at the DOS prompt, change to the drive & directory whose files
were deleted, then type, e.g.,
C:\>UNDELETE <directory that contain the deleted file>
A list of all deleted files will be displayed with the first letter missing. Type
in the first letter and the file will be recovered.
Norton utilities & PC Tools:
Norton utilities & PC Tools also have an undelete facility, which is similar to
the DOS Undelete facility.
LECTURER MR.JONAH K.NGETICH TEL:0720254951/0780254951 Page 85
COMP 111 Fundamentals of Computing
Review Questions
1. Name two commands that can erase the information from a disk.
2. Define ‘Data backup’ and state its importance.
5. Unauthorised access:
Unauthorised access refers to access to data & information without permission.
Computer criminals can do the following harms:
Steal large amounts of funds belonging to various companies by transferring them
out of their computer accounts illegally.
Steal or destroy data & information from companies, bringing their operations to a
standstill.
Spread destruction from one computer to another using virus programs. This can
cripple the entire system of computer networks.
Spread computer worm programs. Worm programs are less harmful in the
beginning, but render the computer almost useless in the long-run.
Precautions against Unauthorised access:
a) Restrict physical access.
Physical access to computer systems should be restricted to ensure that no
unauthorised person gets access to the system.
Some of the ways of restricting physical access include:
Locking of doors.
Use of personal identification cards.
Use of fingerprint identification.
Use of special voice-recorders. They analyse the voice of a trespasser &
checks against the database containing the voice patterns of valid users.
b) Password protection.
Install a password to restrict access to the computer system.
A Password is a secret code that can be used to prevent unauthorised access of
data in a computer.
Passwords can be put in at various levels:
At the point of switching on the computer – to restrict access to the computer.
On folders/directories – to restrict access to entire folders/directories.
On files – to restrict access to individual files within a directory.
On database systems – to restrict access to individual data elements.
When a valid password is entered, the user gets access to the computer system.
Usually, the user is allowed three (3) attempts to get the password correct. If an
invalid password is entered, access is denied after the 3 attempts.
Review Questions
1. State and discuss four causes of data loss in a computer system.
2. (a) Discuss two methods used to restrict unauthorised access to computer systems.
(b) What is a Password? Give its main importance.