220 likes | 230 Views
This lecture explains the concept of CPU in computers and other electronic devices, including its main components such as control unit, arithmetic logic unit, registers, and caches. It also discusses how the CPU interacts with the operating system and other computing hardware.
E N D
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). Central Processing Unit
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 Main Components of CPU
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. How Does Computer Work? Application Software (Outlook, Safari, iTune) Operating System (Windows, MacOS) CPU (Intel, AMD) Computing Hardware (Dell, IBM, Apple)
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 INPUT DEVICE OUTPUT DEVICE HARD DISK MEMORY Computing Hardware CPU MOTHERBOARD
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.” Addressing
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. What Happens When You Turn on Computer?
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 Scheduling Queues
Interactions with Memory Memory CPU Address Lines Data Lines Read Line Write Line
Instruction Fetch Instruction Decode Operand Fetch Execute Result Store Next Instruction CPU Execution Cycle Obtain instruction from program storage Determine required actions and instruction size 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: 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. Thread
Two Threads Sharing a CPU concept reality context switch
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 Speed
high speed CPU slower I/O devices
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, point-to-point connection • Data rate up to 4 GB/second