NTU-Exam 板


LINE

課程名稱︰計算機結構 課程性質︰必修 課程教師︰洪士灝 開課學院:電資學院 開課系所︰資工系 考試日期(年月日)︰2016/11/17 考試時限(分鐘):180分鐘左右 試題 : 1. (30pts) A lot of people are taling about Internet of Things(IoT). According to Wikipedia: IoT is the internetworking of physical devices, vehicles(also referred to as "connected devices" and "smart devices"), buildings and other items -- embedded with electronics, software, sensors, actuators, and network connectivety that enable these objects to collect and exchange data. The IoT allows objects to be sensed and/or controlled remotely across existing network infrastructure, creating opportunities for more direct integration of the physical world into computer-based systems, and resulting in improved efficiency, accracy and economic benefit. Experts estimate that the IoT will consist of almost 50 billion objects by 2020. Typically, IoT is expected to offer advanced connectivity of devices, systems, and services that goes beyond machine-to-machine (M2M) communications and covers a variety of protocols, domains, and applications.The interconnection of these embedded devices (including smart objects), is expected to usher in automation in nearly all fields, while also enabling advanced applications like a smart grid, and expanding to the areas such as smart cities. "Things," in the IoT sense, can refer to a wide variety of devices such as heart monitoring implants, biochip transponders on farm animals, electric clams in coastal waters, automobiles with built-in sensors, DNA analysis devices for environmental/food/pathogen monitoring or field operation devices that assist firefighters in search and rescue operations. Legal scholars suggest to look at "Things" as an "inextricable mixture of hardware, software, data and service".These devices collect useful data with the help of various existing technologies and then autonomously flow the data between other devices. Current market examples include home automation (also known as smart home devices) such as the control and automation of lighting, heating (like smart thermostat), ventilation, air conditioning (HVAC) systems, and appliances such as washer/dryers, robotic vacuums, air purifiers , ovens or refrigerators/freezers that use Wi-Fi for remote monitoring. As well as the expansion of Internet-connected automation into a plethora of new application areas, IoT is also expected to generate large amounts of data from diverse locations, with the consequent necessity for quick aggregation of the data, and an increase in the need to index, store, and process such data more effectively. IoT is one of the platforms of today's Smart City, and Smart Energy Management Systems. The concept of the Internet of Things was invented by and term coined by Peter T. Lewis in September 1985 in a speech he delivered at a U.S. Federal Communications Commission (FCC) supported session at the Congressional Black Caucus 15th Legislative Weekend Conference. Please answer the following questions as complete as possible. (a)(10pts)Since the concept of IoT was "invented" in 1985, why do people start to talk about it until recently?(There are several reasons). (b)(10pts)What kind(s) of computers are needed for this IoT Era? For each kind , please list example applications, describe its typical system configuration and the design issues. (c)(10pts)Similar things can be said about the rise of Artificial Intellifence (AI) in recent years. Actually, AI was very popular in '80s, but it suddenly stopped to talk about it(at least from the industry's point of view) Why? How does this relate to computer architecture? 2. (20pts)Please answer the following questions after reading the MIPS assembly code in the next page. Note that you do NOT need to understand the entire program to analyze the performance, as compilers and processors do not understand the entire program either. The instruction bltz is "branch on less than zero", which branches to the label if the register is less than zero. You can write your ansewers directly on Page 3. (a)(10pts)A basic block is a sequence of instructions without branches, except possibly at the end, and without branch targets or branch labels, except possibly at the beginning. One of the first early phases of compilation is breaking the program into basic blocks. Please identify all the basic block(s) in this assembly code. (b)(10pts)A data dependency in computer science is a situation in which a program statement(instruction) refers to the data of a preceding statement. Please identify all the data dependencies in this assembly code. ASSEMBLY CODE 1 start: 2 lw $t0, 0($gp) #fetch i 3 bltz $t0, def #i<0 ->default 4 slti $t1, $t0, 3 #i<3? 5 beq $t1, $zero, def #no, -> default 6 sll $t0, $t0, 2 #turn i into a byte offset 7 add $t2, $t0, $gp 8 lw $t2, 1064($t2) #fetch the branch table entry 9 jr $t2 #go... 10 is0: sw $zero, 28($gp) #A[0] = 0 11 j case_done 12 is1: 13 is2: addi $t0, $zero, 1 # = 1 14 sw $t0, 32($gp) #A[1] = 1 15 j case_done 16 def: addi $t0, $zero, -1 # = -1 17 sw $t0, 28(gp) #A[0] = -1 18 j case_done 19 case_done: 20 lw $t0, 0($gp) #fetch i 21 lw $t1, 4($gp) #fetch N 22 alt $t1, $t0, $t1 #set $t1 to 1 if $t0 < $t1, to 0 otherwise 23 beq $t1, $zero, skip #branch if result of slt is 0(i.e., !(i<N)) 24 sll $t0, $t0, 2 #i as a byte offset 25 add $t0, $t0, $gp #&A[i] - 28 26 sw $zero, 28($t0) #A[i] = 0 27 skip: 28 add $t0, $gp, $zero #&A[0] - 28 29 lw $t1, 4($gp) #fetch N 30 sll $t1, $t1, 2 #N as byte offset 31 add $t1, $t1, $gp #&A[N] - 28 32 ori $t2, $zero, 256 #MAX_SIZE 33 top: 34 sltu $t3, $t0, $t1 #have we reached the final address? 35 beq $t3, $zero, loop_end #yes, we're done 36 sw $t2, 28($t0) #A[i] = 0 37 addi $t0, $t0, 4 #update $t0 to point to next element 38 j top #go to top of loop 39 loop_end: -ASSEMBLY END- 3. (40pts)Let us analyze the performance of the assembly code on Page 3 for the 5-stage pipelined MIPS datapath shown below. Note that the branch instruction are handle in the EX stage, and there is no data forwarding unit. (a)(10pts)Data hazards can stall the pipeline and cause pieline bubbles. Data hazards mainly come from data dependencies, but not all data dependencies can cause data hazards. Please identify all the pipeline bubbles cause by data hazards in the assembly code. (b)(10pts)Control hazards can stall the pipeline and cause pipeline bubbles. Please identify all the pipeline bubbles cause by control hazards in the assembly code. (c)(10pts)Branch prediction can reduce the penalty caused by contrl hazards only if the prediction is correct. Please discuss the likelihood of correct prediction for the branches in the assembly code. Which branches can be predicted with high probability? Why? (d)(10pts)Loop unrolling is a common technique to eliminate data hazards and speed up the execution. If you have not noticed, Lines 33~39 constitute a loop. Please unroll the loop 4 times(write down the unrolled code on the answer sheet) and estimate the resulted performance. 4. (10pts)Assume we have convented the processor in Problem 3 into a static dual-issue processor, which can execute 2 instructions per cycle, as shown in the following figure. Instruction type Pipe stages ALU or branch instruction IF ID EX MEM WB Load or store instruction IF ID EX MEM WB ALU or branch instruction IF ID EX MEM WB Load or store instruction IF ID EX MEM WB ALU or branch instruction IF ID EX MEM WB Load or store instruction IF ID EX MEM WB ALU or branch instruction IF ID EX MEM WB Load or store instruction IF ID EX MEM WB (a)(5pts)Calculate the number of cycles needed to execute the assembly codes for the loop constituted by Lines 33~39 on Page 3. (b)(5pts)Calculate the number of cycles needed to execute the assembly codes for the loop after you unroll it 4 times as in your answer to Question 3(d). --



※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.43.94.48
※ 文章網址: https://webptt.com/m.aspx?n=bbs/NTU-Exam/M.1486026616.A.49B.html
1F:推 rod24574575 : 已收資訊系! 02/02 21:27







like.gif 您可能會有興趣的文章
icon.png[問題/行為] 貓晚上進房間會不會有憋尿問題
icon.pngRe: [閒聊] 選了錯誤的女孩成為魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一張
icon.png[心得] EMS高領長版毛衣.墨小樓MC1002
icon.png[分享] 丹龍隔熱紙GE55+33+22
icon.png[問題] 清洗洗衣機
icon.png[尋物] 窗台下的空間
icon.png[閒聊] 双極の女神1 木魔爵
icon.png[售車] 新竹 1997 march 1297cc 白色 四門
icon.png[討論] 能從照片感受到攝影者心情嗎
icon.png[狂賀] 賀賀賀賀 賀!島村卯月!總選舉NO.1
icon.png[難過] 羨慕白皮膚的女生
icon.png閱讀文章
icon.png[黑特]
icon.png[問題] SBK S1安裝於安全帽位置
icon.png[分享] 舊woo100絕版開箱!!
icon.pngRe: [無言] 關於小包衛生紙
icon.png[開箱] E5-2683V3 RX480Strix 快睿C1 簡單測試
icon.png[心得] 蒼の海賊龍 地獄 執行者16PT
icon.png[售車] 1999年Virage iO 1.8EXi
icon.png[心得] 挑戰33 LV10 獅子座pt solo
icon.png[閒聊] 手把手教你不被桶之新手主購教學
icon.png[分享] Civic Type R 量產版官方照無預警流出
icon.png[售車] Golf 4 2.0 銀色 自排
icon.png[出售] Graco提籃汽座(有底座)2000元誠可議
icon.png[問題] 請問補牙材質掉了還能再補嗎?(台中半年內
icon.png[問題] 44th 單曲 生寫竟然都給重複的啊啊!
icon.png[心得] 華南紅卡/icash 核卡
icon.png[問題] 拔牙矯正這樣正常嗎
icon.png[贈送] 老莫高業 初業 102年版
icon.png[情報] 三大行動支付 本季掀戰火
icon.png[寶寶] 博客來Amos水蠟筆5/1特價五折
icon.pngRe: [心得] 新鮮人一些面試分享
icon.png[心得] 蒼の海賊龍 地獄 麒麟25PT
icon.pngRe: [閒聊] (君の名は。雷慎入) 君名二創漫畫翻譯
icon.pngRe: [閒聊] OGN中場影片:失蹤人口局 (英文字幕)
icon.png[問題] 台灣大哥大4G訊號差
icon.png[出售] [全國]全新千尋侘草LED燈, 水草

請輸入看板名稱,例如:BuyTogether站內搜尋

TOP