Forum Discussion
Altera_Forum
Honored Contributor
9 years agoThe are problems with all 3, because you have type errors in all 3.
I don't think you want to shift 1 to the left at all. Just connect the output to 2**CNT. You just want
Leds_w <= std_logic_vector( to_unsigned( 2**counter, leds_w'length));
--Or use a for loop
For i in leds_w'range loop
If counter = i then
Leds_w(i) <= '1';
Else
Leds_w(i) <= '0';
End if
End loop;
-- or you could do it in a process
Process (counter)
Begin
Leds_w <= (others => '0');
Leds_w( to_integer (counter)) <= '1';
End process;