avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] [bug #30363] _delay_xx() functions in <util/delay.h>


From: Bob Paddock
Subject: Re: [avr-libc-dev] [bug #30363] _delay_xx() functions in <util/delay.h> are broken
Date: Mon, 5 Jul 2010 19:12:55 -0400

> The other issue that comes into play is rounding itself.
> For example, there are 3 ways to round cycles.
> - up (delay is always *at least* as long as requested)
> - down (delay is closest as possible without going over but can be worst
> case
> nearly 1 cycle shorter than requested)
> - closest (picks closest cycle which could round up or down)
>

In all of the places that I've used delays, I'd always want them to error on
the side of being a cycle to long, than any amount of to short.

Just for completeness, here is a summary of rounding methods:

http://www.pldesignline.com/showArticle.jhtml?articleID=189600747

    * Round-Toward-Nearest
    * Round-Half-Up (Arithmetic Rounding)
    * Round-Half-Down
    * Round-Half-Even (Banker's Rounding)
    * Round-Half-Odd
    * Round-Ceiling (Positive Infinity)
    * Round-Floor (Negative Infinity)
    * Round-Toward-Zero
    * Round-Away From-Zero
    * Round-Up
    * Round-Down
    * Truncation (Chopping)
    * Round-Alternate
    * Round-Random (Stochastic Rounding)
    * Sign-Magnitude Binary Values
    * Rounding Signed Binary Values

-- 
http://blog.softwaresafety.net/
http://www.designer-iii.com/
http://www.wearablesmartsensors.com/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]