Lesson 2
Lesson 2
• Input Unit,
• Central Processing Unit
• Control Unit,
• Arithmetic Logical Unit,
• Output Unit,
• CPU Registers,
• Memory Unit
The input unit of a computer system refers
to the input hardware devices, which is the
hardware used to receive data from
humans. Input devices convert data by
humans into a form that is understandable
by computers.
Examples of input units are a mouse,
joystick, keyboard, scanner, etc.
It is also referred microprocessor, processing unit and
is considered as a brain of the computer system.
CPU takes logical decision and performs all arithmetic
computations important to execute the program on
the computer system.
CPU:
• works at the very high speed
• performs millions of calculations.
The processor is installed on the main printed circuit
board (PCB) called motherboard. It is protected from
heating or damaging by the cooling fan on the top of
it.
Main Printed Circuit Board that is connection circuit for the other internal components
in the computer case.
CPU
• has three functional units – ALU, CU, and MU.
• has cache memory (L1) that is CPU’s internal
memory,
• contains high speed memories that is called
registers,
• can be either single core or multi-cores,
• speed is measured with GHz (GigaHertz),
• needs to be compatible with memory and RAM,
• needs a heatsink to cool down
For understanding of CPU architecture we need to
firstly discuss how processor executes the program.
The OS (Operating System) load the program into
the main memory (RAM). The CPU executes the
programs by getting (fetching) the data and
program statements form the RAM (Read Access
Memory). According program instruction the CPU
operates in the data and stores the result in to
RAM. The OS send this data to the output devices
like monitors, printers.
• Arithmetic Logical Unit (ALU) – performs
all the arithmetic and logical jobs.
• Control Unit (CU) first decodes the
instructions of the program and directs
the ALU to operate on the data.
According to the OP Code (operation
Code) the ALU performs the desired
operation on the data (OPERAND).
• The memory unit in the CPU consists if
very high speed storage which is utilized
by the processor to store data during the
program executions.
The three functional units of the CPU together referred as core processors. Modern
latest generation processor consist of one or multiple cores depending on CPU
architecture. The single core processor can process only one instruction at a time. But,
the multi-core processor can do multiple instruction simultaneously.
The main function of the Computer memory unit is to store data. Computer m system
memory unit has several types of memory. These types of memory in computer system
are organized in a structured order to optimize system performance. We can divide the
memory types into two categories – Main memory, and Secondary memory.
The CPU executes the program at very high speed. Whereas the data transfer from the
main memory RAM to the CPU is relatively slow. And therefore? High speed cache
memory is placed between CPU and main memory RAM. The CPU stores the frequently
used data into the cache memory that can be accessed at high speed as to the RAM.
In computer architecture, the memory is divided into large number of memory blocks (cells). The
computer memory is linear and organized as a series of bits (8 bits = 1 byte). The single block of
memory = 1 Byte and represents a unique memory locations and unique memory address. The
computer memory is also organized as word addressable that is defined as a groups of bits like 8
bits, 16 bits, 32 bits. These bits transferred simultaneously between the CPU and main memory.
A software is a computer program or a group of programs created to perform
specific operations. A software can be written in any programming language
like C, Java, Python, R, Go or any other programming language. The computer
system essentially uses of two types of software – Application Software and
System Software.
The processor chip developing factories have to constantly innovate the new
technology and the microprocessor design in order to increase processor
performance. The instruction pipelining is a technique that help to utilize the
processing power of the CPU. The CPU repetitively performs the instruction
cycle to execute the program instruction.
There are 4 stages for instruction cycle – fetch, decode, execute, and store.
The pipelining techniques allows the processor to concurrently execute
different stages of the instruction cycle for the multiple instruction.
In the simple CPU, the instruction cycle is executed sequentially which is executed
one by one. This type of execution is referred as non-pipelined architecture.
In instruction pipeline architecture, the next instruction processing starts even
before the previous instruction has finished. This improves CPU performance.
In the CO and CA, the instruction set architecture is defined as a set of binary
commands supported by the processor chip. Each processor has a specific ISA.
The ISA defines the types of instructions to be supported by the processor.
Based on the type of operations they perform MIPS Instructions are classified into 3
types:
Arithmetic/Logic Instructions:
These Instructions perform various Arithmetic & Logical operations on one or
more operands.
• Data Transfer Instructions:
These instructions are responsible for the transfer of instructions from memory to
the processor registers and vice versa.
• Branch and Jump Instructions:
These instructions are responsible for breaking the sequential flow of instructions
and jumping to instructions at various other locations, this is necessary for the
implementation of functions and conditional statements.
The ISA forms instruction format for each type of instruction.
The ISA also defines the maximum length of each type of instruction. For
example the MIPS (Million Instruction Per Second) is 32 bits ISA and each
instruction accommodated within 32 bits.
There are three types of instruction format in MIPS ISA.
R – Instruction Format – Register Based Instruction Format,
I – Instruction Format – Immediate Instruction,
J – Instruction Format – Jump Instruction.
The CPU is responsible to execute program. The CPU can decode and execute
only machine instruction in the binary format. All computer programs written
in any high level programming language must be converted machine
language. This is called compilation stage.
The compiler converts the high level program instruction into low level
standard machine instruction in a specific format.
This format is known as “Instruction Format”
The addressing mode part of the machine instruction format allows to
specify whether the OPERAND value is a direct data or it is indirect data.
The addressing mode for the machine instruction specifies the rules for the
CPU while operating on the OPERAND.
Whereas, the interrupt signal generated by the program is called as software interrupt.
Software Interrupt is invoked by the use of INT instruction. This event immediately stops execution
of the program and passes execution over to the INT handler. The INT handler is usually a part of the
operating system and determines the action to be taken. It occurs when an application program
terminates or requests certain services from the operating system.
That is all!