Try   HackMD

Assignment1: RISC-V Assembly and Instruction Pipeline

Due: Oct 25, 2021

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.
    • Don't implement the same problem as others do. Your program shall be different.
    • Your program(s) MUST contain loops (or recursive calls) and conditional branches.
    • You can check the assembly output from C compiler, but you should write down RISC-V assembly by your own. Thus, you are able to explain the whole program.
    • You have to ensure the program fully functioned with Ripes simulator.
  2. You have to explain how each instruction works along with Ripes simulator.
    • Explain your program with the visualization for multiplexer input selection, register write/enable signals and more. You have to illustrate each stage such as IF, ID, IE, MEM, and WB. In addition, you should discuss the steps of memory updates accordingly.
  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.
    • Of course, you MUST write in English.

Fill in the table for your homework

Formal given name Descriptions HackMD note Program (GitHub link)
Sample1 Single number II (LeetCode 137) Lab1: RV32I Simulator singleNumber
Sample2 Count Leading Zeros Lab1: RV32I Simulator Count Leading Zeros
Sample3 Dot Product Lab1: RV32I Simulator Dot Product
Sample4 MergeSort Lab1: RV32I Simulator MergeSort
方竫泓+ Patching Array (LeetCode330) Lab1: RV32I Simulator Patching Array
陳亮州+ Peak Index in a Mountain Array (LeetCode 852) Lab1: RV32I Simulator Peak index
彭恩宇 Ugly Number (LeetCode 263) Lab1: RV32I Simulator Ugly Number
徐卓朗 Shuffle the Array (LeetCode 1470) Lab1: RV32I Simulator Shuffle the Array
鍾震 Reverse Bits (LeetCode 190) Lab1: RV32I Simulator Reverse Bits
向景亘 Counting Bits (LeetCode 338) Lab1: RV32I Simulator Counting Bits
李仲恩 TwoSum (LeetCode 1) Lab1: RV32I Simulator Two Sum
陳力維 Pascal's Triangle II (LeetCode 119) Lab1: RV32I Simulator Pascal's Triangle II
鄭學陽 Number of 1 Bits (LeetCode 191) Lab1: RV32I Simulator Number of 1 bits
陳韋綸 Find Numbers with Even Number of Digits (LeetCode 1295) Lab1: RV32I simulator Find Numbers with Even Number of Digits
黃瑋盛 Palindrome Number (LeetCode 9) Lab1: RV32I simulator Palindrome Number
歐禮寬 Plus One (LeetCode 66) Lab1: RV32I Simulator Plus One
林甄羚 Roman to Integer (LeetCode 13) Lab1: RV32I simulator RomanToInteger
許永貞 Find the Highest Altitude (LeetCode 1732) Lab1: RV32I simulator Find the Highest Altitude
劉恩澔 Search Insert Position (LeetCode 35) Lab1: RV32I simulator Search Insert Position
李政憲 Sqrt(x) (LeetCode 69) Lab1: RV32I simulator Sqrt(x)
張又仁 Defuse the Bomb (Leecode 1652) Lab1: RV32I Simulator Defuse the Bomb
朱俊霖 Find Smallest Letter Greater Than Target (Leetcode 744) Lab1: RV32I simulator Find Smallest Letter Greater Than Target
陳銘畯 Move Zeroes (Leetcode 283) Lab1: RV32I simulator Move Zeroes
孫祥鈞 Maximum Subarray (Leetcode 53) Lab1: RV32I simulator Maximum Subarray
蕭又瑜 Two Sum II - Input array is sorted (Leetcode 167) Lab1: RV32I simulator Two Sum II - Input array is sorted
莊崴 Add Binary (Leetcode 67 ) Lab1: RV32I Simulator Add Binary
賴虓翰 N-Repeated Element in Size 2N Array (LeetCode 961) Lab1: RV32I Simulator N-Repeated Element in Size 2N Array
林信宇 Longest Palindrome (LeetCode 409) Lab1: RV32I Simulator Longest Palindrome
黃品程 Power of Four (LeetCode 342) Lab1: RV32I Simulator Power of Four
蕭珮珊 Length of Last Word (LeetCode 58) Lab1:RV32I Simulator Length of Last Word
李安豐 Missing Number (LeetCode 268) Lab1:RV32I Simulator Missing Number
王駿瀚 Matrix Diagonal Sum (LeetCode 1572) Lab1:RV32I Simulator Matrix Diagonal Sum
陳昕佑 Min Cost Climbing Stairs (Leetcode 746) Lab1: RV321 Simulator Min Cost Climbing Stairs
黃上睿 Binary Number with Alternating Bits (Leetcode 693) Lab1: RV32I Simulator Binary Number with Alternating Bits
陳日昇 Sort an Array (LeetCode 912) Lab1: RV32I Simulator Sort an Array
張峻瑋 single number (LeetCode 136) Lab1: RV32I simulator Single number
朱祐均 Best Time to Buy and Sell Stock (LeetCode 121) Lab1: RV32I simulator Best Time to Buy and Sell Stock
李其祐 Majority Element (Leetcode 169) Lab1: RV32I simulator Majority Element
戴仕誠 Climbing Stairs (Leetcode 70) Lab1: RV32I simulator Climbing Stairs
杰凱力艾 Happy Number (Leetcode 202) Lab1: RV32I simulator Happy Number
林嘉歆 Power of Three (Leetcode 326) Lab1: RV32I simulator Power of Three
黃牧恩 Bitwise AND of Numbers Range (Leetcode 201) Lab1: RV32I simulator Bitwise and in range
歐子杰 N-th Tribonacci Number (LeetCode 1137) Assignment1 Tribonacci Number
陳明吉 Hamming Distance (LeetCode 461) Lab1: RV32I simulator Hamming Distance
郭又宗 Number Complement (Leetcode 476 ) Lab1: RV32I Simulator Number Complement
伍志忠 Monotonic Array(LeetCode 896) Lab1: RV32I Simulator Monotonic Array
朱育萱 Find the difference (LeetCode 389) Lab1:RV32I simulator Find the difference
張亦妤 Power of Two (LeetCode 231) Lab1: RV32I Simulator Power of Two
劉品宏 Add Digits(Leetcode 258) Lab1:RV32I Simulator Add Digits
鄭力維+ Perfect Number (Leetcode 507) Lab1:RV32I Simulator Perfect Number
鄒柏宇 Valid Perfect Square(Leetcode 367) Lab1:RV32I Simulator Valid Perfect Square
張力尹 Sort Colors(Leetcode75) Lab1:RV32I Simulator sort colors
陳柏瑋 Fruit Into Baskets(Leetcode 0904) Lab1: RV32I Simulator Fruit Into Baskets
羅紹豪 Fibonacci Number (Leetcode 509) Lab1:RV32I Simulator Fibonacci number
柯凱瑋 Find Peak Element (Leetcode 162) Lab1:RV32I Simulator Find Peak Element
譚亦翔+ Reverse String (Leetcode344) Lab1:RV32I Simulator Reverse string
林劭謙+ Perfect Number (Leetcode 507) Lab1:RV32I Simulator Perfect Number