Lecture on Central Process Unit CPU Central Processing

  • Slides: 22
Download presentation
Lecture on Central Process Unit (CPU)

Lecture on Central Process Unit (CPU)

Central Processing Unit • Brain of any “processing” device • What are the processing

Central Processing Unit • Brain of any “processing” device • What are the processing devices? – Computers, cell phones, game consoles, TVs, refrigerators, … just about any electronics • CPU is a conceptually simple, but a highly complex circuitry that responds to executable inputs (i. e. , program instructions).

Intel Pentium 4 CPU

Intel Pentium 4 CPU

Main Components of CPU • Control unit: Directs all program instructions. It does not

Main Components of CPU • Control unit: Directs all program instructions. It does not actually execute instructions, but makes other parts to do so. • Arithmetic logic unit: It executes all arithmetic and logical operations. Commonly known as ALU. • Registers: Small memory blocks (a few kilo bytes) inside CPU to store intermediate computation results or addresses during processing • Caches: Larger memory blocks (a few mega bytes) inside CPU to store data during processing

How Does Computer Work? Application Software (Outlook, Safari, i. Tune) Operating System (Windows, Mac.

How Does Computer Work? Application Software (Outlook, Safari, i. Tune) Operating System (Windows, Mac. OS) CPU (Intel, AMD) Computing Hardware (Dell, IBM, Apple) • Application software is written in a human readable form, normally stored in hard disk. • To run application software, OS retrieves it first from hard disk, and translates it to a machine readable form. Then, OS instructs CPU how to run it. • CPU interfaces with rest of computing hardware and together executes the machine readable code from OS. • Computing hardware is controlled by CPU.

Computing Hardware INPUT DEVICE CPU MEMORY OUTPUT DEVICE HARD DISK MOTHERBOARD • CPU: Main

Computing Hardware INPUT DEVICE CPU MEMORY OUTPUT DEVICE HARD DISK MOTHERBOARD • CPU: Main controller • Memory: All instructions and data are entered into CPU through memory • Input device: Keyboard, mouse, touch screen, etc. • Output device: Display terminal, printer, speaker etc. • Hard disk: Mass storage for all data, program, and information

Mother of All Boards = “Motherboard” CPU

Mother of All Boards = “Motherboard” CPU

Addressing • In computer, all storage devices (memories and hard disk) are given unique

Addressing • In computer, all storage devices (memories and hard disk) are given unique addresses. • Main memory is fast and can interact with CPU directly. But its size is limited (a few giga bytes) and cannot store all of the data or programs. • Data or program is loaded into main memory when needed by CPU. Otherwise, it is stored in hard disk. This process is called “swapping. ”

What Happens When You Turn on Computer? • When you turn on the computer,

What Happens When You Turn on Computer? • When you turn on the computer, the hardware starts. • With the power on, the CPU starts executing instruction at certain memory location. This is the “BIOS. ” • The BIOS contains the start-up programs such as device detection, initialize background programs (demons), and the start of OS. • Critical part of OS (i. e. , part needed by all programs) is permanently loaded into the main memory. This part is called the kernel. • Now the computer is ready to accept any command that the user enters.

Scheduling Queues • Scheduling queues is a main functions of OS. • Job queue:

Scheduling Queues • Scheduling queues is a main functions of OS. • Job queue: Set of all processes • Ready queue: Set of all processes residing in main memory, ready and waiting to execute • Device queue: Set of processes waiting for I/O device

Interactions with Memory CPU Address Lines Data Lines Read Line Write Line

Interactions with Memory CPU Address Lines Data Lines Read Line Write Line

CPU Execution Cycle Instruction Fetch Instruction Obtain instruction from program storage Determine required actions

CPU Execution Cycle Instruction Fetch Instruction Obtain instruction from program storage Determine required actions and instruction size Decode Operand Fetch Execute Result Store Next Instruction Locate and obtain operand data Compute result value or status Deposit results in storage for later use Determine successor instruction; can generally be combined w/ Decode

Thread • Thread: Schedulable stream of controls – Defined by CPU – Suspend: Save

Thread • Thread: Schedulable stream of controls – Defined by CPU – Suspend: Save register values in memory – Resume: Restore registers from memory • Multiple threads can execute independently – They can run in parallel on multiple CPUs. . . – Or interleaved on a single CPU – Each thread must have its own control stack.

Single and Multithreaded Processes

Single and Multithreaded Processes

Two Threads Sharing a CPU concept reality context switch

Two Threads Sharing a CPU concept reality context switch

Speed • How fast the CPU can execute instructions • Limited by many factors

Speed • How fast the CPU can execute instructions • Limited by many factors – Speed of electronic circuits in CPU – Speed of memory access – Speed of hard disk – Efficiency of OS – Efficiency of application software

Processor Speed

Processor Speed

CPU high speed slower I/O devices

CPU high speed slower I/O devices

PCI Bus • Peripheral Connection Interface • South Bridge architecture – 66 MHz, 64

PCI Bus • Peripheral Connection Interface • South Bridge architecture – 66 MHz, 64 -bit, 512 MB/second – Shared bus with arbitration

PCI Express • North Bridge architecture • Switched, pointto-point connection • Data rate up

PCI Express • North Bridge architecture • Switched, pointto-point connection • Data rate up to 4 GB/second