Question

How do I design a divide by 4 clock in verilog using 2 D Flip Flop...

How do I design a divide by 4 clock in verilog using 2 D Flip Flop blocks? I have created this divide by 2 clock D Flip Flop block so far:

module divide_by_2(D, Clk,reset, Q, Qnext); //Divide by 2 clock with reset using D flip flop
   input Clk, D, reset;
   output Q,Qnext;
   reg Q;
  
   assign Qnext = ~Q;
  
   always @(posedge Clk or posedge reset) //always at the positive edge of the clock or reset
   begin
       if (reset)begin // asynchronous reset when reset is high
  
       Q <= 1'b0;; //Q gets the value 0
   end
  
       else begin
  
       Q <= D; // Q gets the value of D on posedge of clock
   end
  
   end
   endmodule

Also How would I design a divide by 5 clock using D Flip Flop blocks from this picture given?

Homework Answers

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
Please write the testbench of T-flip flop in VHDL with using assert or wait function. thank...
Please write the testbench of T-flip flop in VHDL with using assert or wait function. thank you. Here my Tff code: module Tff (e,clk,re,q); input e,clk,re; ouput q; always_ff@(posedge clk) begin if (re) q=0; else q<=q+1; end endmodule
Using the programing language of Verilog I attempted to make a counter to count from 0...
Using the programing language of Verilog I attempted to make a counter to count from 0 to 9 then loop back to 0 using the internal clock of the FPGA cyclone IV from altera. the code is posted at the bottom counts from 0 to 1 then loop back to 0 instead of counting up to 9. Can someone help me spot the error so it can count up to 9 module Encryption(SW, CLOCK_50, OUT, HEX0); input[1:0]SW; input CLOCK_50; output...
Problem 4 - 5 Pts] Verilog [Part 4.1 - 5 Pts] What does the Verilog code...
Problem 4 - 5 Pts] Verilog [Part 4.1 - 5 Pts] What does the Verilog code below do? Provide as much detail as possible and provide informative descriptions/labels for the 4 input/outputs. module mystery (W, X, Y, Z); input W, X, Y; output Z; reg [7:0] P; always @ (posedge W or posedge X) begin if (X) P = 8'b00000000; else P = {P[6:0], Y); end assign Z = P[7]; endmodule
Implement the following circuit to test the characteristics of a D flip flop. Note: Using a...
Implement the following circuit to test the characteristics of a D flip flop. Note: Using a clock input to operate the flip-flop is rather quickly. You may wish to select the slow motion of the clock OR to use a simple binary input device instead of a clock input device. Verify the flip flop state table. Q(t+1) = D, is the characteristic equation. Characteristic Table Excitation Table ==================== =================== D Q(t+1) Operation Q(t) Q(t+1) D ==================== =================== 0 0 Reset...
Implement the following circuit to test the characteristics of a D flip flop. Note: Using a...
Implement the following circuit to test the characteristics of a D flip flop. Note: Using a clock input to operate the flip-flop is rather quickly. You may wish to select the slow motion of the clock OR to use a simple binary input device instead of a clock input device. Verify the flip flop state table. Q(t+1) = D, is the characteristic equation. Characteristic Table Excitation Table ==================== =================== D Q(t+1) Operation Q(t) Q(t+1) D ==================== =================== 0 0 Reset...
Sign In INNOVATION Deep Change: How Operational Innovation Can Transform Your Company by Michael Hammer From...
Sign In INNOVATION Deep Change: How Operational Innovation Can Transform Your Company by Michael Hammer From the April 2004 Issue Save Share 8.95 In 1991, Progressive Insurance, an automobile insurer based in Mayfield Village, Ohio, had approximately $1.3 billion in sales. By 2002, that figure had grown to $9.5 billion. What fashionable strategies did Progressive employ to achieve sevenfold growth in just over a decade? Was it positioned in a high-growth industry? Hardly. Auto insurance is a mature, 100-year-old industry...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT