I made the following program for displaying no of days in the user provided month. And to check whether the year user entered is leap year or not. I am trying to make the program on data flow level. I don't know whether I can use if/else in data flow level in Verilog. The following program is giving me errors at the notified place.
module LeapYear(year,month,leapOrNot,Days);
input year,month;
output leapOrNot,Days;
// error here
if((year&400)==0) && ((year % 100)!==0 || (year & 4)==0)begin
leapOrNot=1;
end
else
if(month==4 || month==6|| month==9|| month==11)begin
Days=30;
end else
if(month==1 || month==3|| month==5|| month==7|| month==8|| month==10|| month==12)begin
Days=31;
end else
if(month==2 && leapOrNot==1) begin
Days=29;
end else begin
Days=28;
end
endmodule
Please tell me what is the reason for this error. There error is
** Error: C:/Modeltech_5.7f/examples/LeapYear.v(9): near "if": syntax error
Regards