knip
Newbie level 3
- Joined
- Mar 2, 2013
- Messages
- 4
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,314
I have the following type definitions
I tried to convert the unsigned vector into a std_logic_vector using
but it doesn't work so now I'm using
but when I do a XOR operation:
the following error appears
Error (10327): VHDL error at lambda.vhd(112): can't determine definition of operator ""xor"" -- found 0 possible definitions
I know that std_logic_vector has to be used for memories/registers, while the unsigned type for binary numbers without sign.
I need to use the unsigned type in my circuit because of the rol (rotate left) function.
I cannot avoid to mix the two types.
What is better to do in these cases ?
Code:
subtype msgBlock_t is std_logic_vector((Z-1) downto 0);
subtype msgBlock_u_t is unsigned((Z-1) downto 0);
type msgBlocks_t is array((K_B-1) downto 0) of msgBlock_t;
type msgBlocks_u_t is array((K_B-1) downto 0) of msgBlock_u_t;
signal shMsgBlocks_u: msgBlocks_u_t;
signal shMsgBlocks: msgBlocks_t;
I tried to convert the unsigned vector into a std_logic_vector using
Code:
shMsgBlocks = msgBlocks_t(shMsgBlocks_u);
Code:
c_g: for i in 0 to K_B-1 generate
c_g_i: shMsgBlocks(i) <= std_logic_vector(shMsgBlocks_u(i));
end generate c_g;
but when I do a XOR operation:
Code:
xor_L1: for i in 0 to (K_B/2)-1 generate
xor_L1_i: out_xor_L1 <= shMsgBlocks(2*i) xor shMsgBlocks(2*i+1);
end generate xor_L1;
Error (10327): VHDL error at lambda.vhd(112): can't determine definition of operator ""xor"" -- found 0 possible definitions
I know that std_logic_vector has to be used for memories/registers, while the unsigned type for binary numbers without sign.
I need to use the unsigned type in my circuit because of the rol (rotate left) function.
I cannot avoid to mix the two types.
What is better to do in these cases ?