Verilog Error!!

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: 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!!
 

Hi,

Remove semicolon after always block sensitivity list and add begin and end.

Naseer
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…