/******************************************************************************/
/* */
/* Copyright (c) 1999 Sun Microsystems, Inc. All rights reserved. */
/* */
/* The contents of this file are subject to the current version of the Sun */
/* Community Source License, microSPARCII ("the License"). You may not use */
/* this file except in compliance with the License. You may obtain a copy */
/* of the License by searching for "Sun Community Source License" on the */
/* World Wide Web at http://www.sun.com. See the License for the rights, */
/* obligations, and limitations governing use of the contents of this file. */
/* */
/* Sun Microsystems, Inc. has intellectual property rights relating to the */
/* technology embodied in these files. In particular, and without limitation, */
/* these intellectual property rights may include one or more U.S. patents, */
/* foreign patents, or pending applications. */
/* */
/* Sun, Sun Microsystems, the Sun logo, all Sun-based trademarks and logos, */
/* Solaris, Java and all Java-based trademarks and logos are trademarks or */
/* registered trademarks of Sun Microsystems, Inc. in the United States and */
/* other countries. microSPARC is a trademark or registered trademark of */
/* SPARC International, Inc. All SPARC trademarks are used under license and */
/* are trademarks or registered trademarks of SPARC International, Inc. in */
/* the United States and other countries. Products bearing SPARC trademarks */
/* are based upon an architecture developed by Sun Microsystems, Inc. */
/* */
/******************************************************************************/
/***************************************************************************
****************************************************************************
***
*** Program File: @(#)shift.v
***
***
****************************************************************************
****************************************************************************/
// @(#)shift.v 1.4 3/2/93
// shift.v
//-----------------------------------------------------------------------------
/*
This file contains Mshift which models the barrel shifter
*/
module bsr
(
Shift_out,
shift_in,
shift_cnt,
shift_left,
arith_shift,
// other random ports
dec_shiftN,
arith_shiftN,
pre_shift,
pre_shiftN
);
// OUTPUT
output [31:0] Shift_out
;
// INPUTS
input [31:0] shift_in
; // data to be shifted
// CONTROL
input [4:0] shift_cnt
; // fully encoded shift amount
input shift_left
; // =1 for left shift, =0 for right
input arith_shift
; // =1 for arith shift, =0 for logical
// random ports
input dec_shiftN
;
input arith_shiftN
;
input pre_shift
;
input pre_shiftN
;
reg [95:0] shifted
;
wire filld
= shift_in[31] & arith_shift;
wire [95:0] shift_this
= {({32{filld}}), shift_in, 32'b0};
always @ (shift_this or shift_left or shift_cnt) begin
if (shift_left)
shifted = shift_this << shift_cnt;
else
shifted = shift_this >> shift_cnt;
end
wire [31:0] Shift_out = shifted[63:32];
endmodule
This page: |
Created: | Thu Aug 19 12:02:40 1999 |
| From: |
../../../sparc_v8/ssparc/iu/Mexec/rtl/shift.v
|