IS there a way of getting this code generation program in a simple windows program? It would be handy for when I am working from a workstation that does not have internet access.
When used for division, except in cases where the sum of the terms exactly equals the divisor (e.g. divisor is 8/3 = 2.6666667), the computed quotient will always be slightly smaller than the actual quotient. Rounding can be helpful, particularly with small quotients. Before the final shift, simply examine the highest-order bit that would be shifted out and add it after the final shift.+
e.g. if the last shifting is 4 places and the bits that would be shifted out are 1xxx, add 1 after the last shift.
Try this for 9 divided by 3, using 7 terms. Without rounding, the quotient will be 2. Rounding "fixes" that.
|file: /Techref/piclist/codegen/constdivmul.htm, 5KB, , updated: 2015/7/17 19:40, local time: 2018/11/16 02:27,
|©2018 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.piclist.com/techref/piclist/codegen/constdivmul.htm"> Code Generation for Constant Multiplication/Division </A>
|Did you find what you needed?|
PICList 2018 contributors:
o List host: MIT, Site host massmind.org, Top posters @20181116 RussellMc, Van Horn, David, Sean Breheny, David C Brown, Isaac M. Bavaresco, Bob Blick, Neil, John Gardner, AB Pearce - UKRI STFC, Harold Hallikainen,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
Welcome to www.piclist.com!