tag 标签: point

相关博文
  • 热度 21
    2015-10-17 20:39
    2014 次阅读|
    1 个评论
    Colin Walls recently had an article on this site about floating point math. Once it was common for embedded engineers to scoff at floats; many have told me they have no place in this space. That’s simply wrong. The very first embedded program I wrote in 1972 or so used an 8008 to control a near-infrared instrument. Even though we were limited to 4KB of EPROM (it was incredibly expensive then), all of the math had to be in floating point using a library written by one Cal Ohne. Amazingly, he crammed that into just 1KB of program memory. And that was on an 8 bitter with a ferociously-bad stack and very limited instruction set.   Today even MCUs sometimes have on-board floating point hardware. ST’s STM32F4 parts, for instance, have this feature and some are under four bucks in 1000 piece lots.   But most working in the microcontroller space don’t have hardware floating point, so have to use a software solution, which is slow and consumes a lot of memory.   We use integers because they are fast and convenient. But the dynamic range is limited and fractional arithmetic impossible. Floats give us enormous ranges but suffer from performance. An alternative, well known to DSP developers, is fixed point math.   Integers, of course, look like this (ignoring a sign bit):   Can you see the binary point? It’s not shown, but there is one all the way to the right of the 2 0 bit.   Suppose we move that binary point four bits to the left. Now, in the same 16 bit word, the format looks like this:   The number stored in this format is the 16 bit integer value times 2 -4 . So if the word looks like 11528 (decimal) it’s really 720.5, because 720.5= 11528 x 2 -4 .   Obviously, we lose some range; the biggest number expressible is smaller than devoting those 16 bits to ints. But we gain precision.   Here’s where the magic comes in: to add two fixed point numbers one just does a normal integer addition. Multiplication is little more than multiplies plus shifting. Yes, there are some special cases one must watch for, but math is very fast compared to floats. So if you need fractional values and speed, fixed point might be your new best friend. (These algorithms are well documented and not worth repeating here, but two references are Embedded Systems Building Blocks by Jean LaBrosse and Fixed Point Math in C by Joe Lemieux .   There’s no rule about where the binary point should be; you select a precision that works for your application. “Q notation” is a standardized way of talking about where the binary point is located. Qf means there are f fractional bits (e.g., Q5 means 5 bits to the right of the binary point). Qn.f tells us there are n bits to the left of the binary point and f to the right.   Integers are wonderful: they are easy to understand and very fast. Floats add huge ranges and fractional values, but may be costly in CPU cycles. Sometimes fixed point is just the ticket when one needs a compromise between the other two formats. It’s not unusual to see them used in computationally-demanding control applications, like PID loops. Add them to your tool kit!
相关资源
  • 所需E币: 1
    时间: 2023-6-25 13:26
    大小: 894.58KB
    上传者: 张红川
    TMS320C28xFloatingPointUnitandInstructionSetReferenceGuide(Rev.A).pdf
  • 所需E币: 1
    时间: 2022-7-23 18:03
    大小: 2.98KB
    上传者: Argent
    CS1-CJ1FloatingPointtoFixedPointConversionforHMI
  • 所需E币: 1
    时间: 2022-7-23 16:09
    大小: 869.26KB
    上传者: Argent
    GuardLogixandPOINTGuardonDeviceNet
  • 所需E币: 1
    时间: 2022-7-23 10:26
    大小: 101.43KB
    上传者: Argent
    SimplecontrolofEtherNet-IPPointI-O
  • 所需E币: 1
    时间: 2022-7-23 10:26
    大小: 184.21KB
    上传者: Argent
    ControllingPointI-OonDeviceNet
  • 所需E币: 1
    时间: 2022-7-23 10:34
    大小: 116.42KB
    上传者: Argent
    StandardMotionStartingPoint
  • 所需E币: 1
    时间: 2022-7-23 10:22
    大小: 96.74KB
    上传者: Argent
    ControllingPointI-OOverDeviceNet
  • 所需E币: 1
    时间: 2022-7-23 10:22
    大小: 93.95KB
    上传者: Argent
    ControllingPointIOOverDevicenet
  • 所需E币: 1
    时间: 2022-7-23 10:22
    大小: 112.21KB
    上传者: Argent
    ControllingPointI-OonControlNet
  • 所需E币: 1
    时间: 2022-7-23 10:21
    大小: 107.7KB
    上传者: Argent
    ControllingPointI-OOverEtherNet
  • 所需E币: 1
    时间: 2022-6-2 11:00
    大小: 480.52KB
    Improvedcriticalpointestimationusingapreloadrelay(陈国强)
  • 所需E币: 0
    时间: 2022-5-5 16:28
    大小: 768.43KB
    Fixedpointrepresentations_slides
  • 所需E币: 0
    时间: 2020-9-9 23:17
    大小: 239KB
    上传者: samewell
    延續DSP-PRO技術華之波穩特PointDAC-Basi
  • 所需E币: 5
    时间: 2020-4-7 10:45
    大小: 270.29KB
    上传者: wsu_w_hotmail.com
    1dBCompressionPointSheet1of17LinearityActiveRFdevicesareultimatelynon-linearinoperation.WhendrivenwithalargeenoughRFsignalthedevicewillgenerateundesirablespurioussignals.Howmuchspuriousgeneratedbythedeviceisdependantonthelinearityofthedevice.Ifanamplifierisdrivenhardenoughtheoutputpowerwillbegintorolloffresultinginadropofgainknownasgaincompression.Themeasurementofgaincompressionisgivenbythe1dBgaincompressionpoint.1dBCompressionPointThisparameterinanothermeasureofthelinearityofadeviceandisdefinedastheinputpowerthatcausesa1dBdropinthelineargainduetodevicesaturation.Anexampleofthe1dBcompressionpointisshowninfigure2.3025SaturatedOutputPower21dBm201dBCompressionPoint20dBm……
  • 所需E币: 5
    时间: 2019-12-25 15:02
    大小: 139.64KB
    上传者: quw431979_163.com
    DSPapplicationsareusuallyprogrammedinthesamelanguagesasotherscienceandengineeringtasks,suchas:C,BASICandassembly.ThepowerandversatilityofCmakesitthelanguageofchoiceforcomputerscientistsandotherprofessionalprogrammers.Ontheotherhand,thesimplicityofBASICmakesitidealforscientistsandengineerswhoonlyoccasionallyvisittheprogrammingworld.Regardlessofthelanguageyouuse,mostoftheimportantDSPsoftwareissuesareburiedfarbelowintherealmofwhirlingonesandzeros.Thisincludessuchtopicsas:hownumbersarerepresentedbybitpatterns,round-offerrorincomputerarithmetic,thecomputationalspeedofdifferenttypesofprocessors,etc.Thischapterisaboutthethingsyoucandoatthehighleveltoavoidbeingtrampledbythelowlevelinternalworkingsofyourcomputer.CHAPTERDSPSoftware4DSPapplicationsareusuallyprogrammedinthesamelanguagesasotherscienceandengineeringtasks,suchas:C,BASICandassembly.ThepowerandversatilityofCmakesitthelanguageofchoiceforcomputerscientistsandotherprofessionalprogrammers.Ontheotherhand,thesimplicityofBASICmakesitidealforscientistsandengineerswhoonlyoccasionallyvisittheprogrammingworld.Regardlessofthelanguageyouuse,mostoftheimportantDSPsoftwareissuesareburiedfarbelowintherealmofwhirlingonesandzeros.Thisincludessuchtopicsas:hownumbersarerepresentedbybitpatterns,round-offerrorincomputerarithmetic,thecomputationalspeedofdifferenttypesofprocessors,etc.Thischapteri……
  • 所需E币: 5
    时间: 2019-12-25 15:00
    大小: 1.09MB
    上传者: 978461154_qq
    OnceyoudecidethataDigitalSignalProcessorisrightforyourapplication,youneedawaytogetstarted.Manymanufacturerswillsellyoualowcostevaluationkit,allowingyoutoexperiencetheirproductsfirst-hand.Theseareagreateducationaltool;itdoesn'tmatterifyouareanoviceorapro,theyarethebestwaytobecomefamiliarwithaparticularDSP.Forinstance,AnalogDevicesprovidestheEZ-KIT®LitetoteachpotentialcustomersaboutitsSHARC®familyofDigitalSignalProcessors.Foronly$179,youreceiveallthehardwareandsoftwareyouneedtoseetheDSPinaction.Thisincludes"canned"programsprovidedwiththekit,aswellasapplicationsyoucanwriteyourselfinassemblyorC.SupposeyoubuyoneofthesekitsfromAnalogDevicesandplaywithitforafewdays.Thischapterisanoverviewofwhatyoucanexpecttofindandlearn.TheADSP-2106xfamilyInCHAPTERGettingStartedwithDSPs29OnceyoudecidethataDigitalSignalProcessorisrightforyourapplication,youneedawaytogetstarted.Manymanufacturerswillsellyoualowcostevaluationkit,allowingyoutoexperiencetheirproductsfirst-hand.Theseareagreateducationaltool;itdoesn'tmatterifyouareanoviceorapro,theyarethebestwaytobecomefamiliarwithaparticularDSP.Forinstance,AnalogDevicesprovidestheEZ-KITLitetoteachpotentialcustomersaboutitsSHARCfamilyofDigitalSignalProcessors.Foronly$179,youreceiveallthehardwareandsoftwareyouneedtoseetheDSPinaction.Thisincludes"canned"programsprovidedwiththekit,aswellasapplicationsyoucanwriteyourselfinassemblyorC.Suppos……
  • 所需E币: 3
    时间: 2019-12-25 15:01
    大小: 416.88KB
    上传者: 16245458_qq.com
    DigitalSignalProcessingiscarriedoutbymathematicaloperations.Incomparison,wordprocessingandsimilarprogramsmerelyrearrangestoreddata.ThismeansthatcomputersdesignedforbusinessandothergeneralapplicationsarenotoptimizedforalgorithmssuchasdigitalfilteringandFourieranalysis.DigitalSignalProcessorsaremicroprocessorsspecificallydesignedtohandleDigitalSignalProcessingtasks.Thesedeviceshaveseentremendousgrowthinthelastdecade,findinguseineverythingfromcellulartelephonestoadvancedscientificinstruments.Infact,hardwareengineersuse"DSP"tomeanDigitalSignalProcessor,justasalgorithmdevelopersuse"DSP"tomeanDigitalSignalProcessing.ThischapterlooksathowDSPsaredifferentfromothertypesofmicroprocessors,howtodecideifaDSPisrightforyourapplication,andhowtogetstartedinthisexcitingnewfield.Inthenextchapterwewilltakeamoredetailedlookatoneofthesesophisticatedproducts:theAnalogDevicesSHARC®family.CHAPTERDigitalSignalProcessors28DigitalSignalProcessingiscarriedoutbymathematicaloperations.Incomparison,wordprocessingandsimilarprogramsmerelyrearrangestoreddata.ThismeansthatcomputersdesignedforbusinessandothergeneralapplicationsarenotoptimizedforalgorithmssuchasdigitalfilteringandFourieranalysis.DigitalSignalProcessorsaremicroprocessorsspecificallydesignedtohandleDigitalSignalProcessingtasks.Thesedeviceshaveseentremendousgrowthinthelastdecade,findinguseineverythingfromcellulartelephonestoadvancedscientificinstruments.Infact,hardwareengineersuse"DSP"tomeanDigitalSignalProcessor,justasalgorithmdevelopersuse"DSP"tomeanDigitalSignalProcessing.Thischap……
  • 所需E币: 4
    时间: 2019-12-25 02:43
    大小: 157.93KB
    上传者: 2iot
    ARMVectorFloatingPointInstructionSetQuickReferenceCardVectorFloatingPointInstructionSetQuickReferenceCardKeytoTables{cond}SeeTableConditionField(onARMside).{E}E:raiseexceptiononanyNaN.WithoutE:raiseexceptiononlyonsignalingNaNs.S(singleprecision)orD(doubleprecision).{Z}Roundtowardszero.OverridesFPSCRroundingmode.Asabove,orX(unspecifiedprecision).AcommaseparatedlistofconsecutiveVFPregisters,enclosedinbraces({and}).Fd,Fn,FmSd,Sn,Sm(singleprecision),orDd,Dn,Dm(doubleprecision).……
  • 所需E币: 5
    时间: 2019-12-24 23:07
    大小: 744.37KB
    上传者: givh79_163.com
    本应用笔记介绍了如何使用LPC32x0矢量浮点协处理器(VFP)。AN10902UsingtheLPC32xxVFPRev.01―9February2010ApplicationnoteDocumentinformationInfoContentKeywordsVectorFloatingPoint(VFP)coprocessor,LPC32x0,LPC3180AbstractThisapplicationnotedescribeshowtouseLPC32x0VectorFloatingPoint(VFP)coprocessor.NXPSemiconductorsAN10902UsingtheLPC32xxVFPRevisionhistoryRevDateDescription0120100209Initialversion.Contactinformati……
  • 所需E币: 3
    时间: 2019-12-24 22:11
    大小: 66.17KB
    上传者: givh79_163.com
    Abstract:Thistutorialdiscussesthegrowingtrendofusingmedicalinstrumentsinpoint-of-careandnear-patientsettings.Focusingonrepresentativeexamples(bloodgasanalyzersandflowcytometers)fromtheanalyticalinstrumentsegment,itdescribescriticaldesignconsiderationsformigratingthesemedicaldevicestoportableformfactors.Maxim>Designsupport>Appnotes>A/DandD/AConversion/SamplingCircuits>APP4700Maxim>Designsupport>Appnotes>AmplifierandComparatorCircuits>APP4700Maxim>Designsupport>Appnotes>High-SpeedSignalProcessing>APP4700Keywords:medicalinstruments,portablemedical,bloodgasanalyzer,flowcytometers,pointofcare,nearpatient,electricalcomponents,blockdiagramMay10,2010APPLICATIONNOTE4700IntroductiontoMedicalInstrumentsandGrowingTrendforPoint-of-CareandNear-PatientTestingBy:HughWrightAbstract:Thistutorialdiscussesthegrowingtrendofusingmedicalinstrumentsinpoint-of-careandnear-patientsettings.Fo……