Question

write a verilog code for a airfreshner dispenser that every 15 min it activates the press...

write a verilog code for a airfreshner dispenser that every 15 min it activates the press the dipense the scent.

Homework Answers

Answer #1

the Verilog module for the dispenser is shown below


module air_freshner(clk,dispence);
input clk;// let the input clock be 10Mhz
integer count=0,count1=0;
output reg dispence;
reg s_clk=0;
always@(posedge clk)// creating a clokc of 1 sec clock period
begin
if(count == 50000000)// 10000000 for 1 sec hence for on and off we get 1000000/2
begin
count<=0;
s_clk<=~s_clk;
end
else
count<=count+1;// counter for converting input clock to a second time period clock
end
always@(posedge s_clk)// output block for dispencing at every min
begin
if( count1 == 60*15 )// (60 for 1 min count for sec) and 15 for (15 minutes of each minute counted)
begin
dispence<=1;
count1<=0;
end
else
begin
dispence<=0;
count1<=count1+1;// counter for minutes
end
end
endmodule

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write down the VERILOG code for an AND gate and the testbench code to test it
Write down the VERILOG code for an AND gate and the testbench code to test it
Write verilog code for Huffman Decoder with testbench.
Write verilog code for Huffman Decoder with testbench.
Write down the VERILOG code for a tri-state buffer and the testbench code to test it
Write down the VERILOG code for a tri-state buffer and the testbench code to test it
Write down the VERILOG code for a 2-to-4 decoder and the testbench code to test it
Write down the VERILOG code for a 2-to-4 decoder and the testbench code to test it
Write the code for a static Huffman decoder in verilog with testbench.
Write the code for a static Huffman decoder in verilog with testbench.
Plz use Verilog for below question. I will rate. Write a Verilog code for the following...
Plz use Verilog for below question. I will rate. Write a Verilog code for the following expressions: M = X’Y’ + XY + Z’ N = (A ⊕ B) + C (A + D)
Design a verilog code for four-bit subtractor. write the simulation code and constraints file for nexys...
Design a verilog code for four-bit subtractor. write the simulation code and constraints file for nexys 4.
Please show complete Verilog code. Write a Verilog description for 3-to-8 decoder generating low outputs when...
Please show complete Verilog code. Write a Verilog description for 3-to-8 decoder generating low outputs when enabled with a low enable.
Write the Verilog code for a 16 to 1 multiplexer as well as a test bench...
Write the Verilog code for a 16 to 1 multiplexer as well as a test bench using gate-level modeling.
write verilog code to generate a clock signal clk with 10 ns period
write verilog code to generate a clock signal clk with 10 ns period