Skip to content

What ensures that addition/subtraction completes within a single clock cycle? #141

Answered by stnolting
Aaron1011 asked this question in Q&A
Discussion options

You must be logged in to vote

Assuming my understanding is correct:

You are right. But those simple ALU operations like "add" are processed within a single cycle: on the first rising edge of the clock the operands are output from the register file, applied to the ALU (and thus, the adder). The data propagates through the circuit and arrives the input of the register file (rf_wdata). Since the register file's write enable (ctrl_i(ctrl_rf_wb_en_c)) is also applied on this first edge, the computation result is written back to the register file with the next rising edge.

In the next cycle, the CPU moves to the DISPATCH state to get the next instruction and to prepare the output of the operation's operands from the regis…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Aaron1011
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants