8bits_multiplier.v
上传用户:xyledys
上传日期:2009-08-08
资源大小:20k
文件大小:0k
源码类别:
VHDL/FPGA/Verilog
开发平台:
Windows_Unix
- 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;
- end
- endmodule
English
