napiuuul
Newbie level 4
code vhdl for multiplication matrix .. need hekp
ccording this site
https://vhdlguru.blogspot.co.id/2010/03/matrix-multiplication-in-vhdl.html
i have tried but failed
i have followed every instruction but for matmu.vhd, the instruction not clear..
i created the file for matmul.vhd like this but what's wrong? the project couldn't be compiled
ccording this site
https://vhdlguru.blogspot.co.id/2010/03/matrix-multiplication-in-vhdl.html
i have tried but failed
i have followed every instruction but for matmu.vhd, the instruction not clear..
i created the file for matmul.vhd like this but what's wrong? the project couldn't be compiled
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 library IEEE; use IEEE.STD_LOGIC_1164.all; use ieee.numeric_std.all; package matmul is type t11 is array (0 to numcols1-1) of unsigned(15 downto 0); type t1 is array (0 to numrows1-1) of t11; type t22 is array (0 to numcols2-1) of unsigned(15 downto 0); type t2 is array (0 to numrows2-1) of t22; type t33 is array (0 to numcols3-1) of unsigned(31 downto 0); type t3 is array (0 to numrows3-1) of t33; function matmul ( a : t1; b:t2 ) return t3 is variable i,j,k : integer:=0; variable prod : t3:=(others => (others => (others => '0'))); begin for i in 0 to numrows1-1 loop for j in 0 to numcols2-1 loop for k in 0 to numcols1-1 loop prod(i)(j) := prod(i)(j) + (a(i)(k) * b(k)(j)); end loop; end loop; end loop; return prod; end matmul;
Last edited by a moderator: