相關連結:
作業系統及考古、計算機結構及考古、linux kernel學習筆記、STM32學習筆記
Output Problem
Predict the output of below programs.
1.
#include<stdio.h>
int main() {
int n;
for(n = 7; n!=0; n--)
chihenliu changed 2 days agoView mode Like Bookmark
Problem A
Consider that we plan to deploy a custom RISC-V processor for a space mission, which requires additional data protection in memory. We have decided to implement a Hamming code with even parity to safeguard our data. For this question, please refer to the parity table shown below.
image
Please note that in this context, bit 0 is considered the least significant bit (LSB).
What Are Bit Flips And How Are Spacecraft Protected From Them?
[ ] Part 1
Implement a RISC-V function called calc_parity that takes a 4-byte input in a0 and calculates the parity of its bits. It should return 1 for odd parity or 0 for even parity. For example:
chihenliu changed a year agoView mode Like Bookmark
Problem A
Consider an algorithm for transposing a square matrixin-place by swapping rows and columns. Below, you will find the C code for this operation, and it is important to note that the matrix elements are 32-bit integers.
#include <stddef.h>
void transpose(size_t n, int *m)
{
for (size_t i = 0; i < n; i++) {
for (size_t j = i + 1; j < n; j++) {
int t = m[(i * n) + j];
m[(i * n) + j] = m[(j * n) + i];
chihenliu changed a year agoView mode Like Bookmark
Problem A
Consider a C implementation of the count leading zero function for 64-bit integers. A leading zero is defined as any ‘0’ digit that appears before the first non-zero digit in the binary representation of a number.
Examples:Input :
N = 16 Output : 59
Explanation: As Binary = (00000000000000000000000000000000 00000000000000000000000000010000)
Input :
chihenliu changed a year agoView mode Like Bookmark
contributed By < chihenliu >
linkedlist
"linked list" is a common data structure
As shown in the two diagrams above, the concept is to use nodes to record, represent, and store data. Each node has three components: Data, Pointer, and Address. Additionally, each node's pointer points to the address of the next node, continuing until it points to Null, signifying the end of this simple linked list. The time complexity is O(N)
Count leading zero
To calculate the number of consecutive zeros, counting from the Most Significant Bit (MSB) towards the right, until the first encountered '1' in a binary number
Ex: 0000000000000010 =14
chihenliu changed a year agoView mode Like Bookmark
contributed by < chihenliu >
Problem select and Motivation
this work I select Implement transformation from integer to float by clz from 洪碩星
I want to understand the conversion between floating points and integers, which is a fundamental concept in both C and assembly language. Additionally, I want to become familiar with the application of the GNU Toolchain to aid in this understanding
IEEE 754 floating point
IEEE 754 floating-point numbers consist of three components: the sign bit, exponent, and mantissa, and define special values like positive and negative infinity and NaN. This is a commonly used floating-point representation in the field of computing, IEEE754 floating point have two Common format single and double precision
chihenliu changed a year agoView mode Like Bookmark
Assignemnt 1:RISC-V Assembly and Instruction Pipeline
contribute By<chihenliu>
linkedlist
"linked list" is a common data structure
As shown in the two diagrams above, the concept is to use nodes to record, represent, and store data. Each node has three components: Data, Pointer, and Address. Additionally, each node's pointer points to the address of the next node, continuing until it points to Null, signifying the end of this simple linked list. The time complexity is O(N)
Count leading zero
To calculate the number of consecutive zeros, counting from the Most Significant Bit (MSB) towards the right, until the first encountered '1' in a binary number
chihenliu changed a year agoEdit mode Like Bookmark