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

Subversion Repositories jt51

[/] [jt51/] [trunk/] [jt51/] [jt51_sh.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 gryzor
/*  This file is part of JT51.
2
 
3
    JT51 is free software: you can redistribute it and/or modify
4
    it under the terms of the GNU General Public License as published by
5
    the Free Software Foundation, either version 3 of the License, or
6
    (at your option) any later version.
7
 
8
    JT51 is distributed in the hope that it will be useful,
9
    but WITHOUT ANY WARRANTY; without even the implied warranty of
10
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
    GNU General Public License for more details.
12
 
13
    You should have received a copy of the GNU General Public License
14
    along with JT51.  If not, see <http://www.gnu.org/licenses/>.
15
 
16
        Author: Jose Tejada Gomez. Twitter: @topapate
17
        Version: 1.0
18
        Date: 27-10-2016
19
        */
20
 
21
`timescale 1ns / 1ps
22
 
23
module jt51_sh #(parameter width=5, stages=32 )
24
(
25
        input                                                   clk,
26
        input           [width-1:0]                      din,
27
        output          [width-1:0]                      drop
28
);
29
 
30
reg [stages-1:0] bits[width-1:0];
31
 
32
genvar i;
33
generate
34
        for (i=0; i < width; i=i+1) begin: bit_shifter
35
                always @(posedge clk)
36
                        bits[i] <= {bits[i][stages-2:0], din[i]};
37
                assign drop[i] = bits[i][stages-1];
38
        end
39
endgenerate
40
 
41
endmodule

powered by: WebSVN 2.1.0

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