Ss2 Computer 1st Term
Ss2 Computer 1st Term
CPU is the hardware part of a computer that carries out the instruction of a computer program
by performing the basic arithmetic, logical and input/output operations of the system. CPU is
the brain of the computer where most operations, calculations and processes take place.
1. The arithmetic logic unit (ALU) – it performs arithmetic and logical operation. ALU
carries out arithmetic operations on integer (whole number) and real (with a decimal
point) operands.
2. The control unit (CU) – it extracts instruction from the computer memory, decodes
and executes them and also transferring them to the ALU when necessary. The CU
controls the fetching of instructions from the main memory and the subsequent
execution of these instructions.
Control unit Functions
1. The control unit directs the entire computer system to carry out stored program
instructions.
2. The control unit must communicate with both the arithmetic logic unit and main
memory.
3. The control unit uses the instruction contained in the Instruction Register to decide
which circuits need to be activated.
4. The control unit coordinates the activities of the other two units as well as all peripheral
and auxiliary storage devices linked to the computer.
5. The control unit instructs the arithmetic logic unit which arithmetic operations or
logical operations are to be performed.
6. The control unit is literally in control.
Functions of Arithmetic Logic Unit
1. The arithmetic logic unit executes arithmetic and logical operations.
2. Arithmetic operations include addition, subtraction, multiplication and division.
3. Logical operations compare numbers, letters and special characters.
4. Comparison operations test for three conditions: equal-to condition in which two values
are the same
5. less-than condition in which one value is smaller than the other
6. greater-than condition in which one value is larger than the other
7. Relational operations (=, <, >) are used to describe the comparison operations used by
the arithmetic logic unit.
8. The arithmetic logic unit performs logic functions such as AND, OR and NOT
RAM chips are relatively expensive ROM chips are relatively less expensive
RAM stores all the applications and data ROM usually stores instructions that are
when the computer is running required for booting the computer
Secondary Memory
This type of memory is a non-volatile memory. It is slower than the main memory. These are
used for storing data/Information permanently. CPU directly does not access these memories
instead they are accessed via input-output routines. Contents of secondary memories are first
transferred to the main memory, and then the CPU can access it.
Types of Secondary Memory
Secondary memory can be of the following types:
Magnetic: Data and information are stored and retrieved using magnetism
Examples
Magnetic disk
Magnetic tape
Hard disk
floppy disks
Optical: Optical storage devices employ light (laser beams) to store and retrieve data and
information
Examples
CD
VCD
DVD
Electronic: This holds data and information in the form of electric voltage
Example
Flash Memory
Others include Punch card
Secondary Storage Devices
1. Floppy Diskette
There are two standard sizes used these days which are 5 □((1 )/4) inches and 3 □(1/2) inches,
in size, commonly referred to as the mini-floppy and microfloppy. The capacity of 5 □((1 )/4)
inches floppy is 1.2 MB and that of 3 □(1/2) inches is 1.44 MB.
2. CD-ROM drives
They are of three types:
a. CD-ROM
CD-ROM stands for (Compact Disc Read Only Memory), and it is mainly used to mass
produce audio CDs and computer games. Computer users can only read data and music from
the discs, but they cannot burn their information onto the discs, from their personal
computers.
b. CD-R
CD-R (Compact Disc Recordable) also known as WORM (Write Once Read Many) is a
blank disc that users can put into a CD-ROM drive to burn or make a copy of their personal
data, music, videos and information. CD-Recordable discs are designed for one-time
recording only.
c. CD-RW
The CD-RW (Compact Disc Rewritable) can be erased and returned to its original blank
state. New files can then be copied onto the rewritable disk. CD-RW never became as
popular as the CD-R because they are not compatible with most disc players to listen to
music. They are primarily used to move data from one computer to another or to copy files
that are only needed a few times.
3. DVD (Digital Versatile Disk)
DVD is very similar to a CD but it has a much larger capacity. A standard DVD can hold 4.7
GB of data. DVDs are of the same types as CDs along with different formats as explained
about CDs.
4. Combo Drives
These drives combine the function of a DVD drive and a CD-RW drive.
5. Hard disk: Largest in capacity
Differences between Primary and Secondary Memory
Primary Memory Secondary Memory
These devices are temporary (Volatile) These devices are permanent (Non-volatile)
These devices are expensive These devices are cheaper
They have less storage capacity They have storage capacities
They are usually faster They are slower
Directly accessed by the CPU Not directly accessed by the CPU
2 MB to bits
Let the unknown bits be y
2MB = ybits
but 1MB = 8 × 1024 × 1024bits
1MB = 8388608bits
cross multiply
ybits × 1MB =2MB × 8388608bits
Divide both sides by 1MB
(ybits × 1MB)/(1MB) = (2MB × 8388608bits)/(1MB)
ybits=16777216bits
2MB = 16777216bits
1 1 1
OR Gate
An OR gate is a digital logic gate that gives an output of 1 when any of its inputs are 1,
otherwise 0.
Logic Symbol for OR Gate
Truth Table of the OR Gate
A NOT gate is often called an inverter. A NOT gate is slightly different because it has just
one input. It will give a high output if the input is low and vice versa.
Logic Symbol for NOT Gate
INPUT OUTPUT
A C
0 1
1 0
Logic Equations
Aside from representing the function of a logic gate with a truth table and grammatical
definition, the use of logic equations can be used to represent logic gates and circuits.
The AND gate Equation
The AND gate operation can be expressed by a Boolean algebra equation. For a 2-input AND
gate, the equation is:
X=A.B
The symbol for the AND operation is a centre dot (.). It does not mean multiplication. The
expression reads ‘X’ equal to A and B.
The OR Gate Equation
The OR gate operation can also be expressed by a Boolean algebra equation. For a 2-input
OR gate, the equation is:
X= A+B
The symbol for the OR operation is a +. It does not mean addition. The expression reads X
equal to A or B.
NOT Gate Equation
The NOT gate operation can also be expressed by a Boolean algebra equation
X= Ā
A complement bar (also called an over bar) is placed over the assigned input letter. The
expression reads ‘X’ is equal to not ‘A’.
The expression is the same as the AND gate with an over bar above the entire portion of the
equation representing the input. This equation reads X equals A and B NOT.
NOR Gate
The NOR gate is the combination of both OR gate and a NOT gate. It operates the same as an
OR gate, but the output will be the opposite.
Logic symbol for the NOR gate
XOR Equation
Or
Fetch-Execute Cycle
The fetch-execute cycle is the sequence the computer follows to transform data from one
format to another.
The steps in the processing cycle are as follows:
Fetch the next instruction: The program counter contains the address of the next instruction
to be executed; the control unit goes to the address in the memory specified in the program
counter, makes a copy of the contents and places the copy in the instruction register.
Decode the Instruction: To execute the instruction in the instruction register, the control unit
has to determine what the instruction is.
Get Data If Needed: It may be that the instruction to be executed requires additional
memory accesses to complete its task. If this is the case, the control unit must get the content
of the memory location.
Execute the Instruction: Once an instruction has been decoded and any data fetched, the
control unit is ready to execute the instruction. Execution involves sending signals to the
arithmetic/logic unit to carry out the processing. When the execution is complete, the cycle
begins again.
Fetch-Execute Cycle Flow Diagram
Factors Affecting the Speed of Data Transfer
i. The amount of RAM: The larger the size of the computer RAM the faster the speed of
data transfer and vice versa.
ii. The speed and generation of your CPU (the system clock): The speed of the computer
is measured in Hertz (Hz) which is the number of tasks it can process per second. A computer
with a specification 2GHz can process 2 billion tasks in one second. This implies that the
faster the speed of the computer the faster the speed of data transfer.
iii. The size of the Register on your CPU: The speed of data transfer will be faster if the
size of the register is also large and vice versa.
iv. The Bus width: The larger the width of a bus, the faster the number of bits that bus can
transmit at once.
v. The Bus speed: High bus speed will favour faster speed of data transfers
vi. The amount of Cache memory: Cache memory is a temporary memory that holds
frequently accessed data and instructions for faster and more efficient processing by the CPU.
The higher the size of cache memory the faster the speed of data transfer. The downside of
the cache memory is that it trades off capacity for speed.