Ktmt

  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Ktmt as PDF for free.

More details

  • Words: 2,022
  • Pages: 3
I. Mạch số (là mạch điện từ : 1 cao, 0 thấp; bóng đèn điện -> transistor) - Mạch tích hợp (IC) ; - Chip :bọc = gốm, chất dẻo. Số pin 14 -> 100 hoặc hơn. 3 dạng đóng gói chip : DIP (Dual inline package) có 2 hàng pin, ko wá 80 ; PGA (Pin Grid Array) pin xoay wanh tâm vuông ; PQFP (Plastic Quad Flat Pack) pin fủ ở 4 cạnh. >100 - Mức tích hợp : SSI <10 cổng ; MSI 10-200 cổng, LSI 200 - vài ngàn cổng, VLSI vài ngàn cổng - Họ luận lý số : công nghệ mạch : TTL chuẩn, ECL các hệ thống cần hđộng tốc độ cao, MOS mạch cần mật độ thành phần cao (transistor dơn cực), CMOS hệ thống cần tiết kiệm điện. - Cổng luận lý : mạch số 1 hoặc nhiều tín hiệu nhập và 1 tín hiệu xuất. - Mạch tổ hợp : tạo ra các quyết định đkhiển nhị phân và cung cấp các linh kiện số để xử lý dữ liệu. + Mạch cộng + Mạch giải mã, mã hoá + Mạch dồn - Mạch tuần tự : Mạch lật : SR, D, JK, T, lề II. Bộ nhớ - RAM : quy trình định vị các từ là như nhau và cùng thời gian. 2 tác vụ ghi và đọc. Tín hiệu ghi xđ tác vụ chuyển vào, tín hiệu đọc xđ tác vụ chuyển ra. Tác vụ ghi : đưa địa chỉ của từ lên đường đchỉ, đưa các bit dữ liệu vào đường nhập data, kích hoạt tín hiệu ghi. Tác vụ đọc : đưa địa chỉ của từ lên đường đchỉ, kích hoạt tín hiệu đọc. - ROM : chỉ có tác vụ đọc, ndung trong ROM vĩnh viễn, ko thay đổi. ROM m x n là mảng ô nhớ gồm m từ, mỗi từ n bit. k đường nhập đchỉ dể chọn 2k = m từ và n đường xuất bdiễn n bit của từ. ROM ko cần đường đkhiển đọc vì các đường xuất tự động cho n bit của từ theo đchỉ đã chọn. ROM là mạch tổ hợp vì các ngõ ra là hàm của các ngõ vào. thực tế ROM dc tạo từ các mạch giải mã và cổng OR. Dùng lưu các chtrình và hằng trị ko đổi. Cách tạo ROM : 1/lập trình mặt nạ ; 2/ROM khả trình (PROM) gồm các cầu chì còn nguyên biểu diễn bit 1. 3/EPROM : cho phép tái tạo các cổng = tia cực tím. EEPROM dùng tín hiệu điện thay tia cực tím EPROM (Erasable Programmable): Can write but all the storage cells must be erased to the same initial state, Erased by ultraviolet EEPROM (Electrically Erasable) : Can be written in byte-level at any time without erasing pior contents, Takes much longer to write than read Flash memory: Is intermediate between EPROM and EEPROM in both cost and functionalities, Erase blocks of memory electrically - Đĩa từ: Sector Logic Sector vật lý * Physical sector ↔ Logical sector (Sector, Track, Head) l (logical sector) = t*st*side + h*st + s -1 0 (1, 0, 0) s (sector number) = (l mod st) + 1 1 (2, 0, 0) t (track number) = l div (st * side) ... ... h (head number) = (l div st) mod side side : number of side / disk 17 (18, 0, 0) * 2 heads/disk, 80 tracks/head, 18 sectors/track 18 (1, 0, 1) Disk capacity: 19 (2, 0,1) 2 heads/disk * 80 tracks/head * 18 sectors/track = 2880 sectors/disk ... ... = 0.5 KB/sector * 2880 sectors/disk = 1440 KB/disk (~ 1.44 MB) 35 (18, 0, 1) Logic sectors are numbered from 0 to 2879 * Seek time: time to position the head at the appropriate track 36 (1, 1, 0) A typical average seek time on contemporary hard disks is under 10 ms 37 (2, 1,0 ) - Rotational delay (rotational latency): time to rotate the platter to the the appropriate sector ... ... Average rotational delay = tr /2 tr is time per revolution Disks rotate at speeds ranging from 3600 rpm to 15000 rpm (average rotational delay is 2 ms) - Transfer time = tr*b/N b: number of bytes to be transfer N: number of bytes on a track - Access time = Seek time + Rotational time + Transfer time = Tseek + tr /2 + tr*b/N * Consider a disk with 5 double-sided platters, 500 512-byte sectors per track, average seek time of 4 ms, rotation speed of 15000 rpm. + What is the capacity of this disk ? + Suppose that we wish to read a file consisting of 2500 sectors (about 1.28 MBytes) on a cylinder. Determine the average access time? - Time to read the first track: Average seek: 4 ms ; Average rotational delay: 2 ms ; Read 500 sectors: 4 ms Because the file is on one cylinder, the remain tracks can be read with no seek time. So the total average access time is: 10 + (4×6) = 34 ms = 0.034 seconds III. Nhập xuất - Cấu hình: gởi nhận tuần tự thtin, mỗi lượng thtin gồm 8 bit của 1 kí tự. Dãy thtin từ bàn phím dc dịch vào thghi nhập INPR. Dãy thtin cho máy in dc lưu trong thghi xuất OUTR. Hai thghi ngày liện lạc tuần tự với 1 gitiếp truyền thông và song song với AC. Cờ nhập 1bit FGI là mạch lật đkhiển, =1 khi thtin sẵn sàng trong thbị nhập, 0 khi máy nhận thtin, dùng để đồng bộ sự khác nhau về tốc độ giữa thbị nhập và máy. Quy trình : FGI bị xóa 0. Khi nhấn phím, FGI lên 1. Chừng nào cờ còn =1, INPR ko thể thay đổi = cách nhấm phím. Máy kiểm cờ FGI, nếu =1, INPR dc chuểyn song song vào AC và xoá cờ.. thghi xuất tương tự nhưng ngược lại. - Lệnh nhập xuất dùng chuyển thtin vào ra AC, kiểm các bit cờ và đkhiển ngắt. Lệnh có mã tác vụ là 1111 và dc nhận diện khi D7=1 và I=1 - DMA is the answer : - Additional Module (hardware) on bus ; - DMA controller takes over from CPU for I/O - CPU tells DMA controller : Read/Write; Device address; Starting address of memory block for data; Amount of data to be transferred; CPU carries on with other work. DMA controller deals with transfer ; DMA controller sends interrupt when finished. - DMA controller takes over bus for a cycle ; Transfer of one word of data ;Not an interrupt; CPU suspended just before it accesses bus; Slows down CPU but not as much as CPU doing transfer - DMA Configurations (1) : Single Bus, Detached DMA controller; Each transfer uses bus twice : I/O to DMA then DMA to memory ; CPU is suspended twice

- DMA Configurations (2) : Single Bus, Integrated DMA controller; Controller may support >1 device; Each transfer uses bus once : DMA to memory; CPU is suspended once - DMA Configurations (3) : Separate I/O Bus; Bus supports all DMA enabled devices; Each transfer uses bus once : DMA to memory ; CPU is suspended once - I/O Channels : I/O devices getting more sophisticated; CPU instructs I/O controller to do transfer; I/O controller does entire transfer; Improves speed : Takes load off CPU, Dedicated processor is faster IV. Pipelining Fetch instruction (FI) ; Decode instruction (DI); Calculate operands (CO); Fetch operands (FO); Execute instructions (EI); Write operand (WO) - Dealing with Branches : + Multiple Streams : Have two pipelines, Prefetch each branch into a separate pipeline Use appropriate pipeline Two problems: Leads to memory & register contention, Multiple branches lead to further pipelines being needed + Prefetch Branch Target; Target of branch is prefetched in addition to instructions following branch Keep target until branch is executed + Loop buffer : Very fast memory maintained by fetch stage of pipeline Contain the n most recently fetched instructions Check buffer before fetching from memory, Very good for small loops or jumps Similar to cache but … + Branch prediction; 4 words r bits 8 bits + Delayed branching : Do not take jump until you have to, Rearrange instructions 0 V. RIS Characteristics 1 Block of 2 words number of addressing - One instruction per cycle; Most operations are register-to-register; Fixed instruction size, simple formats; 4Small Tag modes, all are simple modes; No indirect addressing; No operations that combine load/store with arithmetic; No more than one memory64 KBytes … addressed operand per instruction 16 = 214 lines MBytes - RISC Pipelining … + Most instructions are register to register + Two phases of execution : I: Instruction fetch; E: Execute : ALU operation with register input and output 2 -1 + For load and store : I: Instruction fetch; E: Execute : Calculate memory address; D: Memory : Register to memory or memory to register Cache line RAM operation - Superscalar : multiple independent instruction pipelines are used - Superpipelining: perform multi pipeline stages per clock cycle VI. Cache * Address length = (s + w) bits ; Number of addressable units = 2s+w words or bytes ; Block size = line size = 2w words or bytes Number of blocks in main memory = 2s+ w/2w = 2s ; Number of lines in cache = m = 2r ; Size of tag = (s – r) bits (+) Simple (+) Inexpensive (–) Fixed location for given block :If a program accesses 2 blocks that map to the same line repeatedly, cache Memory address 0001 0110 0011 0011 1001 1100 (binary) misses are very high à thrashing 1 6 3 3 9 C (hex) - 24 bit address: 2 bit word identifier (4 byte block), 22 bit block identifier Tag 00 0101 1000 1100 1110 1011 (binary) 14 bit slot or line , 8 bit tag (= 22-14) 0 5 8 C E 7 (hex) * Associative Mapping Example Address length = (s + w) bits ; Number of addressable units = 2s+w words or bytes Block size = line size = 2w words or bytes ; Number of blocks in main memory = 2s+ w/2w = 2s Number of lines in cache = undetermined ; Size of tag = s bits (–) More bits for tag (–) Cache searching gets expensive * 2-Way Set Associative Mapping Example Tag s-d Cache set d Word w Address length = (s + w) bits ; Number of addressable units = 2s+w words or bytes Block size = line size = 2w words or bytes ; Number of blocks in main memory = 2s Number of lines in set = k ; Number of sets = v = 2d ; Number of lines in cache = kv = k * 2d ; Size of tag = (s – d) bits v=m, k=1 à direct mapping ; v=1, k=m à associative mapping * Replacement When no candidate cache line is empty, which non-empty candidate cache line is chosen to replace ? Direct mapping: no choice Each block only maps to one line à Replace that line Associative mapping & Set associative mapping: A•B = B•A A+B = B+A Random A•(B+C) = (A•B)+(A•C) A+(B•C) = (A+B)•(A+C) First in first out (FIFO) 1•A = A 0+A = A replace block that has been in cache longest A•A = 0 A+A = 1 Least Recently used (LRU) replace block that has been in cache longest with no reference to it Least frequently used (LFU) 0•A = 0 1+A = 1 replace block which has had fewest hits A•A = A A+A = A  Sum of Products (SOP) A•(B•C) = (A•B)•C A+(B+C) = (A+B)+C F = ABC + ABC + ABC A•B = A+B A+B = A•B  Product of Sums (POS) F = (ABC) • (ABC) • (ABC) • (ABC) • (ABC) 24

= (A+B+C) • (A+B+C) • (A+B+C) • (A+B+C) • (A+B+C) = (A+B+C) • (A+B+C) • (A+B+C) • (A+B+C) • (A+B+C)

Related Documents

Ktmt
October 2019 14
Ktmt-c1
May 2020 8
Ktmt Completed
June 2020 10
Bai Tap Lon Ktmt
May 2020 6
De Cuong Ktmt - K50cb
October 2019 16
Ktmt-c2-new
May 2020 2