HOME Corporate Product Verilog VHDL Link Contact Site map


型式74xx163ICのVerilog-HDLモデルです。


// 
// Title      : (163)Synchronous Presettable Binary Counter with Clear 
// File name  : 163.v 
// Date       : 2000/12/08 Ver1.0 
// Company    : Future Technology Ltd. 
// 

//----------------------------------------------------------
//  Module
//----------------------------------------------------------

module U163(
            XCLR,
            CLK,
            LD,
            D,
            ENP,
            ENT,
            Q,
            RI
        );

    input           XCLR;
    input           CLK;
    input           LD;
    input   [3:0]   D;
    input           ENP;
    input           ENT;
    output  [3:0]   Q;
    output          RI;

//----------------------------------------------------------
//  Using Register
//----------------------------------------------------------
    reg     [3:0]   Q;
//----------------------------------------------------------
//  Using Wire
//----------------------------------------------------------
    wire            s_en;
    wire            s_ri;


    assign s_en = ENP & ENT;

    always@(posedge CLK)begin
        if(XCLR==1'b0)begin             //クリア
            Q <= 4'b0000;
        end else if(LD==1'b0)begin      //ロード
            Q <= D;
        end else if(s_en==1'b1)begin
            Q <= Q + 4'b0001;
        end
    end

    assign s_ri = (Q==4'b1111)?1'b1:1'b0;
    assign RI = s_ri & ENT;

endmodule



Back

HOME Corporate Product Verilog VHDL Link Contact Site map