mult_for.v
来自「《Verilog HDL 程序设计教程》2」· Verilog 代码 · 共 15 行
V
15 行
module mult_for(outcome,a,b);
parameter size=8;
input[size:1] a,b;
output[2*size:1] outcome;
reg[2*size:1] outcome;
integer i;
always @(a or b)
begin
outcome=0;
for(i=1; i<=size; i=i+1)
if(b[i]) outcome=outcome +(a << (i-1));
end
endmodule
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?