Computer Science Ss 2 1st Term Reviewd
Computer Science Ss 2 1st Term Reviewd
Computer Science Ss 2 1st Term Reviewd
The Central Processing Unit (CPU): Is the portion of a computer system that executes the
instructions of a computer program, and is the primary element carrying out the functions of the
computer or other processing device. The Central Processing Unit carries out each instruction of the
program in sequence, perform the basic arithmetical, logical, and input/output operations of the
system.
Also, the Central Processing Unit (CPU) is the part of a computer that thinks, calculates and carries
out instruction. It is also called the brain of the computer. It is sometimes called the Central
Processor or simply the Processor.
A computer can have more than one CPU; this is called multiprocessing. CPU can be found in the
motherboard. All the functions of the CPU are stored in a component called the chip.
COMPONENTS OF CPU
CPU consists of two main units namely;
Arithmetic Logic Unit
Control Unit
Sub-Topic 2: ARITHMETIC LOGIC UNIT
3
The ALU is a digital circuit that performs arithmetic and logical operations. The ALU is a fundamental
building block of the CPU of a computer.
CONTROL UNIT
The control unit is an important component of the CPU. It contains circuitry that uses electrical
signals to direct the entire computer system to carry out stored program instructions. The control
unit does not execute program instructions; rather, it directs other parts of the system to do so. The
control unit must communicate with both the arithmetic/logic unit and memory. It also maintains the
order of traffic and data in the computer system.
The computer memory is the storage locations where data, programs and information are stored
electronically, which can be recalled, erased or changed. Memory can also be defined as the work
area in the computer where data can be held, copied and retrieved.
Other terms used for memory are main memory, main storage, primary storage, internal memory,
and core storage.
There are two main types of memory, these are;
(i) Primary Storage/ main memory
(ii) Secondary Storage / Auxiliary memory
PRIMARY MEMORY
Primary storage is called ‘primary’ because it is the main memory that is accessible to the CPU. It
represents the core or internal storage areas of the computer system. It is used to store data that are
currently being used; for this reason, the main memory is also called Immediate Access Storage
(IAS).
The two types of primary storage are:
Read Only Memory (ROM)
Random Access Memory (RAM)
Random Access memory (RAM) is a type of memory chip used in primary storage memory. The CPU
continuously reads instructions stored there and executes them as required. Any data actively
operated on is also stored there in uniform manner. It is also a temporary storage, holding software
instructions and short-term working memory for the processor. It allows data which is stored to be
accessed in any order, which is why it is called random. It determines the speed of processing of the
computer. Also, RAM is volatile; which means when the computer loses power, the content is lost.
There are two variations of RAM, these are;
SRAM: Means Static Read Only Memory; In this type of memory the data is stored in cell of
transistors and capacitors and the data has to be refreshed every few milliseconds.
DRAM: Means Dynamic Read Only Memory; This does not require periodical refresh. SRAM is
faster than DRAM but it is more expensive as compared to DRAM.
FLOPPY DISK
6
Floppy disk is a soft magnetic disk. It is called floppy because it flops if you wave it. Floppy disk, also
called diskette, are portable because you can remove them from a disk drive. The medium used to
access floppy disks are known as ‘Floppy Disk Drives’.
Floppy disks are slower to access than hard disk and have less storage capacity. Floppies come in
three basic sizes; 8-inch, 5.25 inches with a capacity of 1.2MB and 3.5 inch with a capacity of 1.44MB.
HARD DISK
This is a magnetic disk on which computer data can be stored. The term hard is used to distinguish it
from soft, or floppy disk. It has the capability to store more data and is faster than floppy disks in
terms of access time.
There are two types of hard disks:
The internal hard disk installed inside the computer
The external hard disk usually connected to the computer
FLASH DRIVE
A Flash drive is a high data storage device that is made up of flash memory and an integrated
Universal Serial Bus (USB) interface, with a storage capacity ranging from 64MB to over 8GB. The
device is connected to the computer through the USB port.
7
COMPACT DISK
The Compact Disc (CD) is an optical disk used to store and backup digital data. It is less vulnerable to
damages or dirt compared to floppy disk. They are generally of two types:
CD-R meaning CD Recordable. Data on this type of disk can be written only once, after that
the data on disk becomes permanent, i.e it can neither be erased and no newer data can be
written on this disk.
CD-RW meaning CD Rewritable. You can record the
Nibble
Byte
Kilobyte (KB)
Megabyte (MB)
Gigabyte (GB)
Terabyte (TB)
Word
BIT:
This refers to the smallest basic unit of information that can be stored on a machine. A bit (binary
digit) is the basic unit of information in computing and telecommunications. It exists in one of two
possible distinct states (0 or 1). These may be the two stable states of a flip flop, two positions of an
electrical switch, two distinct voltage or current levels allowed by a circuit, etc.
NIBBLE:
In computing, a nibble is a four-bit aggregation, or half a byte. The nibble is used to describe the
amount of memory used to store a digit of a number stored in packed decimal within an IBM
mainframe. This technique is used to make computations faster and debugging faster.
BYTE:
A byte is a unit of measurement of information storage that equals 8bits. It can be used to represent
letters and numbers, for example, the number 01000001 is 8bits long and represents the letter A in
ASCII. It is equivalent to 2nibbles. The size of computer memory is determined by bytes.
KILOBYTE (KB):
A kilobyte (KB) is a unit of data that equals 1024bytes. Although the prefix kilo- means 1000, the term
kilobyte and symbol been used to refer to either 1024 (2 10) bytes in the fields of computer science
and information technology.
MEGABYTE (MB):
A megabyte is 1024KB, that is, the kilobyte squared or 1024 2 bytes. The Megabyte is a multiple of the
unit byte for digital information storage or transmission. It is commonly abbreviated as MB.
GIGABYTE (GB):
A Gigabyte is a unit of data storage worth a billion bytes. It is equal to 1024 megabytes (1024 3). The
unit symbol for gigabyte is GB.
TERABYTE (TB):
A terabyte is equivalent to 1024 gigabytes (1024 4) and is defined as about one trillion bytes. The
prefix tera means 1012 in the International System of Units, which equals 1,099,511,627,776 bytes
WORD:
A word represents 2bytes, which is equivalent to 16bits and 4nibbles.
Floppy Disk Portable Small storage Slow speed Magnetic tape technology
space
Hard Disk Not as Portable Enormous Slow as compared Magnetic tape technology
as others storage space to main memory
Digital Versatile Disk Portable Extremely High speed Optical disk technology
large storage
Logic gates are primarily implemented using diodes or transistors acting as electronic switches, but
can also be constructed using electromagnetic relays (relay logic), fluidic logic, pneumatic
logic, optics, molecules, or even mechanical elements. With amplification, logic gates can be
cascaded in the same way that Boolean functions can be composed, allowing the construction of a
physical model of all of Boolean logic, and therefore, all of the algorithms and mathematics that can
be described with Boolean logic.
Logic circuits include such devices as multiplexers, registers, arithmetic logic units (ALUs),
and computer memory, all the way up through complete microprocessors, which may contain more
than 100 million gates. In practice, the gates are made from field-effect transistors (FETs),
particularly MOSFETs (metal–oxide–semiconductor field-effect transistors).
A logic gate is an electronic device that makes decisions based on the different combinations of
digital signals present on its inputs.
It is a logical circuit device in computer, having one output channel and one or more input channels,
which gives signal only when specific input conditions are met.
In logic diagrams, gates are represented by symbols. Inputs and output signals are represented with
arrow lines having labels.
12
The ‘NOT’ Gate: The ‘NOT’ gate is the most basic of all the logic gates and is sometimes referred to as
an inverting buffer or simply a digital inverter. This gate accepts a single input and brings out the
negative of its input as output. That is it inverts its input signal as output. I.e. if its input is 0, output
will be 1, and if its output is 0 it means input will be 1. Or true= false and false =true.
The ‘NOT’ gate accepts only one input signal.
Truth Table for ‘NOT’ gate
INPUT (A) OUTPUT (A)
1 0
0 1
The ‘AND’ Gate: Unlike the ‘NOT’ gate, the ‘AND’ gate accepts only one two inputs signals and bring
out one output signal. Hence there are two signal lines.
It is a logic circuit, used in computers that produce a high voltage signal as output if its two inputs
carry a high voltage; otherwise it produces a low voltage output if any of its input is low.
The ‘OR’ Gate: This is a logic circuit used in computers, that gives a high voltage output if all or one of
its input carries a high voltage, and a low voltage output if all or one of its input carries a low voltage.
The ‘OR’ gate also accepts two inputs.
Truth Table of ‘OR’ Gate
INPUT (A) INPUT (B) OUTPUT (Q)
1 1 1
1 0 1
0 1 1
0 0 0
13
WEEK: 6
CLASS: SS 2
SUBJECT: COMPUTER SCIENCE
The logic NAND gate is a combination of the digital logic AND gate with that of an inverter, or NOT
gate connected together in series. The NAND (Not AND) gate has an output that is normally at logic
level “1” and only goes “LOW” to logic level “0” when ALL of its inputs are at logic level “1”. It is the
reverse of the ‘complementary’ form of AND gate.
The Boolean expression for a logic NAND gate, is denoted by a single dot or full stop symbol (.) with a
line or overline (-) over the expression to signify the NOT or logical negation of the NAND gate, giving
us the Boolean expression of A.B=Q.
Inputs Output
Shows invasion
Inputs Output
The logic NOR or inclusive NOR gate is a combination of the digital logic OR gate with that of an
inverter or NOT gate connected together in series. The NOT (Not OR) gate has an output that is
normally at logic “1” and only goes “LOW” to level of “0” when ANY of its inputs are at logic level “1”.
The logic NOR gate is the reverse or “complementary” from of the OR gate.
The Boolean expression for a logic NOR gate is denoted by a plus sign (+) with a line or overline (-)
over the expression to signify the NOT or logical negation of NOT gate giving us the Boolean
expression of A+B=Q
Symbol of NOR Logic gate
A.
INPUTS OUTPUT
Shows inversion
B.
INPUTS OUTPUT
1 1 1 0
1 0 0 1
0 1 0 1
0 0 0 1
1 1 1 0
1 0 1 0
0 1 1 0
0 0 0 1
There are many ways in which data is converted within the computer environment. This may be seamless, as
in the case of upgrading to a newer version of a computer program.
REGISTER
These are temporary storage areas for instructions or data. They are not part of memory; rather they are
special additional storage locations that offer the advantage of speed. Register work under the direction of the
control unit to accept, hold and transfer instruction or data and perform arithmetic or logical comparisons at
high speed.
Most operations are done on registers; the processor can’t directly perform arithmetic in memory for
example. If you want to add 1 to a memory location, the processor will normally do this by loading the initial
value from memory into a register, adding 1 to the register, and then saving the value back to memory.
MEMORY ADDRESS
This is an identifier for a memory location, at which a computer program or a hardware device can store data
and later retrieve it. Each memory location, in both ROM and RAM, holds a binary number and only depends
on the context of the instructions which retrieve and manipulate it.
BUS
The buses are media that connect the microprocessor (CPU) to each of the RAM, ROM, and input/output (I/0).
Through the buses, information transfer takes place between the CPU and the I/O devices.
TYPES OF REGISTERS
Registers are normally measured by the number of bits they can hold, e.g “8-bit register” to “32-bit register”.
MDR is a two-way register.MDR is half of a minimal interface between a micro-program and computer
storage, the other half is a memory address register.
Others are:
i. User-accessible Register
ii. Data Register
iii. Address Register
iv. Conditional Register
v. General Purpose Register (GPRs)
vi. Floating Point Register (FPRs)
vii. Constant Register
viii. Vector Register
ix. Special Purpose Registers
18
Memory or RAM: Is located external to the CPU. Generally speaking, data has to be loaded into a CPU register
from memory before the CPU can process it.
RAM is much slower than registers, there is a lot more RAM than registers, and generally memory can be
addressed on byte boundaries, where register may not be able to access all the bytes in a register.
Summarily, registers are temporary storage in CPU while RAM holds the program instructions and the data the
program requires.
EVALUATION
1. Simply state how computer read and write information.
The bus refers to the paths between the components of a computer. The data bus and the address bus are
two main buses in a computer which are located on the motherboard.
The performance of computer buses was measured by the number of bits they could transfer at one time.
Hence, the newest 64-bit buses are typically considered the fastest available. This type of performance is
usually measured in megabits per second (Mbps) or megabytes per second (MBps).
BUS WIDTH
A bus is a channel over which information flows. The wider the bus, the more information can flow over the
channel, much as a wider highway can carry more cars than a narrow one.
The original ISA bus on the IBM PC was 8 bit wide; the universal ISA bus used now is 16 bits. The other I/O
buses including VL-Bus (VLB) and peripheral component interconnect (PCI) are 32 bits wide. The memory and
processor buses on Pentium and higher PCs are 64 bits wide.