4 Bit BCD Synchronous Reset Counter Verilog Code
This page of Verilog source code section covers 4 Bit BCD Synchronous Reset Counter Verilog Code. The block diagram and truth table of 4 Bit BCD Synchronous Reset Counter Verilog Code is also mentioned.
Block Diagram of 4 Bit BCD Synchronous Reset Counter

Truth Table of 4 Bit BCD Synchronous Reset Counter

4 Bit BCD Synchronous Reset Counter Verilog Code
module bin_sync( clk, rst, bcd_out);
input clk, rst;
output [3:0] bcd_out;
reg [3:0] bcd_out;
initial
begin
bcd_out=4'd0;
end
always @ (posedge clk)
begin
div = div+1'b1;
clkdiv = div[22];
end
always @ (posedge clkdiv)
begin
if (rst)
bcd_out=4'd0;
else if(bcd_out<4'd9)
bin_out=bin_out+4'd1;
else
bin_out=4'd0;
end
endmodule
input clk, rst;
output [3:0] bcd_out;
reg [3:0] bcd_out;
initial
begin
bcd_out=4'd0;
end
always @ (posedge clk)
begin
div = div+1'b1;
clkdiv = div[22];
end
always @ (posedge clkdiv)
begin
if (rst)
bcd_out=4'd0;
else if(bcd_out<4'd9)
bin_out=bin_out+4'd1;
else
bin_out=4'd0;
end
endmodule
USEFUL LINKS to VHDL CODES
Refer following as well as links mentioned on left side panel for useful VHDL codes.
D Flipflop
T Flipflop
Read Write RAM
4X1 MUX
4 bit binary counter
Radix4 Butterfly
16QAM Modulation
2bit Parallel to serial
USEFUL LINKS to Verilog Codes
Following are the links to useful Verilog codes.
Low Pass FIR Filter
Asynchronous FIFO design with verilog code
D FF without reset
D FF synchronous reset
1 bit 4 bit comparator
All Logic Gates
RF and Wireless tutorials
WLAN 802.11ac 802.11ad wimax Zigbee z-wave GSM LTE UMTS Bluetooth UWB IoT satellite Antenna RADAR