-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExtend.v
33 lines (32 loc) · 832 Bytes
/
Extend.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 11:47:17 04/14/2016
// Design Name:
// Module Name: Extend
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module Extend(
input [1:0] ExtSel, // ÊÇ·ñ·ûºÅÀ©Õ¹ÐźÅ
input [15:0] imm_16,
output reg [31:0] imm_32);
always @ (*)
case (ExtSel)
2'b00: imm_32 = {27'b0, imm_16[10:6]};
2'b01: imm_32 = {16'b0, imm_16};
2'b10: imm_32 = (imm_16[15] == 1) ? {16'hffff, imm_16} : {16'b0, imm_16};
2'b11: imm_32 = 32'b0;
endcase
endmodule