Read four ISA names, decide which software runs on which processor, and count the cost of a multiply without M.
Hardware context: A multiply by repeated addition on a small model of an RV32I processor, and one addition in registers of 32 and of 64 bits, as test code. Choosing the ISA name of a processor and building software for it
Four processors are named RV32I, RV32IMC, RV32IMAC and RV64GC. The letter G is short for I, M, A, F and D. The last four entries are about the multiply loop of the lesson. It clears x12, and then adds x10 into x12 once for each count in x11.
This worksheet uses named constants. The first three entries show how to record your decisions.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Address | Instruction |
|---|---|
| 00 | addi x12, x0, 0 |
| 04 | beq x11, x0, 0x14 |
| 08 | add x12, x12, x10 |
| 0c | addi x11, x11, -1 |
| 10 | bne x11, x0, 0x8 |
| 14 | ebreak |
Enter every number in decimal. For a yes or no question, enter 1 for yes and 0 for no.
| Entry | Your decision |
|---|---|
| WIDTH_RV32IMC | How many bits wide is a register of RV32IMC? |
| MUL_ON_RV32IMC | Does RV32IMC have a multiply instruction? |
| ATOMIC_ON_RV32IMC | Does RV32IMC have the atomic operations? |
| WIDTH_RV64GC | How many bits wide is a register of RV64GC? |
| MUL_ON_RV64GC | Does RV64GC have a multiply instruction? |
| INSTRUCTION_BITS_RV64I | How many bits long is an instruction of RV64I? |
| RUN_IM_ON_IMAC | Does a program built for RV32IM run on RV32IMAC? |
| RUN_IMAC_ON_IMC | Does a program built for RV32IMAC run on RV32IMC, if it uses atomic operations? |
| RUN_RV32I_ON_RV64GC | Does a program built for RV32I run on RV64GC as it is? |
| RUN_IMC_ON_I | Does a program built for RV32IMC run on RV32I, if it multiplies? |
| TURNS_FOR_5_TIMES_4 | The loop starts with 5 in x10 and 4 in x11. How many times does the add at 08 run? |
| X12_FOR_5_TIMES_4 | What does x12 hold at the ebreak, for 5 in x10 and 4 in x11? |
| INSTRUCTIONS_FOR_5_TIMES_4 | How many instructions run before the ebreak, for 5 in x10 and 4 in x11? |
| INSTRUCTIONS_FOR_B | The loop starts with B in x11. Give the number of instructions that run before the ebreak, as an expression in B. |
Examples
Example 1
WIDTH RV32IMC- Input
How many bits wide is a register of RV32IMC?
- Output
matches = 1
The number in the name is the width of a register.
Example 2
MUL ON RV32IMC- Input
Does RV32IMC have a multiply instruction?
- Output
matches = 1
The letter M is multiply and divide.
Example 3
ATOMIC ON RV32IMC- Input
Does RV32IMC have the atomic operations?
- Output
matches = 1
There is no letter A in the name.
Constraints and Contract
- Keep the parameter and named constants. Use the numeric codes and units on this page.
- For INSTRUCTIONS_FOR_B, enter a constant expression using B. Only this entry changes with the parameter. The supported integer range is 7 through 84, inclusive.
Hints
Hint 1
Write the name as RV, a number and letters. Replace G with I, M, A, F and D.
Hint 2
A program runs when the processor has the same width and every letter that the program uses.
Hint 3
Count the instructions of one turn of the loop, and the ones that run only once.
What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.
14 checks on Icarus Verilog · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your source only; samples require the simulation service. A passing result establishes the tested cases, not a proof for all possible inputs.
See all 1 problem on this path