赞
踩
http://mp.weixin.qq.com/mp/homepage?__biz=MzU3OTczMzk5Mg==&hid=7&sn=ad5d5d0f15df84f4a92ebf72f88d4ee8&scene=18#wechat_redirect
--------------------------------------------------------------------------------------------------------------------------
- module multiplier
- (
- input [2:0] x,
- input [2:0] y,
- output [5:0] mult_out
- );
-
- wire [2:0] temp0 = y[0] ? x : 3'd0;
- wire [2:0] temp1 = y[1] ? x : 3'd0;
- wire [2:0] temp2 = y[2] ? x : 3'd0;
-
- assign mult_out = temp0 + (temp1 << 1) + (temp2 << 2);
- endmodule
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。