Computer Architecture Lecture 2 PDF
Document Details
Uploaded by DistinctiveCerium
Akhbar El Yom Academy
2020
Dr Hussein Omran
Tags
Summary
This document is a lecture on computer architecture, focusing on the core concepts and structures of computer systems. It provides comprehensive coverage of the introduction, function, structure, and performance of computer architectures.
Full Transcript
Computer Architecture Lecture2 →Chapter 1&2 —Introduction —Function and structure —Performance By Dr Hussein Omran, akhbar El Yom Academy, Egypt 2020 What is Computer architecture Computer Architecture is concerned with structure and function of computer. Function...
Computer Architecture Lecture2 →Chapter 1&2 —Introduction —Function and structure —Performance By Dr Hussein Omran, akhbar El Yom Academy, Egypt 2020 What is Computer architecture Computer Architecture is concerned with structure and function of computer. Function of processors, memories, and operate together. Format of instruction set. Techniques for addressing memory. Instruction Set Architecture defines communication rules between SW (ISA) and HW that can be understand HW SW What is Computer architecture CA concerned of structure and function of computer. Structure: way in which components relate to each other Function: is the operation of individual components as part of the structure Instruction Set Architecture defines communication rules between SW (ISA) and HW that can be understand ISA Basic Structure Basic function 1.processor 1.Data processing 2.Main memory 2.Data movement 3.Control unit 3.Control mechanism 4.I/O peripherals 4.Data storage how function woks 2-Data Movement 3-Control Mechanism 4-Data 1-Data Storage Processing Facility Facility Function 1.Data processing: Data processing (add, sub, multiply.) 2.Data movement: devices serve as source or destination of data when asked from device connected directly. 3.Control mechanism : manage computer’s resources in the response to instructions. 4.Data storage: computer must temporarily store pieces of data that worked on for short-term and also for long- term storage. Basic function 1.Control mechanism 2.Data processing 3.Data movement 4.Data storage Function “Operations” (b) Data processing 1.Control mechanism Processing from storage to I/O Function “Operations” (c) Data movement (d) Data storage Structure - Top Level Peripherals CPU Computer I/O Arithmetic Registers Computer and CPU System Login Unit Bus Memory Communication Internal CPU lines Interconnection Control Unit Control Unit Sequencing Login CPU ALU Control Unit Registers and Control Unit Internal Control Decoders Unit Bus Control Registers Memory Structure - How related processor, memory, bus, and IO. 1.Central processing unit (CPU): performs data processing. A. Control unit: Controls operation of CPU and computer. B. Arithmetic and logic unit (ALU): Performs the computer’s data processing functions (add, sub,..) C. Registers: Provides storage internal to the CPU. D. interconnection: mechanism for communication among the control unit, ALU, and registers. 2.Main memory: Stores data. 3.I/O: move data between computer and external environment 4.System interconnection: provide communication method among CPU, main memory, and I/O by number of conducting wires to all components. What is hardware? physical devices that computer made of such as motherboard, wired, cables Input Unit 1.Control Unit Controls functions 2.Arithmetic Makes process of Central Logic Unit operation processor Computer unit 3.Register high speed, small store Hardware Storage main and Primary memory Memory cash within CPU, Cash memory Output Unit Storage external to CPU operation Central processing unit (CPU): fetches and executes instructions and consists of ALU, control unit, and registers called processor or “core” in a single ship Multi core computer structure: Processor: computer component interprets and execute instructions placed on physical piece of silicon if containing more than one called multiple cores. when multiple processors reside on single chip, where each processing unit is called core7 Core: is equivalent to CPU on a single-CPU system in functionality. Other specialized processing units, such as one optimized for vector and matrix operations, are also referred to as cores. Multi core computer structure: motherboard contains slot or socket for processor chip Computer Performance Performance it is an execution speed of Instruction used to evaluate HW of processor along with cost, size, security, reliability, power consumption. Computer performance: is the number of instructions (work) executed by computer system per second (specific time) Operations by processor controlled by pulse of clock, is Clock Speed Pulse is clock cycle, time between pulses is cycle time t=1/f. Speed of processor is dictated by pulse frequency of clocks, measured in cycles per second, clock rate or Hertz (Hz). Example,1-GHz processor receives 1 billion pulses /second. Time interval varies for different instruction types I and so number of cycles (load, store, and so) Computer Performance ∑CPIi = total weighted average cycle number Per Instruction CPI to execute a program Let CPIi be number of cycles required for instruction type i, and Ii be number of executed instructions of type i for a given program. Then we can calculate an overall CPI as follows: Program is number of machine instructions executed until completion T Performance =(rate of weighted average Cycle Per Instruction Performance CPI). = Clock rate / (∑CPI ) = IPS Performance calculations Example1: Consider the execution of a program with 2 million instructions on 400 MH processor, program consists of four major types ALU with 60 of instructions, Load with 18, memory reference 10 , and branch with 12 in which each has number of cycles respectively 1,2,8,4 find the performance Base Machine (Reg / Reg) Op Freq (% Time) Cycles CPI(i) ALU 60 (0.6) 1 1x.6=0.6 Load 18 (0.18) 2 2x0.18=.36 Store 10 (0.1) 8 8x0.1=0.8 Branch 12 (0.12) 4 4x0.12=0.48 100 Weight=1 ∑CPIi= 2.24 Typical Mix ∑CPI= (1*0.6)+(2*0.18)+(8*0.1) +(4*0.12)=0.6+0.36+0.8+0.48=2.24 Performance= (400*106 )/( 2.24)= 178 MIPS Performance calculations Example2: Consider the execution of a program with 2 million instructions on 400 MH processor, program consists of four major types ALU with 500 of instructions, Load with 200, memory reference 100 , and branch with 200 in which each has number of cycles respectively 1,2,2,2 find the performance Base Machine (Reg / Reg) Op Freq (% Time) Cycles CPI(i) ALU 500 (0.5) 1 0.5 Load 200 (0.2) 2 0.4 Store 100 (0.1) 2 0.2 Branch 200 (0.2) 2 0.4 1000 Weight=1 ∑CPIi= 1.5 Typical Mix ∑CPI= (1*0.50)+(2*0.2)+(2*0.1) +(2*0.2)=0.5+0.4+0.2+0.4=1.5 Performance= (800*106 )/( 1.5)= 534 MIPS Amdahl’s Law Formula Amdahl's law used to calculate how much computation can be sped up by running part of it in parallel For program running on single processor —T is total execution time for program on single processor —Fraction f of code infinitely parallelizable with no scheduling —Fraction (1-f) of code inherently serial —N number of processors fully exploit parallel portions of code Example, if the part that can be improved is 30% of overall system and its performance can be doubled for a system, then − Speedup MAX = 1/((1-0.30)+(0.30/2)) = 1.18 Conclusions — f small, parallel processors has little effect — N ->∞, speedup bound by 1/(1 – f) Diminishing returns for using more processors