Prod(i)(j) := prod(i)(j) + (a(i)(k) * b(k)(j)) Ĭopy paste the below code and store it as test_ is main module which is used to call the function. Variable prod : t3:=(others => (others => (others => '0'))) įor i in 0 to 3 loop -(number of rows in the first matrix - 1)įor j in 0 to 4 loop -(number of columns in the second matrix - 1)įor k in 0 to 2 loop -(number of rows in the second matrix - 1) ![]() Type t3 is array (0 to 3) of t33 -4*5 matrix as outputįunction matmul ( a : t1 b:t2 ) return t3 įunction matmul ( a : t1 b:t2 ) return t3 is Type t33 is array (0 to 4) of unsigned(31 downto 0) Type t2 is array (0 to 2) of t22 -3*5 matrix Type t22 is array (0 to 4) of unsigned(15 downto 0) Type t1 is array (0 to 3) of t11 -4*3 matrix Type t11 is array (0 to 2) of unsigned(15 downto 0) ![]() ![]() Many people have been asking for a testbench for the above program.Here is the testbench program.The following codes is for matrix multiplication between 4*3 and 3*5 matrices.The resulting matrix has size of 4*5.įirst copy paste the below code and store it as mat_ is the package file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |