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

Subversion Repositories fft2_size

[/] [fft2_size/] [fft_int/] [round32.sv] - Rev 11

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

`ifndef _round32_
`define _round32_

// Round cut value
module round32 #(parameter WIDTH)(input signed [31:0] x, output signed [WIDTH-1:0] y);
        generate
                if (WIDTH == 32)
                        begin                           
                                assign y = x;
                        end
                else
                        begin                           
                                 // overflow check don't need
                                assign y = (x < 'sh0) ? x[31-:WIDTH] - x[31-WIDTH] : x[31-:WIDTH] + x[31-WIDTH];
                        end
        endgenerate
endmodule :round32

`endif

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

powered by: WebSVN 2.1.0

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