Design and Simulation of 4-Bit Johnson Ccounter Using Verilog.
Design and Simulation of 4-Bit Johnson Ccounter Using Verilog.
On
Design and simulation of 4-bit
johnson counter using verilog HDL
(D&LiC Lab)
Submitted By:
Ojaswi Agrawal (22053440)
Himashu Kumar (22053429)
Abhijeet Sinha (22053479)
Akash Aman (22053483)
Amarjyoti Samal (22053484)
Design and Simulation of 4 bit Ring counter and 4 bit Johnson counter using Verilog
HDL.
Hardware implementation of 4 bit Ring counter and 4 bit Johnson counter.
THEORY:
Johnson Counter:
A Johnson counter is a type of shift register that is similar to a ring counter, but with
an additional invert stage. It is sometimes also called a "twisted ring counter" counter".
The operation of a Johnson counter is similar to that of a ring counter, with each flip
flop output changing state on each clock pulse. However, in a Johnson counter, the
output of the last flip-flop is inverted and fed back into the first flip-flop. This causes
the counter to cycle through a sequence of states that includes both ascending and
descending binary values.
The theoretical foundation for this project involves understanding the principles of sequential logic circuits,
particularly shift registers and feedback loops. Verilog, a hardware description language (HDL), serves as a
crucial tool for modeling and simulating digital systems. The language allows for the abstraction of
complex digital circuits into modular and hierarchical structures, making it suitable for describing the
behavior of the 4-bit Johnson counter at various levels of abstraction.
In the context of the 4-bit Johnson counter, the design involves specifying the flip-flops, the feedback
connections, and the sequential logic necessary to achieve the counter's cyclic behavior. Verilog modules
can be defined for each component, fostering modularity and reusability. Simulation tools such as
ModelSim or VCS can be employed to validate the correctness and functionality of the designed counter
before actual implementation.
Additionally, the thesis can delve into the optimization of the design, considering factors like speed, power
consumption, and area utilization. This may involve tweaking parameters such as clock frequency or
exploring different architectures to achieve a balance between performance and resource utilization.
Understanding the trade-offs and implications of these design choices contributes to the depth of the thesis.
Furthermore, the thesis could explore applications of the 4-bit Johnson counter in practical scenarios, such
as signal generation, frequency division, or pattern recognition.
REQUIREMENTS:
LOGIC DIAGRAM:
DESIGN CODE:
module johnson_counter( out,reset,clk);
input clk,reset;
reg [3:0] q;
begin
if(reset)
q=4'd0;
else
begin
q[3]<=q[2];
q[2]<=q[1];
q[1]<=q[0];
q[0]<=(~q[3]);
end
end
assign out=q;
endmodule
TESTBENCH CODE:
module test_jcounter();
reg clk,reset;
wire [3:0] out;
always
#5 clk =~clk;
initial begin
reset=1'b1; clk=1'b0;
#20 reset= 1'b0;
end
initial
begin
$monitor( $time, " clk=%b, out= %b, reset=%b", clk,out,reset);
#105 $stop;
end
endmodule
OBSERVATIONS/RESULTS
A) RTL Schematic
B) Output Waveform
DISCUSSION OF RESULTS:
CONCLUSION:
Thus,Design and simulation of 4-bit johnson ccounter using verilog HDL was
implementated using hardware and software simulation using vivado 2016.1 and
the truth table was verified along with it.
STUDENT SIGNATURES:
1)
2)
3)
4)