I have to emulate a single die roll, therefore it needs to wrap back to one at 6.
`D1
and `D6
correspond to my 3-bit state encoding of the die at value 1 an 6, respectively.
in
corresponds to the switch roll, if the switch is on then the dice is rolling and value increments if not then it simply equals the last value given. I need equal probability so no I can't just ignore any values.
My problem is this:
I am trying to use a ternary conditional within one.
I'm hoping to stop the roll at `D6
and just wrap to `D1
, if not then `D6
.
assign next = in ?((count == `D6) ? `D1 :(count + 1)) : count;
DFF state_register(clk, next, state);
I don't think my conditional is right. Any help on reading it properly?