design of a simple computer
play

Design of a Simple Computer 2 Schedule Today - PowerPoint PPT Presentation

Computer Systems and Networks ECPE 170 Jeff Shafer University of the Pacific Design of a Simple Computer 2 Schedule Today


  1. ì ¡ Computer ¡Systems ¡and ¡Networks ¡ ECPE ¡170 ¡– ¡Jeff ¡Shafer ¡– ¡University ¡of ¡the ¡Pacific ¡ Design ¡of ¡a ¡Simple ¡ Computer ¡

  2. 2 ¡ Schedule ¡ ì Today ¡ ¡ ì Simple ¡computer ¡organizaBon ¡(conBnued) ¡ ì Exam ¡review ¡ ì Wednesday ¡8 th ¡-­‑ ¡Exam ¡1 ¡ ì Exam ¡covers ¡all ¡of ¡Chapters ¡2 ¡and ¡3 ¡ ì Study: ¡Homework, ¡Quizzes, ¡review ¡slides ¡ ì Friday ¡10 th ¡ ¡ ì Introduce ¡new ¡machine ¡architecture ¡– ¡MARIE ¡– ¡and ¡ assembly ¡programming ¡language ¡ Computer ¡Systems ¡and ¡Networks ¡ Spring ¡2012 ¡

  3. 3 ¡ Clocks ¡ ì Clock ¡speed ¡does ¡not ¡( directly ) ¡equal ¡CPU ¡ performance! ¡ ì CPU ¡Bme ¡required ¡to ¡run ¡a ¡program: ¡ CPU Time= seconds program = instructions program * avg.cycles instruction *seconds cycle ì How ¡can ¡we ¡decrease ¡CPU ¡Bme? ¡Many ¡ways! ¡ Reduce ¡the ¡number ¡of ¡instrucBons ¡in ¡a ¡program ¡ ì Reduce ¡the ¡number ¡of ¡cycles ¡per ¡instrucBon ¡ ì Reduce ¡the ¡number ¡of ¡nanoseconds ¡per ¡clock ¡cycle ¡ ì Computer ¡Systems ¡and ¡Networks ¡ Spring ¡2012 ¡

  4. 4 ¡ The ¡Input/Output ¡Subsystem ¡ ì A ¡computer ¡communicates ¡with ¡the ¡outside ¡world ¡ through ¡its ¡input/output ¡(I/O) ¡subsystem ¡ ì Two ¡different ¡ways ¡I/O ¡devices ¡can ¡funcBon ¡ ì Memory-­‑mapped : ¡the ¡I/O ¡device ¡behaves ¡like ¡main ¡ memory ¡from ¡the ¡CPU’s ¡point ¡of ¡view. ¡ ì InstrucLon-­‑based : ¡the ¡CPU ¡has ¡a ¡specialized ¡I/O ¡ instrucBon ¡set ¡ ì Modern ¡devices ¡are ¡typically ¡memory-­‑mapped ¡ ì But ¡CPUs ¡sBll ¡have ¡legacy ¡I/O ¡instrucBons… ¡ Computer ¡Systems ¡and ¡Networks ¡ Spring ¡2012 ¡

  5. 5 ¡ Interrupts ¡ High ¡priority ¡events ¡(requiring ¡immediate ¡handling) ¡can ¡alter ¡ ì normal ¡program ¡flow ¡ I/O ¡requests ¡ ì ArithmeBc ¡errors ¡(division ¡by ¡0) ¡ ì Invalid ¡instrucBons ¡ ì CPU ¡is ¡noBfied ¡of ¡the ¡high-­‑priority ¡event ¡via ¡an ¡ interrupt ¡ ì Nonmaskable ¡interrupts ¡are ¡high-­‑priority ¡interrupts ¡that ¡ ì cannot ¡be ¡ignored ¡ Each ¡interrupt ¡is ¡associated ¡with ¡a ¡procedure ¡(subrouBne) ¡ ì that ¡tells ¡the ¡CPU ¡what ¡to ¡do ¡ Copy ¡data ¡from ¡the ¡NIC? ¡ ì Give ¡the ¡video ¡card ¡a ¡new ¡frame ¡to ¡display? ¡ ì Computer ¡Systems ¡and ¡Networks ¡ Spring ¡2012 ¡

  6. 6 ¡ ì ¡ Memory ¡Organization ¡ Computer ¡Systems ¡and ¡Networks ¡ Spring ¡2012 ¡

  7. 7 ¡ Memory ¡Organization ¡ ì Imagine ¡computer ¡memory ¡as ¡a ¡linear ¡array ¡of ¡ addressable ¡storage ¡cells ¡(i.e. ¡an ¡array ¡of ¡registers) ¡ ì Addressability ¡ What ¡is ¡the ¡smallest ¡amount ¡of ¡memory ¡I ¡can ¡access? ¡ ì Byte-­‑address ¡or ¡word-­‑addressable ¡ ¡ ì ì A ¡word ¡might ¡be ¡2, ¡4, ¡or ¡8 ¡bytes… ¡ ì Memory ¡is ¡constructed ¡from ¡RAM ¡chips ¡ Each ¡chip ¡referred ¡to ¡in ¡terms ¡of ¡length ¡ × ¡width ¡ ì Example: ¡if ¡the ¡memory ¡word ¡size ¡of ¡the ¡machine ¡is ¡16 ¡ ì bits, ¡then ¡a ¡4M ¡ × ¡16 ¡RAM ¡chip ¡gives ¡us ¡4x2 20 ¡memory ¡ locaBons, ¡each ¡of ¡which ¡is ¡16 ¡bits ¡wide ¡ Computer ¡Systems ¡and ¡Networks ¡ Spring ¡2012 ¡

  8. 8 ¡ Memory ¡Organization ¡ ì How ¡does ¡the ¡computer ¡access ¡a ¡memory ¡locaBon ¡ corresponds ¡to ¡a ¡parBcular ¡address? ¡ ì We ¡observe ¡that ¡4M ¡can ¡be ¡expressed ¡as ¡2 2 ¡ × ¡2 20 ¡= ¡ 2 22 ¡words ¡ ì The ¡memory ¡locaBons ¡for ¡this ¡memory ¡are ¡ numbered ¡0 ¡through ¡2 22 -­‑1. ¡ ì Thus, ¡the ¡memory ¡bus ¡of ¡this ¡system ¡requires ¡ at ¡ least ¡22 ¡address ¡lines ¡ ì Address ¡lines ¡“count” ¡from ¡0 ¡to ¡2 22 ¡-­‑ ¡1 ¡in ¡binary ¡ Computer ¡Systems ¡and ¡Networks ¡ Spring ¡2012 ¡

  9. 9 ¡ Memory ¡Organization ¡ ì How ¡does ¡the ¡number ¡of ¡addresses ¡relate ¡to ¡the ¡ memory ¡width? ¡ ì If ¡memory ¡is ¡ word-­‑addressable , ¡then ¡the ¡number ¡of ¡ locaBons ¡directly ¡gives ¡the ¡number ¡of ¡address ¡lines ¡ ì If ¡memory ¡is ¡ byte-­‑addressable , ¡we ¡need ¡ extra ¡ address ¡lines ¡ to ¡specify ¡which ¡byte ¡within ¡each ¡ word ¡ Computer ¡Systems ¡and ¡Networks ¡ Spring ¡2012 ¡

  10. 10 ¡ Memory ¡Organization ¡ ì Typically ¡mulBple ¡RAM ¡chips ¡are ¡used ¡ ì Access ¡is ¡more ¡efficient ¡when ¡memory ¡is ¡organized ¡ into ¡banks ¡of ¡chips ¡with ¡the ¡addresses ¡ interleaved ¡ across ¡the ¡chips ¡ ì Low-­‑order ¡interleaving ¡ ì Low ¡order ¡bits ¡of ¡the ¡address ¡specify ¡which ¡memory ¡ bank ¡contains ¡the ¡address ¡of ¡interest ¡ ì High-­‑order ¡interleaving ¡ ì High ¡order ¡address ¡bits ¡specify ¡the ¡memory ¡bank ¡ Computer ¡Systems ¡and ¡Networks ¡ Spring ¡2012 ¡

  11. 11 ¡ Memory ¡Interleaving ¡ Low-­‑Order ¡Interleaving ¡ High-­‑Order ¡Interleaving ¡ Computer ¡Systems ¡and ¡Networks ¡ Spring ¡2012 ¡

  12. 12 ¡ Memory ¡Organization ¡ ì Example: ¡Computer ¡memory ¡composed ¡ of ¡16 ¡chips, ¡each ¡of ¡size ¡2K ¡x ¡8 ¡ ì Total ¡memory ¡locaBons? ¡ 32K ¡= ¡2 5 ¡ × ¡2 10 ¡= ¡2 15 ¡ ì 15 ¡bits ¡are ¡needed ¡for ¡each ¡address ¡ ì ì Wiring ¡ 4 ¡bits ¡will ¡select ¡which ¡chip ¡(out ¡of ¡16) ¡ ì 11 ¡bits ¡will ¡select ¡a ¡parBcular ¡byte ¡inside ¡ ì the ¡selected ¡chip ¡ Computer ¡Systems ¡and ¡Networks ¡ Spring ¡2012 ¡

  13. 13 ¡ Memory ¡Organization ¡ ì In ¡ high-­‑order ¡interleaving ¡ the ¡ high-­‑order ¡ 4 ¡bits ¡ select ¡ the ¡chip ¡ ì In ¡ low-­‑order ¡interleaving ¡ the ¡ low-­‑order ¡ ¡ 4 ¡bits ¡ select ¡ the ¡chip ¡ Computer ¡Systems ¡and ¡Networks ¡ Spring ¡2012 ¡

  14. 14 ¡ Example ¡– ¡Memory ¡Organization ¡ Example: ¡Suppose ¡we ¡build ¡a ¡8M ¡x ¡32 ¡word-­‑addressable ¡main ¡ ì memory ¡using ¡512K ¡x ¡8 ¡RAM ¡chips. ¡ How ¡many ¡RAM ¡chips ¡are ¡necessary? ¡ ì 8M/512K ¡* ¡32/8 ¡= ¡16 ¡* ¡4 ¡= ¡64 ¡ ì How ¡many ¡RAM ¡chips ¡are ¡there ¡per ¡word? ¡ ì 32/8 ¡= ¡4 ¡chips ¡per ¡word ¡ ì How ¡many ¡address ¡bits ¡are ¡needed ¡per ¡RAM ¡chip? ¡ ì 512K ¡addresses ¡= ¡2 10+9 ¡= ¡19 ¡address ¡bits ¡ ì How ¡many ¡banks ¡will ¡there ¡be? ¡ ì 8M/512K ¡= ¡16 ¡banks ¡ ì Computer ¡Systems ¡and ¡Networks ¡ Spring ¡2012 ¡

  15. 15 ¡ Example ¡– ¡Memory ¡Organization ¡ Example: ¡Suppose ¡we ¡build ¡a ¡8M ¡x ¡32 ¡word-­‑addressable ¡main ¡ ì memory ¡using ¡512K ¡x ¡8 ¡RAM ¡chips. ¡ How ¡many ¡address ¡bits ¡are ¡needed ¡for ¡all ¡memory? ¡ ì Word ¡addressable: ¡8M ¡addresses ¡= ¡8*2 20 ¡= ¡2 20+3 ¡= ¡23 ¡address ¡bits ¡ ì Byte-­‑addressable, ¡8M ¡addresses ¡* ¡4 ¡bytes ¡per ¡word ¡= ¡2 20+3+2 ¡= ¡25 ¡ ì address ¡bits ¡ If ¡high-­‑order ¡interleaving ¡is ¡used, ¡where ¡would ¡address ¡ ì 247193 16 ¡be ¡located? ¡ Bank ¡4 ¡(247193 16 ¡= ¡010 ¡0100 ¡0111 ¡0001 ¡1001 ¡0011 2 ) ¡ ì If ¡low-­‑order ¡interleaving ¡is ¡used, ¡where ¡would ¡address ¡247193 16 ¡ ì be ¡located? ¡ Bank ¡3 ¡(247193 16 ¡= ¡010 ¡0100 ¡0111 ¡0001 ¡1001 ¡0011 2 ) ¡ ì Computer ¡Systems ¡and ¡Networks ¡ Spring ¡2012 ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend