?
}{
Guest
I am having a little trouble with an and gate in verilogger, I have 5
registers that can change state on the rising edge of a clock pulse, when I
do this,
and(val_out, reg1, reg2, reg3, reg4, reg5);
everything seems fine, ie val_out = 1 when all of the registers = 1;
If however, I add a simple 1 to the end eg
and(val_out, reg1, reg2, reg3, reg4, reg5, 1);
when all of the regs are 1, val_out is unknown.
This may seem like a silly thing to do anyway but I discovered it while
trying to do something else.
As mentioned, the registers are checked on the rising edge of the clock
pulse, if val_out equates to a 1, it stays that way until the next rising
edge. Ideally, I would like it to fall to zero again at the falling edge of
the clock. I thought the simplest way to do this would be to add another
register that is set to 0 on the falling edge of the clock and include it in
the and logic. I got the problems described above, that is when I thought
about just making it a constant 1, to try to work out where I was going
wrong.
I am a total newbie so please be gentle, but any pointers would be
appreciated.
Thanks
registers that can change state on the rising edge of a clock pulse, when I
do this,
and(val_out, reg1, reg2, reg3, reg4, reg5);
everything seems fine, ie val_out = 1 when all of the registers = 1;
If however, I add a simple 1 to the end eg
and(val_out, reg1, reg2, reg3, reg4, reg5, 1);
when all of the regs are 1, val_out is unknown.
This may seem like a silly thing to do anyway but I discovered it while
trying to do something else.
As mentioned, the registers are checked on the rising edge of the clock
pulse, if val_out equates to a 1, it stays that way until the next rising
edge. Ideally, I would like it to fall to zero again at the falling edge of
the clock. I thought the simplest way to do this would be to add another
register that is set to 0 on the falling edge of the clock and include it in
the and logic. I got the problems described above, that is when I thought
about just making it a constant 1, to try to work out where I was going
wrong.
I am a total newbie so please be gentle, but any pointers would be
appreciated.
Thanks