1 chapter 6 computer architecture. computer components: top level view
TRANSCRIPT
![Page 1: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/1.jpg)
1
Chapter 6Computer Architecture
![Page 2: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/2.jpg)
Computer Components:Top Level View
![Page 3: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/3.jpg)
Instruction Cycle
• Two steps:—Fetch—Execute
![Page 4: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/4.jpg)
Fetch Cycle
• Program Counter (PC) holds address of next instruction to fetch
• Processor fetches instruction from memory location pointed to by PC
• Increment PC—Unless told otherwise
• Instruction loaded into Instruction Register (IR)
• Processor interprets instruction and performs required actions
![Page 5: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/5.jpg)
Execute Cycle
• Processor-memory—data transfer between CPU and main memory
• Processor I/O—Data transfer between CPU and I/O module
• Data processing—Some arithmetic or logical operation on data
• Control—Alteration of sequence of operations—e.g. jump
• Combination of above
![Page 6: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/6.jpg)
Example of Program Execution
![Page 7: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/7.jpg)
Interrupts
• Mechanism by which other modules (e.g. I/O) may interrupt normal sequence of processing
• Program—e.g. overflow, division by zero
• Timer—Generated by internal processor timer—Used in pre-emptive multi-tasking
• I/O—from I/O controller
• Hardware failure—e.g. memory parity error
![Page 8: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/8.jpg)
Transfer of Control via Interrupts
![Page 9: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/9.jpg)
Connecting
• All the units must be connected• Different type of connection for different
type of unit—Memory—Input/Output—CPU
![Page 10: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/10.jpg)
Computer Modules
![Page 11: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/11.jpg)
What is a Bus?
• A communication pathway connecting two or more devices
• Usually broadcast • Often grouped
—A number of channels in one bus—e.g. 32 bit data bus is 32 separate single bit
channels
![Page 12: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/12.jpg)
Data Bus
• Carries data—Remember that there is no difference between
“data” and “instruction” at this level
• Width is a key determinant of performance—8, 16, 32, 64 bit
![Page 13: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/13.jpg)
Address bus
• Identify the source or destination of data• e.g. CPU needs to read an instruction
(data) from a given location in memory• Bus width determines maximum memory
capacity of system—e.g. 8080 has 16 bit address bus giving 64k
address space
![Page 14: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/14.jpg)
Control Bus
• Control and timing information—Memory read/write signal—Interrupt request—Clock signals
![Page 15: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/15.jpg)
Bus Interconnection Scheme
![Page 16: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/16.jpg)
Physical Realization of Bus Architecture
![Page 17: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/17.jpg)
17
Cache Memory
![Page 18: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/18.jpg)
Memory Hierarchy - Diagram
![Page 19: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/19.jpg)
Access Methods (1)
• Sequential—Start at the beginning and read through in
order—Access time depends on location of data and
previous location—e.g. tape
• Direct—Individual blocks have unique address—Access is by jumping to vicinity plus sequential
search—Access time depends on location and previous
location—e.g. disk
![Page 20: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/20.jpg)
Access Methods (2)
• Random—Individual addresses identify locations exactly—Access time is independent of location or
previous access—e.g. RAM
• Associative—Data is located by a comparison with contents
of a portion of the store—Access time is independent of location or
previous access—e.g. cache
![Page 21: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/21.jpg)
Physical Types
• Semiconductor—RAM
• Magnetic—Disk & Tape
• Optical
![Page 22: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/22.jpg)
Hierarchy List
• Registers• L1 Cache• L2 Cache• Main memory• Disk• Optical• Tape
![Page 23: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/23.jpg)
Cache
• Small amount of fast memory• Sits between normal main memory and
CPU• May be located on CPU chip or module
![Page 24: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/24.jpg)
Cache/Main Memory Structure
![Page 25: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/25.jpg)
Cache operation – overview
• CPU requests contents of memory location• Check cache for this data• If present, get from cache (fast)• If not present, read required block from
main memory to cache• Then deliver from cache to CPU• Cache includes tags to identify which
block of main memory is in each cache slot
![Page 26: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/26.jpg)
Typical Cache Organization
![Page 27: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/27.jpg)
Comparison of Cache SizesProcessor Type
Year of Introduction L1 cachea L2 cache L3 cache
IBM 360/85 Mainframe 1968 16 to 32 KB — —
PDP-11/70 Minicomputer 1975 1 KB — —
VAX 11/780 Minicomputer 1978 16 KB — —
IBM 3033 Mainframe 1978 64 KB — —
IBM 3090 Mainframe 1985 128 to 256 KB — —
Intel 80486 PC 1989 8 KB — —
Pentium PC 1993 8 KB/8 KB 256 to 512 KB —
PowerPC 601 PC 1993 32 KB — —
PowerPC 620 PC 1996 32 KB/32 KB — —
PowerPC G4 PC/server 1999 32 KB/32 KB 256 KB to 1 MB 2 MB
IBM S/390 G4 Mainframe 1997 32 KB 256 KB 2 MB
IBM S/390 G6 Mainframe 1999 256 KB 8 MB —
Pentium 4 PC/server 2000 8 KB/8 KB 256 KB —
IBM SPHigh-end server/ supercomputer
2000 64 KB/32 KB 8 MB —
CRAY MTAb Supercomputer 2000 8 KB 2 MB —
Itanium PC/server 2001 16 KB/16 KB 96 KB 4 MB
SGI Origin 2001 High-end server 2001 32 KB/32 KB 4 MB —
Itanium 2 PC/server 2002 32 KB 256 KB 6 MB
IBM POWER5 High-end server 2003 64 KB 1.9 MB 36 MB
CRAY XD-1 Supercomputer 2004 64 KB/64 KB 1MB —
![Page 28: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/28.jpg)
Mapping Function
• Cache of 64kByte• Cache block of 4 bytes
—i.e. cache is 16k (214) lines of 4 bytes
• 16MBytes main memory• 24 bit address
—(224=16M)
![Page 29: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/29.jpg)
Direct Mapping
• Each block of main memory maps to only one cache line
–i.e. if a block is in cache, it must be in one specific place
![Page 30: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/30.jpg)
Direct Mapping Example
![Page 31: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/31.jpg)
Associative Mapping
• A main memory block can load into any line of cache
• Cache searching gets expensive
![Page 32: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/32.jpg)
Associative Mapping Example
![Page 33: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/33.jpg)
Set Associative Mapping
• Cache is divided into a number of sets• Each set contains a number of lines• A given block maps to any line in a given
set—e.g. Block B can be in any line of set i
• e.g. 2 lines per set—2 way associative mapping—A given block can be in one of 2 lines in only
one set
![Page 34: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/34.jpg)
Replacement Algorithms (1)Direct mapping
• No choice• Each block only maps to one line• Replace that line
![Page 35: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/35.jpg)
Replacement Algorithms Associative & Set Associative
• Least Recently used (LRU)• e.g. in 2 way set associative
—Which of the 2 block is lru?
• First in first out (FIFO)—replace block that has been in cache longest
• Least frequently used—replace block which has had fewest hits
• Random
![Page 36: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/36.jpg)
Write Policy
• Write through • Write back
![Page 37: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/37.jpg)
Write through
• All writes go to main memory as well as cache
• Multiple CPUs can monitor main memory traffic to keep local (to CPU) cache up to date
• Slows down writes
![Page 38: 1 Chapter 6 Computer Architecture. Computer Components: Top Level View](https://reader033.vdocument.in/reader033/viewer/2022061616/56649cb15503460f949761d6/html5/thumbnails/38.jpg)
Write back
• Updates initially made in cache only
• Update bit for cache slot is set when update occurs
• If block is to be replaced, write to main memory only if update bit is set