Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

The problem of custom instruction

I want to define instruction of multiplication,but there is a problem that I cann't solve.

the code is:

library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_unsigned.all;

use ieee.std_logic_arith.all;

entity mult is

port(dataa:in std_logic_vector(31 downto 0);

datab:in std_logic_vector(31 downto 0);

result:out std_logic_vector(31 downto 0);

reset:in std_logic:='0';

start:in std_logic:='0';

clk_en:in std_logic:='0';

clk:in std_logic);

end mult;

architecture behave of mult is

signal rt:std_logic_vector(31 downto 0);

begin

rt<=dataa(15 downto 0) * datab(15 downto 0);

result<=rt;

end behave;

please help me!

thanks in advance!

http://b31.photo.store.qq.com/http_imgload.cgi?/rurl4_b=b579f8b54f494fc69149a5de70a1aee96a8bb3395a15bfa223135b6ed1f66877333e0ee98fe950027efdba4f36399042461e971cccff013808067a464a918e626f13a199366ba222d1c8d503aaf9f20bd3d0defd&a=32&b=31

http://b31.photo.store.qq.com/http_imgload.cgi?/rurl4_b=b579f8b54f494fc69149a5de70a1aee9f2965158095d9394e8f9fcc35b25e9a1411ee3cb150f70930cfe80cf31fadf167c862b99da9005da91fd1ed71efad8180c6d064fb270f4db73076963dcbe583a984987c8&a=31&b=31

3 Replies