Latest Post

Ads

Verilog: 2 Bit Counter Behavioral Modelling using If Else Statement

Verilog Code for 2 Bit Counter Behavioral Modelling using If Else Statement

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

Xillinx Output:

2 Bit Counter using If Else Behavioral Modelling
2 Bit Counter using If Else Behavioral Modelling
 

Also See:

List of Verilog Programs

Comments

Ads

Popular posts from this blog

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

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

VLSI: 4-1 MUX Dataflow Modelling with Testbench

VLSI: Half Subtractor and Full Subtractor Gate Level Modelling

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