(20/6/2020之前持續更新)傳感,驅動,控制-第十一章quiz2複習筆記(UTS-41081)

悉尼科技大學期末複習筆記
【試題總結】:
Latency:
在這裏插入圖片描述

  • What is longest time the system might take to detect a rise on A0? 500ms
  • After A0 rises, how much time is spent in state Compute? 500ms
  • When a tick occurs that transitions to state Write, how much time passes before the output B is updated?0
  • What is the maximum latency between A0 rising and B being updated?1000ms
  • The Compute state could be eliminated, moving Compute’s actions to the top of Write’s actions, or moving them to Mealy actions on the transition from Wait to Write. What is the maximum latency between A0 rising and B being updated in that case?500ms
  • For the original synchSM above, what would be the maximum latency if the period was set to 100?200ms

11.1 計算任務最壞執行時間
可以通過用匯編指令數乘執行器執行每個彙編任務的時間來估算。

  • 簡單的複製語句需要3個彙編指令
  • 比較語句需要2個彙編指令
  • 只考慮簡單賦值的操作,複雜的語句替換成簡單的再執行
  • 現代的微控制器每個時鐘週期執行大約1條指令,因此時鐘頻率爲1 MHz的微控制器執行1百萬條指令/秒,即每條指令1微秒,而1 GHz時鐘意味着每條指令1納秒。

在這裏插入圖片描述
【錯題總結】
假設每條指令需要2微秒才能執行。

  1. 該狀態有動作B0 = 1,B1 = 0,B2 = 1,B3 =0。一個刻度需要多少微秒? 4x3x2 = 24
  2. 該狀態的作用爲B = X + Y +Z。一個刻度需要多少微秒?tmp = X+Y; B = tmp+Z => 3x2x2=12
  3. 如果synchSM的週期爲20微秒,並且動作tmp = X + Y,B = tmp + Z,那麼利用率是多少? 12/20 = 60%
  4. 如果微控制器具有100 MHz時鐘,並且每個時鐘週期執行1條指令,則執行1條指令需要多長時間(以納秒爲單位)?

狀態的動作可能包括循環,函數調用,分支語句等
對於for循環,分析應包括循環初始化(i = 0:3個指令),加上循環控制指令(i <4,而i ++,所以2 + 3),並且還應將每個循環的指令相乘-迭代次數。上面的循環迭代4次。如果循環迭代次數與數據有關,則應使用迭代次數的上限。
WCET:worst -case exectue time在這裏插入圖片描述
【錯題整理】
基於下圖回答問題:
在這裏插入圖片描述
5. S0的WCET是多少?3+2+3+3 = 11
6. S1的WCET是多少? 3+(3+3+2)*100+3 = 806
7. WECT是S0和S1的最長執行時間。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章