Hello, I’m having trouble getting a simple frequency dividing loop to work. Here’s a minimal test fragment, if the comparison wire has any don’t care bits in it the test fails, if I don’t include them it works fine. I’m obviously specifying the don’t cares in the wrong way, can anyone help?
In case it matters, IDE is Quartus-II. Thanks in advance
reg [24:0] TBdiv;
reg LEDreg ;
wire Roll = (TBdiv == 25'b1111111111111111111111111) ; // This works
wire Roll = (TBdiv == 25'b111111111111111111x111111) ; // This doesn't
always @ (posedge clk)
begin
if (Roll)
begin
LEDreg <= ~LEDreg ; // Test LED
TBdiv <= 25'd0 ;
end
else
begin
TBdiv <= TBdiv + 25'd1 ;
end
end
assign LED = LEDreg ;