Altera_Forum
Honored Contributor
15 years agoHow do I identify carry/overflow condition in Verilog?
Hi
I need to identify an overflow condition for a counter in Verilog code. Say that count register is 16bits wide; I make the assignment count <= count + 1 and I need to know when the overflow condition happens. I now defined count as 17bits wide and I simply check when 17th bit toggles, and the design works. Anyway, I think there should be a better and more efficient way to do it. I have only minor experience with Verilog, so I don't know how to get the overflow status signal from the adder for a generic operation count<=count+n Cris