3
NWEN 242 Revision 1. Introduction Embedded computers are computer inside another device. It is less tolerance to failure compare to other type of computers. + The performance of the program is determined by: < The algorithm run by the program < Compiler < Effectiveness of the computer in executing the instructions (Memory/System/Processor) < I/O performance < The OS (Operating System) From the above factors we cannot say one factor influence the program performance more than the other, it depends, but usually the I/O and the OS (depend on the app running). ! What is a Compiler? < A compiler is a program that translates high<level language into assembly language. The OS handles the basic I/O operation. Allocates storage and memory, and provide protection of sharing the computer with multiple applications using it simultaneously. + Note: App cannot access the hardware directly. Assembler – converts the assembly statement into binary machine codes. Assembly statement corresponds to the machine instructions. Example of the assembly statement could be like this: add $t0, $t1, 2 + The 5 major components of the computer are: < Control (command the datapath, memory, I/O devices according to the instructions of the program) < Input (computer fed in the information such as mouse, keyboard) < Output (conveys the result of computation to the user) < Datapath (performs the arithmetic and logical operation) < Memory (DRAM & SRAM) The CPU contains the datapath and the control. Note: The main memory is volatile, this means that the component can only keep information when there is a power supple to it, the information will disappear if there is no power supply. Cache is Volatile, and it uses the SRAM which build fast memory but costly. On the other hand, secondary storage such as Hard Disk, Flash Drive is non<volatile and uses the DRAM. Application Software System Software Hardware

NWEN 242 Revision - Amazon Web Services€¦ · < Memory!(DRAM!&!SRAM)!!! The!CPU!contains!the!datapath!and!the!control.!!! Note: ... < There!are!problems!if!we!use!MIPS!to!compare!computers,!one!is!different!

Embed Size (px)

Citation preview

!

NWEN$242$Revision$$

1. Introduction$$$

Embedded!computers!are!computer!inside!another!device.!It!is!less!tolerance!to!failure!

compare!to!other!type!of!computers.!!

!+!The!performance!of!the!program!is!determined!by:!

< The!algorithm!run!by!the!program!!< Compiler!!

< Effectiveness!of!the!computer!in!executing!the!instructions!

(Memory/System/Processor)!< I/O!performance!!

< The!OS!(Operating!System)!!

!From!the!above!factors!we!cannot!say!one!factor!influence!the!program!performance!more!

than!the!other,!it!depends,!but$usually$the$I/O$and$the$OS!(depend!on!the!app!running).!!!

! What!is!a!Compiler?!!< A!compiler!is!a!program!that!translates!high<level!language!into!assembly!language.!!

!

The!OS!handles!the!basic!I/O!operation.!Allocates!storage!and!memory,!and!provide!protection!of!sharing!the!computer!with!multiple!applications!using!it!simultaneously.!!

!

+!Note:!App!cannot!access!the!hardware!directly.!!!

!

!!

!!

!

!!

Assembler!–!converts!the!assembly!statement!into!binary!machine!codes.!Assembly!

statement!corresponds!to!the!machine!instructions.!Example!of!the!assembly!statement!could!be!like!this:!add!$t0,!$t1,!2!!

!+!The!5!major!components!of!the!computer!are:!!

< Control!(command!the!datapath,!memory,!I/O!devices!according!to!the!instructions!

of!the!program)!!< Input!(computer!fed!in!the!information!such!as!mouse,!keyboard)!!

< Output!(conveys!the!result!of!computation!to!the!user)!!< Datapath!(performs!the!arithmetic!and!logical!operation)!

< Memory!(DRAM!&!SRAM)!!

!The!CPU!contains!the!datapath!and!the!control.!!

!

Note:$The!main!memory!is!volatile,!this!means!that!the!component!can!only!keep!information!when!there!is!a!power!supple!to!it,!the!information!will!disappear!if!there!is!no!power!supply.!

Cache!is!Volatile,!and!it!uses!the!SRAM!which!build!fast!memory!but!costly.!On!the!other!hand,!secondary!storage!such!as!Hard!Disk,!Flash!Drive!is!non<volatile!and!uses!the!DRAM.!!

!

Application!Software!

System!Software!!

Hardware!!

!

2. Understanding$Performance$$$

The!performance!of!the!computer!can!be!seen!as!the!“time!it!takes!to!execute!given!a!single!

task.!!

!! Concepts$

$

< Throughput:!total!amount!if!work!done!in!a!given!time.!!

< Response!time:!The!time!between!the!start!and!the!completion!of!the!task.!!

< Execution!time:!The!time!it!takes!to!execute!the!task.!!< Time:!is!the!measure!of!the!computer!performance.!!

< CPU!time:!the!time!the!CPU!spends!computing!for!a!task.!!

< Clock!cycles:!how!fast!the!hardware!can!perform!basic!functions.!!< Clock!period:!a!time!for!a!complete!clock!cycle.!!

< Clock!rate:!the!inverse!of!clock!period.!!< Clock!signal:!can!consider!as!a!sequence!of!pulses.!!

!

For!example,!if!we!replace!the!processor!of!the!computer!say!from!core!i3!to!core!i7,!then!it!will!help!reduce!the!response!time.!What!if!we!add!more!processors,!say!from!1!to!8?!What!is!

the!benefit?!This!really!depends,!but!at!least!it!should!give!a!better!throughput.!It!won’t!really!improve!the!response!time,!if!we!were!to!just!execute!one!task!then!one!processor!is!enough!

but!if!we!were!to!execute!multiple!tasks!then!more!processor!is!better,!so!less!response!time.!

What!we!are!trying!to!say!is!that,!if!we!only!execute!one!task,!only!one!processor!is!use!anyway!so!there!is!no!point!in!having!lots!of!processors,!hence!no!improvement.!!

!

+!In!order!to!maximize!the!performance,!we!need!to!minimize!the!execution!time.!!!

!"#$%#&'()" = ! 1!"!#$%&'(!!"#$!!

!+!If!say!we!have!two!computers,!x,!and!y.!Say!x!has!a!better!performance!than!y,!then!we!have:!

!!"#$%#&'()"! ! > !!"#$%#&'()"!(!)!

!1

!"!#$%&'(!!"#$!(!) > !1

!"!#$%&'(!!"#$!(!)!!

!"!#$%&'(!!"#$! ! > !!"!#$%&'(!!"#$!(!)!!

+!If!x!is!n<times!faster!than!y,!then,!!!

! = !!"#$%#&'()"!(!)!"#$%#&'()"!(!) = !!"!#$%&'(!!"#$!(!)!"!#$%&'(!!"#$!(!)!

!

Different$time$concepts:!Clock!time!/!Elapsed!time!/!Response!time,!they!all!refer!to!the!same!idea!in!which!means!the!total!time!spent!when!executing!a!task.!The!time!included,!the!

disk!access,!memory!access,!I/O!operations,!etc.!On!the!other!hand!the!CPU!time!does!not!include!the!time!spent!waiting!for!the!I/O!or!running!other!programs.!There!are!‘User!CPU!

time’!(Time!spent!by!the!CPU!in!user!mode!–!has!limited!access)!and!the!‘System!CPU!time’!

(Time!spent!by!the!CPU!in!kernel!mode!–!can!access!all!resources!in!the!computer).!!!

Note:!Almost!all!the!computers!construct!using!the!clock!to!determine!when!events!take!place!

in!hardware.!!

!

CPU$Performance$

!To!get!the!CPU!execution!time,!let!x!=!CPU!execution!time!for!a!program!

! ! ! ! !!!!!!!!!!!y!=!CPU!clock!cycles!for!a!program!!

! ! ! ! !!!!!!!!!!!z!=!Clock!cycle!time!!!! ! ! ! !!!!!!!!!!!a!=!Clock!rate!!

!! = ! ∗ !!

!

Note:!CPU!clock!cycles!means!how!may!clock!cycle!is!required!to!execute!a!task.!Clock!cycle!time!is!the!inverse!of!the!clock!rate.!!

! = !!!!!

Instruction$Performance$$

$

+!Clock$cycle$per$instruction$(CPI):!average!number!of!clock!cycles!per!instruction!for!a!program.!!

!!"#!!"#$%!!"!#$% = !"#$%&'$()"# ∗ !"#!!

!

It!is!noted!that!different!instructions!may!take!different!amount!of!time.!CPI!can!be!seen!as!a!way!of!comparing!two!processors.!We!can!use!the!CPI!to!tell!us!the!performance.!!

!Note:!Instruction!mix!is!a!measure!of!the!dynamic!frequency!of!instructions!across!one!or!

more!programs.!

!The$power$wall$$$$

$

+!Dynamic!power!is!the!power!that!is!consumed!during!the!switch.!!!

!"#$% = !"#"$%&%'(!!"#$ ∗ !"#$%&'! ∗ !"#$%#&'(!!"#$%ℎ!"!!

+!Lower!the!voltage!can!help!reduce!the!dynamic!power!but!it!may!make!the!transistors!too!leaky.!About!40%!of!the!power!consumption!is!due!to!leakage.!!

!Amdahl’s$Law$$

$

Let!a!=!“Execution!time!after!improvement”!!!!!!!!!b!=!“Execution!time!affected!by!improvement”!

!!!!!!!c!=!“Amount!of!improvement”!!!!!!!!d!=!“Execution!time!unaffected”!

!

! = !!! + !!!!!

Millions$instructions$per$second$(MIPS)$=>$!"#$ = ! !"#$%&'$()"!!"#$% !"#$%&'()!!"#$ ∗ !10!$< There!are!problems!if!we!use!MIPS!to!compare!computers,!one!is!different!

instruction!sets,!two!is!MIPS!varies!between!programs!on!the!same!computer.!!!

!

!!