CPU执行时间
我想知道在速度为 16MHZ 的处理器上运行的 Flat(无循环、无跳转、无动态内存分配)代码的执行时间是多少。是否取决于代码长度。如果P1具有N1指令并且P2具有N2指令,使得N2>N2。 N1。处理器的执行时间在纳秒范围内。
I want to know what will be execution time for Flat (no loops, no jumps, no dynamic memory allocation) code running on processor with speed 16MHZ. Does it depends on code length. If P1 have N1 instructions and P2 with N2 instructions such that N2 > N1. Is Execution time of processor is in range of nano seconds.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
关于 16MHz CPU,你唯一能真正说的是时钟信号每秒翻转 1600 万次,我对此并不完全确定!:-)
执行时间取决于很多因素变量:
等等。
换句话说,除了原始时钟速度之外,还有很多因素需要考虑。
对于一个非常简单的 CPU,每条指令占用一个时钟周期,没有由于内存访问或其他 I/O 造成的延迟,没有流水线,没有并发执行,并且没有其他任何会影响每个时钟周期一条指令的性质,那么是的,它仅取决于代码的长度。
但自 8080/6502 时代以来,我认为我从未见过如此简单的 CPU :-)
The only thing you can really say about a 16MHz CPU is that the clock signal is flipping sixteen million times per second, and I'm not entirely sure of that! :-)
Execution time depends on so many variables:
and so on.
In other words, there's a huge number of factors to take into account other than the raw clockspeed.
For a very simple CPU with every instruction taking one clock cycle, no delays due to memory accesses or other I/O, no pipelining, no concurrent execution, and nothing else that will affect the one instruction per clock cycle nature, then yes, it depends just on the length of the code.
But I don't think I've seen CPUs that simple since the 8080/6502 days :-)