C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #16  
Old April 25th, 2012, 03:30 AM
SimonB2 SimonB2 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 249 SimonB2 User rank is First Lieutenant (10000 - 20000 Reputation Level)SimonB2 User rank is First Lieutenant (10000 - 20000 Reputation Level)SimonB2 User rank is First Lieutenant (10000 - 20000 Reputation Level)SimonB2 User rank is First Lieutenant (10000 - 20000 Reputation Level)SimonB2 User rank is First Lieutenant (10000 - 20000 Reputation Level)SimonB2 User rank is First Lieutenant (10000 - 20000 Reputation Level)SimonB2 User rank is First Lieutenant (10000 - 20000 Reputation Level)SimonB2 User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Days 17 h 55 m 47 sec
Reputation Power: 110
That's okay, you're welcome.

I REALLY wish you would start using code-tags! This is the last message I will repond to of yours that includes code and doesn't doesn't use code-tags.
Again, for reference: click "Go Advanced button", paste code snippet, highlight with mouse, click button with # symbol on it.

EDIT:
Alternately, type "[ code ]" before the code, followed by "[ /code ]" after the code block. (remove spaces and " chars)
/EDIT

I don't know what the device is you're putting this code into, nor do I know it's application. You may well find that the error introduced by an (integer) division here will be greater than the error introduced if 11.7ns is rounded-up to 12ns.

E.g
D1=6, D2=7, D3=7
Dtotal = 6+7+7 = 20
Daverage = 20 / 3 = 6 (remainder 2) I.e Daverage is actually 6.667

Therefore, you have an error here of (6.77-6) / 6.77 = 10%

Rounding 11.7ns up to 12ns gives an error of (12-11.7) / 11.7 = 2.5%


Perhaps you would benefit from using a fixed-point library? Assuming 32bit ints, you can represent any number from 0-65535, in increments of 0.0000152590

Also, for what it's worth - a CISC(complex instruction set) cpu without pipelining running at 1Ghz can execute no more than 1 instruction per ns. It's entirely possible that the amount of time required to perform 'ideal' calculations is greater than the error introduced by approximating the transmission interval.

It's food for thought anyway.

EDIT: Editor changed my escaped sequences for [ and ]

Last edited by SimonB2 : April 25th, 2012 at 03:44 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Packet distribution interval:

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap