Professional Documents
Culture Documents
Vending Machine1 UVM
Vending Machine1 UVM
Vending Machine1 UVM
CODING TEST
Total Hour:- Max. Marks:- 20
1
VLSI Training Services
Setting standards in VLSI Design
always @(*)
begin
case(prestate)
STATE00 :
begin
if(coin_in == 2'b00)
nextstate = STATE25;
else if(coin_in == 2'b01)
nextstate = STATE50;
else if(coin_in == 2'b10)
nextstate = STATE100;
else
nextstate = STATE00;
end
STATE25 :
begin
if(coin_in == 2'b00)
nextstate = STATE50;
else if(coin_in == 2'b01)
nextstate = STATE75;
else if(coin_in == 2'b10)
nextstate = STATE100;
else
nextstate = STATE25;
end
STATE50 :
begin
if(coin_in == 2'b00)
nextstate = STATE75;
else if(coin_in == 2'b01 || coin_in == 2'b10)
nextstate = STATE100;
else
2
VLSI Training Services
Setting standards in VLSI Design
nextstate = STATE50;
end
STATE75 :
begin
if(coin_in == 2'b00 || coin_in == 2'b01 || coin_in == 2'b10)
nextstate = STATE100;
else
nextstate = STATE75;
end
default : nextstate = STATE00;
endcase
end
3
VLSI Training Services
Setting standards in VLSI Design
STATE100 :
begin
lsb7seg_out = 7'b0001001;
msb7seg_out = 7'b0001000;
end
default :
begin
lsb7seg_out = 7'b1000000;
msb7seg_out = 7'b1000000;
end
endcase
end
endmodule