Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Optimized verilog code

Status
Not open for further replies.
Newbie level 4
Joined
Jun 8, 2010
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
bangalore
Activity points
1,320
Hi,

Please let me know , what will be the optimized verilog code of below:-


Code Verilog - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
reg [31:0] control_pin_ton_delay_cntr; 
always @ (posedge clk_i or negedge nrst_i)              
begin
  if (!nrst_i)
       control_pin_ton_delay_cntr <= 33'd0;
  else if (enable_i)
  begin
    if (control_on_i)
        control_pin_ton_delay_cntr <= 33'd1;
else if ((control_pin_ton_delay_cntr >= 33'd1) && (control_pin_ton_delay_cntr <         33'h1FFFFFFFF) && (~ iVOUT_UV_FAULT_LIMIT_UNMASK))
         control_pin_ton_delay_cntr <= control_pin_ton_delay_cntr + 33'd1;
else if (control_pin_ton_delay_cntr == 33'h1FFFFFFFF)
       control_pin_ton_delay_cntr <= 33'd0;
  end
end

 
Last edited by a moderator:

You can make the 3rd "else if" statement the 2nd one and shift the 2nd one to the 3rd one. In the 2nd "else if" statement, remove the check for cntr>=1 and cntr <1FFF*.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top