码迷,mamicode.com
首页 > 其他好文 > 详细

mutiple cycle cpu (转)

时间:2014-05-07 11:23:20      阅读:417      评论:0      收藏:0      [点我收藏+]

标签:code   tar   ext   int   get   http   

言简意赅

 

A single instruction enters the CPU at the Fetch stage and the PC is incremented in one clock cycle. In the next clock cycle, the instruction moves to the Decode stage. In the third clock cycle, the instruction moves to the Access stage and the operands are loaded. In the last two stages, the instruction is executed and the result is stored.

 

 

here‘s  multi-cycle datapath: bubuko.com,布布扣

the first things you should notice when looking at the datapath is that it has fewer functional units than the single cycle cpu. we only have one memory unit, and only one alu. on the other hand, we have lots of registers that we didn‘t have before: ir ("instruction register"), mdr ("memory data register"), a, b, and aluout.

so, the obvious first question is: why can we get away with fewer functional units, and why do we need all these registers? we don‘t need as many functional units because we can re-use the same functional unit for a different purpose on a different clock cycle. for example, during the first cycle of execution, we use the alu to compute pc+4. on the second cycle, we use the alu to precompute the target address of a branch.

we need the extra registers because we will need data from earlier cycles in later cycles. for example, we read the register file in the second cycle of execution, but we will need the values that we read in the third cycle. the extra registers allow us to remember values across clock cycles. 

if i point to any component on the multi-cycle datapath, you should be able to tell me what it is and why we need it.

mutiple cycle cpu (转),布布扣,bubuko.com

mutiple cycle cpu (转)

标签:code   tar   ext   int   get   http   

原文地址:http://www.cnblogs.com/csxyc/p/3712868.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!