一个Verilog测序 看不懂 是个乘法器 请教下 谢谢

[复制链接]
2742|1
 楼主| yanzhiyi1012 发表于 2010-7-14 20:00 | 显示全部楼层 |阅读模式
parameter size=8,longsize=16;
reg [size:1] opa, opb;
reg [longsize:1] result;

begin: mult
    reg [longsize:1] shift_opa, shift_opb;
    shift_opa = opa;
    shift_opb = opb;
    result = 0;
    repeat(size)
       begin
         if(shift_opb[1])
         result = result + shift_opa;

         shift_opa = shift_opa <<1;
         shift_opb = shift_opb >>1;
       end
end
 楼主| yanzhiyi1012 发表于 2010-7-14 20:02 | 显示全部楼层
repeat 8次就 opa乘以8了
后面的位移是干嘛的 移一次就是乘以2,移动八次就是乘以8个2  
完全看不懂什么意思
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3

主题

17

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部