简体   繁体   English

8 位 CPU 和内存读取的时钟周期

[英]Clock cycles for a 8bit CPU and memory reads

Is it possible for a 8bit CPU to read memory in less than 3 clock cycles? 8 位 CPU 是否有可能在不到 3 个时钟周期内读取内存? I know that the 6502 works with an asynchronous memory but what about other 8bit CPUs with clocked memories?我知道 6502 使用异步内存,但是其他带有时钟内存的 8 位 CPU 呢? Do I need a clock divider to make the CPU slower?我需要一个时钟分频器来使 CPU 变慢吗?

My understanding is that during cycle 1: CPU outputs an address, during cycle 2: memory reads the address then gives the corresponding byte, and during cycle 3: CPU finally receives byte.我的理解是在周期1:CPU输出地址,在周期2:内存读取地址然后给出对应的字节,在周期3:CPU最终接收字节。 Is this correct?这样对吗?

My understanding is that during cycle 1: CPU outputs an address, during cycle 2: memory reads the address then gives the corresponding byte, and during cycle 3: CPU finally receives byte.我的理解是在周期1:CPU输出地址,在周期2:内存读取地址然后给出对应的字节,在周期3:CPU最终接收字节。 Is this correct?这样对吗?

That's not quite right.这不太对。 In particular, the CPU must "receive" the byte in the same cycle that the memory has "given" it.特别是,CPU 必须在内存“给出”字节的同一周期内“接收”字节。 Generally, the value is latched with a rising or falling clock edge.通常,该值通过时钟上升沿或下降沿锁存。

What exactly takes place depends on the instruction that's executing.究竟发生了什么取决于正在执行的指令。 For example, an LDA immediate takes two cycles.例如,LDA 立即数需要两个周期。 The first cycle, the CPU reads the opcode.第一个周期,CPU 读取操作码。 The second cycle, the CPU reads the operand and stores it in the accumulator.第二个周期,CPU 读取操作数并将其存储在累加器中。

Another example: LDA zeropage.另一个例子:LDA 零页。 The CPU reads the instruction in the first cycle. CPU 在第一个周期读取指令。 It reads the address in the second cycle.它在第二个周期读取地址。 Then it reads the datum into the accumulator on the third and last cycle of the instruction.然后它在指令的第三个也是最后一个周期将数据读入累加器。

Notice how each cycle is a memory access on the 6502. An address is output, and an 8 bit value is read in or written out.注意每个周期是如何对 6502 进行内存访问。输出地址,读入或写出 8 位值。 Always.总是。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM