Verilog Error!! Please help..

Status
Not open for further replies.

jeetesh

Newbie level 4
Joined
Dec 19, 2013
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
54
I am getting an error as while designing an OAI22 in verilog(Xilinkx ISE 14.1) : ERROR:HDLCompilers:26 - "OAI21.v" line 26 expecting 'endmodule', found 'if'
21: module OAI21(a, b, cntrl, z);
22: input a, b, cntrl;
23: output z;
24: reg z;
25: always @(a or b or cntrl);
26: if (cntrl)
27: z = a & b;
28: else
29: z = a | b;
30: endmodule
Help me
Thanks in advance!!
 

I guess you wanted the if statement inside the always block. The you should delete the semicolon in line 25.
 
thank u.... I was doing the same silly mistake....
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…