0
\$\begingroup\$

CPU

Assuming a CPU has the architecture as in the image, what's the use of the registers A1, A2, and Aout? Why can't the inputs and output be connected directly to the ALU?

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

That is a drawing of a pipelined processor. The registers are there as a speed optimization. It could certainly work without them. For example: assume it takes ALUDelay nanoseconds for the ALU to produce a valid output after receiving new inputs, and it takes MemWriteDelay nanoseconds for the memory to write once it receives new inputs. Then, without the Aout register, you would need to wait (ALUDelay + MemWriteDelay) nanoseconds after presenting inputs to the ALU, to ensure the memory gets written.

But, with Aout, you only have to wait for ALUDelay after presenting inputs to the ALU. Then, on the next clock cycle, you can present new inputs, and let the ALU produce a new result while the memory is busy writing its previous result. That means you only need to wait max(ALUDelay,MemWriteDelay) rather than sum(AluDelay,MemWriteDelay).

Modern desktop processors make heavy use of that sort of pipelining to achieve fast clock speeds.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.