Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

Verilog Syntax Error

module de1sign (C, SW);
input  SW;
output  C;
assign C = SW;
assign C = SW;
endmodule
module codes (O, C, d, e, i) ; //possibility of using "i" if "1" is reserved.
input  C;
output d;
output e;
output i;
output O;
endmodule
begin    //THIS IS LINE 17
if ( C == 1'b0 && C == 1'b0);
O = d
if ( C == 1'b0 && C == 1'b1);
O = e
if ( C == 1'b1 && C == 1'b0);
O = i
end
endmodule  //Line You Asked Me to Add
module hexcircuit (O, HEX0);
input O;
output  HEX0;
always @ (O);
begin
if ( O == d )
HEX0 = 7'b100_0010;
if ( O == e )
HEX0 = 7'b011_0000;
if ( O == i )
HEX0 = 7'b100_1111;
end
endmodule

I am trying to do Lab Exercise 1 Part IV (Displaying the characters d, e, 1 on HEX0 in turn when I play with the switches.)

when i try and compile it, i get:

Error (10170): Verilog HDL syntax error at de1sign.v(17) near text "begin"; expecting a description

I am sure this is probably a very nooby error, but help is really appreciated! :)

17 Replies