diff options
author | Matt Ettus <matt@ettus.com> | 2009-09-11 01:05:24 -0700 |
---|---|---|
committer | Matt Ettus <matt@ettus.com> | 2009-12-21 16:55:45 -0800 |
commit | 029602d026f5e66ea6fcadc6ae75c1808851e444 (patch) | |
tree | 590b98bcfc6dd945b707dbd4d2102d7884ee2650 /udp/add_onescomp.v | |
parent | 37f1e195832e9c7e69a14947a810e8cc72b40e10 (diff) | |
download | uhd-029602d026f5e66ea6fcadc6ae75c1808851e444.tar.gz uhd-029602d026f5e66ea6fcadc6ae75c1808851e444.tar.bz2 uhd-029602d026f5e66ea6fcadc6ae75c1808851e444.zip |
barebones udp support. Compiles, but untested.
Diffstat (limited to 'udp/add_onescomp.v')
-rw-r--r-- | udp/add_onescomp.v | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/udp/add_onescomp.v b/udp/add_onescomp.v new file mode 100644 index 000000000..048842a86 --- /dev/null +++ b/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 |