variable cnt1 : std_logic_vector(20 downto 0):= (cnt1'right => '1', others => '0');


Joined
Mar 12, 2009
Messages
3
Reaction score
0
Hi,

I want to initialise a variable this way :
Code:
variable cnt1 : std_logic_vector(20 downto 0):= (cnt1'right => '1', others => '0');

I know i doesn't work, i want to know the correct way of doing this kind of initialisations.

Best regards,
Hassen.
 
Ad

Advertisements

Joined
Mar 10, 2008
Messages
348
Reaction score
0
Try this

variable cnt1 : std_logic_vector(20 downto 0):= ((0)=>'1',others=>'0');

Your welcome
Jeppe
 
Joined
Mar 12, 2009
Messages
3
Reaction score
0
Hi,
Thank you, it worked !

Now i want to do the following :
Code:
if count = ((20 downto 11) => (others => '0'), (10 downto 0) => (others => '1')) then
	   led <= '1';
	  end if;
or :
Code:
if count = ((20 downto 11) => (others => '0'), others => '1') then
	   led <= '1';
	  end if;

Best regardes,
Hassen.
 
Last edited:
Ad

Advertisements

Joined
Mar 10, 2008
Messages
348
Reaction score
0
The best way will be this:

if count="000000000011111111111" then
led<='1';
end if;

Your welcome
Jeppe
 

Top