- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Everybody,
I would like using different constants of std_logic_vector type like that, because I want to using the numeric value :
constant VAL_MAX_COMPTEUR_2HZ : std_logic_vector(19 downto 0) := To_stdlogicvector(X"000011");
and if I change the size of the std_logic_vector at 21 bit, quartus indicates : Error (10324): VHDL Expression error at Jongleur_main.vhd(72): expression "('0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','1','0','0','0','1')" has 24 elements ; expected 21 elements. For me that indicates that a constant is not taller than 20bit. But I don't arrive to find the explanation for that In advance thank you to the reading and if you have an explanation. Best Regards, Amitié - Philippe
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are writing a 24 bit constant where a 20 bit constant should be used. 6 hex digits make 24 bit, isn't it? Just delete a leading zero.
Secondly, why are you not simply writingconstant VAL_MAX_COMPTEUR_2HZ : std_logic_vector(19 downto 0) := X"00011";
Finally, if you want numeric values, why don't you use unsigned or integer with range?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello FvM,
Thank you very much for your answer - indeed I make a mistake, I mixed the bit number and the hex value... Now I understand why the declaration of my constant didn't work. Still a Big Thank you.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page