所需E币: 3
时间: 2019-12-24 19:14
大小: 182.06KB
Oneverycommonandrelativelyquickmethodforfind-ingthesquarerootofanumberistheNewton-Raphsonmethod.Althoughthismethodisquickintermsofmathematics,italsorequiresextensiveuseofdivisiontoproduceresults,usuallyiteratingmanytimes.InthePIC18CXX2microcontrollerfamily,thoughnotdifficult,divisiondoesrequiresseveralbasicoperations.How-ever,withthehelpofthesinglecyclehardwaremulti-plier,oneofthemanynicefeaturesinthePIC18CXX2andtheuseofatechniquedifferentfromtheNewton-Raphsonmethod,divisionisavoided.ThefollowingTB040FastIntegerSquareRootalgorithmdemonstrateshowthesinglecyclemultiplierAuthor:RossM.FoslerisusefulincalculatingasquarerootandatthesameMicrochipTechnologyInc.time,saveprocessortime.THEALGORITHMINTRODUCTIONUsingthebinarynatureofthemicrocontroller,theOneverycommonandrelativelyquickmethodforfind-squarerootofaf……