summaryrefslogtreecommitdiffstats
path: root/usrp2/udp/add_onescomp.v
diff options
context:
space:
mode:
authorMatt Ettus <matt@ettus.com>2010-03-25 21:00:25 -0700
committerMatt Ettus <matt@ettus.com>2010-03-25 21:00:25 -0700
commitf979a9d4e7b9664e046aaca54357e46782c4aa51 (patch)
treed48bb446844d647977c2ba4d52fcb64d935df079 /usrp2/udp/add_onescomp.v
parentb74388567c0ed3048e45158ac077e31def59fea1 (diff)
parent16818dc98e97b69a028c47e66ebfb16e32565533 (diff)
downloaduhd-f979a9d4e7b9664e046aaca54357e46782c4aa51.tar.gz
uhd-f979a9d4e7b9664e046aaca54357e46782c4aa51.tar.bz2
uhd-f979a9d4e7b9664e046aaca54357e46782c4aa51.zip
Merge branch 'udp' into u1e
Diffstat (limited to 'usrp2/udp/add_onescomp.v')
-rw-r--r--usrp2/udp/add_onescomp.v12
1 files changed, 12 insertions, 0 deletions
diff --git a/usrp2/udp/add_onescomp.v b/usrp2/udp/add_onescomp.v
new file mode 100644
index 000000000..048842a86
--- /dev/null
+++ b/usrp2/udp/add_onescomp.v
@@ -0,0 +1,12 @@
+
+
+module add_onescomp
+ #(parameter WIDTH = 16)
+ (input [WIDTH-1:0] A,
+ input [WIDTH-1:0] B,
+ output [WIDTH-1:0] SUM);
+
+ wire [WIDTH:0] SUM_INT = {1'b0,A} + {1'b0,B};
+ assign SUM = SUM_INT[WIDTH-1:0] + {{WIDTH-1{1'b0}},SUM_INT[WIDTH]};
+
+endmodule // add_onescomp