2014-01-06 37 views
0

這個問題涉及使用中斷來處理到達輸入接口的數據在內存中的輸入和存儲,以及考慮使用這種機制實現的數據速率。 在這個特定的問題中,每個新數據項的到達觸發了一箇中斷請求,用於輸入數據並將其存儲在內存中的隊列中。問題是計算此場景中可實現的最大數據速率。中斷數據速率計算

您首先需要計算從接口響應中斷的時間,運行中斷服務程序(ISR)並返回到中斷的程序。由此以及每個中斷輸入的數據位數量,您需要計算可以處理的每秒比特數的最大數據速率。 下面給出:CPU響應中斷和切換到ISR所需的時鐘週期數,ISR執行的指令數,ISR中每條指令執行的平均時鐘週期數,每個中斷輸入的數據項中的位以及時鐘頻率。 [你可以假設的是,當CPU可以立即再次儘快ISR完成,但在此之前沒有中斷]

clock cycles to respond to interrupt = 15 
instructions executed in ISR = 50 
average clock cycles per instruction = 8 
number of bits per data item = 8 
clock frequency = 5MHz 

a) What is the time in microseconds to respond to an interrupt from the interface, run the interrupt service routine (ISR) and return to the interrupted program? 

b) What is the maximum data rate in Kbits/second (K is 1000 , not 1024)? 

Answers 
a) 83.0 
b) 96.4 

任何人都可以解釋的答案嗎?

回答

1

A.(50個指令*每指令+ 15個循環的反應8個週期)/ 5兆赫 =(50 * 8 + 15)/ 5 = 83

B.(每ISR 8比特/ 83微秒(usecs)/ISR)* 1000 = (8/83)* 1000 = 96.385

閱讀上Dimensional Analysis

+0

從我的頭... :) – OldProgrammer