Why is it required to increment PC by 4bits in RISC Architecture?

137 views
Skip to first unread message

Meet Sangani

unread,
Dec 20, 2023, 11:56:21 AM12/20/23
to RISC-V ISA Dev
Hello Everyone,

I am currently working on developing a 32bit RISC-V core and I am getting confused when PC is incremented by 4 bits. Since my PC is 32bit wide so one complete instruction can be fetched from memory in one clock cycle. Then why it is required to increment PC by 4bits?

Please help me in this situation and explain in detail is possible.

Richard Herveille

unread,
Dec 20, 2023, 11:58:13 AM12/20/23
to Meet Sangani, RISC-V ISA Dev, Richard Herveille

PC contains byte addresses

You fetch 32bits; i.e. 4 bytes.

Hence PC must increment by 4

 

Richard

 

 

--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/9a8e5b1d-32b9-47ad-9e1a-3c5f09f36572n%40groups.riscv.org.

Tommy Murphy

unread,
Dec 20, 2023, 12:11:55 PM12/20/23
to RISC-V ISA Dev, Meet Sangani
On Wednesday 20 December 2023 at 16:56:21 UTC Meet Sangani wrote:

... why it is required to increment PC by 4bits?
 
What requirement are you referring to and where is it stated?
Are you referring to some specific RISC-V implementation perhaps?

Isn't the handling of PC increments a micro-architectural issue/implementation detail outside the scope of the ISA specs?
I can't see anything in the specs that dictate how this is required to be done.
Reply all
Reply to author
Forward
0 new messages