Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20707 Discussions

how to write verilog code for checking overlapping group of 3bits?

Altera_Forum
Honored Contributor II
1,257 Views

If I have a 7bits multiplier, (let's say 0010110), how do I write verilog code to check for the bits in overlapping group of 3, such as (starting from lsb 110, then 101, then 001)? Assuming I do not know what is the actual multiplier number but I can fix it to 7 bits. I have some idea like using n-1, n-2 but not sure how to put into verilog code. Need some suggestion. Pls help. Thanks!

0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
396 Views

You can use a loop and increase the index by 2 on each iteration, until you reach the msb.

0 Kudos
Reply