data/full_repos/permissive/103649428/VendingMachine.v
1: b'%Warning-WIDTH: data/full_repos/permissive/103649428/VendingMachine.v:359: Operator ASSIGNDLY expects 8 bits on the Assign RHS, but Assign RHS\'s CONST \'9\'hfd\' generates 9 bits.\n                                                                         : ... In instance VendingMachine.show\n                            AN[7:0] <= 9\'b11111101;\n                                    ^~\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/103649428/VendingMachine.v:407: Operator ASSIGNDLY expects 8 bits on the Assign RHS, but Assign RHS\'s CONST \'9\'hdf\' generates 9 bits.\n                                                                         : ... In instance VendingMachine.show\n                                        AN[7:0] <= 9\'b11011111;\n                                                ^~\n%Warning-WIDTH: data/full_repos/permissive/103649428/VendingMachine.v:427: Operator ASSIGNDLY expects 8 bits on the Assign RHS, but Assign RHS\'s CONST \'9\'hdf\' generates 9 bits.\n                                                                         : ... In instance VendingMachine.show\n                                    AN[7:0] <= 9\'b11011111;\n                                            ^~\n%Warning-WIDTH: data/full_repos/permissive/103649428/VendingMachine.v:447: Operator ASSIGNDLY expects 8 bits on the Assign RHS, but Assign RHS\'s CONST \'9\'hdf\' generates 9 bits.\n                                                                         : ... In instance VendingMachine.show\n                                    AN[7:0] <= 9\'b11011111;\n                                            ^~\n%Warning-WIDTH: data/full_repos/permissive/103649428/VendingMachine.v:467: Operator ASSIGNDLY expects 8 bits on the Assign RHS, but Assign RHS\'s CONST \'9\'hdf\' generates 9 bits.\n                                                                         : ... In instance VendingMachine.show\n                                    AN[7:0] <= 9\'b11011111;\n                                            ^~\n%Warning-WIDTH: data/full_repos/permissive/103649428/VendingMachine.v:487: Operator ASSIGNDLY expects 8 bits on the Assign RHS, but Assign RHS\'s CONST \'9\'hdf\' generates 9 bits.\n                                                                         : ... In instance VendingMachine.show\n                                    AN[7:0] <= 9\'b11011111;\n                                            ^~\n%Warning-WIDTH: data/full_repos/permissive/103649428/VendingMachine.v:507: Operator ASSIGNDLY expects 8 bits on the Assign RHS, but Assign RHS\'s CONST \'9\'hdf\' generates 9 bits.\n                                                                         : ... In instance VendingMachine.show\n                                    AN[7:0] <= 9\'b11011111;\n                                            ^~\n%Warning-WIDTH: data/full_repos/permissive/103649428/VendingMachine.v:532: Operator ASSIGNDLY expects 8 bits on the Assign RHS, but Assign RHS\'s CONST \'9\'hdf\' generates 9 bits.\n                                                                         : ... In instance VendingMachine.show\n                                    AN[7:0] <= 9\'b11011111;\n                                            ^~\n%Warning-WIDTH: data/full_repos/permissive/103649428/VendingMachine.v:672: Operator ASSIGNDLY expects 8 bits on the Assign RHS, but Assign RHS\'s CONST \'9\'h7f\' generates 9 bits.\n                                                                         : ... In instance VendingMachine.show\n                                 AN[7:0] <= 9\'b01111111;\n                                         ^~\n%Warning-WIDTH: data/full_repos/permissive/103649428/VendingMachine.v:715: Operator ASSIGNDLY expects 8 bits on the Assign RHS, but Assign RHS\'s CONST \'9\'h7f\' generates 9 bits.\n                                                                         : ... In instance VendingMachine.show\n                                 AN[7:0] <= 9\'b01111111;\n                                         ^~\n%Warning-WIDTH: data/full_repos/permissive/103649428/VendingMachine.v:734: Operator ASSIGN expects 8 bits on the Assign RHS, but Assign RHS\'s CONST \'9\'h7f\' generates 9 bits.\n                                                                         : ... In instance VendingMachine.show\n                                 AN[7:0] = 9\'b01111111;\n                                         ^\n%Warning-WIDTH: data/full_repos/permissive/103649428/VendingMachine.v:753: Operator ASSIGN expects 8 bits on the Assign RHS, but Assign RHS\'s CONST \'9\'h7f\' generates 9 bits.\n                                                                         : ... In instance VendingMachine.show\n                                 AN[7:0] = 9\'b01111111;\n                                         ^\n%Error: Exiting due to 12 warning(s)\n'
module Show(ck, item1, item2, state, money, chargeMoney, SEG, AN);
    input ck;
    input item1, item2;
    input [2:0]state;
    input [4:0]money;
    input [4:0]chargeMoney;
    output reg [7:0]SEG;
    output reg [7:0]AN;
    reg [2:0]cnt;

    initial begin
        cnt = 0;
    end

    parameter  off        =      0,
               start      =      1,
               toSale     =      2,
               chooseItem =      3,
               pay        =      4,
               charge     =      5;

        always@(posedge ck) begin
        case(state)
            off: begin
                case(cnt)
                    0: begin
                        cnt <= 1;
                        SEG[7:0] <= 8'b11000000;
                        AN[7:0] <= 8'b11111011;
                    end
                    1: begin
                        cnt <= 2;
                        SEG[7:0] <= 8'b10001110;
                        AN[7:0] <= 8'b11111101; 
                    end
                    2: begin
                        cnt <= 0;
                        SEG[7:0] <= 8'b10001110;
                        AN[7:0] <= 8'b11111110;
                    end
                    default: cnt = 0;
                endcase
            end
            start: begin
                case (cnt)
                    0:begin
                        cnt <= 1;
                        SEG[7:0]<=8'b11000000;
                        AN[7:0]<=8'b11111110;
                    end
                    1:begin
                        cnt <= 2;
                        SEG[7:0] <= 8'b11000111;
                        AN[7:0] <= 8'b11111101;
                    end                
                    2:begin
                        cnt <= 3;
                        SEG[7:0] <= 8'b11000111;
                        AN[7:0] <= 8'b11111011;
                    end
                    3:begin 
                        cnt <= 4;
                        SEG[7:0] <= 8'b10000110;
                        AN[7:0] <= 8'b11110111;
                    end
                    4:begin
                        cnt <= 0;
                        SEG[7:0] <= 8'b10001001;
                        AN[7:0] <= 8'b11101111;
                    end
                    default: cnt = 0;
                endcase
            end
            toSale: begin
                case (cnt)
                    0:begin
                        cnt <= 1;
                        SEG[7:0]<=8'b11000000;
                        AN[7:0]<=8'b11111110;
                    end
                    1:begin
                        cnt <= 2;
                        SEG[7:0] <= 8'b11000111;
                        AN[7:0] <= 8'b11111101;
                    end                
                    2:begin
                        cnt <= 3;
                        SEG[7:0] <= 8'b11000111;
                        AN[7:0] <= 8'b11111011;
                    end
                    3:begin 
                        cnt <= 4;
                        SEG[7:0] <= 8'b10000110;
                        AN[7:0] <= 8'b11110111;
                    end
                    4:begin
                        cnt <= 0;
                        SEG[7:0] <= 8'b10001001;
                        AN[7:0] <= 8'b11101111;
                    end
                    default: cnt = 0;
                endcase
            end
            chooseItem: begin
                if(item1) begin
                    case(cnt)
                        0:begin
                            cnt <= 1;
                            SEG[7:0] <=  8'b10010010;
                            AN[7:0] <= 8'b11111110;
                        end
                        1:begin
                            cnt <= 0;
                            SEG[7:0] <= 8'b00100100;
                            AN[7:0] <= 9'b11111101;
                        end
                        default: cnt = 0;
                    endcase
                end
                else if(item2) begin
                    SEG[7:0] <=  8'b10010010;
                    AN[7:0] <= 8'b11111110;
                end
                else begin
                     case(cnt)
                        0:begin
                            cnt <= 1;
                            SEG[7:0] <= 8'b10010010;
                            AN[7:0] <= 8'b11111110; 
                        end
                        1:begin
                            cnt <= 2;
                            SEG[7:0] <= 8'b00100100;
                            AN[7:0] <= 8'b11110111;
                        end
                        2:begin
                            cnt <= 0;
                            SEG[7:0] <= 8'b10010010;
                            AN[7:0] <= 8'b11111011;
                        end
                        default: cnt = 0;
                    endcase
                 end 
            end
            pay: begin
                if(item1)begin
                    case (money)
                         0: begin
                                case(cnt)
                                    0: begin
                                        cnt <= 1;
                                        SEG[7:0] <= 8'b11000000;
                                        AN[7:0] <= 8'b11111110;                                    
                                    end
                                    1: begin
                                        cnt <= 2;
                                        SEG[7:0] <=  8'b10010010;
                                        AN[7:0] <= 8'b11101111; 
                                    end
                                    2: begin
                                        cnt <= 0;
                                        SEG[7:0] <= 8'b00100100;
                                        AN[7:0] <= 9'b11011111;
                                    end
                                    default: cnt <= 0;
                                endcase
                        end
                        1: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b11111001;
                                    AN[7:0] <= 8'b11111110;                                    
                                end
                                1: begin
                                    cnt <= 2;
                                    SEG[7:0] <=  8'b10010010;
                                    AN[7:0] <= 8'b11101111; 
                                end
                                2: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b00100100;
                                    AN[7:0] <= 9'b11011111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        2: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b10100100;
                                    AN[7:0] <= 8'b11111110;                                    
                                end
                                1: begin
                                    cnt <= 2;
                                    SEG[7:0] <=  8'b10010010;
                                    AN[7:0] <= 8'b11101111; 
                                end
                                2: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b00100100;
                                    AN[7:0] <= 9'b11011111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        3: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b10110000;
                                    AN[7:0] <= 8'b11111110;                                    
                                end
                                1: begin
                                    cnt <= 2;
                                    SEG[7:0] <=  8'b10010010;
                                    AN[7:0] <= 8'b11101111; 
                                end
                                2: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b00100100;
                                    AN[7:0] <= 9'b11011111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        4: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b10011001;
                                    AN[7:0] <= 8'b11111110;                                    
                                end
                                1: begin
                                    cnt <= 2;
                                    SEG[7:0] <=  8'b10010010;
                                    AN[7:0] <= 8'b11101111; 
                                end
                                2: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b00100100;
                                    AN[7:0] <= 9'b11011111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        5: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b10010010;
                                    AN[7:0] <= 8'b11111110;                                    
                                end
                                1: begin
                                    cnt <= 2;
                                    SEG[7:0] <=  8'b10010010;
                                    AN[7:0] <= 8'b11101111; 
                                end
                                2: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b00100100;
                                    AN[7:0] <= 9'b11011111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        10: begin
                             case(cnt)
                                 0: begin
                                     cnt <= 1;
                                     SEG[7:0] = 8'b11000000;
                                     AN[7:0] = 8'b11111110;
                                 end
                                 1: begin
                                     cnt <= 2;
                                     SEG[7:0] = 8'b11111001;
                                     AN[7:0] = 8'b11111101;
                                 end
                                2: begin
                                    cnt <= 3;
                                    SEG[7:0] <=  8'b10010010;
                                    AN[7:0] <= 8'b11101111; 
                                end
                                3: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b00100100;
                                    AN[7:0] <= 9'b11011111;
                                end
                                default: cnt = 0;
                             endcase
                         end
                         default: cnt = 0;
                    endcase
                end
                else if(item2) begin
                    case (money)
                        0: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b11000000;
                                    AN[7:0] <= 8'b11111110;       
                                end
                                1: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b10010010;
                                    AN[7:0] <= 8'b11101111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        1: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b11111001;
                                    AN[7:0] <= 8'b11111110;       
                                end
                                1: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b10010010;
                                    AN[7:0] <= 8'b11101111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        2: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b10100100;
                                    AN[7:0] <= 8'b11111110;       
                                end
                                1: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b10010010;
                                    AN[7:0] <= 8'b11101111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        3: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b10110000;
                                    AN[7:0] <= 8'b11111110;       
                                end
                                1: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b10010010;
                                    AN[7:0] <= 8'b11101111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        4: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b10011001;
                                    AN[7:0] <= 8'b11111110;       
                                end
                                1: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b10010010;
                                    AN[7:0] <= 8'b11101111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        5: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b10010010;
                                    AN[7:0] <= 8'b11111110;       
                                end
                                1: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b10010010;
                                    AN[7:0] <= 8'b11101111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        10: begin
                             case(cnt)
                                 0: begin
                                    cnt <= 1;
                                    SEG[7:0] = 8'b11000000;
                                    AN[7:0] = 8'b11111110;
                                 end
                                 1: begin
                                    cnt <= 2;
                                    SEG[7:0] = 8'b11111001;
                                    AN[7:0] = 8'b11111101;
                                 end
                                 2: begin
                                    cnt <= 0;
                                    SEG[7:0] = 8'b10010010;
                                    AN[7:0] = 8'b11101111; 
                                 end
                                 default: cnt = 0;
                             endcase
                        end
                        default: cnt = 0;
                    endcase    
                end
            end
            charge: begin
                 case(chargeMoney)
                     0: begin
                         SEG[7:0] <= 8'b11000000;
                         AN[7:0] <= 8'b01111111;    
                     end
                     1: begin
                         case(cnt)
                             0:begin
                                 cnt <= 1;
                                 SEG[7:0] <=  8'b10010010;
                                 AN[7:0] <= 8'b10111111;
                             end
                             1:begin
                                 cnt <= 0;
                                 SEG[7:0] <= 8'b01000000;
                                 AN[7:0] <= 9'b01111111;
                             end
                             default: cnt = 0;
                         endcase
                     end
                     2: begin
                         SEG[7:0] <= 8'b11111001;
                         AN[7:0] <= 8'b01111111;
                     end
                     4: begin
                         SEG[7:0] <= 8'b10100100;                  
                         AN[7:0] <= 8'b01111111;
                     end
                     6: begin
                         SEG[7:0] <= 8'b10110000;
                         AN[7:0] <= 8'b01111111;
                     end
                     8: begin
                         SEG[7:0] <= 8'b10011001;
                         AN[7:0] <= 8'b01111111;
                     end
                     10: begin
                         SEG[7:0] <= 8'b10010010;
                         AN[7:0] <= 8'b01111111;
                     end
                     12: begin
                         SEG[7:0] = 8'b10000010;
                         AN[7:0] = 8'b01111111;
                     end
                     14: begin
                         SEG[7:0] = 8'b11111000;
                         AN[7:0] = 8'b01111111;
                     end
                     15: begin
                         case(cnt)
                             0:begin
                                 cnt <= 1;
                                 SEG[7:0] <=  8'b10010010;
                                 AN[7:0] <= 8'b10111111;
                             end
                             1:begin
                                 cnt <= 0;
                                 SEG[7:0] <= 8'b01111000;
                                 AN[7:0] <= 9'b01111111;
                             end
                             default: cnt = 0;
                         endcase
                     end
                     16: begin
                         SEG[7:0] = 8'b10000000;
                         AN[7:0] = 8'b01111111;
                     end
                     17: begin
                         case(cnt)
                             0:begin
                                 cnt = 1;
                                 SEG[7:0] =  8'b10010010;
                                 AN[7:0] = 8'b10111111;
                             end
                             1:begin
                                 cnt = 0;
                                 SEG[7:0] = 8'b00000000;
                                 AN[7:0] = 9'b01111111;
                             end
                             default: cnt = 0;
                         endcase
                     end
                     18: begin
                         SEG[7:0] = 8'b10010000;
                         AN[7:0] = 8'b01111111;
                     end
                     19: begin
                         case(cnt)
                             0:begin
                                 cnt = 1;
                                 SEG[7:0] =  8'b10010010;
                                 AN[7:0] = 8'b10111111;
                             end
                             1:begin
                                 cnt = 0;
                                 SEG[7:0] = 8'b00010000;
                                 AN[7:0] = 9'b01111111;
                             end
                             default: cnt = 0;
                         endcase
                     end
                     default: cnt = 0;
                 endcase
            end
        endcase
    end
endmodule
module Show(ck, item1, item2, state, money, chargeMoney, SEG, AN);

    input ck;
    input item1, item2;
    input [2:0]state;
    input [4:0]money;
    input [4:0]chargeMoney;
    output reg [7:0]SEG;
    output reg [7:0]AN;
    reg [2:0]cnt;

    initial begin
        cnt = 0;
    end

    parameter  off        =      0,
               start      =      1,
               toSale     =      2,
               chooseItem =      3,
               pay        =      4,
               charge     =      5;

        always@(posedge ck) begin
        case(state)
            off: begin
                case(cnt)
                    0: begin
                        cnt <= 1;
                        SEG[7:0] <= 8'b11000000;
                        AN[7:0] <= 8'b11111011;
                    end
                    1: begin
                        cnt <= 2;
                        SEG[7:0] <= 8'b10001110;
                        AN[7:0] <= 8'b11111101; 
                    end
                    2: begin
                        cnt <= 0;
                        SEG[7:0] <= 8'b10001110;
                        AN[7:0] <= 8'b11111110;
                    end
                    default: cnt = 0;
                endcase
            end
            start: begin
                case (cnt)
                    0:begin
                        cnt <= 1;
                        SEG[7:0]<=8'b11000000;
                        AN[7:0]<=8'b11111110;
                    end
                    1:begin
                        cnt <= 2;
                        SEG[7:0] <= 8'b11000111;
                        AN[7:0] <= 8'b11111101;
                    end                
                    2:begin
                        cnt <= 3;
                        SEG[7:0] <= 8'b11000111;
                        AN[7:0] <= 8'b11111011;
                    end
                    3:begin 
                        cnt <= 4;
                        SEG[7:0] <= 8'b10000110;
                        AN[7:0] <= 8'b11110111;
                    end
                    4:begin
                        cnt <= 0;
                        SEG[7:0] <= 8'b10001001;
                        AN[7:0] <= 8'b11101111;
                    end
                    default: cnt = 0;
                endcase
            end
            toSale: begin
                case (cnt)
                    0:begin
                        cnt <= 1;
                        SEG[7:0]<=8'b11000000;
                        AN[7:0]<=8'b11111110;
                    end
                    1:begin
                        cnt <= 2;
                        SEG[7:0] <= 8'b11000111;
                        AN[7:0] <= 8'b11111101;
                    end                
                    2:begin
                        cnt <= 3;
                        SEG[7:0] <= 8'b11000111;
                        AN[7:0] <= 8'b11111011;
                    end
                    3:begin 
                        cnt <= 4;
                        SEG[7:0] <= 8'b10000110;
                        AN[7:0] <= 8'b11110111;
                    end
                    4:begin
                        cnt <= 0;
                        SEG[7:0] <= 8'b10001001;
                        AN[7:0] <= 8'b11101111;
                    end
                    default: cnt = 0;
                endcase
            end
            chooseItem: begin
                if(item1) begin
                    case(cnt)
                        0:begin
                            cnt <= 1;
                            SEG[7:0] <=  8'b10010010;
                            AN[7:0] <= 8'b11111110;
                        end
                        1:begin
                            cnt <= 0;
                            SEG[7:0] <= 8'b00100100;
                            AN[7:0] <= 9'b11111101;
                        end
                        default: cnt = 0;
                    endcase
                end
                else if(item2) begin
                    SEG[7:0] <=  8'b10010010;
                    AN[7:0] <= 8'b11111110;
                end
                else begin
                     case(cnt)
                        0:begin
                            cnt <= 1;
                            SEG[7:0] <= 8'b10010010;
                            AN[7:0] <= 8'b11111110; 
                        end
                        1:begin
                            cnt <= 2;
                            SEG[7:0] <= 8'b00100100;
                            AN[7:0] <= 8'b11110111;
                        end
                        2:begin
                            cnt <= 0;
                            SEG[7:0] <= 8'b10010010;
                            AN[7:0] <= 8'b11111011;
                        end
                        default: cnt = 0;
                    endcase
                 end 
            end
            pay: begin
                if(item1)begin
                    case (money)
                         0: begin
                                case(cnt)
                                    0: begin
                                        cnt <= 1;
                                        SEG[7:0] <= 8'b11000000;
                                        AN[7:0] <= 8'b11111110;                                    
                                    end
                                    1: begin
                                        cnt <= 2;
                                        SEG[7:0] <=  8'b10010010;
                                        AN[7:0] <= 8'b11101111; 
                                    end
                                    2: begin
                                        cnt <= 0;
                                        SEG[7:0] <= 8'b00100100;
                                        AN[7:0] <= 9'b11011111;
                                    end
                                    default: cnt <= 0;
                                endcase
                        end
                        1: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b11111001;
                                    AN[7:0] <= 8'b11111110;                                    
                                end
                                1: begin
                                    cnt <= 2;
                                    SEG[7:0] <=  8'b10010010;
                                    AN[7:0] <= 8'b11101111; 
                                end
                                2: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b00100100;
                                    AN[7:0] <= 9'b11011111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        2: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b10100100;
                                    AN[7:0] <= 8'b11111110;                                    
                                end
                                1: begin
                                    cnt <= 2;
                                    SEG[7:0] <=  8'b10010010;
                                    AN[7:0] <= 8'b11101111; 
                                end
                                2: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b00100100;
                                    AN[7:0] <= 9'b11011111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        3: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b10110000;
                                    AN[7:0] <= 8'b11111110;                                    
                                end
                                1: begin
                                    cnt <= 2;
                                    SEG[7:0] <=  8'b10010010;
                                    AN[7:0] <= 8'b11101111; 
                                end
                                2: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b00100100;
                                    AN[7:0] <= 9'b11011111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        4: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b10011001;
                                    AN[7:0] <= 8'b11111110;                                    
                                end
                                1: begin
                                    cnt <= 2;
                                    SEG[7:0] <=  8'b10010010;
                                    AN[7:0] <= 8'b11101111; 
                                end
                                2: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b00100100;
                                    AN[7:0] <= 9'b11011111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        5: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b10010010;
                                    AN[7:0] <= 8'b11111110;                                    
                                end
                                1: begin
                                    cnt <= 2;
                                    SEG[7:0] <=  8'b10010010;
                                    AN[7:0] <= 8'b11101111; 
                                end
                                2: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b00100100;
                                    AN[7:0] <= 9'b11011111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        10: begin
                             case(cnt)
                                 0: begin
                                     cnt <= 1;
                                     SEG[7:0] = 8'b11000000;
                                     AN[7:0] = 8'b11111110;
                                 end
                                 1: begin
                                     cnt <= 2;
                                     SEG[7:0] = 8'b11111001;
                                     AN[7:0] = 8'b11111101;
                                 end
                                2: begin
                                    cnt <= 3;
                                    SEG[7:0] <=  8'b10010010;
                                    AN[7:0] <= 8'b11101111; 
                                end
                                3: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b00100100;
                                    AN[7:0] <= 9'b11011111;
                                end
                                default: cnt = 0;
                             endcase
                         end
                         default: cnt = 0;
                    endcase
                end
                else if(item2) begin
                    case (money)
                        0: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b11000000;
                                    AN[7:0] <= 8'b11111110;       
                                end
                                1: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b10010010;
                                    AN[7:0] <= 8'b11101111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        1: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b11111001;
                                    AN[7:0] <= 8'b11111110;       
                                end
                                1: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b10010010;
                                    AN[7:0] <= 8'b11101111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        2: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b10100100;
                                    AN[7:0] <= 8'b11111110;       
                                end
                                1: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b10010010;
                                    AN[7:0] <= 8'b11101111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        3: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b10110000;
                                    AN[7:0] <= 8'b11111110;       
                                end
                                1: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b10010010;
                                    AN[7:0] <= 8'b11101111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        4: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b10011001;
                                    AN[7:0] <= 8'b11111110;       
                                end
                                1: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b10010010;
                                    AN[7:0] <= 8'b11101111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        5: begin
                            case(cnt)
                                0: begin
                                    cnt <= 1;
                                    SEG[7:0] <= 8'b10010010;
                                    AN[7:0] <= 8'b11111110;       
                                end
                                1: begin
                                    cnt <= 0;
                                    SEG[7:0] <= 8'b10010010;
                                    AN[7:0] <= 8'b11101111;
                                end
                                default: cnt <= 0;
                            endcase
                        end
                        10: begin
                             case(cnt)
                                 0: begin
                                    cnt <= 1;
                                    SEG[7:0] = 8'b11000000;
                                    AN[7:0] = 8'b11111110;
                                 end
                                 1: begin
                                    cnt <= 2;
                                    SEG[7:0] = 8'b11111001;
                                    AN[7:0] = 8'b11111101;
                                 end
                                 2: begin
                                    cnt <= 0;
                                    SEG[7:0] = 8'b10010010;
                                    AN[7:0] = 8'b11101111; 
                                 end
                                 default: cnt = 0;
                             endcase
                        end
                        default: cnt = 0;
                    endcase    
                end
            end
            charge: begin
                 case(chargeMoney)
                     0: begin
                         SEG[7:0] <= 8'b11000000;
                         AN[7:0] <= 8'b01111111;    
                     end
                     1: begin
                         case(cnt)
                             0:begin
                                 cnt <= 1;
                                 SEG[7:0] <=  8'b10010010;
                                 AN[7:0] <= 8'b10111111;
                             end
                             1:begin
                                 cnt <= 0;
                                 SEG[7:0] <= 8'b01000000;
                                 AN[7:0] <= 9'b01111111;
                             end
                             default: cnt = 0;
                         endcase
                     end
                     2: begin
                         SEG[7:0] <= 8'b11111001;
                         AN[7:0] <= 8'b01111111;
                     end
                     4: begin
                         SEG[7:0] <= 8'b10100100;                  
                         AN[7:0] <= 8'b01111111;
                     end
                     6: begin
                         SEG[7:0] <= 8'b10110000;
                         AN[7:0] <= 8'b01111111;
                     end
                     8: begin
                         SEG[7:0] <= 8'b10011001;
                         AN[7:0] <= 8'b01111111;
                     end
                     10: begin
                         SEG[7:0] <= 8'b10010010;
                         AN[7:0] <= 8'b01111111;
                     end
                     12: begin
                         SEG[7:0] = 8'b10000010;
                         AN[7:0] = 8'b01111111;
                     end
                     14: begin
                         SEG[7:0] = 8'b11111000;
                         AN[7:0] = 8'b01111111;
                     end
                     15: begin
                         case(cnt)
                             0:begin
                                 cnt <= 1;
                                 SEG[7:0] <=  8'b10010010;
                                 AN[7:0] <= 8'b10111111;
                             end
                             1:begin
                                 cnt <= 0;
                                 SEG[7:0] <= 8'b01111000;
                                 AN[7:0] <= 9'b01111111;
                             end
                             default: cnt = 0;
                         endcase
                     end
                     16: begin
                         SEG[7:0] = 8'b10000000;
                         AN[7:0] = 8'b01111111;
                     end
                     17: begin
                         case(cnt)
                             0:begin
                                 cnt = 1;
                                 SEG[7:0] =  8'b10010010;
                                 AN[7:0] = 8'b10111111;
                             end
                             1:begin
                                 cnt = 0;
                                 SEG[7:0] = 8'b00000000;
                                 AN[7:0] = 9'b01111111;
                             end
                             default: cnt = 0;
                         endcase
                     end
                     18: begin
                         SEG[7:0] = 8'b10010000;
                         AN[7:0] = 8'b01111111;
                     end
                     19: begin
                         case(cnt)
                             0:begin
                                 cnt = 1;
                                 SEG[7:0] =  8'b10010010;
                                 AN[7:0] = 8'b10111111;
                             end
                             1:begin
                                 cnt = 0;
                                 SEG[7:0] = 8'b00010000;
                                 AN[7:0] = 9'b01111111;
                             end
                             default: cnt = 0;
                         endcase
                     end
                     default: cnt = 0;
                 endcase
            end
        endcase
    end
endmodule