Forum Discussion
Altera_Forum
Honored Contributor
11 years agoAssign all zeroes to unsigned
Hi, I want to assign all zeroes to an unsigned signal. I've been using ( others => '0' ) for STD_LOGIC_VECTOR signals, but when i attempt to do the same for unsigned, i get an error: Error (105...
Altera_Forum
Honored Contributor
11 years ago --- Quote Start --- Unsigned is a base 10 nuber without a sign. So assigning 0 should work. unsigned_sig <= 0; --- Quote End --- You can't do that because 0 is an integer. Also note that unsigned is binary, not base 10. You need to convert to an unsigned from an integer. Op <= to_unsigned(0, op'length); This should also work. Op <= (others => '0'); The ops problem sounds like a syntax error. Why not post the actual code?