# In instructions pipelining, why does register read/write take up only half clock cycle?

While studying instruction pipelining in MIPS processor, we make an assumption that registers read/write stages take only a half clock cycle, as this picture shows (half clock cycles are dotted in register operations):

So what is the purpose of this assumption? and why is the fourth instruction in this graph is considered a hazard if we actually wrote the value of $2 in the first half clock cycle and then read it in the latter one? • My guess is that in the same cycle you can read the old value of the register and write a new value on it, but you can not write a new value and read that new value. Hence the hazard. – chi May 16 '19 at 17:03 ## 1 Answer By using different phases of a clock cycle for register write and register read, the number of register file ports can be reduced. (This can reduce area and latency.) A two-read and one-write instruction would otherwise require three register file ports (or introduce a structural hazard); by using different phases of the cycle one port can be used for both read and write. This can also facilitate reading from the register file in the same cycle as the value is written, which reduces the number of results that must be managed through the forwarding network. The fourth instruction (add $$14,$$2,$2) does not have a data hazard even without forwarding.

• After more reading into our course reference book, this answer makes perfect sense! Thank you. – Khalid Khalil May 18 '19 at 12:55