-
Notifications
You must be signed in to change notification settings - Fork 0
/
vmachine_tb.v
44 lines (41 loc) · 1.32 KB
/
vmachine_tb.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module Vending_Machine1_tb_final;
reg nickel,dime,quarter,clk,reset,choice;
wire [1:0]nickel_out,dime_out,quarter_out;
wire dispense1;
integer i;
integer check=1;
integer file,file2;
Vending_Machine1 m1(dime,nickel,quarter,nickel_out,quarter_out,dime_out,reset, clk, dispense1,choice);
initial begin
reset=0;clk=0;nickel=0;quarter=0;dime=0;
$monitor("clock=%b dispense=%b reset=%b dime=%b nickel=%b quarter=%b nickel_out=%d dime_out=%d quarter_out=%d choice=%b",clk,dispense1,reset,dime,nickel,quarter,nickel_out,dime_out,quarter_out,choice);
choice=0;
#10 dime=0;nickel=1;quarter=0;
#10 dime=1;nickel=0;quarter=0;
#10 dime=1;nickel=0;quarter=0;
#10 dime=0;nickel=1;quarter=0;
#10 dime=0;nickel=1;quarter=0;
#10 dime=0;nickel=0;quarter=0;
#10 dime=0;nickel=1;quarter=0;
#10 dime=0;nickel=0;quarter=1;
#10 dime=0;nickel=0;quarter=1;
#10 dime=0;nickel=0;quarter=0;
#10 dime=0;nickel=0;quarter=1;
#10 dime=0;nickel=0;quarter=1;
#10 dime=0;nickel=0;quarter=0;
#10 choice=1;
#10 dime=0;nickel=1;quarter=0;
#10 dime=1;nickel=0;quarter=0;
#10 dime=1;nickel=0;quarter=0;
#10 dime=0;nickel=1;quarter=0;
#10 dime=0;nickel=0;quarter=0;
#10 dime=0;nickel=0;quarter=1;
#10 dime=1;nickel=0;quarter=0;
#10 dime=0;nickel=0;quarter=0;
#10 dime=0;nickel=0;quarter=1;
#10 dime=0;nickel=0;quarter=1;
#10 dime=0;nickel=0;quarter=0;
end
always
#5 clk=~clk;
endmodule