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

Subversion Repositories fluid_core_2

[/] [fluid_core_2/] [trunk/] [xilinx14.5 project/] [Shifter.v] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 azmathmoos
`timescale 1ns / 1ps
2
`include "Configuration.v"
3
`define sh_left 3'b001
4
`define sh_right 3'b010
5
 
6
module Shifter(
7
        input [0:`mod_sel_msb] Module,
8
        input [0:`operation_msb] Operation,
9
        input [0:`dpw] OP1, OP2,
10
        output [0:`dpw] Result
11
    );
12
 
13
        reg [0:`dpw] Result_buff;
14
        wire en;
15
        assign en = (Module==`barrel_Shifter);
16
 
17
        always@(*) begin
18
                case(Operation)
19
                        `sh_left: Result_buff <= OP1<<OP2;
20
                        `sh_right: Result_buff <= OP1>>OP2;
21
                endcase
22
        end
23
 
24
        assign Result = en ? Result_buff : 'bz;
25
 
26
 
27
endmodule

powered by: WebSVN 2.1.0

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