Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

Verilog basics - isolating a bit in a sum

Inside an always statement:

c <= a + b;

s <= c[7];

What if I wanted to do:

s <= (a+b)[7];

It does not work as such (compiler error), but it'd be convenient in that I do not want to store the result in a register and waste a clock cycle.

Is there a way to do something like this?

Thanks.