Factors
Factors
org/what-are-the-functions-of-a-cpu/
ICT
NOTES
https://www.geeksforgeeks.org/what-are-the-functions-of-a-cpu/
COMPUTER HARDWARE
Main Parts of a computer
Computer components are divided into two major categories, which
are hardware and software. The difference between the two is that hardware components
can be seen and touched, but software components can only be seen; they cannot be
touched.
CPU
The central processing unit (CPU) is the primary component of any digital computer system,
consisting of the main memory, the control unit, and the arithmetic-logic unit.
It is the physical heart of the entire computer system.
The CPU in modern computers is housed on an integrated circuit chip known as a
microprocessor.
A microprocessor is a small electronic device that contains the arithmetic, logic, and control
circuitry required to perform the functions of a digital computer’s central processing unit. In
practice, this type of integrated circuit is capable of interpreting and executing program
instructions in addition to performing arithmetic operations.
The central processing unit’s control unit regulates and integrates the computer’s operations.
It selects and retrieves instructions from the main memory in the correct sequence and
interprets them so that the other functional elements of the system can perform their
respective operations at the appropriate time. All input data are transferred via main memory
to the arithmetic-logic unit for processing, which includes the four basic arithmetic functions
(addition, subtraction, multiplication, and division) as well as certain logic operations such as
data comparison and selection of the desired problem-solving procedure or a viable
alternative based on predetermined decision criteria.
Characteristics/Functions
It is in charge of controlling the transfer of data and instructions among the various
components of a computer.
It manages and coordinates all of the computer’s units.
It reads instructions from memory, interprets them, and directs the computer’s
operation.
It communicates with Input/Output devices to transfer data.
It neither processes nor stores data.
Arithmetic Logic Unit
This unit is divided into two subsections, namely,
Sections of Arithmetic and Logic
Arithmetic Unit
The arithmetic unit’s function is to perform arithmetic operations such as addition,
subtraction, multiplication, and division. All complex operations are carried out by repeatedly
performing the aforementioned operations.
Logic Unit
The logic unit’s function is to perform logic operations on data such as comparing, selecting,
matching, and merging.
The arithmetic logic unit (ALU) is responsible for the computer’s arithmetic and logical
functions. The input data is held in the A and B registers, and the result of the operation is
received in the accumulator. The instruction register stores the instruction that the ALU will
execute.
When adding two numbers, for example, one is placed in the A register and the other in the
B register. The addition is performed by the ALU, and the result is stored in the accumulator.
The data to be compared is placed into the input registers if the operation is logical. The
comparison result, a 1 or 0, is stored in the accumulator. The accumulator content is then
https://www.geeksforgeeks.org/what-are-the-functions-of-a-cpu/
placed into the cache location reserved by the program for the result, whether it is a logical
or arithmetic operation.
The ALU also performs another type of operation. The result is a memory address, which is
used to calculate a new memory location to begin loading instructions. The outcome is
stored in the instruction pointer register.
Instruction register and pointer
The instruction pointer identifies the memory location in which the CPU will execute the next
instruction. When the current instruction is completed, the CPU loads the next instruction
into the instruction register from the memory location specified by the instruction pointer.
Cache
The CPU never has direct access to RAM. Modern CPUs have one or more cache layers.
The CPU’s calculation speed is much faster than the RAM’s ability to feed data to the CPU.
Cache memory is faster than system RAM and, because it is located on the processor chip,
it is closer to the CPU. The cache stores data and instructions to keep the CPU from having
to wait for data to be retrieved from RAM. When the CPU requires data—and program
instructions are considered data—the cache checks to see if the data is already in residence
and returns it to the CPU.
If the requested data is not in the cache, it is retrieved from RAM and used to move more
data from RAM into the cache using predictive algorithms. The cache controller analyses the
requested data and attempts to predict what additional data from RAM will be required. It
loads the expected data into the cache. By storing some data closer to the CPU in a faster-
than-RAM cache, the CPU can stay busy and avoid wasting cycles waiting for data.
Computer Memory
Memory is designed for fast access and typically stores only the data and instructions that
are necessary for the currently running programs on a computer.
When input devices send binary data to a CPU, it immediately stores that data in memory to
make it easier to process.
Let's say we ask a computer to add 2 + 4. Here's what it will do:
Store 2 (0010) and 4 (0100) in memory
Use a circuit in the CPU to calculate the result
Store 6 (0110) in memory
Since the CPU is constantly using data from memory, they're connected via a memory bus,
a high-speed communication transfer system, typically made from wires, conductors, or
optical fibers.
Memory types
This type of memory, also called main memory or RAM (Random Access Memory), is only
used for temporary storage of data. When you restart a computer, it typically wipes the
memory entirely. Memory wouldn't be a good place to store data for later, like files and
programs.
Computers store long-term data in a different type of memory: external memory or
secondary storage, like a hard drive or USB drive.
RAM, ROM and Cache are the 3 main types of memory.
RAM stands for Random Access Memory and it only stores data temporarily, as soon as
your power is off, you will lose the data, but the advantage is that its speed is a lot faster
than external memory or ROM.
SRAM (static RAM) and DRAM (dynamic RAM) are the two main types of RAM.
When a SRAM unit is given a status (0/1), it will maintain this status until the power is off or
given a new status. But SRAM need 4-6 transistors to store a 1-bit data, so it costs a lot.
DRAM on the other hand, only needs 1 transistor to store the 1-bit, but you have to keep
refreshing in a certain period of time to keep the data, otherwise it will disappear. DRAM
keeps data for a short time, the speed is also slower, but it's cheap, and still faster than any
type of ROM. There are many types of DRAM too, but you can look it up yourself. (the most
used type is DDR RAM)
ROM stands for read-only memory, like its name, you can only read the data, once the data
is written in it won't change, and will be saved even if the power is off. It's usually a readable
chip integrated on a hardware and is written before putting the computer together to identify
and control hardware.
https://www.geeksforgeeks.org/what-are-the-functions-of-a-cpu/
EPROM, erasable programmable ROM, uses ultraviolet rays to erase data, one of the
common used ones.
EEPROM, electrically EPROM, doesn't need ultraviolet to erase, so the programming can be
done in the circuits, but with high price and slow writing.
Measurement of computer memory in terms of: bit, byte, KB, MB, GB, TB.
Input devices
Output devices
This are devices used to display information or data. They give output as either softcopy or
hardcopy. Softcopy output is that which can be seen, listened to, but not touched. Hardcopy output is
that which is given on a paper; it can be touched. Some examples of output devices include the
monitor, the printer and audio speakers.
Storage/Hard disk/SSD
What it is: All computers need somewhere to store their data. Modern computers either use
a Hard Disk Drive (HDD) or Solid State Drive (SSD).
What it does: HDDs are made of an actual disk onto which data is stored. The disk is read
by a mechanical arm. (HDDs are cheaper than SSDs, but are slowly becoming more and
more obsolete.)
SSDs (think SIM cards) have no moving parts and are faster than a hard drive, because no
time is spent waiting for a mechanical arm to find data on a physical location on the disk.
Peripheral devices
https://www.geeksforgeeks.org/what-are-the-functions-of-a-cpu/
Defragmenting files
Files that are broken or it takes long to read them will mean that the computer will have to
defragment them first. This will slow down the performance of the computer.
https://www.geeksforgeeks.org/what-are-the-functions-of-a-cpu/
OPERATING SYSTEM
Definition
An Operating System acts as a communication bridge (interface) between the user and
computer hardware. The purpose of an operating system is to provide a platform on which a
user can execute programs conveniently and efficiently.
An operating system is a piece of software that manages the allocation of Computer
Hardware. The coordination of the hardware must be appropriate to ensure the correct
working of the computer system and to prevent user programs from interfering with the
proper working of the system.
The main goal of the Operating System is to make the computer environment more
convenient to use and the Secondary goal is to use the resources most efficiently.
An operating system is a program that manages a computer’s hardware. It also provides a
basis for application programs and acts as an intermediary between the computer user and
computer hardware. The main task an operating system carries out is the allocation of
resources and services, such as the allocation of memory, devices, processors, and
information. The operating system also includes programs to manage these resources, such
as a traffic controller, a scheduler, a memory management module, I/O programs, and a file
system. The operating system simply provides an environment within which other programs
can do useful work.
An operating system manages the processor’s work by allocating various jobs to it and
ensuring that each process receives enough time from the processor to function properly.
Keeps track of the status of processes. The program which performs this task is known as a
traffic controller. Allocates the CPU that is a processor to a process. De-allocates processor
when a process is no longer required.
Device Management
An OS manages device communication via its respective drivers. It performs the following
activities for device management.
Keeps track of all devices connected to the system. Designates a program responsible for
every device known as the Input/Output controller.
Decide which process gets access to a certain device and for how long.
Allocates devices effectively and efficiently. Deallocates devices when they are no longer
required.
There are various input and output devices. An OS controls the working of these input-output
devices.
It receives the requests from these devices, performs a specific task, and communicates
back to the requesting process.
File Management
A file system is organized into directories for efficient or easy navigation and usage. These
directories may contain other directories and other files. An Operating System carries out the
following file management activities. It keeps track of where information is stored, user
access settings, the status of every file, and more. These facilities are collectively known as
the file system. An OS keeps track of information regarding the creation, deletion, transfer,
copy, and storage of files in an organized way. It also maintains the integrity of the data
stored in these files, including the file directory structure, by protecting against unauthorized
access.
Security
The operating system uses password protection to protect user data and similar other
techniques. it also prevents unauthorized access to programs and user data. The operating
system provides various techniques which assure the integrity and confidentiality of user
data. The following security measures are used to protect user data:
Operating systems also coordinate and assign interpreters, compilers, assemblers, and
other software to the various users of the computer systems. In simpler terms, think of the
operating system as the traffic cop of your computer. It directs and manages how different
software programs can share your computer’s resources without causing chaos. It ensures
that when you want to use a program, it runs smoothly without crashing or causing problems
for others. So, it’s like the friendly officer ensuring a smooth flow of traffic on a busy road,
making sure everyone gets where they need to go without any accidents or jams.