A vending machine is an automated machine that provides items such as snacks and beverages to the consumers after the cash is inserted to the machine. For example, a vending machine to dispense candies where the vending machine accepts 10 cent and 20 cent coins only. The price of the candy is 30 cents. Therefore, the machine will automatically dispense the candy whenever it has received 30 cents. If it receives more that 30 cents, it will dispense the candy with the balance money. In this assignment, you are required to propose and design a vending machine controller for the above specifications. Assume that there are two outputs for the vending machine controller, which are F and G. F = 1 and G = 0 indicate 30 cents have been received and there is no balance money. F = 1 and G = 1 indicate the machine received more that 30 cents and need to return the balance money. Figure 1 show  the block diagram of FSM the code down show Verilog program for the system   you need to  do the tech bench  code  based on this Verilog program  and show the result in quertus. module veding2(clk, rst, w, F, G, state);    input clk, rst;    input [1:0]w;    output reg F, G;    output reg [2:0] state;     reg [2:0]next_state;     parameter [2:0] zero=0, ten=1, twenty=2, thirty=3, fourty=4;     // state register

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

A vending machine is an automated machine that provides items such as snacks and beverages
to the consumers after the cash is inserted to the machine. For example, a vending machine to
dispense candies where the vending machine accepts 10 cent and 20 cent coins only. The price
of the candy is 30 cents. Therefore, the machine will automatically dispense the candy
whenever it has received 30 cents. If it receives more that 30 cents, it will dispense the candy
with the balance money. In this assignment, you are required to propose and design a vending
machine controller for the above specifications. Assume that there are two outputs for the
vending machine controller, which are F and G. F = 1 and G = 0 indicate 30 cents have been
received and there is no balance money. F = 1 and G = 1 indicate the machine received more
that 30 cents and need to return the balance money.

Figure 1 show  the block diagram of FSM

the code down show Verilog program for the system 

 you need to  do the tech bench  code  based on this Verilog program  and show the result in quertus.

module veding2(clk, rst, w, F, G, state);
   input clk, rst;
   input [1:0]w;
   output reg F, G;
   output reg [2:0] state;
    reg [2:0]next_state;
    parameter [2:0] zero=0, ten=1, twenty=2, thirty=3, fourty=4;
    // state register
    always@(posedge clk, posedge rst)
       if(rst) state <= zero;
        else state <= next_state;
    //next_state and output logics
   always@(w, state)
        case(state)
            zero: begin F=0; G=0;
                      case(w)
                        2'b00: next_state = zero;
                             2'b01: next_state = ten;
                             2'b10: next_state = twenty;
                             default : next_state = zero;
                        endcase
                    end
            twenty: begin F=0; G=0;
                   case(w)
                        2'b00: next_state = ten;
                             2'b01: next_state = twenty;
                             2'b10: next_state = thirty;
                             default : next_state = ten;
                        endcase
                    end
            ten: begin F=0; G=0;
                   case(w)
                        2'b00: next_state = twenty;
                             2'b01: next_state = thirty;
                             2'b10: next_state = fourty;
                             default : next_state = twenty;
                        endcase
                    end                         
            thirty: begin F=1; G=0; next_state = zero; end 
            fourty: begin F=1; G=1; next_state = zero; end
            default: begin F=0; G=0; next_state = zero; end
        endcase
endmodule

011
Stake
0o .
nexit
Stake
Cogre
output
logic
Cit 4ate
regrter
figure 1o
Transcribed Image Text:011 Stake 0o . nexit Stake Cogre output logic Cit 4ate regrter figure 1o
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 6 steps with 5 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY