HierarchyFilesModulesSignalsTasksFunctionsHelp

/* -*-Verilog-*-
*******************************************************************************
*
* File:         divide_by_24.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 d4]
module divide_by_24Index (
    clk,
    reset,
    enable,
    out);

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

reg [4:0] count;

assign out = (count == 5'd23);



always @(posedge clk)
    begin
    if (reset)
        begin
        zero_count;
        end
    else if (enable)
        begin
        if ( out )
            zero_count;
        else
            increment_count;
        end
    end

task zero_count;
    begin
    count = 0;
    end
endtask

task increment_count;
    begin
    count = count + 1;
    end
endtask


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:01 2009
From: ../verilog/divide_by_24.v

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