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.

real number implementation in vhdl

Status
Not open for further replies.

ravi33811

Newbie level 4
Joined
Feb 24, 2007
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,325
hi i have to perform real num addition.
i will use the single precision format.
can i give the input as a real num

for ex:4.5.. is this possible in vhdl

can any one help me how to convert real num into binary.. using vhdl
i am not getting how to proceed
 

Iouri

Advanced Member level 2
Joined
Aug 17, 2005
Messages
682
Helped
87
Reputation
174
Reaction score
8
Trophy points
1,298
Activity points
4,814
if it is only one digit after comma, I will use BCD convention, in this case 4 LSB will represent your .5 and do all the math based BCD format
in case of 16 bit your max value will be 999.9
 

echo47

Advanced Member level 5
Joined
Apr 7, 2002
Messages
3,942
Helped
637
Reputation
1,272
Reaction score
88
Trophy points
1,328
Location
USA
Activity points
33,178
VHDL supports the real data type directly. No need for conversion.

However, many synthesis tools don't support real, but that's a different issue. Some tools provide various workarounds (such as core libraries) for doing floating point calculations. Or you can scale all your arithmetic algorithms so they fit conveniently into integers or fixed-point.
 

ravi33811

Newbie level 4
Joined
Feb 24, 2007
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,325
hi thanks for ur reply .
but how can u actually test it on the hardware.....
 

vinodkumar

Full Member level 5
Joined
Oct 5, 2006
Messages
251
Helped
12
Reputation
24
Reaction score
3
Trophy points
1,298
Location
hyderabad
Activity points
2,822
hi,u can look for either ip cores or look for libraries which allow u to write code for ur operations by including them,two such are available under ieee_proposed libraries.
fixed point and floating point packages.
u will find these in this board.

i hope this helped u.
 

ravi33811

Newbie level 4
Joined
Feb 24, 2007
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,325
hi can any one tell me the logic to convert real to binary.
how would u seperate the integer from the decimal value
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top