aboutsummaryrefslogtreecommitdiffstats
path: root/usrp2/sdr_lib/add2_and_clip.v
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-07-08 12:14:53 -0700
committerJosh Blum <josh@joshknows.com>2011-07-08 12:14:53 -0700
commit4ea6f7431e09d9f27ecaa1c1b187d2c2f613e8f4 (patch)
treed2e66eb4e5f7cf7f8ab033f5482a6f2477aa88b6 /usrp2/sdr_lib/add2_and_clip.v
parentdd41da159157afe417e7f3b77ba30e189eb510fe (diff)
parentfbc01138d5f943b06ce1bf3f746287b9d6c7789d (diff)
downloaduhd-4ea6f7431e09d9f27ecaa1c1b187d2c2f613e8f4.tar.gz
uhd-4ea6f7431e09d9f27ecaa1c1b187d2c2f613e8f4.tar.bz2
uhd-4ea6f7431e09d9f27ecaa1c1b187d2c2f613e8f4.zip
Merge branch 'b100_shrink' into next
Diffstat (limited to 'usrp2/sdr_lib/add2_and_clip.v')
-rw-r--r--usrp2/sdr_lib/add2_and_clip.v12
1 files changed, 12 insertions, 0 deletions
diff --git a/usrp2/sdr_lib/add2_and_clip.v b/usrp2/sdr_lib/add2_and_clip.v
new file mode 100644
index 000000000..663f5d004
--- /dev/null
+++ b/usrp2/sdr_lib/add2_and_clip.v
@@ -0,0 +1,12 @@
+
+module add2_and_clip
+ #(parameter WIDTH=16)
+ (input [WIDTH-1:0] in1,
+ input [WIDTH-1:0] in2,
+ output [WIDTH-1:0] sum);
+
+ wire [WIDTH:0] sum_int = {in1[WIDTH-1],in1} + {in2[WIDTH-1],in2};
+ clip #(.bits_in(WIDTH+1),.bits_out(WIDTH)) clip
+ (.in(sum_int),.out(sum));
+
+endmodule // add2_and_clip