У меня проблема с умножением двоичного 5-битного числа на 2 в VHDL. Ошибка:Умножение двоичного 5-битного числа на 2 в VHDL
** Error: C:/altera/13.1/binary.vhd(29): No feasible entries for infix operator "*".
** Error: C:/altera/13.1/binary.vhd(29): Bad right hand side (infix expression) in variable assignment.
** Error: C:/altera/13.1/binary.vhd(34): VHDL Compiler exiting
Вот моя программа:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.numeric_std.all;
entity binary is
port(int: in integer;
b: out std_logic_vector(4 downto 0));
end binary;
Architecture Behavior1 of binary is
function binary1 (int1:integer) return std_logic_vector is
variable int2: integer;
variable a:std_logic_vector(4 downto 0);
variable i: integer;
begin
int2:=int1;
i:=0;
while (i<a'length) loop
int2:=int2/2;
if (int2 mod 2 = 0) then
a(i):='0';
else
a(i):='1';
end if;
i:=i+1;
end loop;
a:=a * "00010";
return a;
end binary1;
begin
b<=binary1(int);
end Behavior1;
Пожалуйста, мне действительно нужно, чтобы понять концепцию за этой проблемы. Это связано с тем, что я всегда сталкиваюсь с такой ошибкой.
Большое спасибо. Это действительно помогло. – user3300910