Tuesday, 7 February 2017

DOWN Counter ( Verilog ) with Test Fixture



Test Fixture Program :-
module tf_down_counter;

// Inputs
reg clk;
reg reset;

// Outputs
wire [7:0] out;

// Instantiate the Unit Under Test (UUT)
down_counter uut (
.out(out),
.clk(clk),
.reset(reset)
);

initial begin
clk=1'b1;
forever #5 clk=~clk;
end


initial begin
reset = 1;#10;
reset = 0;#30;

end
   
endmodule


--------------------------------------------------------------------------------------------------------------------------

Program for Down Counter (  VERILOG  ) :-

module down_counter    (
 out      ,  // Output of the counter
 clk      ,  // clock input
 reset       // reset input
 );
 //----------Output Ports--------------
  output [7:0] out;
  //------------Input Ports--------------
  input clk, reset;
  //------------Internal Variables--------
  reg [7:0] out;
  //-------------Code Starts Here-------
  always @(posedge clk)
  if (reset) begin // active high reset
    out <= 7'b0 ;
  end else begin
    out <= out - 1;
 end

  endmodule









7 comments:

  1. This is most informative and also this post most user friendly and super navigation to all posts... Thank you so much for giving this information to me.
    rpa training in chennai
    rpa training in bangalore
    rpa course in bangalore
    best rpa training in bangalore
    rpa online training

    ReplyDelete
  2. This is a good post. This post give truly quality information. I’m definitely going to look into it. Really very useful tips are provided here. thank you so much. Keep up the good works.
    python training in chennai
    python course institute in chennai

    ReplyDelete
  3. Some us know all relating to the compelling medium you present powerful steps on this blog and therefore strongly encourage
    contribution from other ones on this subject while our own child is truly discovering a great deal.
    Have fun with the remaining portion of the year.

    Selenium training in bangalore | best selenium training in bangalore

    ReplyDelete
  4. Thanks For sharing Your information The Information Shared Is Very Valuable Please Keep updating Us Time Just Went On Redaing The Article Python Online Course Devops Online Course Data Science Online Course Aws Science Online Course

    ReplyDelete
  5. I impressed by the quality of information on this website. I am very enjoyed for this blog. Its an informative topic. Very useful info. I am sure I will visit this place again soon. Hope to see more posts soon!
    Salesforce Training in Chennai

    Salesforce Online Training in Chennai

    Salesforce Training in Bangalore

    Salesforce Training in Hyderabad

    Salesforce training in ameerpet

    Salesforce Training in Pune

    Salesforce Online Training

    Salesforce Training

    ReplyDelete