Skip to main content

Design Engineer - STA, SD, Power, PDN at Dew Software

Hello Dear Readers,   Currently at Dew Software Bangalore vacancy for Design Engineer - STA, SD, Power, PDN role. Dew Software, a leading player in the Digital Transformation space, is seeking a skilled Design Engineer specializing in STA (Static Timing Analysis), SD (Signal Integrity), Power, and PDN (Power Delivery Network) to join our team. Working with Fortune 500 companies to support their digital innovation and transformation strategies, the Design Engineer will be responsible for ensuring the integrity and efficiency of digital designs through comprehensive analysis and optimization. Dew Software is dedicated to delivering exceptional outcomes with cutting-edge technologies, and this is an excellent opportunity to contribute to the growth and success of our clients. Responsibilities: Perform STA (Static Timing Analysis) to ensure design meets timing requirements Conduct signal integrity analysis to optimize signal integrity and minimize signal integrity issues Provide power anal

Different types of Counters In Verilog HDL

 Hello Dear Readers,

Today, I will explain Designing of the different types of counters. There are two types of counter based on the how clock signal is assigned to it namely 1). Synchronous Counters 2). Asynchronous Counter. 

1). Synchronous Counters:

If all the storage elements are triggered by the same source clock signal then the design is said to be synchronous. The advantage of the synchronous design is the overall propagation delay for the design is equal to the propagation delay of the flip-flop or storage element. STA is very easy for the synchronous logic and even performance improvement is possible by using the pipelining. Most of the ASIC implementation uses synchronous logic. In practical applications counters are used as a clock divider network. Even counters are used in the frequency synthesizers to generate variable frequency outputs.

i) Parameterized N Bit Up Counter:

Counters are used to generate the predefined and required count sequence on the active edge of the clock. In ASIC design it is essential to write an efficient RTL code for the counter by using the synthesizable constructs. The N-bit-up counter is described by using Verilog to generate the synthesizable design. Here I have design every RTL is parameterized so we can modify it for any number of bits.

Verilog Code:

module counters #(parameter N=3)(data_in,load_en,rst,clk,q_out);

input [N-1:0] data_in;

input load_en,clk,rst;

output reg [N-1:0] q_out;

always@(posedge clk or negedge rst)

begin

 if(~rst)

 q_out <= 3'b0;

 else if(load_en)

 q_out <= data_in;

 else

 q_out <= q_out+1'b1;

 end

endmodule


In the above code, the procedural block is sensitive to the clock(clk) and reset(rst) signal. Here for reset 'rst=0' is assign 3'b000 to the q_out. So it is called asynchronous reset and it has the highest priority over any other input. Similarly, if you want to design a down counter as shown below.

Verilog Code:

module counters #(parameter N=3)(data_in,load_en,rst,clk,q_out);

input [N-1:0] data_in;

input load_en,clk,rst;

output reg [N-1:0] q_out;

always@(posedge clk or negedge rst)

begin

 if(~rst)

 q_out <= 3'b0;

 else if(load_en)

 q_out <= data_in;

 else

 q_out <= q_out-1'b1;

 end

endmodule

Now if we want to design a Common Up-Down counter based on signal value let's say one-bit 'up_down' signal if its value '1' counter work as an up counter and if the value is '0' then it works as a down counter. Synthesized RTL Verilog is shown below.

Verilog Code:

module counters #(parameter N=3)(data_in,load_en,rst,clk,up_down,q_out);

input [N-1:0] data_in;

input load_en,clk,rst,up_down;

output reg [N-1:0] q_out;

always@(posedge clk or negedge rst)

begin

 if(~rst)

 q_out <= 3'b0;

 else if(load_en)

 q_out <= data_in;

 else

 begin

 if(up_down)

 q_out <= q_out+1'b1;

 else

 q_out <= q_out-1'b1;

 end

end

endmodule

(ii) Gray Counters:

Gray Counters is another example of a synchronous counter. Gray counters are used in the multiple clock domain designs as only one-bit changes on the active clock edge. Gray codes are used in the synchronizers. The Gray counter is described below. In which first we increment input data as binary counter and then using code converter algorithms final output is Gray counter which is represented by 'q_out'.

Verilog Code:

module counters #(parameter N=4)(data_in,load_en,rst,clk,up_down,q_out);

input [N-1:0] data_in;

input load_en,clk,rst,up_down;

output reg [N-1:0] q_out;

reg q2,q1,q0;

reg [N-1:0] count;

always@(posedge clk)

begin

 if(rst) begin

 q_out <= 4'b0;

 {q2,q1,q0}<=3'b0;

 count<=4'b0;

 q_out<=4'b0;

 end

 else if(load_en) begin

 count <= data_in;

 {q2,q1,q0}<={data_in[2],data_in[1],data_in[0]};

 q_out<={data_in[3],data_in[2],data_in[1],data_in[0]};

 end

 else

 begin

 count<= count+1'b1;

 q2<=count[3]^count[2];

 q1<=count[2]^count[1];

 q0<=count[1]^count[0];

 q_out<={count[3],q2,q1,q0};

 end

end

endmodule

(iii) Ring Counters:

Ring Counters is a synchronous counter where the sequence is repeated after few clock cycles. Ring Counters are used in practical applications to provide the predefined delay. These counters are synchronous in nature and used in practical applications like traffic light controller, timers to introduce the certain amount of predefined delay. The internal logic structure using the D flip-flops for the four-bit ring counter is shown in Fig.1, as shown the output of MSB flip-flop is fed back to the LSB flip-flop input, and the counter shifts the data on every active edge of clock signal.

Fig. 1

Verilog Code:

module counters #(parameter N=4)(set_in,clk,q_out);

input set_in;

input clk;

output reg [N-1:0] q_out;

always@(posedge clk)

 if(set_in)

 begin

 q_out<=4'b1000;

 end

 else

 begin

 q_out<=q_out<<1; // describe functionality that MSB is                           feedback to the LSB

 q_out[0]<=q_out[3];

 end

end

endmodule

(iv) Johnson Counters:

Johnson Counter is a special type of synchronous counter and designed by using the shift register. The internal structure for the three-bit Johnson counter is shown in Fig.2. The Verilog RTL for the four-bit Johnson counter is shown below.

Fig.2

Verilog Code:

module counters #(parameter N=4)(rst,clk,q_out);

input rst;

input clk;

output reg [N-1:0] q_out;

always@(posedge clk or negedge rst)

begin 

 if(~rst)

 q_out<=4'b0;

 else

 q_out<={{q_out[2:0]},{~q_out[3]}};

end

endmodule 


2). Asynchronous Counters:

In the asynchronous counters, the clock signal is not driven by the common clock source. If the output of the LSB flip-flop is given as an input to the subsequent flip-flop then the design is asynchronous. The issue with the asynchronous design is the cumulative clock to q delay of flip-flop due to the cascading of the stages. Asynchronous counters are not recommended in the ASIC design due to the issue of glitches or spikes and even the timing analysis for such kind of design is very complex.

Ripple Counters:

The ripple counter is an asynchronous counter and is shown in Fig.3. As shown in the logic diagram all the flip-flops are positive edge triggered and the LSB register receives the clock from the master clock source. The output of the LSB flip-flop is given as clock input to the next subsequent stage. 

Fig.3

The Verilog RTL for the four-bit ripple up counter is shown below.

Verilog Code:

module ripple_counters #(parameter N=4)(rst,clk,togle_in,q_out);

input rst,clk,togle_in;

output reg [N-1:0] count_out;

wire c0,c1,c2;

assign c0=count_out[0];

assign c1=count_out[1];

assign c2=count_out[2];

always@(posedge clk or negedge rst)

begin

 if(~rst)

count_out[0]<=1'b0;

else if(togle_in)

count_out[0]<=~count_out[0];

always@(negedge rst or negedge c0)

begin

 if(~rst)

count_out[1]<=1'b0;

else if(togle_in)

count_out[1]<=~count_out[1];

always@(negedge rst or negedge c1)

begin

 if(~rst)

count_out[2]<=1'b0;

else if(togle_in)

count_out[2]<=~count_out[2];

always@(negedge rst or negedge c2)

begin

 if(~rst)

count_out[3]<=1'b0;

else if(togle_in)

count_out[3]<=~count_out[3];

endmodule

Thanks for reading and comment your doubts I will try to resolve early as possible.



Connect with me 



Comments

  1. Wow bro really helpful post.

    ReplyDelete
  2. Wonderful post bro keep it up

    ReplyDelete
  3. Superb flow of information.

    ReplyDelete

Post a Comment

Popular posts from this blog

Apprenticeship CAI at MediaTek Bangalore

Hello Dear Readers,   Currently at MediaTek Bangalore vacancy for an Apprenticeship CAI role. Job Description: B.Tech degree in Electrical/Electronics Engineering with a strong educational background in Digital circuit design Experience in physical design of high performance design with frequencies > 2 Ghz. Experienced in hierarchical design, budgeting, multiple voltage domains and multiple clock domains. Strong skills with Cadence Encounter. Solid understanding of STA and timing constraints. Experienced in working on advanced process nodes (16nm). Strong expertise in Physical Verification to debug LVS/DRC issues at the block level. Requirement: B.Tech degree in Electrical/Electronics Engineering with strong educational background in Digital circuit design Experience in physical design of high performance design with frequencies > 2 Ghz. Experienced in hierarchical design, budgeting, multiple voltage domains and multiple clock domains. Strong skills with Cadence Encounter. Solid

Power Analysis in the VLSI Chip Design

  Hello Dear Readers,   Today in this series of posts I will provide some deep insight into Power Analysis in the VLSI Chip Design. The power analysis flow calculates (estimates of) the active and static leakage power dissipation of the SoC design. This electrical analysis step utilizes the detailed extraction model of the block and global SoC layouts. The active power estimates depend on the availability of switching factors for all signals in the cell netlist. Representative simulation test cases are applied to the netlist model, and the signal value change data are recorded. The output data from the power analysis flow guide the following SoC tape out release assessments:  Total SoC power specification (average and standby leakage): The specification for SoC power is critical for package selection and is used by end customers for thermal analysis of the product enclosure. In addition to the package technology selection, the SoC power dissipation is used to evaluate the die attach ma

IC Physical Design (PnR) at Ulkasemi

Hello Dear Readers,   Ulkasemi  has a vacancy for an IC Physical Design (PnR) role. Job Overview: As a full-time Trainee Engineer, the individual will be working on IC Physical Design implementation from RTL to GDSII to create design databases ready for manufacturing with a special focus on power, performance & area optimization with next-generation state-of-the-art process technologies. Job Responsibilities: Perform physical design implementation which includes Floor planning, Power Planning, Clock Tree Synthesis, Place and Route, ECO, Logic Equivalence checks Timing analysis, physical & electrical verification, driving the sign-off closure meeting schedule, and design goals Develop flow, methodologies, and automation scripts for various implementation steps Follow the instructions, compile documents, prepare deliverables, and report to the team lead Should remain up to date with the latest technology trends Educational Qualification:   B.Sc/M.Sc   in EEE or equivalent degree