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

72 views
Skip to first unread message

Meet Sangani

unread,
Dec 20, 2023, 11:55:56 AM12/20/23
to RISC-V HW 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.

Ahmed Juba

unread,
Feb 29, 2024, 9:27:27 AMFeb 29
to RISC-V HW Dev, meetsanga...@gmail.com
Hello There,

Because the memory is byte-aligned, and the instruction is 32-bits wide which's 4 bytes so in order to fetch the next instruction you have to increment the pc with 4 bytes that addresses next instruction.

Tommy Murphy

unread,
Feb 29, 2024, 9:46:08 AMFeb 29
to Ahmed Juba, RISC-V HW Dev, meetsanga...@gmail.com
and the instruction is 32-bits

Not necessarily - e.g. 16-bit compressed instructions.

From: Ahmed Juba <ahmed.j...@gmail.com>
Sent: Thursday, February 29, 2024 2:27:27 PM
To: RISC-V HW Dev <hw-...@groups.riscv.org>
Cc: meetsanga...@gmail.com <meetsanga...@gmail.com>
Subject: [hw-dev] Re: Why is it required to increment PC by 4bits in RISC Architecture?
 
--
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+un...@groups.riscv.org.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/210c486e-4c34-47f2-aace-ad751c777326n%40groups.riscv.org.

Tommy Murphy

unread,
Feb 29, 2024, 9:50:09 AMFeb 29
to Ahmed Juba, RISC-V HW Dev, meetsanga...@gmail.com
Reply all
Reply to author
Forward
0 new messages