FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
6673 Discussions

Verilog basics - isolating a bit in a sum

Altera_Forum
Honored Contributor II
1,487 Views

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.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
799 Views

You can simply define s as a wire and use an assign statement

0 Kudos
Altera_Forum
Honored Contributor II
799 Views

Huh that makes sense. 

 

Thanks!
0 Kudos
Reply