10170 syntax error occurs for verilog codes to on/off the 7 segment LED

92 views Asked by At

My project is about finding the common factor value between two inputs P[3:0] and Q[3:0]. The display output is G[13:0]. P,Q and G are 2 digits values. I am trying to build a display module for two digits 7 segment display with the code below. However, the compilation is fail.

this is my code:

module display(
    input[3:0] p0,q0,
    output reg[13:0]LEDp,LEDq,LEDg);

    always @*
    begin
        case(p0)
            4'b0000 : LEDp = 14'b11111111000000;
            4'b0001 : LEDp = 14'b11111111111001;
            4'b0010 : LEDp = 14'b11111110100100;
            4'b0011 : LEDp = 14'b11111110110000;
            4'b0100 : LEDp = 14'b11111110011001;
            4'b0101 : LEDp = 14'b11111110010010;
            4'b0110 : LEDp = 14'b11111110000010; 
            4'b0111 : LEDp = 14'b11111111111000;
            4'b1000 : LEDp = 14'b11111110000000;
            4'b1001 : LEDp = 14'b11111110010000;
            4'b1010 : LEDp = 14'b11111101000000;
            4'b1011 : LEDp = 14'b11111101111001;
            4'b1100 : LEDp = 14'b11111100100100;
            4'b1101 : LEDp = 14'b11111100110000;
            4'b1110 : LEDp = 14'b11111100011001;
            4'b1111 : LEDp = 14'b11111100010010;
            default : LEDp = 14'b01111110111111;
        endcase
    end
        
    always @*
    begin
        case (q0)
            4'b0000: LEDq = 14'b11111111000000;
            4'b0001: LEDq = 14'b11111111111001;
            4'b0010: LEDq = 14'b11111110100100;
            4'b0011: LEDq = 14'b11111110110000;
            4'b0100: LEDq = 14'b11111110011001;
            4'b0101: LEDq = 14'b11111110010010;
            4'b0110: LEDq = 14'b11111110000010;
            4'b0111: LEDq = 14'b11111111111000;
            4'b1000: LEDq = 14'b11111110000000;
            4'b1001: LEDq = 14'b11111110010000;
            4'b1010: LEDq = 14'b11111101000000;
            4'b1011: LEDq = 14'b11111101111001;
            4'b1100: LEDq = 14'b11111100100100;
            4'b1101: LEDq = 14'b11111100110000;
            4'b1110: LEDq = 14'b11111100011001;
            4'b1111: LEDq = 14'b11111100010010;
            default: LEDq = 14'b01111110111111;
        endcase
    end
    
    always @*
    begin
        case (G)
            4'b0000: LEDg = 14'b11111111000000;
            4'b0001: LEDg = 14'b11111111111001;
            4'b0010: LEDg = 14'b11111110100100;
            4'b0011: LEDg = 14'b11111110110000;
            4'b0100: LEDg = 14'b11111110011001;
            4'b0101: LEDg = 14'b11111110010010;
            4'b0110: LEDg = 14'b11111110000010;
            4'b0111: LEDg = 14'b11111111111000;
            4'b1000: LEDg = 14'b11111110000000;
            4'b1001: LEDg = 14'b11111110010000;
            4'b1010: LEDg = 14'b11111101000000;
            4'b1011: LEDg = 14'b11111101111001;
            4'b1100: LEDg = 14'b11111100100100;
            4'b1101: LEDg = 14'b11111100110000;
            4'b1110: LEDg = 14'b11111100011001;
            4'b1111: LEDg = 14'b11111100010010;
            default: LEDg = 14'b01111110111111;
        endcase
    end
endmodule

The errors are:

Error (10170): Verilog HDL syntax error at display.v(8) near text ï

Error (10170): Verilog HDL syntax error at display.v(8) near text "ï"; expecting ":", or ","

Error (10170): Verilog HDL syntax error at display.v(8) near text ¼

Error (10170): Verilog HDL syntax error at display.v(8) near text š

May I know how should I correct it? I had searched through Internet but find no solutions.

1

There are 1 answers

2
ToTamire On

When I copied your code and executed it in my software I noticed that you don't have colons (:) in your code only fullwidth colons (). Changing this weird unicode colons to ascii colons almost solved all problems. You use also undefined G.