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

Subversion Repositories sbd_sqrt_fp

[/] [sbd_sqrt_fp/] [tags/] [start/] [sbd_shifter_left2.v] - Diff between revs 3 and 4

Only display areas with differences | Details | Blame | View Log

Rev 3 Rev 4
/****************************************************************************
/****************************************************************************
sbd_shifter_left2
sbd_shifter_left2
- shift register - shifts left - towards MSB - 2 bits
- shift register - shifts left - towards MSB - 2 bits
 
 
Copyright (C) 2005 Samuel Brown
Copyright (C) 2005 Samuel Brown
sam.brown@sbdesign.org
sam.brown@sbdesign.org
 
 
This library is free software; you can redistribute it and/or
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
version 2.1 of the License, or (at your option) any later version.
 
 
This library is distributed in the hope that it will be useful,
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.
Lesser General Public License for more details.
 
 
You should have received a copy of the GNU Lesser General Public
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 
****************************************************************************/
****************************************************************************/
 
 
 
 
 
 
module sbd_shifter_left2 (SIN,PIN,LOAD,RST,SHIFT,CLK,SOUT,POUT);
module sbd_shifter_left2 (SIN,PIN,LOAD,RST,SHIFT,CLK,SOUT,POUT);
 
 
parameter bitlength = 24;
parameter bitlength = 24;
 
 
input [1:0] SIN;
input [1:0] SIN;
input [bitlength-1:0] PIN;
input [bitlength-1:0] PIN;
input LOAD;
input LOAD;
input RST;
input RST;
input SHIFT;
input SHIFT;
input CLK;
input CLK;
output wire [1:0] SOUT;
output wire [1:0] SOUT;
output wire [bitlength-1:0] POUT;
output wire [bitlength-1:0] POUT;
 
 
reg  [bitlength-1:0] writeData, readData;
reg  [bitlength-1:0] writeData, readData;
 
 
assign POUT = readData;
assign POUT = readData;
assign SOUT = readData[bitlength-1:bitlength-2];
assign SOUT = readData[bitlength-1:bitlength-2];
 
 
always @ (posedge CLK)
always @ (posedge CLK)
begin:shiftreg
begin:shiftreg
   if(RST) readData <= 0;
   if(RST) readData <= 0;
   else if(SHIFT | LOAD) readData <= writeData;
   else if(SHIFT | LOAD) readData <= writeData;
end
end
 
 
always @ (readData, SIN, PIN, LOAD)
always @ (readData, SIN, PIN, LOAD)
begin:shiftmux
begin:shiftmux
   if(LOAD) writeData = PIN;
   if(LOAD) writeData = PIN;
   else writeData = { readData[bitlength-3:0], SIN };
   else writeData = { readData[bitlength-3:0], SIN };
end
end
 
 
endmodule
endmodule
 
 

powered by: WebSVN 2.1.0

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