www.pudn.com > x86.rar > shift_64_Logical.v, change:2007-12-05,size:14968b


module shift_64_Logical(shiftOut, shiftIn, Count, direction); 
 
input [63:0] shiftIn; 
input [63:0] Count; 
input direction;//  shiftBitIn; 
 
output [63:0]shiftOut; 
 
reg [63:0] shiftOut; 
 
 
always@(shiftIn or Count or direction) 
 begin 
  
  case(Count) 
   64'd0: 
    begin 
      shiftOut = shiftIn; 
    end 
 
   64'd1: 
    begin 
     case(direction) 
      1'b0: shiftOut = {shiftIn[62:0], 1'd0}; 
      1'b1: shiftOut = {1'b0, shiftIn[63:1]}; 
     endcase 
    end 
   64'd2: 
    begin 
     case(direction) 
      1'b0: shiftOut = {shiftIn[61:0], 2'd0}; 
      1'b1: shiftOut = {2'd0, shiftIn[63:2]}; 
     endcase 
    end 
 
   64'd3: 
    begin 
     case(direction) 
      1'b0:shiftOut = {shiftIn[60:0], 3'd0}; 
      1'b1:shiftOut = {3'd0, shiftIn[63:3]}; 
     endcase 
    end 
 
   64'd4: 
    begin 
      case(direction) 
      0:shiftOut = {shiftIn[59:0], 4'b0000}; 
      1:shiftOut = {4'b0000, shiftIn[63:4]}; 
     endcase 
    end 
 
   64'd5: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[58:0], 5'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {5'd0, shiftIn[63:5]}; 
       end 
     endcase 
    end 
 
   64'd6: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[57:0], 6'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {6'd0, shiftIn[63:6]}; 
       end 
     endcase 
    end 
 
 
   64'd7: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[56:0], 7'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {7'd0, shiftIn[63:7]}; 
       end 
     endcase 
    end 
 
   64'd8: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[55:0], 8'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {8'd0, shiftIn[63:8]}; 
       end 
     endcase 
    end 
 
 
 
   64'd9: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[54:0], 9'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {9'd0, shiftIn[63:9]}; 
       end 
     endcase 
    end 
 
   64'd10: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[53:0], 10'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {10'd0, shiftIn[63:10]}; 
       end 
     endcase 
    end 
 
 
   64'd11: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[52:0], 11'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {11'd0, shiftIn[63:11]}; 
       end 
     endcase 
    end 
 
   64'd12: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[51:0], 12'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {12'd0, shiftIn[63:12]}; 
       end 
     endcase 
    end 
 
 
   64'd13: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[50:0], 13'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {13'd0, shiftIn[63:13]}; 
       end 
     endcase 
    end 
 
   64'd14: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[49:0], 14'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {14'd0, shiftIn[63:14]}; 
       end 
     endcase 
    end 
 
   64'd15: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[48:0], 15'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {15'd0, shiftIn[63:15]}; 
       end 
     endcase 
    end 
 
 
   64'd16: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[47:0], 16'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {16'd0, shiftIn[63:16]}; 
       end 
     endcase 
    end 
 
 
 
   64'd17: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[46:0], 17'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {17'd0, shiftIn[63:17]}; 
       end 
     endcase 
    end 
 
 
 
   64'd18: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[45:0], 18'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {18'd0, shiftIn[63:18]}; 
       end 
     endcase 
    end 
 
 
   64'd19: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[44:0], 19'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {19'd0, shiftIn[63:19]}; 
       end 
     endcase 
    end 
 
 
   64'd20: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[43:0], 20'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {20'd0, shiftIn[63:20]}; 
       end 
     endcase 
    end 
 
 
   64'd21: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[42:0], 21'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {21'd0, shiftIn[63:21]}; 
       end 
     endcase 
    end 
 
 
   64'd22: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[41:0], 22'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {22'd0, shiftIn[63:22]}; 
       end 
     endcase 
    end 
 
   64'd23: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[40:0], 23'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {23'd0, shiftIn[63:23]}; 
       end 
     endcase 
    end 
 
   64'd24: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[39:0], 24'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {24'd0, shiftIn[63:24]}; 
       end 
     endcase 
    end 
 
   64'd25: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[38:0], 25'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {25'd0, shiftIn[63:25]}; 
       end 
     endcase 
    end 
 
   64'd26: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[37:0], 26'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {26'd0, shiftIn[63:26]}; 
       end 
     endcase 
    end 
 
   64'd27: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[36:0], 27'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {27'd0, shiftIn[63:27]}; 
       end 
     endcase 
    end 
 
   64'd28: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[35:0], 28'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {28'd0, shiftIn[63:28]}; 
       end 
     endcase 
    end 
 
   64'd29: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[34:0], 29'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {29'd0, shiftIn[63:29]}; 
       end 
     endcase 
    end 
 
   64'd30: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[33:0], 30'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {30'd0, shiftIn[63:30]}; 
       end 
     endcase 
    end 
 
   64'd31: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[32:0], 63'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {31'd0, shiftIn[63:31]}; 
       end 
     endcase 
    end 
 
   64'd32: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[63:0], 32'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {32'd0, shiftIn[63:32]}; 
       end 
     endcase 
    end 
 
   64'd33: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[30:0], 33'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {33'd0, shiftIn[63:33]}; 
       end 
     endcase 
    end 
 
   64'd34: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[29:0], 34'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {34'd0, shiftIn[63:34]}; 
       end 
     endcase 
    end 
 
   64'd35: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[28:0], 35'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {35'd0, shiftIn[63:35]}; 
       end 
     endcase 
    end 
 
   64'd36: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[27:0], 36'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {36'd0, shiftIn[63:36]}; 
       end 
     endcase 
    end 
 
   64'd37: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[26:0], 37'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {37'd0, shiftIn[63:37]}; 
       end 
     endcase 
    end 
 
   64'd38: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[25:0], 38'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {38'd0, shiftIn[63:38]}; 
       end 
     endcase 
    end 
 
   64'd39: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[24:0], 39'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {39'd0, shiftIn[63:39]}; 
       end 
     endcase 
    end 
 
   64'd40: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[23:0], 40'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {40'd0, shiftIn[63:40]}; 
       end 
     endcase 
    end 
 
   64'd41: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[22:0], 41'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {41'd0, shiftIn[63:41]}; 
       end 
     endcase 
    end 
 
   64'd42: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[21:0], 42'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {42'd0, shiftIn[63:42]}; 
       end 
     endcase 
    end 
 
   64'd43: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[20:0], 43'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {43'd0, shiftIn[63:43]}; 
       end 
     endcase 
    end 
 
   64'd44: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[19:0], 44'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {44'd0, shiftIn[63:44]}; 
       end 
     endcase 
    end 
 
   64'd45: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[18:0], 45'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {45'd0, shiftIn[63:45]}; 
       end 
     endcase 
    end 
 
   64'd46: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[17:0], 46'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {46'd0, shiftIn[63:46]}; 
       end 
     endcase 
    end 
 
   64'd47: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[16:0], 47'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {47'd0, shiftIn[63:47]}; 
       end 
     endcase 
    end 
 
   64'd48: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[15:0], 48'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {48'd0, shiftIn[63:48]}; 
       end 
     endcase 
    end 
 
   64'd49: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[14:0], 49'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {49'd0, shiftIn[63:49]}; 
       end 
     endcase 
    end 
 
   64'd50: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[13:0], 50'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {50'd0, shiftIn[63:50]}; 
       end 
     endcase 
    end 
 
   64'd51: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[12:0], 51'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {51'd0, shiftIn[63:51]}; 
       end 
     endcase 
    end 
 
   64'd52: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[11:0], 52'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {52'd0, shiftIn[63:52]}; 
       end 
     endcase 
    end 
 
   64'd53: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[10:0], 53'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {53'd0, shiftIn[63:53]}; 
       end 
     endcase 
    end 
 
   64'd54: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[9:0], 54'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {54'd0, shiftIn[63:54]}; 
       end 
     endcase 
    end 
 
   64'd55: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[8:0], 55'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {55'd0, shiftIn[63:55]}; 
       end 
     endcase 
    end 
 
   64'd56: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[7:0], 56'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {56'd0, shiftIn[63:56]}; 
       end 
     endcase 
    end 
 
   64'd57: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[6:0], 57'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {57'd0, shiftIn[63:57]}; 
       end 
     endcase 
    end 
 
   64'd58: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[5:0], 58'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {58'd0, shiftIn[63:58]}; 
       end 
     endcase 
    end 
 
   64'd59: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[4:0], 59'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {59'd0, shiftIn[63:59]}; 
       end 
     endcase 
    end 
 
   64'd60: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[3:0], 60'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {60'd0, shiftIn[63:60]}; 
       end 
     endcase 
    end 
 
   64'd61: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[2:0], 61'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {61'd0, shiftIn[63:61]}; 
       end 
     endcase 
    end 
 
   64'd62: 
    begin 
     case(direction) 
      1'b0: 
       begin 
        shiftOut = {shiftIn[1:0], 62'd0}; 
       end 
      1'b1: 
       begin 
        shiftOut = {62'd0, shiftIn[63:62]}; 
       end 
     endcase 
    end 
 
   64'd63: 
    begin 
     case(direction) 
      1'b0: shiftOut = {shiftIn[0], 63'd0}; 
      1'b1:shiftOut = {63'd0, shiftIn[63]}; 
     endcase 
    end 
 
   default: 
    begin 
        shiftOut = 64'd0; 
    end 
  endcase 
  
end 
 
 
endmodule