2014-06-30 3 views
0

두 개의 32 비트 피연산자를 얻고 64 비트 출력을 반환하는 승수를 Verilog에 작성했습니다. 이 코드를 제대로 작동하는 5 비트로 테스트했지만이 코드를 실행할 때 아무 것도 일어나지 않고 시뮬레이션 ModelSim을 중지하거나 종료 할 수 없습니다. 이 문제에 대해 알고 있습니까?Verilog에서 두 개의 32 비트 피연산자를 곱하면

module multiplier_always(operand1,operand2,product); 
input [31:0] operand1 ,operand2; 
output reg [63:0] product; 

reg [63:0] op1; 
reg [31:0] op2,addres,subres; 
reg [64:0] subres2,result,addres2,opp1; 
reg [2:0] i=0; 



[email protected](*) 
begin 
     op1 = {32'b0,operand1}; 
     opp1 = {op1,1'b0}; 

for(i=0;i<32;i=i+1) 
begin 
case(opp1[1:0]) 
2'b00:begin 
      opp1 = {opp1[64],opp1[64:1]}; 
      end 

2'b01:begin 
       addres = opp1[64:6]+ operand2; 
       addres2 = {addres,opp1[32:0]}; 
       opp1 = {addres2[64],addres2[64:1]}; 
      end 

2'b10:begin 
       subres = opp1[64:6]+ (~operand2+1); 
       subres2 = {subres,opp1[32:0]}; 
       opp1 = {subres2[64],subres2[64:1]}; 
      end 

2'b11:begin 
      opp1 = {opp1[64],opp1[64:1]};//shift 
      end 

endcase 
end 
product = opp1[64:1]; 

end 
endmodule 

답변

2

reg [2:0] i과 같은 무한 루프는 항상 32보다 작지 않습니다. 일 때 i+10입니다. integer i 또는 reg [5:0] i으로 변경하십시오.

관련 문제