HierarchyFilesModulesSignalsTasksFunctionsHelp
/* -*-Verilog-*-
*******************************************************************************
*
* File:         divide_by_365.v
* RCS:          $Header: $
* Description:  
* Author:       Costas Calamvokis
* Language:     Verilog
* Package:      N/A
* Status:       Experimental (Do Not Distribute)
*
* Copyright (c) 1998 Costas Calamvokis, all rights reserved.
*
*******************************************************************************
*/


[Up: pulse_per_year d5]
module divide_by_365Index ( clk, reset, enable, out);
`include "defs.v"

input clk;
input reset;
input enable;
output out;

reg [8:0] count;

wire  [8:0] new_count = count + 1;

assign out = last_count(count);

always @(posedge clk)
    begin
    if (reset)
        begin
        count = 0;
        end
    else if (enable)
        begin
        if ( out )
            count = 0;
        else
            count = new_count;
        end
    end


function last_count;
    input [8:0] count;
    begin
    last_count = (count == (`DAYS_IN_YEAR - 1))
    end
endfunction



endmodule

/*
 *  Click on this link to go back to v2html home page: 
 *    http:../../../v2html.html
 */    

HierarchyFilesModulesSignalsTasksFunctionsHelp

This page: Maintained by: v2html730@burbleland.com
Created:Thu Jan 15 16:17:02 2009
From: ../verilog/divide_by_365.v

Verilog converted to html by v2html 7.30.1.3 (written by Costas Calamvokis).Help