OpenCores
URL https://opencores.org/ocsvn/fft2_size/fft2_size/trunk

Subversion Repositories fft2_size

[/] [fft2_size/] [fft_int_size/] [bitrev.sv] - Blame information for rev 12

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 Papayaved
/*
2
Bit-reversal permutation module
3
Delay 1 clock
4
*/
5
 
6
`ifndef _bitrev_
7
`define _bitrev_
8
 
9
module bitrev #(
10
        parameter WIDTH = 14, // max data width
11
        parameter BIT_WIDTH = (2**$clog2(WIDTH) > WIDTH - 1) ? $clog2(WIDTH) : $clog2(WIDTH) + 1
12
)(
13
        input clk,
14
        input [BIT_WIDTH-1:0] width, // current data width
15
        input [WIDTH-1:0] x, // input data
16
        output [WIDTH-1:0] y // result
17
);
18
 
19
        wire [WIDTH-1:0] yy;
20
 
21
        genvar i;
22
        generate for (i = 0; i < WIDTH; i++)
23
                begin :gen
24
                        assign yy[WIDTH-1-i] = x[i];
25
                end
26
        endgenerate
27
 
28
        always_ff @(posedge clk)
29
                y <= yy >> (WIDTH - width);
30
 
31
endmodule :bitrev
32
 
33
`endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.