大连交通大学coa考试题2

上传人:hs****ma 文档编号:500459598 上传时间:2024-02-23 格式:DOC 页数:16 大小:204KB
返回 下载 相关 举报
大连交通大学coa考试题2_第1页
第1页 / 共16页
大连交通大学coa考试题2_第2页
第2页 / 共16页
大连交通大学coa考试题2_第3页
第3页 / 共16页
大连交通大学coa考试题2_第4页
第4页 / 共16页
大连交通大学coa考试题2_第5页
第5页 / 共16页
点击查看更多>>
资源描述

《大连交通大学coa考试题2》由会员分享,可在线阅读,更多相关《大连交通大学coa考试题2(16页珍藏版)》请在金锄头文库上搜索。

1、I. Suppose both instructions and data are 16bits long, the opcode field in 4 bits long, there is a program fragment( 程序段)with three instructions stored from memory location 300 to 302 and two data items stored in memory location 941 and 942, all the number are hexadecimal(十六进制数)in the figure. (16 po

2、ints)(Notes: Load x means Load AC from memory location x;Store x means Store AC to memory location x;Add (x) means Operand pointed by the content of location X is added to AC) Answer the following questions:(Put the answer on the next page)(1) Give the PC value before and after the program fragment

3、execution.( 2 points )(2) Tell the final result of memory location 941. ( 2 points )(3) Tell the addressing mode and addressing range of the instruction stored in memory location 300 and 301.( 6 points )(4) Write out the all the micro-operation of the instructions stored in memory location 301 .( 6

4、points )Answer: 1. before (PC) =300(1 points)After: (PC) =303(1 points)2.Final result of memory location 941: (941)=1283(2 points)3.instruction stored in memory location 300:Addressing mode:direct(1 points)Addressing range: _22=4K _(2 points) instruction stored in memory location 301:Addressing mode

5、: _indirect _(1 points)Addressing range:_ 26=64K _(2 points)4. Write out the micro-operation of the instructions stored in memory location 301.Add (500);Fetch cyclet1: (PC) - MARt2: (MAR) - Memory read - Memoryt3: Memory - MBRt4: (MBR) - IR(PC) +1 - PC(2 points)Indirect cycle:t1: Ad(MBR) - MARt2:(MA

6、R) - Memoryread -Memoryt3: Memory-MBR(2 points)Execute cyclet1: (MBR) - MARt2: (MAR) - Memory read -Memory t3: Memory- MBR t4:(MBR)+(AC)- AC(2 points)II. A set associative cache consists of 32k lines, divided into 8-line sets. Main memory contains 16M blocks of 256 words each. Answer the following q

7、uestions: ( 16 points) Show the format of the main memory address. ( 7 points)(2) For a certain block of main memory, how many cache lines can it map to? ( 2 points)(3) For a certain line of cache memory, how many blocks of main memory may be mapped to ? ( 2 points)(4) Where in the cache is the word

8、 from memory location ABCDE8F8 mapped? ( 5 points)Answer:(1) 1) Line size=Block size=256words=2 8words = Word# =8bits ( 1 points)2) Number of sets=32kl in es/ 8li nes/set =2 12sets =Set# =12bits ( 2 poi nts)3) Memory size=16M x 256words=2 32words = Length of RA =32 bits= Tag=32-12-8=12 bits ( 2 poi

9、nts)so, address format is : (2 points)tagset#word#12-bit12-bit8-bit(2) 8 lines ( 2 points)Tag 12(3) 2 g=2 =4K blocks (2 points)(4) ABCDE8F8H= 1010, 1011, 1100,1101, 1110, 1000,1111, 1000 ( 2 points)Tag=ABCHSET#=DE8H( 2 poi nts)memory location ABCDE8F8 can be mapped to any line of set DE8H, tag= ABCH

10、 ( 1 poi nts)III. Suppose the Hamming code 0101 1101 0101 is just read from memory , please use theHamming algorithm to determine what is thevalid 8-bit data? (14 points)k(1) 2 -1 m+k m=8 = k=4-bit (1 points)Bit PositionPosition numberCheck bitData bit121100:D8111011D7101010D691001D581000C870111D46r

11、 0110r D350101D240100C430011D20010C210001C Set up a table (3 points)010111010101C8C4C2C1 =1001 (1 points)D8 D7 D6 D5 D4 D3 D2 D1=01011011(1 points)(3)Calculates new check bits:C1 (1,2,4,5,7)= $ 1 1 1 1=1(1 points)C2 (1,3,4,6,7)= 0 1 0 1=1(1 points)C4 (2,3,4,8) = 0 1 0=0(1 points)C8 (5,6,7,8) = 0 1 0

12、= 0 (1 points)= new check bits: C8C4C2C1=0011(4) syndrome words=C8C4C2C1 C8C4C2C1=1001 0011=1010 (2 points)D6 has an error, so correct D6=1 (1 points)So correct data bit :0111 1011 (1 points)IV. In multi-processor systems, MESI protocol is used to solve the problem of cache coherence. According to t

13、he given figure, answer the following questions:o o o oIn itialSno opy1) (14 pointsThis is the case of .2) Please complete this figure.3) With this case , please fill best answers into the following table.The states in beginWhere is the Valid data?ActionsThe states in endInitialsnoopyInitialsnoopy1)

14、 This is the case of write hit2) Please complete this figure.3) With this case , please fill best answers into the following table.The states in beginWhere is theValid data?ActionsThe states in endInitialsnoopyInitialsnoopyEIThe cache in Exclusive stateandMM.The initial just updates the word, and transitions to modified state.MISSThe cache in shared state and MMThe initial signals its exclusive ownership of the cache line on the bus, the snoopy in shared state transitions to invalid state. The initial updates the word and transitions to modified state ,MIMIOnlythecacheinmodified

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 建筑/环境 > 施工组织

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号