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.

Help me do some fractional arithmetic using VHDL

Status
Not open for further replies.

nlulani

Junior Member level 3
Joined
Nov 29, 2004
Messages
26
Helped
2
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
313
2 complement and fractional arithmetics

hi all,
I want to do some fractional arithmetic using VHDL,
I would thankful to you if any one could help me for the same.
simply i want to make some MAC (multiply accumulate unit ), now because integers due to overflow cann't support this arithmetic so i want to do fractional arithmetic.

thanks and regards
Nitin Lulani
 

adap

Member level 5
Joined
Feb 16, 2005
Messages
93
Helped
12
Reputation
24
Reaction score
1
Trophy points
1,288
Activity points
2,261
fractional to decimal

To implement fractional arithmetic, the numbers will be represented in 2's complement. That means that they will be sign-extended.
The most significant bit of a two's complement number represents its sign, and the remaining bits represent its magnitude.
If the sign is 0 then the number is positive and when 1 then the number is negative.
So a positive number written in 2's-complement is the same as the
number written in unsigned notation with the most significant bit to be zero.
A negative number is written in 2's complement notation by inverting all of the bits of its absolute value, then adding one to the result.(The sign bit will remain 1)
 

nlulani

Junior Member level 3
Joined
Nov 29, 2004
Messages
26
Helped
2
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
313
Fractional Arithmetic

hi,
I agree with what you have written , but ceratinly i need more to implement FRACTIONAL ARITHMETIC, the details of which you have not put here. By fractional arithmetic i mean to deal with nos which will need to be computed in real data types.
thanks for your reply
 

checkmate

Advanced Member level 3
Joined
Feb 25, 2004
Messages
833
Helped
178
Reputation
356
Reaction score
125
Trophy points
1,323
Location
Toilet Seat
Activity points
7,815
Re: Fractional Arithmetic

I think you mean fixed point arithmetic? There are lots of references on google. There are no real or fractional data types in hardware. We simply represent it as an integer and declare the position the decimal point lies.
 

nlulani

Junior Member level 3
Joined
Nov 29, 2004
Messages
26
Helped
2
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
313
Fractional Arithmetic

hi Chekmate,
I think you have got the point, I exactly want to deal with fixed point arithmetic, but i am unable to locate material through www.google.com. can you suggest me some direct links for that
thanks and regards
 

quy1001

Junior Member level 2
Joined
May 30, 2006
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,420
Re: Fractional Arithmetic

hi nlulani:

I wonder, have you find out Fixed point library or not, now I also meet problem with fixed-point arithmetic.

Could you help me ?

Thanks.
 

quy1001

Junior Member level 2
Joined
May 30, 2006
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,420
Re: Fractional Arithmetic

This is a good explaination about Fixed point representation. I already use and work with them for along time but I used fixed point DSP of TI (F2812).

However, this time I have to use FPGA, so please tell me the information about VHDL library. :|
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top