Forum Discussion

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

multiplication of unsigned and sfixed numbers

I am trying to multiply an unsigned number with sfixed number (0.703125). following are the code and errors:

library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

library ieee_proposed;

use ieee_proposed.fixed_pkg.all;

USE ieee.numeric_std.all;

entity tryproduct is

end tryproduct;

architecture Behavioral of tryproduct is (Line 11)

signal a : sfixed(0 downto -6);

signal k : sfixed(8 downto -6);

SIGNAL temp1: UNSIGNED (8 downto 0) := "101001001" ;

begin

a <= to_sfixed (0.703125,a);

k <= to_sfixed(temp1) * a; (Line 19)

end Behavioral;

Errors:

ERROR:HDLCompiler:432 - "G:/vhdlcodes/producttry/tryproduct.vhd" Line 19: Formal <arg> has no actual or default value.

ERROR:HDLCompiler:841 - "G:/vhdlcodes/producttry/tryproduct.vhd" Line 19: Expecting type integer for <temp1>.

ERROR:HDLCompiler:9 - "G:/vhdlcodes/producttry/tryproduct.vhd" Line 19: Found 0 definitions for operator "*".

ERROR:HDLCompiler:854 - "G:/vhdlcodes/producttry/tryproduct.vhd" Line 11: Unit <behavioral> ignored due to previous errors.

thanks in advance