S6 Verilog LAB Project Report
S6 Verilog LAB Project Report
Group Members:
Aravind Krishnan - ECE21110
Athithya V S - ECE21112
Avanthika S - ECE21113
Abstract
This project presents the design and implementation of an automatic washing machine
control system using Verilog HDL. The controller operates in several states: rinse, soak,
wash, spin, and dry, with specific time durations allocated to each state. The system is
triggered by inserting a coin and completes the washing cycle by transitioning through all the
states. The design is implemented on an FPGA and verified using simulation. The results
show the correct operation of the FSM, timing logic, and output signals.
Methodology
Design Code
The washing machine controller is implemented using Verilog HDL. The FSM has states
corresponding to rinse, soak, wash, spin, and dry, with respective time durations. The
following is the Verilog code for the controller:
module washing_machine_controller (
input clk,
input rst,
input coin,
output reg on,
output reg completed,
output reg [6:0] remaining_time
);
Testbench
The testbench simulates the behavior of the washing machine controller. It initializes the
inputs, applies a reset, inserts a coin to start the washing machine, and waits for the washing
cycle to complete.
verilog
Copy code
module tb_washing_machine_controller;
reg clk;
reg rst;
reg coin;
wire on;
wire completed;
wire [6:0] remaining_time;
// Clock generation
always #5 clk = ~clk; // 10ns period
initial begin
// Initialize signals
clk = 0;
rst = 0;
coin = 0;
// Apply reset
#10;
rst = 1;
#10;
rst = 0;
// Finish simulation
#100;
$stop;
end
endmodule
Results
The waveform indicates the correct operation of the washing machine controller. The FSM
transitions through the states of rinse, soak, wash, spin, and dry with the specified time
durations. The remaining_time output shows the countdown of time units for each state, and
the completed signal is asserted at the end of the cycle. The on signal correctly indicates the
on/off state of the washing machine.