单片机的数值运算程序设计方法.pdfVIP

  • 22
  • 0
  • 约6.56千字
  • 约 3页
  • 2017-08-27 发布于北京
  • 举报
2oo8年3月 电 子 测 试 Mar.2oo8 第3期 ELEcTRONICTEsT No.3 单片机的数值运算程序设计方法 刘 涛 (济宁职业技术学院 济宁 272037) 摘 要:本文从实际应用出发,结合计量移动标准的开发讨论了单片机数值运算程序设计的4个方面。其中,参 数传递决定了采用怎样的程序结构,容错设计是为了使程序在各种条件下正常工作,算法的时间复杂性分析关 系到程序的先天素质,文档编写与程序测试则说明了怎样维护程序。本文从这4个方面,概括和阐述单片机数 值运算程序设计的思路和方法。 关键词:数值运算;单片机;程序设计 中图分类号:TP368 文献标识码:A Numeric calculation program design of single chip Liu Tao (J/n/ng Vocational Technology College,.~ning 272037,China) Abstract:From the actual applications,and connected with the development of the portable verifica— tion instrument,the four aspects of the numeric calculation program design is discussed.Of the as— pects,parameter passing determines how to select the program Structure,eITor tolerating design and the analysis of time complexity affect the original quality of the program ,document writing and program tes— ting is to maintain the program.From these,the ideas and methods of this kind of program is summa- rized and illustrated. Keywords:numeric calculation;single chip;programming design 用,必须理解数值运算在单片机上的设计方法与原 0 引 言 理,才能够使用好数值运算子程序库,正确、规范的 很多单片机应用系统都需要用到数值运算功 实现有特殊要求的运算功能。如何进行单片机系统 能,即加、减、乘、除、开方以及各类函数的求值。按 中数值运算程序的设计,本文将结合自己参与开发 照数的存储方式分类,它分为定点运算和浮点运算2 的检定仪软件编制工作从4个方面来讨论。 种。目前,要实现运算功能,有不少成熟的子程序库 1 参数传递的方法 可以使用,减少开发的时间。但是,不同的单片机应 用系统对运算程序的功能、使用要求各不相同,因此 子程序调用通常需要进行参数传递,也就是 运算程序设计要有一定的针对性。为满足实际应 说,主程序调用子程序要先把入口参数放到约定位 黾堕醚 匦 ELECTRONIC TEST 2008.3 置以使子

文档评论(0)

1亿VIP精品文档

相关文档