The Central Processing Unit (CPU)
Learning Objectives
By the end of this module, you should be able to:
Describe the function and features of CPUs
Describe CPU design characteristics
Identify features of modern CPUs
CPU Fundamentals
The system architecture of the computer is built around the CPU
Includes the number and type of CPUs in the hardware; the communications routes (buses) between CPUs; and other hardware components, such as memory and disk storage
A bus is a path or channel between a computer’s CPU and the devices it manages, such as memory and I/O devices
The CPU is the chip that performs the actual computational and logic work
Most client computers have one chip and are referred to as single-processor computers
A processor core is the part of a CPU that reads and executes machine code
A multicore processor has two or more cores
CPUs are manufactured on a silicone wafer, called a die
Multiprocessor computers have multiple physical CPU chips
Many server computers and high-end client computers are multiprocessor computers
CPU Startup Operation
When power is applied to the CPU, it begins reading data from a memory address called the reset vector
The reset vector is an address that a CPU begins reading from when the CPU receives a reset signal
On many processors, the data found at the address of the reset vector is loaded into the CPU’s program counter and is used as the address where the CPU will begin program execution
The program counter is a register on a CPU that contains the address of the next instruction the CPU will execute
CPU Design
Most CPUs are composed of the following elements:
Control unit—the control unit (CU) provides timing and coordination between other parts of the CPU
Arithmetic logic unit (ALU)—the ALU performs the primary task of executing instructions
Registers—a register is a temporary holding location where data must be placed before the CPU can use it
Memory/cache controller—the cache controller intercepts access to memory for data or code and checks if the requested data is in cache first
System bus—a series of lanes used to communicate the CPU and other major parts of the computer
There are three types of buses:
Control bus—carries status signals between the CPU and other devices
Address bus—carries address signals to indicate where data should be read or written to in the system’s memory
Data bus—carries the actual data that is being read from or written to system memory
CPUs can be classified by hardware elements:
Architecture
Clock speed
Cache
Address bus
Data bus
Control bus
CPU scheduling
Each of these elements is described in more detail on the following slides
Architecture
Two general CPU designs are used today:
Complex Instruction Set Computing (CISC)
Reduced Instruction Set Computing (RISC)
The main difference between the two design types is the number of different instructions the chip can process
CPUs can process as many as several billion operations per second, depending on the architecture
An instruction set is a list of commands the CPU can understand and carry out
CISC and RISC CPUs differ in the following ways:
Complex versus simple instructions
CISC CPUs are generally more complex
Clock cycles
Pipelining
Pipelining is the ability of the CPU to perform more than one task on a single clock cycle
Hardware versus microcode
Microcode is a small program inside the chip that interprets and executes each instruction
Complier
A complier is a computer program that takes a high-level language and turns it into assembly code that is executed by the CPU
An assembler turns those instructions into numeric values, called opcodes
Number and usage of registers
CISC CPUs have fewer registers than a RISC CPU
Clock Speed
The speed of a CPU defines how fast it can perform operations
the most frequently used indicator is the internal clock speed
The internal clock speed is the speed at which a CPU executes an instruction or part of an instruction
The faster the clock speed, the faster the CPU
As more components are needed to make a CPU, the chip uses more energy, which is converted to heat
CPUs require fans to keep cool
The CPU must be able to communicate with other chips in the computer
It uses an external clock speed to communicate with the rest of the computer
The external clock speed runs slower than the internal clock speed
The external clock speed is typically one-half, one-third, one-fourth, or one-eighth the speed of the internal CPU clock
Cache
Because the internal clock is faster than the external clock, the CPU has to wait on information to arrive from other parts of the computer
Most modern CPUs have cache memory built into the chip
While the CPU is executing program code, instructions or data that are most likely to be used next are fetched from main memory and placed in cache memory
There are different levels of cache:
Level 1 (L1) cache is the fastest and usually runs at the same speed as the CPU
Level 2 (L2) cache is slower than L1, but much larger
Level 3 (L3) cache, until the last several years, was not part of the CPU chip, but part of the motherboard
Level 4 (L4) cache will usually be found on the motherboard (if it exists)
The cache controller predicts what data will be needed and makes the data available in cache before it is needed
Address Bus
The address bus is an internal communications pathway that specifies the source and target addresses for memory reads and writes
The address bus typically runs at the external clock speed of the CPU
The width of the address bus is the number of bits that can be used to address memory
A wider bus means the computer can address more memory and store more data
Modern processors have a 64-bit address bus
Allows them to address 16 terabytes (TB) of memory
Data Bus
The data bus allows computer components, such as the CPU, display adapter, and main memory, to share information
The number of bits in the data bus indicates how many bits of data can be transferred from memory to the CPU in one clock tick
A CPU with an external clock speed oof 1 GHz and a 64-bit data bus could transfer as much as 8 GB per second
A CPU with a 64-bit data bus typically can perform operations on 64 bits of data at a time
Control Bus
Information is transported on the control bus to keep the CPU informed about the status of resources and devices connected to the computer
Memory read and write status is transported on this bus, as well as interrupt requests (IRQ)
An interrupt request is a request to the processor to “interrupt” whatever it is doing to take care of a process, which in turn might be interrupted by another process
CPU Scheduling
CPU scheduling determines which process to start given the multiple processes waiting to run
Modern OSs support multithreading
Multithreading is the ability to run two or more processes (known as threads) at the same time
A thread is the smallest piece of computer code that can be independently scheduled for execution
Hyper-threading (HT) allows two threads to run on each CPU core simultaneously
Modern Processors for PCs and Servers
This section provides an overview of CPUs found in modern client and server systems running general-purpose OSs
Modern systems today typically have two or more cores and 64-bit architecture
Intel Processors
The most popular CPU manufacturer today is Intel
8086 architecture is the CPU found in the original IBM PC
All processors introduced by Intel that are intended to run Windows and other PC OSs have been based on the 8086 architecture
Modern processors are multicore, with as many as 72 or more cores
Microarchitecture is the description of a CPU’s internal circuitry, defining characteristics such as the technology ised to create the chip, the supported instruction set, and the bit size
The most current microarchitecture is called Cascade Lake-AP
It supports up to 56 cores running at 2.6 GHz with an L3 cache up to 77 MB
AMD Processors
Advanced Micro Devices, Inc. (AMD) manufactures processors that compete with Intel’s line of processors
AMD processors are compatible with software written for the Intel x86-based processors
AMD processors tend to cost less for similar performance and are easier to overclock
Overclocking is the ability to run a processor faster than its stated clock speed
ARM-Based Processors
Advanced RISC Machines (ARM) processors are RISC processors that are commonly used in mobile devices such as smartphones and tablets
They are also used in embedded systems and are starting to be used in notebook computers
They are multicore, 32-bit and 64-bit processors with low power consumption
ARM processors are not produced by a single company
Companies license the architecture and sell their own version of an ARM processor