Quartus Prime Standard Edition 17.1 - Subtraction Operator Problem
Hello,
I'm trying to remake the lpm down counter in verilog and I'm having an issue with the subtraction operator. Every time I include the subtraction operator (I've tried using it in many different ways...) it causes "sclr" to make "q" go to 8'd0 in a combinational manner rather than a sequential manner ("q" should go to zero a clock cycle after "sclr" goes high, but "q" goes to 8'd0 immediately when "sclr" is pulled high).
I've included two photos, from a VWF file, of how "sclr" causes "q" to act when there is no subtraction and when subtraction is included. I've also included the basic verilog file for viewing.
- Files:
- "downcounter without subtraction operator.PNG" exemplifies correct behavior of "q" with respect to "sclr"
- "downcounter with subtraction operator.PNG" exemplifies incorrect behavior of "q" with respect to "sclr"
I have run into this issue in the past when making an i2c master in verilog.... but I thought the problem was with my code. Now, I've come to the realization that it is truly a problem with Quartus 17.1 unless someone can tell me my basic code is wrong.
Please help!!
Thank you,
Nick