- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Not sure why i'm getting this error, any help would be appreciated.

library ieee;

use ieee.std_logic_1164.all;

use ieee.numeric_std.all;

Entity Radar is

port(rin : in STD_LOGIC_VECTOR(7 downto 0);

AngleCode : in STD_LOGIC_VECTOR(3 downto 0);

xDist : out STD_LOGIC_VECTOR(7 downto 0);

Warning : out STD_LOGIC_VECTOR(2 downto 0));

end entity Radar;

architecture behavior of Radar is

signal int_rin,rinby8,xDistUnsigned: unsigned(7 downto 0);

constant code0: std_logic_vector(3 downto 0) := "0000";

constant code1: std_logic_vector(3 downto 0) := "0001";

constant code2: std_logic_vector(3 downto 0) := "0010";

constant code3: std_logic_vector(3 downto 0) := "0011";

constant code4: std_logic_vector(3 downto 0) := "0100";

constant code5: std_logic_vector(3 downto 0) := "0101";

constant code6: std_logic_vector(3 downto 0) := "0110";

constant code7: std_logic_vector(3 downto 0) := "0111";

constant code8: std_logic_vector(3 downto 0) := "1000";

begin

int_rin <= unsigned(rin);

rinby8 <= shift_right(int_rin,3);

with AngleCode select

xDistUnsigned <= "00000000" when code0,

rinby8 when code1,

shift_left(rinby8,1) when code2,

rinby8+shift_left(rinby8,1) when code3,

shift_left(rinby8,2) when code4,

rinby8+shift_left(rinby8,2) when code5,

shift_left(rinby8,3) when code6,

rinby8+shift_left(rinby8,3) when code7,

int_rin when others;

xDist <= std_logic_vector(XDistUnsigned(7 downto 0));

Warning <= "111" when(xDist > 11001000) else

"110" when(xDist > 10010110) else

"100" when(xDist > 01100100) else

"011" when(xDist > 00110010) else

"010" when(xDist > 00011001) else

"001" when(xDist > 00000101) else

"000";

end architecture behavior;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I am not a VHDL expert but I believe that the less than ">" operator has been used to compare two type of value: std_logic_vector and integer.

Greater than and less than are relational operators, while using relational operators is that the two numbers being compared must be of the same 'type'. An integer cannot be compared to a std_logic_vector type value.

From what I get from another case:

You can use explicit numeric types SIGNED or UNSIGNED. Alternatively you can use a library that treats all std_logic_vector as SIGNED or UNSIGNED type: IEEE.STD_LOGIC_SIGNED respectively IEEE.STD_LOGIC_UNSIGNED.

I hope it helps.

Best Regards,

Richard Tan

p/s: If any answer from the community or Intel support are helpful, please feel free to give Kudos.

Link Copied

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I am not a VHDL expert but I believe that the less than ">" operator has been used to compare two type of value: std_logic_vector and integer.

Greater than and less than are relational operators, while using relational operators is that the two numbers being compared must be of the same 'type'. An integer cannot be compared to a std_logic_vector type value.

From what I get from another case:

You can use explicit numeric types SIGNED or UNSIGNED. Alternatively you can use a library that treats all std_logic_vector as SIGNED or UNSIGNED type: IEEE.STD_LOGIC_SIGNED respectively IEEE.STD_LOGIC_UNSIGNED.

I hope it helps.

Best Regards,

Richard Tan

p/s: If any answer from the community or Intel support are helpful, please feel free to give Kudos.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I believed that I have answered your question and I yet to receive any response from you to the previous question/reply/answer that I have provided.

With that, I will now transition this thread to community support. If you have a new question, feel free to open a new thread to get the support from Intel experts. Otherwise, the community users will continue to help you on this thread. Thank you.

Best Regards,

Richard Tan

p/s: If any answer from the community or Intel support are helpful, please feel free to give Kudos.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page