8bits_multiplier.v

来自「该代码中有不少关于学习verilog HDL的例子,对初学者有帮助」· Verilog 代码 · 共 17 行

V
17
字号
module _8bits_multiplier(result,opa,opb);parameter size=8,wordsize=16;output[wordsize-1:0] result;input[size-1:0] opa,opb;reg[wordsize-1:0] result;always@(opa or opb)  begin:mult    reg[wordsize-1:0] shift_opa,shift_opb;    shift_opa=opa;    shift_opb=opb;    result=0;    repeat(size)    if(shift_opb[0]==1) result=result+shift_opa;    shift_opa=shift_opa<<1;    shift_opb=shift_opb>>1;  endendmodule

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?