304 - Exercises

Exercise 301

Try to get the example for the counter-enforced SoC to work.

Exercise 302

Make a new (as in: don’t modify the dummy) component that can calculated the Hamming distance of two values.

Make a comparison like the table in 202 where you compare your pure software implementation of the Hamming distance with the codesign.

Exercise 303

Make a new component that calculates the sine of a positive angle. The angle is provided as natural number (no decimals), in degrees and can be up to 10 bits.

To prevent decimal numbers, the resulting value should be multiplied with 1'000'000. The remaining decimal digits can be dropped. Hence the result should fit in 20 bits.

Negative numbers should be represented in two’s complement.



Some examples:

PROTIP: work smart, not hard !!

Exercise 304

Make a new component that can calculated at matrix multiplication. This is (one of) the core operattion(s) in machine learning. Not to complicate things too much: 1) only the matrix multiplication of two 2x2 matrices should be made; 2) the elements are 8-bit in size; and 3) the multiplication should be modulo 256 (as in, only take the 8 least significant bits of the product).

For those who don’t remember how matrix multiplicatiork, it goes like this.


Make a comparison like the table in 202 where you compared your pure software implementation of the Hamming distance with the codesign.

Handing in exercises

When you upload your assigments, check the following:

          • all your files are archived in one single file (.zip, .tar, …)
          • structurise your files in subfolders
              • firmware/ containing all the software: build files, binaries, …
                  • firmware/src/ containing all the source files (.c, .S, …)
              • hdl/ containing all the hardware descriptions (.vhd, .v, .sv, …)
                  • hdl/tb/ containing all the simulation files (.vhd)
              • files like a README.md, vivado_script.tcl, …
                  • README.md: if you want to add some additional info
                  • vivado.tcl: script to automate project creation in Vivado

Tree

If you look at the structure of how you need to hand in assignments, you might spot something. These are all plain text files and there are not many of them. However, this will enable you to generate all data you need: binaries, hex-files, vivado projects, bitstreams, …
In case you want to use some version control (like GitHub), it would make sense to track only these files.