/*
 *   Titor - Barrel Processor - Performs sign extension of halfword integers
 *   Copyright (C) 2012		Sean Ryan Moore
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

`ifdef INC_Sign_Ext_Imm
`else
`define INC_Sign_Ext_Imm

`timescale 1 ns / 100 ps

// Combinational module
// takes a two's complement, WORD/2 bit number and conditionally sign extends to WORD bits
module Sign_Ext_Imm (
	result,
	operand,
	enable
);
	
	`include "definition/Definition.v"
	
	output				[WORD-1:0]								result;
	input				[WORD-1:0]								operand;
	input														enable;
		
	Sign_Ext_Return standin(
		.result(result),
		.operand(operand),
		.size(IMM_EXT_CONSTANT),
		.signage(enable)
	);
endmodule

`endif
