DeadLine: 12/28 23:59:59
Submission
Login the system by your personal account. (Use the ssh command)
Create an directory with name “HW11” in your home directory.You can use the “pwd” command to confirm your current directory.
The “mkdir [name]” command can create a directory with the name
[name]
In HW11 directory, you need to create 1 files with name “hw11.c”
You need to compile your program by yourself, and create 1 executable files with the filenames “hw11”
contributed by < Daniel-0224 >
Hello World in Chisel
This code toggles an LED output based on a counter cntReg.LED change after CNT_MAX cycles.
class Hello extends Module {
val io = IO(new Bundle {
val led = Output(UInt(1.W))
})
val CNT_MAX = (50000000 / 2 - 1).U;
Jim Huang changed a year agoView mode Like Bookmark
contributed by < Daniel-0224 >
Problem selet
I choose the problem Output different number with same binary format by using counting leading zeros from classmate, 陳金諄. I believe I can enhance his assembly code. This classmate relies heavily on loops and branches to implement clz, which consumes a significant number of clock cycles.
The origin code
#include <stdint.h>
#include <stdio.h>
uint16_t count_leading_zeros(uint32_t x)
{
Daniel-0224 changed a year agoView mode Like Bookmark