9517 - ss2 Computer First Term Lesson Note
9517 - ss2 Computer First Term Lesson Note
WEEK
TOPIC
Introduction/Scheme of work
· The CPU
· Functions of:
· Register
3–4
Memory Unit
· Computer memory
· Types of memory
· Unit of storage
5
Logic Circuits I
6-7
Logic circuits II
8-9
10
REVISION
The Central Processing Unit (CPU) is the computer component that's responsible for
interpreting and executing most of the commands from the computer's other hardware and
software.
All sorts of devices use a CPU, including desktop, laptop, tablet computers, and
smartphones...even your flat-screen television set.
Intel and AMD are the two most popular CPU manufacturers for desktops, laptops, and servers,
while NVIDIA and Qualcomm are big smartphone and tablet CPU makers.
CPU has different names including processor, microprocessor or the “brain of the computer”.
A modern CPU is usually small and square, with short, rounded, metallic connectors on its
underside. Some have pins instead of metallic connectors.
The CPU attaches directly to a CPU ‘socket’ (or sometimes a ‘slot’) on the motherboard. The
CPU is inserted into the socket pin-side-down.
The clock speed of a processor is the number of instructions it can process in any given second,
measured in hertz (Hz). A CPU with a clock speed of 3.0 GHz can process 3 billion instructions
each /per second.
Some devices have a single-core processor while others may have a dual-core (or quad-core,
etc.) processor.
The components of the CPU work together to achieve its functions. The three components are:
2. Control Unit
3. Registers
· Executes logical operations (i.e. making comparison) such as AND, OR, XOR etc.
· Interprets instructions
Registers: Register are temporary storage location used to quickly accept, store, and transfer
data and instructions that are being used immediately by the CPU. They are special purpose
memory which resides within the CPU.
TOPIC TWO: COMPUTER MEMORY
Computer memory is the storage space in the computer where the data to be processed and
the instructions required for processing are stored.
Types of memory
PRIMARY MEMORY
Also known as the main memory is the storage in the computer in which data is stored for quick
access by the CPU and are connected via a memory bus. The primary memory is divided into
two:
The RAM is the volatile memory that temporarily stores data and instruction currently being
used by the computer. It is called volatile because the content of it disappears when the
computer is turned off or there is loss of power supply.
The ROM is the non-volatile memory that stores small program that the computer can use to
perform some of the basic operations required to initiate the boot process. The content of the
ROM are often times stored by the manufacturer of the system and always permanent. Since
the content of it can only be read, they are called Read Only. Have you ever seen the black/blue
background with some information during the booting process? That’s the content of the ROM
being displayed.
SECONDARY MEMORY
This is the permanent, non-volatile memory that is not directly accessed by the
computer/processor. Before the content of the secondary memory can be used by the
computer, it must be copied into the RAM. It has the capacity to store huge amount of data. The
secondary storage is the slowest and cheapest form of memory. Examples of secondary
storage include Hard Disk (Local Disk), Optical disk (CD, DVD), Floppy Disk, USB flash drive,
memory card etc.
Differences between primary and secondary memory
Primary
Secondary
Assignment 1:
1. Write the difference(s) between CD-R and CD-RW, DVD-R and DVD-RW
· Hard disk
· Floppy disk
· Magnetic tape
· Compact Disc
Unit of storage
The storage capacity is the amount of space available for the storage of data in a particular
storage media. The storage unit includes:
· Bits: a bit is a contraction of the word “binary digit” and is denoted with either 1 or 0. A bit
is the simplest unit of data storage.
· Nibble: a nibble is a collection of 4 bits
= 2048 bytes
b. 1024 bytes = 1 KB
1 byte = 1/1024 KB
= 2KB
Assignment 2:
· Petabyte
· Zettabyte
· Yottabyte
A logic gate is the fundamental building block of digital integrated circuits. Most logic gate
takes an input of two binary values, and output a single value of 1 or 0. Some circuits may have
only a few logic gates, while others, such as microprocessors, may have millions of them. Logic
gates are primarily implemented using diodes or transistors acting as electronic switches, but
can also be constructed using vacuum tube, fluidic logic, optics, molecules or even mechanical
elements.
Logic circuit includes such devices as registers, arithmetic logic units, and computer memory,
all the way up through complete microprocessors, which may contain more than 100 million
gates.
· OR gate
· AND gate
· NOT gate
1. OR gate: the OR gate is a circuit that has two or more inputs and operates in such a way
that:
X=A + B
The algebraic symbol of the AND gate is * or .. The AND gate is represented graphically below.
3. NOT gate: This is the logic gate that has one input and one output such that when the input
is true (1), the output is false and when the input is false, the output is true.
The truth table is the table that shows the possible combinations of variable values in the
equation and the result (output) for each of the logic gates.
For a two-input truth table, there will be 4 (22) possible combinations of variable inputs and
generally for n-input truth table, there will be 2n possible combinations of the input variables.
See the examples below:
1. OR gate: The algebraic equation (with two inputs A and B): x = A+B , is represented in the
truth table below
2. AND gate: The algebraic equation(with two inputs A and B) : x = A.B, is represented in the
table below
X = A.B
0
1
3. NOT gate: the truth table for the NOT gate (with input A): x= A’ or x= Ᾱ is shown below
X=Ᾱ
Assignment 3: An OR gate has 3 inputs and 1 output. Show the truth table for this OR gate.
1. NAND GATE
This is a logic gate whose output is zero (0) if both of the inputs are 1and 1 otherwise. A NAND
gate is equivalent to an AND gate followed by a NOT gate. The NAND gate is the complement of
the AND function. The word NAND is got from the abbreviation NOT-AND. The NAND gate is
represented graphically below.
A comparator is a circuit that compares two input voltages and indicates which is higher. One of
the special logic circuit that occurs quite often in digital system is the exclusive-OR (XOR)
circuits.
The XOR produces a high voltage when the two inputs are at opposite levels. This means that
the XOR yields true (1) if and only if one of the inputs is true (1) and the other is false (0). The
XOR gate is graphically represented below.
Register: the term register can be defined as a high-speed storage location in the Central
Processing Unit (CPU), which is used to hold data and addresses to be processed by the
computer. A register may hold a computer instruction, a storage address or any kind of data. A
register must be large enough to hold an instruction. For example, in a 32-bit instruction
computer, the register must be 32-bit wide.
Address: an address is a name, label or number that identifies a location where data or
information is stored within the computer memory. It is a particular location holding a word or a
byte. Computer memory is an array of storage boxes; each of these storage boxes is one byte in
length. Each box has an address (a unique number) to it.
Bus: In digital computing, a bus is a set of physical connections (cables, printed circuits etc.),
which can be shared by multiple hardware components in order to communicate with one
another. It is a transmission path on which signals are dropped off or picked up at every device
attached to the line.
The purpose of buses is to reduce the number of PATHWAYS needed for communication
between the components by carrying out all communication over a single data channel.
Internal (System) bus: the internal bus enables communication between internal components
such as the memory and the video card. It connects the CPU to the main memory. It is also
called Front Side Bus (FSB) or memory bus.
External/expansion bus: this bus is capable of communicating with the external components or
peripheral devices. These devices connect to the internal bus via a bridge implemented in the
processor chipset. It is also called input/output bus.
The lines or pins of a bus are of three types:
Address - the components pass memory addresses to one another over the address bus.
Control - used to send out signals to coordinate and manage the activities of the motherboard
components.
Data - transferred between peripherals, memory and the CPU. Obviously, the data bus can be a
very busy pathway.
This is the register that contains the data to be stored in the computer memory or the data
fetched from memory and ready to be processed by the CPU. It acts like a buffer and holds
anything that is copied from the memory ready for the processor to use it.
This is part of the CPU’s control unit that stores the instruction currently being executed or
decoded.
This is the CPU register that either stores the memory address from which data will be fetched
to the CPU or the address to which data will be sent and stored.
In other words, MAR holds the memory location of the data that need to be accessed. When
reading from memory, data addressed by MAR are fed into the MDR and then used by the CPU.
When writing to memory, the CPU writes data from MDR to the memory location whose address
is stored in MAR.
Register
Main memory
Registers are internal, i.e. they are located inside the processor
It is slow
FETCH-EXECUTE CYCLE
Most modern processors work on the FETCH-EXECUTE principle. It is based on the Von
Newman Architecture. When a set of instructions is to be executed, the instructions and data
are loaded in main memory. The address of the first instruction is copied into the program
counter. The execution of an instruction by a processor is divided in three parts. These parts are
fetching, decode and execute.
The program counter (PC) contains the address of the next instruction to be executed, so the
control unit goes to the address in memory specified in the PC, makes a copy of the contents
and places the copy in the Current Instruction Register (CIR).
The next step is for the CPU to interpret the instruction that has just been fetched and stored in
the CIR. The CPU is designed to understand specific set of commands called “instruction set”
of the CPU. Each make of CPU has a different instruction set.
The CPU decodes the instruction and prepares various areas within the chip in readiness of the
next step.
It may be that the instruction to be executed requires additional memory accesses in order to
complete its task. For example, if the instruction says to add the content of the memory to a
register, the control unit must get the content of the memory location.
Once an instruction has been decoded and any data fetched, the control unit is ready to execute
the instruction. If the instruction involves arithmetic operation or involves comparison, the ALU
is called upon to handle this and send the result to a special register (Accumulator) before being
moved to the memory.
The control unit increment the value in the program counter by 1 and the cycle begins again.
Bus speed: The term "bus speed" refers to how quickly the system bus can move data from one
computer component to the other. The faster the bus, the more data it can move within a given
amount of time. It is measured in Hertz.
Bus width: The size of a bus, known as its width, is important because it determines how much
data can be transmitted at one time. For example, a 16-bit bus can transmit 16 bits of data,
whereas a 32-bit bus can transmit 32 bits of data.