Breaking News
Comments
Oldest First | Newest First | Threaded View
<<   <   Page 2 / 3   >   >>
tom-ii
User Rank
Blogger
Re: Fortran is lying to you
tom-ii   12/7/2013 5:48:22 PM
NO RATINGS
@AZskibum:

 

Fractional fixed point (often referred to as "Q" format) is efficient -- you choose exactly the precision you need, no less and no more -- and the bookkeeping exercise of keeping track of the radix point is not a big deal.

 

This is actually what I used in my final implementation - We'll get to that in a few weeks, I suppose....  (Max willing)

tom-ii
User Rank
Blogger
Re: math links
tom-ii   12/7/2013 5:49:11 PM
NO RATINGS
Brian,

 

Interesting stuff.  To be honest, though, I'm a complete n00b, and am teaching myself Verilog at this point.

sa_penguin
User Rank
Manager
Re: Fractional arithmetic
sa_penguin   12/7/2013 7:50:19 PM
NO RATINGS
I broke out Excel and did some quick fractions.

For a 12-bit number: 1/10 = 409.6/4096 and 410 = 19AH
16 bits: 1/10 = [6,553.6] / [65,536]  and 6,554 = 199AH
24 bits: 1/10 = [1,677,721.6] / [16,777,216] and 1,677,722 = 19 999AH

Yes, I have a habit of putting commas in decimal numbers and spaces in hex numbers. I find it makes them easier to distinguish.

Adam-Taylor
User Rank
Blogger
How FPGA do math
Adam-Taylor   12/8/2013 7:22:29 AM
Hi Tom

good blog, I wrote an article on this for Xcell a few years ago hope you do not mind me linking to it here

 

http://www.eetimes.com/document.asp?doc_id=1279807

tom-ii
User Rank
Blogger
Re: How FPGA do math
tom-ii   12/8/2013 10:31:35 AM
NO RATINGS
@Adam:

 

Of course I don't mind!

DrFPGA
User Rank
Blogger
Re: How FPGA do math
DrFPGA   12/8/2013 11:49:13 PM
NO RATINGS
Adam-

Thanx for posting the link to your article. Very detailed and even had some code!

Adam-Taylor
User Rank
Blogger
Re: How FPGA do math
Adam-Taylor   12/9/2013 3:47:20 AM
NO RATINGS
You are welcome I tried to make it as simple as possible to explain within the 2000 word limit how to do maths in FPGA's

The more complex things like filters and CORDICs etc are covered in other articles

I find a simple example often helps to demonstrate the principles

Adam-Taylor
User Rank
Blogger
How the divisor works
Adam-Taylor   12/9/2013 4:04:30 AM
NO RATINGS
1 saves
The divider works because the 0x199A for a 16 bit number is the reciprocal of 10 which is 1/10 or 0.1

This is then scaled by integer(2**16 * 0.1) = 6554 or 0x199A doing the multiply then works out the same as doing the divide. This trick can be used for any number when the divisor is fixed.

 

Max The Magnificent
User Rank
Blogger
Re: math links
Max The Magnificent   12/9/2013 10:01:11 AM
NO RATINGS
1 saves
@Brian: There's some nice material about constant division on the companion website for "Hacker's Delight"

I was going to mention that book Hacker's Delight -- it's a great book -- lots of useful tricks in it. I just now found there's a second edition (the link above) -- I have th efirst -- I'll have to add this second edition to my wish list :-)

 

Max The Magnificent
User Rank
Blogger
Re: math links
Max The Magnificent   12/9/2013 10:04:24 AM
NO RATINGS
@Kris: Pretty cool math...I wonder whether they teach something like that in vlsi classes...


I'd be interested to knwo that myself -- but I fear not. When I started out, everyone knew and "swapped" tips and tricks like this -- it was key to making programs run as fast as possible when you were limited in terms of memory size, clock frequency, and the fac tthat CPUs too multiple cycles to do anything.

Magazines like BYTE were always publishing stuff like this... I love this stuff

<<   <   Page 2 / 3   >   >>


EE Life
Frankenstein's Fix, Teardowns, Sideshows, Design Contests, Reader Content & More
Max Maxfield

Oh, No! My Antique Analog Meter Has Twitched Its Last
Max Maxfield
21 comments
Well, life is certainly full of ups and downs, isn't it? When it comes to the antique analog meters I'm using in a number of my hobby projects, things appeared to be going swimmingly well, ...

EDN Staff

11 Summer Vacation Spots for Engineers
EDN Staff
20 comments
This collection of places from technology history, museums, and modern marvels is a roadmap for an engineering adventure that will take you around the world. Here are just a few spots ...

Glen Chenier

Engineers Solve Analog/Digital Problem, Invent Creative Expletives
Glen Chenier
15 comments
- An analog engineer and a digital engineer join forces, use their respective skills, and pull a few bunnies out of a hat to troubleshoot a system with which they are completely ...

Larry Desjardin

Engineers Should Study Finance: 5 Reasons Why
Larry Desjardin
46 comments
I'm a big proponent of engineers learning financial basics. Why? Because engineers are making decisions all the time, in multiple ways. Having a good financial understanding guides these ...

Flash Poll
Top Comments of the Week
Like Us on Facebook
EE Times on Twitter
EE Times Twitter Feed

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)