URL
https://opencores.org/ocsvn/sbd_sqrt_fp/sbd_sqrt_fp/trunk
[/] [sbd_sqrt_fp/] [trunk/] [sbd_adsu.v] - Blame information for rev 4
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
2 |
sbdesign |
/****************************************************************************
|
2 |
|
|
sbd_adsu
|
3 |
|
|
|
4 |
|
|
- ADSU
|
5 |
|
|
|
6 |
|
|
Copyright (C) 2005 Samuel Brown
|
7 |
|
|
sam.brown@sbdesign.org
|
8 |
|
|
|
9 |
|
|
This library is free software; you can redistribute it and/or
|
10 |
|
|
modify it under the terms of the GNU Lesser General Public
|
11 |
|
|
License as published by the Free Software Foundation; either
|
12 |
|
|
version 2.1 of the License, or (at your option) any later version.
|
13 |
|
|
|
14 |
|
|
This library is distributed in the hope that it will be useful,
|
15 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
17 |
|
|
Lesser General Public License for more details.
|
18 |
|
|
|
19 |
|
|
You should have received a copy of the GNU Lesser General Public
|
20 |
|
|
License along with this library; if not, write to the Free Software
|
21 |
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
22 |
|
|
|
23 |
|
|
****************************************************************************/
|
24 |
|
|
|
25 |
|
|
module sbd_adsu(A,B,ADD,C_IN,C_OUT,S);
|
26 |
|
|
|
27 |
|
|
parameter bitlength=8;
|
28 |
|
|
|
29 |
|
|
input [bitlength-1:0] A;
|
30 |
|
|
input [bitlength-1:0] B;
|
31 |
|
|
input ADD;
|
32 |
|
|
input C_IN;
|
33 |
|
|
output wire C_OUT;
|
34 |
|
|
output wire [bitlength-1:0] S;
|
35 |
|
|
|
36 |
|
|
wire [bitlength-1:0] Bx;
|
37 |
|
|
wire [bitlength:0] tmp;
|
38 |
|
|
|
39 |
|
|
assign Bx = B ^ {bitlength{~ADD}};
|
40 |
|
|
assign tmp = A + Bx + C_IN;
|
41 |
|
|
|
42 |
|
|
assign S = tmp[bitlength-1:0];
|
43 |
|
|
assign C_OUT = tmp[bitlength];
|
44 |
|
|
|
45 |
|
|
endmodule
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.