ripple_carry_counter.pdf - Ripple.v 4-bit Ripple Carry...

Info icon This preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Ripple.v 4-bit Ripple Carry Counter Example // ripple.v - 4-bit Ripple Carry counter example // // Copyright Roy Kravitz, 2015 // // Created By: Roy Kravitz // Last Modified: 26-June-2015 // // Revision History: // ----------------- // 26-Jun-2015 RK Created this module as an overview to Verilog // // // Description: // ------------ // Stimulus block and implementation block for a 4-bit Ripple Carry counter. // Source: Samir Palnitkar, Verilog HDL 2nd Edition, Chapter 2 ////////////////////////////////////////////////////////////////////////////
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
// D flip-flop with asynchronous reset // Behavioral model module DFF(q, d, clk, reset); output q; input d, clk, reset; reg q; always @(posedge reset or negedge clk) begin if (reset) q = 1'b0; else q = d; end endmodule
Image of page 2
// Toggle Flip-flop // Gate level model module TFF( output wire q, input wire clk, reset ); wire d; // instantiate a D flip-flop DFF dff0(q, d, clk, reset); // create the toggle flip-flop by driving the input with the inverted output not n1(d, q); // not is a Verilog provided primitive.
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern