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.

any value conversion to 32 bit vector form in vhdl...please help

Status
Not open for further replies.

dksagra

Junior Member level 1
Joined
Jul 26, 2010
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
india
Activity points
1,493
hi, please help me out...

i have a constant value let A:=9
now i have to convert into digital form...
as we know in digital we can write this 00000000000000000000000000001001 for 32 bit data...
another example i have A:=34
we can write this 00000000000000000000000100010

i want this type of conversion (any number into 32 bit vector form)in VHDL...
please help me out..its too urgent
 

Bit vectors can be either signed or unsigned numbers. Use ieee.numeric_std conversion functions to_signed() or to_unsigned() respectively.

Reviewing some of your posts, I'm under the impression that you most urgently need the lecture of a VHDL text book.
 

yes u r right...thanks...
may be my understanding is not that good, but those who are good in any area they wont underestimate others..
i m accepting m not good in vhdl...but this is not a way to treat to beginner...

nevertheless, thanks a lot for ur deep concern...
 

Bit vectors can be either signed or unsigned numbers. Use ieee.numeric_std conversion functions to_signed() or to_unsigned() respectively.
It is only possible to control the 31 lowest bits with to_unsigned() since it takes a natural as argument, and the tools normally restrict this to 31 bits.
Higher bits will be '0'.
 
  • Like
Reactions: FvM

    FvM

    Points: 2
    Helpful Answer Positive Rating
It is only possible to control the 31 lowest bits with to_unsigned() since it takes a natural as argument.
At least with Altera Quartus, unsigned numbers between 2**31 and 2**32-1 are also accepted and correctly converted, e.g.
Code:
to_unsigned(4294967295,32);
 

At least with Altera Quartus, unsigned numbers between 2**31 and 2**32-1 are also accepted and correctly converted, e.g.
Code:
to_unsigned(4294967295,32);

It doesn't work with the Modelsim simulator. The maximum argument for to_unsigned() is 2147483647. This is also the expected behavior for all VHDL implementations that use 32 bits for the integer type (31 bits for type natural).

(the forum has lost all posts since yesterday, so some earlier posts in this thread has been lost)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top