2014-01-06 35 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