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

Subversion Repositories raptor64

[/] [raptor64/] [trunk/] [rtl/] [verilog/] [lib/] [rol.v] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 robfinch
//=============================================================================
2
//      (C) 2006-2011  Robert Finch
3
//      All rights reserved.
4
//      robfinch@opencores.org
5
//
6
//      rol.v
7
//              Rotate or shift left by up to 64 bits.
8
//
9
//
10
// This source file is free software: you can redistribute it and/or modify 
11
// it under the terms of the GNU Lesser General Public License as published 
12
// by the Free Software Foundation, either version 3 of the License, or     
13
// (at your option) any later version.                                      
14
//                                                                          
15
// This source file is distributed in the hope that it will be useful,      
16
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
18
// GNU General Public License for more details.                             
19
//                                                                          
20
// You should have received a copy of the GNU General Public License        
21
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
22
//                                                                          
23
//      Funnel rotater / shifter
24
//      Rotate, arithmetic shift left, or logical shift /
25
//      arithmetic shift right by 0 to 63 bits.
26
//      Parameterized with a default width of 32 bits.
27
//
28
//=============================================================================
29
//
30
// op
31
//      0        shift left
32
//      1       rotate left
33
module rol
34
#(parameter WID = 32)
35
(
36
input op,
37
input [WID:1] a,
38
input [5:0] b,
39
output [WID:1] o
40
);
41
wire [WID:1] t1, t2, t3;
42
assign o = t3;
43
 
44
rolx1  #(WID) u1 (op,  a, b[1:0], t1);
45
rolx4  #(WID) u2 (op, t1, b[3:2], t2);
46
rolx16 #(WID) u3 (op, t2, b[5:4], t3);
47
 
48
endmodule
49
 

powered by: WebSVN 2.1.0

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