2016-11-12 1 views
1

저는 4 비트 2 진수의 9의 보수를 찾아야하는 Verilog 프로젝트에서 일하고 있습니다. 내가 일을한다고 생각 모듈을 썼다, 그러나 나는 테스트 벤치와 이상한 오류가 있어요 : 발견 예기치 않은 토큰 "END"와 "endmodule": 나는 그것을 실행하면Verilog Test Bench에서 예상치 못한 "end"및 "endmodule"이 발생합니까?

module test_nine(); 

reg [3:0] A; //inputs 

wire w,x,y,z; //outputs 

integer loop_counter; //for loop counter 

NinesComplement nc0(A[0],A[1],A[2],A[3],w,x,y,z); 

initial 
    begin 

    for(loop_counter=0; loop_counter<16; loop_counter=loop_counter+1) 
    begin 
    #8 A=loop_counter; 
    end 

    #8 $finish() 
    end 
endmodule 

, 나는 오류가 발생합니다. 그게 필요하지 않니? 필자는 본질적으로 YouTube 동영상에서 Verilog를 배우 았기 때문에 내가 생각한 것을 놓친 것 같습니다. 그냥 오류가 내 주요 모듈 인 경우에, 나는 아래에 추가 할 것 :

module NinesComplement(a,b,c,d,w,x,y,z); 

//inputs 
input a,b,c,d; 

//outputs 
output w,x,y,z; 

//wires 
wire ab,an,bn,cn,dn; 


not #8 
//creates a' 
n0a(an,a), 

//creates b' 
n0b(bn,b), 

//creates c' 
n0c(cn,c), 

//creates d' 
n0d(dn,d); 


and #8 
a0a(ab,an,bn), 

a0b(w,ab,cn), 

a0c(y,c,c); 

xor #8 

x0a(x,b,c); 


nand #8 

n1a(z,dn,dn); 

endmodule 

읽기 주셔서 감사합니다, 도움이 다량으로 각 문은 세미콜론으로 종료 할 필요가

답변

0

감사합니다. $finish 다음에 하나 추가 :

#8 $finish();