0% found this document useful (0 votes)
73 views

Chapter 3-CPU

The document discusses the CPU and computer hardware architecture. It begins by defining the CPU as the central processing unit that processes instructions. It then describes the types of CPUs including single-core, dual-core, quad-core, etc. It discusses the Von Neumann architecture which stores both instructions and data in memory and fetches and executes instructions in order. The fetch-execute cycle is also summarized involving fetching instructions from memory, decoding them, and executing them. Key components like the control unit, ALU, registers, buses, and memory are defined.

Uploaded by

p8q4jkz4p5
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views

Chapter 3-CPU

The document discusses the CPU and computer hardware architecture. It begins by defining the CPU as the central processing unit that processes instructions. It then describes the types of CPUs including single-core, dual-core, quad-core, etc. It discusses the Von Neumann architecture which stores both instructions and data in memory and fetches and executes instructions in order. The fetch-execute cycle is also summarized involving fetching instructions from memory, decoding them, and executing them. Key components like the control unit, ALU, registers, buses, and memory are defined.

Uploaded by

p8q4jkz4p5
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Chapter 3 : Hardware- CPU

CPU : Central Processing Unit


• Stands for "Central Processing Unit."
• The CPU is the primary component of a computer that processes instructions.
• The CPU is a vital element that manages all the calculations and commands which are transferred to other components
of the computer and its peripherals.
• It runs the operating system and applications, constantly receiving input from the user or active software programs. It
processes the data and produces output, which may be stored by an application or displayed on the screen.

Types of CPU :
The major types of CPU are classified as : single-core, dual-core, Quad-core(4 processors) , Hexa core(6 processors),
Octa-core (8 processors), and Deca core (10 processors ) .
Single-core CPU
It is the oldest type of CPU which is available and employed in most of the personal and official computers.
The single-core CPU can execute only one command at a time and its not efficient in multi-tasking.

Dual Core CPU


Dual core is a CPU that has two distinct processors that work simultaneously in the same integrated circuit.
This type of processor can function as efficiently as a single processor but can perform operations up to twice as quickly.
It can process two instructions simultaneously which increase the performance.
Computer architecture :
is a set of rules stating how computer software and hardware are joined together and interact to make a
computer work

• Very early computers were fed data whilst the machines were actually running. They weren’t able to store
programs; consequently, they weren’t able to run without human intervention.
• In about 1945, John von Neumann developed the idea of a stored program computer, often referred to as the
VON NEUMANN ARCHITECTURE concept.How ?
• Instructions and data stored in the same/main memory (RAM/IAS)
• − Instructions fetched and executed in order (one after another )
• His idea was to hold programs and data in a memory. Data would then move between the memory unit and
the processor(CPU)
Von Neumann architecture
• In most computer systems, the CPU receives instructions and data from an input or memory.
• The instructions and data are processed by the CPU and the results are either sent to an output or transferred
to secondary storage.
• 'Architecture' is the design that enables the instructions and data to reach and be processed by the CPU
Von Neumann Architecture has three basic units:
1.The Central Processing Unit (CPU)
2.The Main Memory Unit
3.The Input/Output Device
CPU performs operations on data. It has 3 parts:
• Arithmetic Logic UNIT (ALU) : performs arithmetic (addition , subtraction,……)and logical operations.
• Control Unit : handles all processor control signals . It governs the flow (the transmission) of information (data and
instructions)through the system by issuing control signals to different components.
• Set of registers: are fast stand-alone storage locations that hold data temporarily. All data must
be represented in a register before it can be processed.

Main memory (address and content)


An address is the location of where data can be found in a computer memory. Each address in the memory is unique.
Content is A program (data & Instructions) should be stored in memory in order to get executed.

The Input/Output Device :It allows a computer to communicate/interact with the outside world
and store programs and data.
Connecting CPU ,memory , and I/O devices using BUSES

• A Bus is a subsystem that is used to connect computer components and transfer data
between them.
• Bus is made of several wires, each having a bit at a time

Types of buses :
Type of bus Description of bus Data/signal direction
Address bus carries signals relating to addresses between the processor and unidirectional(signals travel in
the memory one direction only)

Data bus sends data between the processor, the bi-directional (data can travel
memory unit and the input/output devices in both directions)
Control bus carries signals relating to the control and coordination of all Unidirectional and bi-directional;
activities within the computer (examples include: the read and it transmits command signals
write functions(bidirectional) , and interrupt from the CPU and response
signals(unidirectional)) signals from the hardware.
Control bus consist of various lines : read line , write line,
clock line(s) for timing/synchronizing , interrupts, resets etc.
Registers (are fast stand-alone storage locations that hold data temporarily) :
1.Accumulator: Stores temporarily the results of calculations made by ALU.
2.Program Counter (PC): Keeps track of the memory location of the next instructions to be
fetched /processed/executed . The PC then passes this next address to Memory Address
Register (MAR).
3.Memory Address Register (MAR): It stores the memory locations of instructions (that is
in use )that need to be fetched from memory or stored into memory.
4.Memory Data Register (MDR): It stores instructions (that is in use )fetched from memory
or any data that is to be transferred to, and stored in, memory.
5.Current Instruction Register (CIR): It stores the most recently fetched instructions while
it is waiting to be coded and executed.
Memory unit : The computer memory unit is made up of a number of partitions. Each partition consists of an ADDRESS and its
CONTENTS.
RAM/(immediate access store IAS): is the place where programs and data that is needed by processor are held; ready to be
fetched and decoded and executed by the CPU using data bus.
Example A word processing document that is being edited will be loaded into IAS.
Register : used to temporarily hold data and instruction during processing (example saves only the edited in the word processing
document).

Memory READ and WRITE operations :


The following steps have to be followed in a typical READ cycle:
1. Place the address of the location to be read on MAR .
2. Send the address through the address bus to the memory .
3. Activate the memory read control signal on the control bus.
4. Wait for the memory to retrieve the data from the address memory location through data bus.
5. Read the data from the data bus and place the content in MDR.
6. Drop the memory read control signal to terminate the read cycle.
The following steps have to be followed in a typical WRITE cycle:
1. Place the address of the location to be written on MAR
2. send the address of the location to be written to the memory through
address bus.
3. Place the data to be written in MDR
4. Send the data to the memory through data bus.
5. Activate the memory write control signal on the control bus.
6. Wait for the memory to store the data at the address location..
7. Drop the memory write control signal to terminate the write cycle.
0478/13/O/N/15
The fetch–execute cycle:
• The basic operation of a computer is called the ‘fetch-execute’ cycle.
• The CPU is designed to understand a set of instructions - the instruction set.
• The data and instruction(either from input device or from hard disk ) must saved first in RAM
• It fetches the instructions from the main memory(RAM) and executes them.
• This is done repeatedly from when the computer is turned on to when it is shut down.

The stages of the processing an instruction that are done by the CPU are :
• Fetch means : To load an instruction or piece of data from memory into a CPU register. All instructions must be
fetched before they can be executed.
• Decode means : a translation of the instruction to a form that will be understood by CPU, this stage will be
done by CU(control unit)
• Execute and execution are terms that describe the process of running a computer software, application or
program . For example, each time you open your Internet explorer , you are executing the program.
The fetch–decode- execute cycle

Fetch Stage :
1. The PC contains the address of the memory location of the next instruction which has to be fetched
2. This address is then copied from the PC to the MAR using address bus
3. The contents (instruction) at the memory(RAM) location (address) contained in MAR are then
copied temporarily into the MDR using data bus
4. The contents (instruction) of the MDR are then copied and placed into the CIR using data bus
5. The value in the PC is then incremented by 1 so that it now points to the next instruction which has
to be fetched
The fetch–decode- execute cycle

Decode Stage :
1. The instruction is finally decoded (translated ) by control unit
2. The CU has an Instruction set that contains all the commands in machine language (binary) that are
understood and can be processed by CPU
Execute stage :
3. The decoded instruction will be executed ( by control unit) by sending out signals (via the control
bus) to the various components of the computer system.
4. If mathematical and logical calculations are required the data will be sent to ALU unit , any interim
values (calculation results)will be saved in Accumulator(ACC)register
The Von Neumann model for a computer system uses several components in the fetch-execute cycle.

1. Control Unit (CU).


2. Arithmetic and logic unit (ALU)
3. Memory address register (MAR)
4. Memory data register (MDR)
5. Accumulator (ACC)
6. Immediate Access Store (IAS)
7. Main memory // RAM
8. Program counter (PC)
9. Current instruction register (CIR)
10. Address bus
11. Data bus
12. Control bus
13. Input device
14. Output device
15. Secondary storage device
The key elements of Von Neumann architecture are:
• Data and instructions are both stored as binary.
•Data and instructions (program ) are both stored in main memory
•The CPU fetches the data and instructions needed and stores them in Immediate access store IAS.
•The processor CPU (using registers) decodes and executes an instruction, before cycling around to fetch the next
instruction.
•Any calculations that are carried out on the data are done by Arithmetic and logical Unit ALU . During the
calculations , the data is temporarily held in the accumulator/ALU register .
•The cycle continues until no more instructions are available.
CPU : Central Processing Unit
An embedded system is a small computer that forms part of a larger system, device or machine. Its purpose is to control the
device and to allow a user to interact with it. They tend to have one, or a limited number of tasks that they can perform.
An embedded processor is a microprocessor designed especially for handling the needs of an embedded system.
Embedded systems require less power, so these processors are very small .
In an embedded systems, the main memory and CPU are just one component, whereas they are physically separate in a
non-embedded system. The programs used by an embedded device are also likely to be stored in__ ROM__ instead
of RAM. This means that an embedded system is likely to have more ROM than RAM and indeed, less likely to require
secondary storage.

Examples of embedded systems include:


• central heating systems
• engine management systems in vehicles
• appliances, such as dishwashers, TVs and digital phones
• digital watches
• electronic calculators
• GPS systems
• fitness trackers

Embedded systems can have advantages over general purpose computers in that:
CPU performance
There are factors about CPU architecture that affect its performance:
• cores
• clock speed
• cache size

1. Cores
• A CPU can contain one or more processing units. Each unit is called a core.
• A core contains an ALU, control unit and registers to perform fetch-decode-execute cycle and process an
instruction .
• It is common for computers to have two (dual), four (quad) or even more cores.
• So the CPU performs multiple Fetch-decode-execute cycle per time .
• CPUs with multiple cores have more power to run multiple programs and multitasking at the same time so
increase the performance of the CPU.

However, doubling the number of cores will not simply double a computer's speed. CPU cores have to communicate
with each other through channels and this uses up some of the extra speed.
CPU performance
2. Clock speed
• The clock speed - also known as clock rate - indicates how fast the CPU can run.
• This is measured in megahertz (MHz) or gigahertz (gHz)
• Corresponds with how many instruction cycles the CPU can deal with in a second.
• Ex. 2 gHz CPU performs two billion cycles a second.
• Disadv : A faster CPU uses more energy and creates more heat.
• Quad core doesn’t have double speed of dual core, because some time will be lost for coordinate between the
processors

3. Cache
• Cache is a small amount of memory which is a part of the CPU - closer to the CPU than RAM.
• It is used to temporarily hold instructions and data that the CPU is likely to reuse(used mostly).
• The CPU control unit automatically checks cache for instructions before requesting data from RAM(which is
faster .
• This saves fetching the instructions and data repeatedly from RAM .
• Transfers to and from cache take less time than transfers to and from RAM.
• The more cache there is, the more data can be stored closer to the CPU.

You might also like