Why PC in RISC V architecture connect with PC+4 instead of PC+2 or PC+1. I think it depend on the width of memory cell of the Instruction Memory (IMEM). If the width is 16 bits, then we need to load two adjacent addresses to fill 32 bits instruction or if the width is 32 bits, we only need to load one address to take the full instruction.
Why Program Counter in RISC V should be added by 4 instead of adding 0 or 2
6.6k Views Asked by Khoa Trần At
1
There are 1 best solutions below
Related Questions in MEMORY
- DataTable does not release memory
- Impala Resource Estimation for queries with Group by
- Is there any way to get a lru list in Linux kernel?
- C# console application - Unhandled exception while finding the Available and free Ram space.Getting exact answer in windows forms application
- Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in PHP
- C# equivalent of Java Memory mapping methods
- How to figure out the optimal fetch size for the select query
- Creating two arrays with malloc on the same line
- Using parse.com and having allocation memory issue
- error reading variable: cannot access memory at address
- CentOS memory availability
- Correct idiom for freeing repr(C) structs using Drop trait
- Find Ram/Memory manufacturer in Linux?
- Profiling memory usage on App Engine
- Access Violation: 0xC0000005, why is this happening?
Related Questions in PROGRAM-COUNTER
- Questions about adding jal instruction to mips single cycle datapath
- VHDL Program counter using signals and previously made components?
- VHDL Program Counter , multiple constant driver error
- How is code stored and executed on the C++ abstract machine?
- How to modify return address on Stack in C or Assembly
- RISC-V architecture, why do one add 4 bytes with no branch but shift with one when branch?
- Program Counter changes
- branch if not equal to PC address
- Trying to understand an assembly line of ARM7
- Comp Architecture - LC-3
- How is value of Program Counter incremented?
- Android Studio counter
- Why Program Counter in RISC V should be added by 4 instead of adding 0 or 2
- Address in Program Counter Register
- Program counter in processes
Related Questions in RISCV32
- Access rights in RISC-V linkerscripts
- Minimum CSR requirements to run Linux
- "Properly" dereferencing pointer to address zero in RISC-V
- Creating Cache Conflict in assembly
- Pipelining stalls and data-forwarding
- Concatenate values to float64 in RISC V
- How do I store or load by byte unit into memory when using “riscv32-unknown-elf-gcc”?
- SPI test case in C for Pulpissimo
- Shift 32 bit Numbers on a 16 bit Datapath
- [LLVM][RISCV] Easy way to promote byte loads/stores to word/dword loads/stores?
- Executing dynamically generated code on RISC-V
- Compiling rv32i Code includes compressed Instructions
- Unrecognized opcode in creating custom RISC-V instruction
- Extend risc-v instructions on QEMU
- Running GCC compiled code on custom machine. cant find sp initialization in assembly
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
RISC-V deals with everything in byte addresses (from page 19 of the ISA manual: "RV32I provides a 32-bit user address space that is byte-addressed and little-endian"). So when using byte addresses, it makes sense to think of the PC as incrementing by 4, as each of the RV32 instructions are 4 bytes.
When we say RISC-V increments the PC by 4, what that means is that for any given byte address
Xof a 32-bit RISC-V instruction, the next instruction will begin in memory at addressX+4. (Note that when using compressed instructions, which are 16 bits / 2 bytes, the PC is incremented by 2).An IMEM read width of 16 bits means 2 reads from IMEM are necessary to get a full instruction, and an IMEM read width of 32 bits means only 1 read from IMEM is necessary to get a full instruction. But these are implementation considerations, not an ISA considerations -- you could hypothetically implement an ISA-compliant RISC-V processor with either type of IMEM.