3

I've been looking around for a while so forgive me if maybe I'm using improper terminology...

The goal of the code is to update Aout1 and Aout0 if the input is 0, with the output corresponding to a 7-segment display, but I'm getting the following error:

"Error (10170): Verilog HDL syntax error at FourBitAdder.v(55) near text: ","; expecting ";". Check for and fix any syntax errors that appear immediately before or at the specified keyword."

Below is a snippet of the code giving me issues...

always @*
case (A)
4'b0000 : Aout1 = 7'b1000000, Aout0 = 7'b1000000; //00

I tried changing the code to the following and while I didn't get any errors on my software, my hardware (7-segment display) isn't working like it was when I was trying to just change one variable per case.

always @*
case (A)
4'b0000 : Aout1 = 7'b1000000; 4'b0000 : Aout0 = 7'b1000000; //00

Thank you in advance :)

gdagis
  • 113
  • 1
  • 4
  • 15

1 Answers1

5

Use a begin and end statement after the colon.

always @* begin
    case(A)
        4'b0000: begin
            Aout1 = 7'b1000000;
            Aout0 = 7'b1000000;
        end
        4'b0001: begin
            Aout1 = 7'b0000011;
            Aout0 = 7'b0000011;
        end

    endcase
end
Charles Clayton
  • 17,005
  • 11
  • 87
  • 120
  • 3
    `begin`/`end` is required when you want to put multiple statements where only one is allowed. – dave_59 Dec 10 '17 at 06:15