stijn58274
Newbie level 1
- Joined
- Jun 7, 2013
- Messages
- 1
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,288
Hi,
I am learning VHDL last weeks. Im now making an attenuator for audio samples. I want to attenuate 12 bits audio samples.
But when I want to simulate in Modelsim I get the following error:
Identifier "unsigned" is not directly visible.
Can somebody help me please?
I am learning VHDL last weeks. Im now making an attenuator for audio samples. I want to attenuate 12 bits audio samples.
But when I want to simulate in Modelsim I get the following error:
Identifier "unsigned" is not directly visible.
Code:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.numeric_std.all;
ENTITY attenuator IS
PORT(
out : OUT std_logic_vector (11 DOWNTO 0);
input : IN std_logic_vector (11 DOWNTO 0);
validdiv: IN std_logic
);
-- Declarations
END attenuator ;
--
ARCHITECTURE attenuate OF attenuator IS
signal b:integer;
signal c:integer;
signal d: std_logic_vector(11 downto 0);
BEGIN
process (input,validdiv)
begin
if rising_edge(validdiv) then
b <= conv_integer(unsigned(input));
c <= b/4;
d <= conv_std_logic_vector(c, 12);
out <= d;
end if;
end process;
END ARCHITECTURE attenuate;
Can somebody help me please?