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.

bit_vector subtraction with constant function

Status
Not open for further replies.

verilog2vhdl

Newbie level 6
Joined
Oct 22, 2007
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,350
in which library do i get bit_vector subtraction with constant funtion??

can some one give me the code if possible...

the need is i have
SIGNAL O_cnt_xhdl1 : bit_vector(12 DOWNTO 0);

and i want to do

O_cnt_xhdl1 <= O_cnt_xhdl1 - "0000000000001";

I see the error as following in modelsim ...

No feasible entries for infix operator "-".
 

There is only the official IEEE library numeric_bit, all alternatives are non-standard

http://www.eda.org/rassp/vhdl/models/standards/numeric_bit.vhd

In this library there are the types unsigned and signed, both compatible with and easily convertible from the bit_vector type. Use a simple cast bit_vector(uns) or unsigned(bv).

After you have an unsigned (or signed) you can even do integer mathematics!
Code:
signal O_cnt_xhdl1 : unsigned(12 DOWNTO 0);
O_cnt_xhdl1 <= O_cnt_xhdl1 - 1;
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top