Forum Discussion
Dealing with single bit unsigned types
Hi guys, I started out using std_logic and std_logic_vectors but whenever I would look up things about converting those to integers and back, everything I read said to use numeric_std's unsigned and signed. I've been using those since, but I have a problem whenever I want to use a single bit (like an enable, clock, etc). I tried to use the bit type but it seemed to be incompatible, so I've been using unsigned(0 downto 0), but that seems pretty clunky and odd, so I was wondering if theres another way. I want to be able to assign this single bit to a bit in another unsingned signal, or assign a single bit of a signal to this. Any ideas?
1 Reply
- Altera_Forum
Honored Contributor
theres nothing wrong with using std_logic and std_logic_vectors. Clocks and resets and busses of bits that are not numbers should use them (or any other single bit signals). An unsigned is just an array of std_logic anyway.
Unsigned should be used when you need to do arithmatic.