0% found this document useful (0 votes)
10 views34 pages

Lecture 20,21 (19CS) CPU

Uploaded by

zawars0005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views34 pages

Lecture 20,21 (19CS) CPU

Uploaded by

zawars0005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 34

Lecture: 20-21

Computer Fundamentals

Central Processing Unit


Components, Working, Functions, Clock & Instruction
Cycle, Single & Multi-Core Processor

1
Conten
ts
• What is CPU?
• Components of CPU
• Working of CPU
• Functions of CPU
• Bus
• Clock Cycle
• Instruction Cycle
• Instruction Set
• Single-Core and Multi-Core Processor

2
Central Processing Unit

• CPU stands for Central Processing Unit.


• Also called as processor or microprocessor.
• It is like brain of the computer system.
• It executes instructions stored in memory.
• It executes one instruction at a time.
• It is made up of millions of transistors.
• The size of microprocessor is almost equal to human thumb nail.

3
Central Processing Unit
• It implements VLSI (Very Large Scale Integration) and ULSI (Ultra
Large Scale Integration)
• Microprocessor is housed on a chip called as microprocessor chip.
• The CPU is a tiny silicon chip that acts as the brains of a computer
system.
• The chip contains switches and pathways that the CPU turns on and
off according to instructions from computer programs.
• The system clock is an electronic pulse that controls the speed of
the CPU.
• The rate of the pulse is measured in megahertz (MHz).
4
MAJOR COMPONENTS OF CPU
• Storage Components:
• Registers
• Flip-flops

• Execution (Processing) Components:


• Arithmetic Logic Unit (ALU):
• Arithmetic calculations, Logical computations, Shifts/Rotates

• Transfer Components:
• Bus

• Control Components:
• Control Unit

5
• A group of flip-flop is known as a Register. The n-bit register will
consist of n number of flip-flop and it is capable of storing an n-bit
word. The binary data in a register can be moved within
the register from one flip-flop to another. The registers that allow
such data transfers are called as shift registers.

6
Block Diagram

7
MAJOR COMPONENTS OF CPU
• Central processing unit (CPU)
• A hardware component that performs computing functions utilizing the ALU,
control unit, and registers.
• Arithmetic/logic unit (ALU)
• Performs mathematical calculations and makes logical comparisons.
• It performs both bitwise and mathematical operations on binary numbers and is
the last component to perform calculations in the processor. The ALU uses
operands and code that tells it which operations to perform for input data. After
the information is processed by the ALU, it's sent to the computer's memory.
• In some computer processors, the ALU is divided into an AU and LU. The AU
performs the arithmetic operations, and the LU performs the logical operations.

8
MAJOR COMPONENTS OF CPU
• Control unit
• Sequentially accesses program instructions, decodes them, coordinates flow of
data in/out of ALU, registers, primary and secondary storage, and various output
devices
• This section coordinates all activity within the CPU. It uses programming
instructions to control what actions the CPU performs and when it performs them.
• A control unit or CU is circuitry that directs operations within a computer's
processor. It lets the computer's logic unit, memory, as well as both input and
output devices know how to respond to instructions received from a program.
• Registers
• High-speed storage areas used to temporarily hold small units of program
instructions and data immediately before, during, and after execution by the CPU
• Primary storage
• Holds program instructions and data (a.k.a. main memory)

9
MAJOR COMPONENTS OF CPU

10
Communicating with the CPU
• The control unit reads and interprets program instructions and then changes it into
machine language that the CPU can understand.
• Data is stored in a computer in binary format as a series of 1s and 0s. Every 1 or 0 is a
bit of information.
• Computers use standardized coding systems (such as ASCII) to determine what
character or number is represented by what series of binary digits.
• The ASCII code is a standard code used to represent the alphabet, numbers,
symbols, and punctuation marks.
• Data is stored in a series of 8-bit combinations called a byte. Every character, such as
a letter, number, or punctuation mark, is a byte created from a unique combination
of ones and zeros.

11
Functions of CPU
• The Four Primary Functions of the CPU
• The CPU processes instructions it receives in the process of decoding data. In processing this
data, the CPU performs four basic steps:
• Fetch: Each instruction is stored in memory and has its own address. The processor takes this
address number from the program counter, which is responsible for tracking which
instructions the CPU should execute next.
• Decode: All programs to be executed are translated to into Assembly instructions. Assembly
code must be decoded into binary instructions, which are understandable to your CPU. This
step is called decoding.
• Execute: While executing instructions the CPU can do one of three things: Do calculations
with its ALU, move data from one memory location to another, or jump to a different address.
• Store: The CPU must give feedback after executing an instruction, and the output data is
written to the memory.

12
Functions of CPU (Summary)
• Fetch - Retrieve an instruction from the memory.
• Decode - Translate the retrieved instruction into a series of computer
commands.
• Execute - Execute the computer commands.
• Store - Send and write the results back in memory.

13
Basic Terms
• Pipelining
• A CPU operation in which multiple execution phases are performed in a single machine cycle.
Pipelining allows another instruction to start executing before the last one finished.
• Bus
• Physical wiring connecting computer components
• Bus width
• Number of bits a bus can transfer at one time
• Clock speed
• Predetermined rate a CPU produces a series of electronic pulses.
• When referring to a computer processor or CPU, GHz is a clock frequency, also known as
a clock rate or clock speed, representing a cycle of time.
• "Hz" is an abbreviation of Hertz, and "k" represents Kilo (thousand), "M" represents Mega
(million), and "G" represents Giga (thousand million).
• The first computers processors (CPU's) operated in kHz. Later processors operated in MHz.
• Today's processors operate in the GHz range.

14
BUS
• A collection of wires through which data is transmitted from one part of a
computer to another. You can think of a bus as a highway on which data
travels within a computer.
• When used in reference to personal computers, the term bus usually refers
to internal bus. This is a bus that connects all the internal computer
components to the CPU and main memory.
• There's also an expansion bus that enables expansion boards to access the
CPU and memory.
• All buses consist of two parts -- an address bus and a data bus.
• The data bus transfers actual data whereas the address bus transfers
information about where the data should go.
15
BUS
• 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.
• Every bus has a clock speed measured in MHz. A fast bus allows data
to be transferred faster, which makes applications run faster.

16
Clock Cycle
• The speed of a computer processor, or CPU, is determined by the clock cycle, which is
the amount of time between two pulses of an oscillator.
• The higher number of pulses per second, the faster the computer processor will be
able to process information.
• The clock speed is measured in Hz, typically either megahertz (MHz) or gigahertz (GHz
).
• For example, a 4GHz processor performs 4,000,000,000 clock cycles per second.
• Computer processors can execute one or more instructions per clock cycle, depending
on the type of processor.
• Early computer processors and slower processors can only execute one instruction
per clock cycle, but faster, more advanced processors can execute multiple
instructions per clock cycle, processing data more efficiently.

17
Units
• 1KHz= 1000Hz
• 1MHz= 1,000,000 Hz (One Million)
• 1GHz= 1,000,000,000 Hz (One Thousand Millions)

18
Instruction Cycle
• The Steps required by CPU to fetch and execute an Instruction is called a Instruction Cycle.
• The sequence of operations that the CPU has to carry out while execution is called
instruction cycle.

• 1:- Read an Instruction


• 2:- Decode the instruction
• 3:- Find the address of operand
• 4:- retrieve an operand
• 5:- perform desired operation
• 6:- find the address of destination
• 7:- store the result into the destination

19
The Instruction Cycle and the
Execution Cycle in RAM

20
The Instruction Cycle and the
Execution Cycle in RAM

1. The steps in the basic cycle involved in processing a


program statement in RAM are shown at left in the
figure. This process is called the instruction cycle since it
must be performed for every instruction to be executed.
2. The amount of time required to complete the instruction
cycle is referred to as the execution cycle, shown at right
in the figure.

21
The Instruction Cycle and the
Execution Cycle in RAM

22
Instruction Set
• The instruction set is part of a computer that pertains to programming, which is
basically machine language.
• The instruction set provides commands to the processor, to tell it what it needs to
do.
• The instruction set consists of addressing modes, instructions, native data types,
registers, memory architecture, interrupt, and exception handling, and external I/O.

• Examples of instruction set


• ADD - Add two numbers together.
• COMPARE - Compare numbers.
• IN - Input information from a device, e.g., keyboard.
• OUT - Output information to device, e.g., monitor.
• STORE - Store information to RAM.
23
Instruction Set
• Complex instruction set computing (CISC)
• A computer chip design that places as many microcode instructions into the central
processor as possible.
• CISC is currently the standard in the majority of PCs today that supports as many as two
hundred instructions.
• CISC chips use many techniques formerly associated only with RISC chips.

• Reduced instruction set computing (RISC)


• RISC is a processor architecture that requires less instructions to operate, causing the
processors to be faster than earlier CISC processors.
• Today, RISC and CISC processors share many of the same instruction techniques and
operate at similar speeds.
• A computer chip design based on reducing the number of microcode instructions built
into a chip to an essential set of common microcode instructions.

24
CISC V/S RISC

25
Core
• A core, or CPU core, is the "brain" of a CPU. It receives instructions,
and performs calculations, or operations, to satisfy those instructions.
A CPU can have multiple cores.
• A processor with two cores is called a dual-core processor; with four
cores, a quad-core; six cores, hexa-core; eight cores, octa-core.
• As of 2019, the majority of consumer CPUs feature between two and
twelve cores. Workstation and server CPUs may feature as many as 48.
• Each core of a CPU can perform operations separately from the others.
Or, multiple cores may work together to perform parallel operations on
a shared set of data in the CPU's memory cache.

26
Core
• A multi-core processor is a computer processor integrated circuit with
two or more separate processing units, called cores, each of which
reads and executes program instructions, as if the computer had
several processors.
• The instructions are ordinary CPU instructions (such as add, move
data, and branch) but the single processor can run instructions on
separate cores at the same time, increasing overall speed for
programs that support multithreading or other parallel computing
techniques.

27
Example
• An Intel Core 2 Duo E6750 dual-core processor.

28
Single-Core v/s Multiple-Core
• A single-core processor is a microprocessor with a single core on a chip,
running a single thread at any one time. The term became common after the
emergence of multi-core processors (which have several
independent processors on a single chip) to distinguish non-multi-
core designs.
• The benefit of having multiple cores is that the system can handle more than
one thread simultaneously. Each core can handle a separate stream of data.
This architecture greatly increases the performance of a system that is
running concurrent applications
• A CPU can contain one or more processing units. ... CPUs with
multiple cores have more power to run multiple programs at the same time.

29
Multithreading
• In computer science, a thread of execution is the smallest sequence
of programmed instructions that can be managed independently by a
scheduler, which is typically a part of the operating system.

30
How to check processor type
and speed on Windows?
• If you are running Microsoft Windows, you can determine the
processor type and speed by pressing the Windows Key and
Pause key at the same time. Doing so opens a System window similar
to one of the examples below.

• In this window, you should see the manufacturer of the processor


(e.g., Intel or AMD), the model of the processor (e.g., Core 2), and the
speed (e.g., 1.86 GHz). For new versions of Windows, it also shows
you the System type, which in the Windows 8 example below shows
a 64-bit operating system on an x64 processor.

31
32
• The Windows 8 computer has an "Intel(R) Core(TM) i7-2600 CPU @
3.40 GHz 3.40 GHz." Intel is the brand and company of the processor,
Core i7-2600 is the model of the processor, and 3.40 GHz is the speed
of the processor.

33
Tasks
• What is the max number of cores on a CPU?
• However, it's rare for a consumer PC to need more than one CPU.
Windows 10 can support up to a max of 32 cores for 32-bit Windows
and 256 cores for 64-bit Windows.
• How do I check my CPU cores?
• Press Ctrl + Shift + Esc to open Task Manager. Select the Performance
tab to see how many cores and logical processors your PC has.

34

You might also like