2025-2026
Computer Science
Lecture 2
Components of Computer
Lecturer: Dr. Salwa Adel Alagha
Department of Electrical Engineering First Year / 2025-2026 By: Dr. Salwa Adel Alagha
Lecture 2
1. Memory:
A memory is just like a human brain. It is used to store data and instructions.
Computer memory is the storage space in computer where data is to be processed
and instructions required for processing are stored. The memory is divided into large
number of small parts called cells. Each location or cell has a unique address which
varies from zero to memory size minus one.
For example if computer has 64k words, then this memory unit has 64 *
1024=65536 memory locations. The address of these locations varies from 0 to
65535(65536-1)
Memory is a collection of storage registers used to transfer information in and
out of the unit. The actual work is done in (memory) and the finished result is stored
in (disk). The information stored in the memory as binary code in groups of bits
called word. The binary is two logic levels:
Logic)1(
Logic(0)
Capacity (memory size) is an important aspect of system performance; it is a
useful and convenient way to describe the size of memory. Most computer memory
sizes are described as a specific number of words. Computer memory sizes are:
2
Department of Electrical Engineering First Year / 2025-2026 By: Dr. Salwa Adel Alagha
Lecture 2
The memory is characterized on the basis of two key factors: capacity and
access time.
Capacity: is the amount of information (in bits) that a memory can store.
Access Time: is the time interval between the read/ write request and the
availability of data. The lesser the access time, the faster is the speed of memory.
2. Hierarchy of Memory:
The Internal Memory and External Memory are the two broad categories of
memory used in the computer. In general, referring to the computer memory usually
means the internal memory.
Internal Memory
The key features of internal memory are:
1. Limited storage capacity.
2. Temporary storage.
3. Fast access.
4. High cost.
Internal memory consists of:
Registers: are the fastest and the most expensive among all the memory types. The
registers are located inside the CPU, and are directly accessible by the CPU; the
speed of registers is between 1-2 ns (nanosecond). After CPU gets the data and
instructions, the data and instructions are moved to the registers for processing.
Cache memory: is placed between the CPU and the main memory (primary
memory), it improves the speed of the CPU but it is expensive; the speed of cache is
between 2-10 ns. When the CPU needs an instruction or data during processing, it
3
Department of Electrical Engineering First Year / 2025-2026 By: Dr. Salwa Adel Alagha
Lecture 2
first looks in the cache. Type of Cache Memory is divided into different levels that
are:
1. Level 1 (L1) cache or Primary Cache
2. Level 2 (L2) cache or Secondary Cache
3. Level 3 (L3) cache or Main Memory
Primary memory (Main memory): Primary memory is the main memory of
computer, it is a chip mounted on the motherboard of computer, relatively slower
than the cache memory (speed of RAM is around 60ns). Primary memory is
categorized into two main types: Random Access Memory (RAM) and Read Only
Memory (ROM).
1. RAM (Random Access Memory)
This memory called random because can read store data randomly at any time
and from any physical location. RAM is Volatile that only retains all the data as long
as the computer powered. RAM is used for the temporary storage of input data,
output data and intermediate results. The input data entered into the computer using
the input device, is stored in RAM for processing. After processing, the output data
is stored in RAM before being sent to the output device. Any intermediate results
generated during the processing of program are also stored in RAM. There are two
types of RAM:
1. Static RAM (SRAM)
2. Dynamic Random Access Memory (DRAM)
2. ROM (Read Access Memory)
ROM is the long-term internal memory. ROM is Non-Volatile Memory that
retains data without the flow of electricity. ROM comes with pre-written by the
computer manufacturer to hold the instructions for booting-up the computer. ROM
4
Department of Electrical Engineering First Year / 2025-2026 By: Dr. Salwa Adel Alagha
Lecture 2
is an essential chip with permanently written data or programs. The data once stored
in ROM either cannot be changed or can only be changed using some special
operations. Therefore, ROM is used to store the data that does not require a change.
There are types of ROM:
1. PROM (Programmable Read Only Memory)
2. EPROM (Erasable Programmable Read Only Memory)
3. EEPROM (Electrically Erasable Programmable Read Only Memory)
External Memory
The External Memory is also called the Secondary Memory or Storage Device.
Secondary memory stores much larger amounts of data and information. The data
and instructions stored in secondary memory must be fetched into RAM before
processing is done by CPU. There the different types of storage devices.
1. Floppy Disk: they are plastic square disks, usually
with a silver or black sliding piece going across the top.
These disks come in a variety of colors and they come
in two basic sizes 5¼ inch and 3½ inch. They are small
and inexpensive.
2. Hard Disk: is a fixed disk. The operating system is
stored on the hard disk. The disk is not removable from
the drive. Generally, PCs come with 250 GB hard disk.
Nowadays, hard disks are available that can store up to
4 TB of data. Nowadays, portable external hard disk
drive is available which can be attached to the USB
drive of the computer.
5
Department of Electrical Engineering First Year / 2025-2026 By: Dr. Salwa Adel Alagha
Lecture 2
3. CD + R Disk: Compact Disk Recordable: is a CD that, can
record on. It’s mostly used to record audio and once it’s
been written on, cannot rewrite or erase anything of it.
4. CD + RW Disk: Compact Disk Rewriteable: this disk
looks like a regular CD. The only difference is that, can
write on this disk and erase it as many times as want.
5. DVD – R Disc: Digital Video Recordable: These discs hold
the space of about 4.7 GB and are used to record movies on.
6. Flash: Flash memory is a non-volatile memory chip used
for storage and for transferring data between a personal
computer (PC) and digital devices. It is often found in USB
flash drives, MP3 players, and digital cameras.
7. Blu-ray Disk.
8. Smart Cards.
9. Storage Tapes.
10. Memory Sticks.
11. Smart Media.
12. Magnetic Tape.
6
Department of Electrical Engineering First Year / 2025-2026 By: Dr. Salwa Adel Alagha
Lecture 2
2. Central Processing Unit (CPU):
The Central Processing Unit (CPU) is an internal component of the computer,
is the brain of a computer system that carries out the instructions of a computer
program, to perform the basic arithmetical, logical, and input/output operations of
the system.
The CPU is sometimes called the processor, or in the personal computer field
called microprocessor. It is a single Integrated Circuit that contains all the
electronics needed to execute a program. The processor calculates (add, multiplies
and so on), performs logical operations (compares numbers and make decisions),
and controls the transfer of data among devices.
CPU is housed in a single silicon chip called a Microprocessor. Modern CPUs
are large scale integrated circuits in small and square rectangular packages, with
multiple metallic connecting pins. Pentium chip or processor, made by Intel, is the
most common CPU.
The processor acts as the controller of all actions or services provided by the
system. Processor actions are synchronized to its clock input. A clock signal consists
of clock cycles. The time to complete a clock cycle is called the clock period.
Normally, using the clock frequency to specify the clock. The clock frequency is
measured in Hertz, which represents one cycle/second. Hertz is abbreviated as Hz.
Usually, using mega Hertz (MHz) and Giga Hertz (GHz) as in 1.8 GHz Pentium.
A typical CPU has three major components:
1. Register Set.
2. Arithmetic Logic Unit (ALU).
3. Control Unit (CU).
7
Department of Electrical Engineering First Year / 2025-2026 By: Dr. Salwa Adel Alagha
Lecture 2
Arithmetic and Logic Unit (ALU)
ALU can also be subdivided into two sections namely, arithmetic unit and logic
unit. It is a complex digital circuit which consists of registers and which performs
arithmetic and logical operations. Arithmetic sections perform arithmetic
operations like addition, subtraction, multiplication, division etc. All other complex
operations can also be performed by repetition of these above basic operations.
The logic unit is responsible for performing logical operations such as
comparing, selecting, matching and merging of different data or information.
So basically ALU is the major part of the computer system which handles
different calculations. Depending on the design of ALU it makes the CPU more
powerful and efficient.
Control Unit
It is the unit which controls all the operations of the different units but does not
carry out any actual data processing operation. Control unit transfers data or
instruction among different units of a computer system. Control unit is the main
8
Department of Electrical Engineering First Year / 2025-2026 By: Dr. Salwa Adel Alagha
Lecture 2
coordinator since it sends signals and find the sequence of instructions to be
executed. It receives the instructions from the memory, interprets them and sends
the operation to various units as instructed.
Control unit is also responsible for communicating with all input and output
devices for transferring or receiving the instruction from the storage units.
3. Computer Ports:
Ports are the connections between external and internal input/output devices
such as keyboards, mice, mouse, Disk Drive, and many more with motherboards
using cables. That allows to communicate between external devices or peripherals
with a laptop or computer. There are two types of computer ports:
1. Internal Port: Internal ports are used to connect internal devices like disk drives,
CD drives, and other internal devices with the motherboard.
2. External Port: External ports are used to connect external devices modem,
mouse, printer, flash drives, etc. with the motherboard.
There are important types of ports:
3. Serial Port: A serial port is also called a communication port and they are
used for connection of external devices like a modem, mouse, or keyboard
(basically in older PCs). Send and receive one bit at a time via a single wire
pair. Serial cables are cheaper to make in comparison to parallel cables and
they are easier to shield from interference. There are two versions of the serial
port, the 9-pin serial port and the 25-pin serial port.
4. Parallel Port: Parallel ports are generally used for connecting scanners and
printers. It can send several bits at the same time as it uses parallel
9
Department of Electrical Engineering First Year / 2025-2026 By: Dr. Salwa Adel Alagha
Lecture 2
communication. Its data transfer speed is much higher in comparison with the
serial port. It is a 25-pin model.
USB (Universal Serial Bus) Infrared Port
PS/2 Port Game Port
VGA Port Modem Port
Sockets Digital Video Interface(DVI) Port
FireWire Port Ethernet Port
4. Personal Computer:
Personal Computer, often referred to as a PC or simply Computer. It is small,
inexpensive computer designed for an individual user. PC is based on the
microprocessor technology that enables manufacturers to put an entire CPU one
chip. It is typically used for tasks such as word processing, internet browsing, email,
multimedia playback, and gaming.
Personal computers first appeared in the late 1970s. Popular types of personal
computers are:
IBM compatible, Macintosh computers.
Toshiba, Asus, Acer, Apple, Dell Technologies, HP, Lenovo
10
Department of Electrical Engineering First Year / 2025-2026 By: Dr. Salwa Adel Alagha
Lecture 2
There are many types of PC:
Desktop: a personal computer made for regular
use in a single location, typically a desk. It features
a monitor, keyboard, mouse, speakers and often a
printer that are all connected to a computer tower ,
housing the power supply, motherboard and
processor.
Laptop: Laptop computers is small, portable
computer that can run on rechargeable battery as
well as mains power. A laptop integrates most of
the typical components of a desktop computer,
including a display, a keyboard, a pointing device
(a touchpad) and speakers into a single unit.
Tablet and Smartphone: portable touchscreen
devices that run on mobile operating systems.
Handheld Computer.
Wearable.
11