Latest Post

Ads

Verilog: BCD Counter (Mod 10 Counter) Behavioral Modelling using If Else Statement

Verilog Code for BCD Counter (Mod 10 Counter) Behavioral Modelling using If Else Statement

module bcd_Count(
    input clock, reset,
    output [3:0]dout
    );
reg [3:0]dout; 
initial dout = 0;
 
always @ (posedge (clock))
   begin 
        if (reset) 
            dout <= 0; 
        else if (dout <= 9)
            dout <= dout + 1; 
        else if (dout == 9) 
            dout <= 0;
   end
endmodule

Xillinx Output:

Verilog Code for BCD Counter (Mod 10 Counter) Behavioral Modelling using If Else Statement
BCD Counter Behavioral Modelling Response
 

Also See:

List of Verilog Programs

Comments

Ads

Popular posts from this blog

VLSI: 1-4 DEMUX (Demultiplexer) Dataflow Modelling with Testbench

VLSI: BCD to Excess 3 and Excess 3 to BCD Dataflow Modelling

VLSI: 2 Bit Magnitude Comparator Dataflow Modelling

1 to 4 DEMUX (Demultiplexer) Verilog CodeStructural/Gate Level Modelling with Testbench

Full Subtractor Verilog Code in Structural/Gate Level Modelling with Testbench