[SOLVED] using "sra" in vhdl

Status
Not open for further replies.

yamine

Member level 1
Joined
May 4, 2012
Messages
37
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,507
hi,
i want to use "sra" for shifting right arithmetic, but i have this error:
"" Error (10476): VHDL error at cordic.vhd(76): type of identifier "y" does not agree with its usage as "bit_vector" type ""
 
Last edited:

Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
USE ieee.numeric_std.ALL;

entity coco is
    Port ( A: in  signed(15 downto 0);
           Z : out signed(15 downto 0) );
end coco;

architecture Behavioral of coco is
begin

Z<= A + (A sra 3);

end Behavioral;
 
Last edited:

Review ieee.numeric_std. sra isn't defined for signed data type.

Code:
Z<= A + shift_right(A,3);
 
Reactions: yamine

    yamine

    Points: 2
    Helpful Answer Positive Rating
Thank you FvM,
that resolve my problem,
where can i fine the description of function defined in ieee.numeric_std ?
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…