View Single Post
  #4 (permalink)  
Old 12-26-2003, 06:48 AM
Peter Alfke
Guest
 
Posts: n/a
Default Re: How to get first bit '0' position in certain register?

[email protected] (Hal Murray) wrote in message news:<[email protected]>...
> >This function is called "find first one" and is fairly common. You could
> >use a for loop or if-else construct in Verilog. Try Googling on "find
> >first one" - you may find something you can use.

>
> Another term to search on is priority encoder.

If you can restrict your search to the first 24 bits, and if you have
a Virtex-II BlockRAM available, you can feed the upper 12 bits as
address to one port, and the lower 12 bits as address to the other
port, and make the BlockRAM give you the 4-bit position information
within the 12 address bits. You then have to combine the two port
outputs. You can get the answer in one clock cycle (faster than all
the suggested software solutions) at well over 100 MHz,
ocnservatively.

Peter Alfke, Xilinx Applications (answering from home)
Merry Christmas to everybody on this newsgroup, and an interesting and
interactive 2004!
Reply With Quote