Post by Jim LewisDoes anyone reverse bits enough to justify
adding an operator to do it?
FFT algorithms need a bit-reverse function.
That's the only place I've ever met the need.
However, SystemVerilog seems to think you need it.
Suppose ABCDEFGH is an 8-bit number, with one letter
standing for each bit, and suppose we've stored
that number in variable v. Then
{ << { v } } yields HGFEDCBA (simple bit reverse)
{ << 2 { v } } yields GHEFCDAB (reverse in 2-bit groups)
{ << 4 { v } } yields EFGHABCD (reverse in 4-bit groups)
{ << { { << 4 { v } } } } yields DCBAHGFE (reverse each 4-bit group)
How cool is that? ;-)
I have already made public my disappointment that
SystemVerilog lacks a :-) operator....
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
***@MYCOMPANY.com
http://www.MYCOMPANY.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.