Try   HackMD

Assignment1: RISC-V Assembly and Instruction Pipeline

Due: Oct 10, 2023

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.
    • Choose one problem (A, B, or C) from Quiz1, translate it from C code to a complete RISC-V assembly program, and include the relevant test data.
    • Generate a simplified (but still informative) use case that serves as the subject for your assignment, demonstrating the practical application of the above selected problem (i.e., derived from Problem A/B/C from Quiz1). For instance, you can create a use case that involves performing branchless counting leading zero operations on integer base-2 values titled as "Implement log2 with branchless clz" or "Matrix multiplication using bfloat16."
    • You are required to use only RV32I instructions (without M or F/D extensions) for floating-point data manipulation. This means you should not depend on a C compiler to generate assembly routines; instead, you must write RISC-V assembly code from scratch.
    • At least 3 test data should be included in your program(s).
      • Without accepting an external data set, you can inline the predefined data.
    • Do choose a unique subject to work on, as each student should have a separate program. Starting earlier is advised to ensure you have ample time for your work.
    • Your program(s) must include loops (or recursive calls) and conditional branches, especially when writing test cases.
    • You must demonstrate iterative efforts to enhance the RISC-V programs, including reducing code size and minimizing runtime overhead, with explicit measurements.
    • 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 must ensure that the program functions correctly with the Ripes simulator.
    • Reference: Example RISC-V Assembly Programs
  2. You must provide explanations for both the program's functionality and the operation of each instruction using the 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.
    • Write in English and feel free to utilize ChatGPT or QuillBot to improve your writing.

Fill in the table for your homework

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 →
Be aware of spaces. Separate each item with |

Formal given name Descriptions HackMD note Program (GitHub/gist hyperlink)
Sample0 Palindrome Linked List Lab1: RV32I Assembly Palindrome Linked List
Sample1 Patching Array Lab1: RV32I Assembly Patching Array
Sample2 Shuffle the Array Lab1: RV32I Assembly Shuffle the Array
Sample3 Three Consecutive Odds Lab1: RV32I Assembly Three Consecutive Odds
黃柏叡 Logarithm of bfloat16 numbers Lab1: RV32I Assembly Logarithm of bfloat16 numbers
陸品潔 Implementation of Bit-Plane Slicing with CLZ Lab1: RV32I Assembly Implementation of Bit-Plane Slicing with CLZ
唐飴苹 Calculate the Hamming Distance using Counting Leading Zeros Lab1: RV32I Assembly Calculate the Hamming Distance using Counting Leading Zeros
劉庭聿 Approximating a bfloat number using binary search Lab1: RV32I Assembly Approximating a bfloat number using binary search
洪佑杭 Multiplication overflow prediction for unsigned int using CLZ Lab1: RV32I Assembly Multiplication Overflow Prediction
陳金諄 Output different number with same binary format by using counting leading zeros Lab1: RV32I Assembly Output different number with same binary format by using counting leading zeros
陳浩文 Implement palindrome detection and using CLZ Lab1: RV32I Assembly Implement palindrome detection and using CLZ
侯廷翰 Optimizing Storage with Count Leading Zero Lab1: RV32I Assembly Optimizing Storage with Count Leading Zero
廖泓博+ Matrix multiplication with floating point addition and multiplication Lab1: RV32I Assembly Matrix multiplication with floating point addition and multiplication
蔡忠翰 Convert FP32 to BF16 and Count the Number of Ones in the Binary Representation Lab1: RV32I Assembly Convert FP32 to BF16 and Count the Number of Ones in the Binary Representation
林允顥 Implement Variable Byte Compression By Counting Leading Zeros Lab1: RV32I Assembly Implement Variable Byte Compression By Counting Leading Zeros
戴鈞彥 Get sine value without floating point multiplication support Lab1: RV32I Assembly Get sine value without floating point multiplication support
張澤家+ Improving multiplication without extension instruction Lab1: RV32I Assembly riscv-multiplicator-no-mul-instruction
洪胤勛 Implement log base power of 2 with CLZ Lab1: RV32I Assembly log base power of 2 with clz
李承泰 Find the position of MSB by CLZ Lab1: RV32I Assembly Find the position of MSB by CLZ
施柏安 Implementing FP32 Operations by Applying FP32 to Bfloat16 Conversion Algorithm Lab1: RV32I Assembly Implementing FP32 Operations by Applying FP32 to Bfloat16 Conversion Algorithm
陳川曜 Find Leftmost 0-byte using CLZ Lab1: RV32I Assembly Find Leftmost 0-byte using CLZ
謝維倫 Enhancing Buffer Overflow Defense with Return Address Protection and CLZ Lab1: RV32I Assembly Enhancing Buffer Overflow Defense with Return Address Protection and CLZ
曾鼎棊 Implement counting tailing zero by CLZ - -
李晨瑞 Implement next power of two using clz Lab1: RV32I Assembly Implement next power of two using clz
邱德昌 Determining the Maximum Value by CLZ Lab1: RV32I Assembly determining the maximum value by CLZ
林柏全 Find First String of 1-bits of a Given Length by CLZ Lab1: RV32I Assembly Finding First String of 1-bits of a given length by CLZ
劉智恩 Sum of Leading Zeros in Linked List by CLZ Lab1: RV32I Assembly Sum of Leading Zeros in Linked List by CLZ
林昊霆 Counting total zero of binary number by CLZ Lab1: RV32I Assembly Counting total zero of binary number by CLZ
林以薰 Indexing of hierachical data structures by CLZ Lab1: RV32I Assembly Indexing of hierachical data structures by CLZ
盧俊銘 Compare difference between fp32 multiplication and bf16 multiplication Lab1: RV32I Assembly Compare difference between fp32 multiplication and bf16 multiplication
鍾沅熹 Multiply a floating-point by an integer Lab1: RV32I Assembly Multiply a floating-point by an integer
黃于睿 Generate 3×3 Filter Box in BF16 Format and Application Lab1: RV32I Assembly Generate 3×3 Filter Box in BF16 Format and Application
范紘維+ A Novel Approach to IP Routing: CLZ for Prefix Match Lab1: RV32I Assembly A Novel Approach to IP Routing: CLZ for Prefix Match
江冠霆 Normalizing a value using clz Lab1: RV32I Assembly Normalizing a value using clz
李冠澄 Optimize the multiplication of 3 integer numbers without extensions Lab1: RV32I Assembly Optimize the multiplication of 3 integer numbers without extensions
陳彥佑 Implement unsigned int mul by count leading zero Lab1: RV32I Assembly Implement unsigned int mul by count leading zero
張偉治 Implement backpropagation algorithm using bfloat16 floating-point format Lab1: RV32I Assembly Implement backpropagation algorithm using bfloat16 floating-point format
洪碩星 Implement transformation from integer to float by clz Lab1: RV32I Assembly Implement transformation from integer to float
魏泳禎 Implement and analyze BF16 multiplication Lab1: RV32I Assembly Implement and analyze BF16 multiplication
陳冠元 Implement function to find maximum absolute value in bfloat16 array for quantization Lab1: RV32I Assembly Implement find bf16 maximum absolute value
林勁羽 Implement image binarization by CLZ Lab1: RV32I Assembly Binarization by CLZ
李熙堃 Improve bitwise and of numbers range with clz Lab1: RV32I Assembly Improve bitwise and of numbers range with clz
高紹捷 Implement square root using CLZ Lab1: RV32I Assembly Implement square root using CLZ
施宇庭 Exploiting data-level parallelism in bfloat16 multiplication with SWAR Lab1: RV32I Assembly Exploiting data-level parallelism in bfloat16 multiplication with SWAR
吳堉銨 Data encryption using CLZ Lab1: RV32I Assembly Data encryption using CLZ
鄭博文 Reducing memory usage with bfloat16 and bfloat16 multiplication Lab1: RV32I Assembly Reducing memory usage with bfloat16 and bfloat16 multiplication
王豊惟 Linear convolution using bfloat16 Lab1: RV32I Assembly Linear convolution using bfloat16
王昱傑 implement maxpool operator using bfloat16 Lab1: RV32I Assembly implement maxpool operator using bfloat16
黃定山 A comparison of binary search, Harley’s algorithm, and De Bruijn sequence in the context of CLZ Lab1: RV32I Assembly Comparison of binary search and hash tables in the context of CLZ
鄭朝駿 Perform a one-hot encoding search using the count leading zeros function Lab1: RV32I Assembly Perform a one-hot encoding search using the count leading zeros function
魏彥庭 Matrix multiplication using bfloat16 Lab1: RV32I Assembly Martrix multiplication using bfloat16
許唯萱 Explore and analysis different approaches of CLZ method Lab1: RV32I Assembly Explore and analysis different approaches of CLZ method
倪英智 Implement priority encoder using CLZ Lab1: RV32I Assembly Implement priority encoder using CLZ
楊宇翔 Calculate the log2 Integer part of a log2 int64 number by CLZ Lab1: RV32I Assembly Calculate the Integer part of a log2 int64 number by CLZ
林子勝 converting float to integer Lab1: RV32I Assembly Computer_Architecture_11201_homework_1
顏伯丞 Determine number size range by CLZ Lab1: RV32I Assembly Determine number size range by CLZ
鄭吉廷 Implement Collatz conjecture by ctz Lab1: RV32I Assembly Implement Collatz conjecture by ctz
林晉宇 Image scaling with Bilinear interpolation by float32 multiplication Lab1: RV32I Assembly Image scaling with Bilinear interpolation
陳燦仁 Shell sort with FP32 in BF16 format Lab1: RV32I Assembly Shell sort with FP32 in BF16 format
李亮穎 Implement unsigned int multiplication by CLZ without multiplication instruction Lab1: RV32I Assembly Implement unsigned int multiplication by CLZ without multiplication instruction
張正德 Convert RGB image into grayscale by using RV32I ISA Lab1: RV32I Assembly Convert RGB image into grayscale by using RV32I ISA
周育晨 Generate bitmask by CLZ Lab1: RV32I Assembly Generate bitmask by CLZ
許卜元 Optimizing division with powers of two using CLZ Lab1: RV32I Assembly Optimizing division with powers of two using CLZ
簡志耀 Convolution by using bfloat16 Lab1: RV32I Assembly Convolution by using bfloat16
彭煜博 Reverse bits using CLZ Lab1: RV32I Assembly Reverse bits using CLZ
丁竟烽 Find Longest String of 1-Bits using CLZ Lab1: RV32I Assembly Find Longest String of 1-Bits using CLZ
蕭明祥 Find first set using CLZ Lab1: RV32I Assembly Find first set using CLZ
劉誠量 Find first Clear using CLZ Lab1: RV32I Assembly Find first Clear bit using CLZ
張智惟 Bits Compression Using CLZ Lab1: RV32I Assembly Bits Compression Using CLZ
李協儒 Implement Exponential-Golomb coding by using clz Lab1: RV32I Assembly Implement Exponential-Golomb decoding by using clz

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 →
Be aware of spaces. Separate each item with |