Forum Discussion
Altera_Forum
Honored Contributor
8 years agoNo
No No This is bad advice. Never use IEEE.std_logic_unsigned.all or IEEE.std_logic_signed.all. Those are non standard libraries, and cause a variety of problems, especially the day where you will need to use both signed and unsigned values in the same module. Only use those two packages: library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; Then change the type of the signal counter to wither "signed" or "unsigned", depending on what you want, and then you can just usecounter <= counter + 1; If you never need the actual bit representation of the signal counter you can also make it a natural or an integer. Just remember to put a fixed range on it.