Sign In

Don't have a Xilinx account yet?

  • Choose to receive important news and product information
  • Gain access to special content
  • Personalize your web experience on Xilinx.com

Create Account

Username

Password

Forgot your password?
XClose Panel
Xilinx Home
Reply
Contributor
michaelfpga
Posts: 29
Registered: ‎11-18-2011
0

vhdl problem

Hi all

 

I am writing a vhdl code, I need to run a counter, I have seen a code segment that increments a 3 bit counter like this 

counter <= ext(ext(counter,32) + 1,abs(2-0)+1)

 

can we write it

 

counter<= counter+'1' ??

why the ( ext and abs) are used??

thanks

 

Expert Contributor
gszakacs
Posts: 5,254
Registered: ‎08-14-2007
0

Re: vhdl problem

You didn't post the declaration of "counter," but I'm guessing it was a std_logic_vector(2 downto 0).

 

Please see this post about counters in VHDL.

 

-- Gabor

-- Gabor
Super Contributor
rourabpaul
Posts: 149
Registered: ‎08-13-2010
0

Re: vhdl problem

yah i think its right

Research Fellow
University of Calcutta, India