Try   HackMD

Assignment1: RISC-V Assembly and Instruction Pipeline

Due: Oct 10, 2022

Requirements

  1. Following the instructions of Lab1: RV32I Simulator, you shall write RISC-V assembly programs (RV32I ISA) and output to the console with environment calls.
    • Select one of the problems listed at LeetCode. Difficuty "Easy" is preferable. The input data of specified LeetCode problems MUST be accessed in the form of pointer, array, linked list, or tree. It is not permitted to have only primitive integer types such as char and int in parameter list.
      • That is, you CAN NOT select 69. Sqrt(x), which specifies one integer paramater instead of memory regions.
    • At least 3 test data should be included in your program(s).
      • Without accepting an external data set, you can inline the predefined data.
    • Avoid solving the same problem as others. You will have a separate program for a unique problem.
      • Then, you shall start earlier, otherwise there would be less availability for you to work on.
    • Your program(s) MUST contain loops (or recursive calls) and conditional branches.
    • Although you MUST write down your own RISC-V assembly, you can still verify the output of the C compiler's assembly output. As a result, you are able to describe the entire program.
    • You have to ensure the program fully functioned with Ripes simulator.
    • Reference: Example RISC-V Assembly Programs
  2. You have to explain how each instruction works along with Ripes simulator.
    • Using the visualization for signals such as register write/enable signals, multiplexer input selection, and more, describe your application. You must provide examples for each stage, including IF, ID, IE, MEM, and WB. You should also explain the appropriate memory update steps.
  3. Write down your thoughts and progress in HackMD notes.
    • Example page

      Image Not Showing Possible Reasons
      • The image file may be corrupted
      • The server hosting the image is unavailable
      • The image path is incorrect
      • The image format is not supported
      Learn More →
      Do not modify this note.

    • Insert your HackMD notes and RISC-V assembly programs in the following table.
    • Your HackMD page should be Published and editable as Signed-in write.
    • You MUST write in English, of course.

Fill in the table for your homework

Formal given name Descriptions HackMD note Program (GitHub hyperlink)
Sample1 Single number II (LeetCode 137) Lab1: RV32I Simulator -
Sample2 Patching Array (LeetCode330) Lab1: RV32I Simulator Patching Array
Sample3 Shuffle the Array (LeetCode 1470) Lab1: RV32I Simulator Shuffle the Array
鄭明奇+ Remove Duplicates from Sorted Array (LeetCode 26) Lab1: RV32I Simulator Remove Duplicates from Sorted Array
潘鴻福 Long Pressed Name (LeetCode 925) Lab1: RV32I Simulator Long Pressed Name
陳品崴 Pascal's Triangle II (LeetCode 119) Lab1: RV32I Simulator Pascal's Triangle II
馮柏為 Find the Highest Altitude (LeetCode 1732) Lab1: RV32I Simulator Longest Common Prefix
周士翔 Two sum (LeetCode 1) Lab1: RV32I Simulator Two sum
黃彥承 Missing Number (LeetCode 268) Lab1: RV32I Simulator Missing Number
何坤霖 Majority Element(LeetCode 169) Lab1: RV32I Simulator Majority Element
吳宇晨 Find Target Indices After Sorting Array (LeetCode 2089) Lab1: RV32I Simulator Find Target Indices After Sorting Array
王漢祺 Three Consecutive Odds (LeetCode 1550) Lab1: RV32I Simulator Three Consecutive Odds
陳韋勳+ Remove Element (LeetCode 27) Lab1: RV32I Simulator Remove Element
鄭至崴 Move Zeroes (LeetCode 283) Lab1: RV32I Simulator Move Zeroes
張瑞甫 Trapping Rain Water(LeetCode42) Lab1: RV32I Simulator Trapping Rain Water
黃榆哲 Best Time to Buy and Sell Stock(LeetCode 121) Lab1: RV32I Simulator Best Time to Buy and Sell Stock
楊淳皓 Concatenation of Array (LeetCode 1929) Lab1: RV321 Simulator Concatenation of Array
王彥翔 Convert Binary Number in a Linked List to Integer(LeetCode 1290) Lab1: RV321 Simulator Convert Binary Number in a Linked List to Integer
謝鈞霖 Find the Difference(LeetCode 389) Lab1: RV321 Simulator Find the Difference
謝長成 Number of Good Pairs(LeetCode 1512) Lab1: RV321 Simulator Number of Good Pairs
陳邦尉 122. Best Time to Buy and Sell Stock II(LeetCode 122) Lab1: RV321 Simulator Best Time to Buy and Sell Stock
張中龍 Lemonade Change(LeetCode 860) Lab1: RV321 Simulator Lemonade Change
陳奕萍 Search Insert Position (LeetCode 35) Lab1: RV321 Simulator Search Insert Position
蘇勇達 Length of Last Word (LeetCode 58) Lab1: RV321 Simulator Length of Last Word
陳彥甫 Remove Linked List Elements (LeetCode 203) Lab1: RV321 Simulator Remove Linked List Elements
吳峻廷 Linked List Cycle (LeetCode 141) Lab1: RV321 Simulator Linked List Cycle
王昱承 Running Sum of 1d Array (LeetCode 1480) Lab1: RV321 Simulator Running Sum of 1d Array
黃昱澄 Build Array from Permutation(LeetCode1920) Lab1: RV321 Simulator Build Array from Permutation
吳紀寬 Single Number(LeetCode136) Lab1: RV321 Simulator Single Number
黃冠予 Decode XORed Array(LeetCode1720) Lab1: RV321 Simulator Decode XORed Array
俞杉麒 Decompress Run-Length Encoded List(LeetCode1313) Lab1: RV321 Simulator Decompress Run-Length Encoded List
張邦翰 Monotonic Array(LeetCode 896) Lab1: RV32I Simulator Monotonic Array
吳昱 Palindrome Linked List(LeetCode 234) Lab1: RV32I Simulator Palindrome Linked List
洪嘉志 Sort Array By Parity (LeetCode 905) Lab1: RV32I Simulator Sort Array By Parity
江坤諦 Remove Duplicates from Sorted List II(LeetCode 82) Lab1: RV32I Simulator Remove Duplicates from Sorted List II
賴致文+ Find Numbers with Even Number of Digits(LeetCode1295) Lab1: RV32I Simulator Find Numbers with Even Number of Digits
陳嘉晟 Add Two Numbers (LeetCode2) Lab1: RV32I Simulator Add Two Numbers
杜孟聰 Invert Binary Tree (LeetCode 226) Lab1: RV32I Simulator Invert Binary Tree
曾晧峖 Valid Anagram (Leetcode 242) Lab1: RV32I Simulator Valid Anagram
莊集+ Contains Duplicate (Leetcode 217) Lab1: RV32I Simulator Contains Duplicate
方宣翔 Plus One (Leetcode 66) Lab1: RV32I Simulator Plus One
陳證仰 Merge Two Sorted Lists (LeetCode 21) Lab1: RV32I Simulator Merge Two Sorted Lists
鄒崴丞 Binary Search (LeetCode 704) Lab1: RV32I Simulator Binary Search
李協儒 Reverse Linked List (LeetCode 206) Lab1: RV32I Simulator Reverse Linked List
黃柏瑜 Jewels and Stones (LeetCode 771) Lab1: RV32I Simulator Jewels and Stones
陳柏瑋 Find Pivot Index (LeetCode 724) Lab1: RV32I Simulator Find Pivot Index
陳靖雯 Roman to Integer (LeetCode 13) Lab1: RV32I Simulator Roman to Integer