Computational Proof as Experiment: Probabilistic Algorithms from a (cid:1) Thermodynamic Perspective KrishnaV.Palem CenterforResearchonEmbeddedSystemsandTechnology, SchoolofElectricalandComputerEngineering, GeorgiaInstituteofTechnology,AtlantaGA30332,USA. [email protected] Abstract. Anovelframeworkforthedesignandanalysisofenergy-awarealgo- rithmsispresented, centeredaroundadeterministicBit-level(Boltzmann)Ran- dom Access Machine or BRAM model of computing, as well its probabilistic counterpart, the RABRAM.Usingthisframework, itisshown for thefirsttime thatprobabilisticalgorithmscanasymptoticallyyieldsavingsintheenergycon- sumed, over theirdeterministic counterparts. Concretely, we show that the ex- pectedenergysavingsderivedfromaprobabilisticRABRAMalgorithmforsolv- ingthedistinctvecto(cid:1)rpro(cid:1)blemintro(cid:2)du(cid:2)cedhere,overanydeterministicBRAMal- gorithmgrowsasΘ nln n ,eventhoughthedeterministicandproba- n−εlog(n) bilisticalgorithmshavethesame(asymptotic)time-complexity.Theprobabilistic algorithmisguaranteedtobecorrectwithaprobabilityp≥(1− 1)(foracon- nc stantcchosenasadesignparameter).Asusualndenotesthelengthoftheinput instance of the DVP measured in the number of bits. These results are derived inthecontextofatechnology-independent complexitymeasureforenergycon- sumptionintroducedhere,referredtoaslogicalwork.Inkeepingwiththetheme of the symposium, the introduction to this work is presented in the context of “computationalproof”(algorithm)andthe“workdone”toachieveit(itsenergy consumption). 1 Introduction Theword“fact”conjuresupimagesofasenseofdefinitivenessinthatthereisabelief initsabsolutetruth.Thisnotionistheveryessenceofmodernmathematicaltheories, with their foundationalframeworkbased on (formal)languagessuch as the predicate calculus.Thus,followingRussellandWhitehead’sseminalformalizationofmathemat- icalreasoningembodiedintheirPrincipia[31],theverynotionoftheconsistencyofan axiomatictheorydisallowsevenahintofadoubtaboutafact,oftenreferredtoasathe- orem(oritssubsidiarylemma)inmodernaswellasancientmathematicalthought.The modernfoundationsofverificationasproof,withemphasisonitsautomaticormecha- nizedform,appliedtoproblemsmotivatedinlargepartfromwithinthedisciplinesof (cid:1) ThisworkissupportedinpartbyDARPAunderseedlingcontract#F30602-02-2-0124. N.Dershowitz(Ed.):Verification(MannaFestschrift),LNCS2772,pp.524–547,2003. (cid:2)c Springer-VerlagBerlinHeidelberg2003 ComputationalProofasExperiment 525 computerscienceandelectricalengineering(seeMannaforexample[13,14])arealso boundinessentialwaystothisnotionofanabsoluteordeterministictruth. Concomitantto this absolute notion of truth, and a significant contribution of the mathematicaltheoryofcomputing(referredtoinpopulartermsastheoreticalcomputer science) is the notion of the complexity or equivalently, the “degree of difficulty” of such a proof. Thus, starting with Rabin’s [23] work as a harbinger with further con- tributions by Blum [1], the notion of a machine independent measure of complexity led to the widely used formulationsof Hartmanisand Stearns [7]—essentially within the context of a deterministic mechanistic approach to proof. Here, a deterministic algorithm—equivalently, any execution of a Turing machine’s program [28]—upon halting, is viewed as provinga theoremor fact, stated as a decision problem.For ex- ample,determiningtheoutcomeofthecelebratedhaltingproblem[14,28]wouldcon- stitute provingsucha theoremin the contextof a giveninstance,where an answer of ayeswouldimplythattheTuringmachineprogramgivenastheinputwouldhaltwith certainty. Both this notion of absolute truth as well as the deterministic (Turing machine based) approach to arriving at it mechanically are subject to philosophically signifi- cantrevisionifoneconsidersalternateapproachesthatarenotdeterministic.Acritical firststepinvolvesnon-deterministicapproacheswiththefoundationslaidbyRabinand Scott[25].Basedonthesefoundations,Cook’s[4](andLevin’s[12])characterizations of NPas a resourceboundedclass ofproofs,whoseremarkablerichnesswasdemon- strated by Karp [9], elevated NP to a complexity class of great importance, and the accompanyingP=?NPquestiontoitsexaltedstatus.Here,whiletheapproachtoprov- ing is not based on the traditional deterministic transition of a Turing machine, the meaningoftruthoneassociateswiththefinaloutcome—acceptorreject—continuesto bedefiniteordeterministic. Movingbeyondnondeterminism,the earlyuse ofstatistical methodswith empha- sis on probability can be found in Karp’s [10] introductionof average case analysis. Compelled by the need to better understand the gap between the empirical behavior andtheresultsofpessimal(mathematical)analysisofalgorithms(oradeterminationof lengthsofproofsinoursense),inKarp’sapproach,theinputisassociatedwithaprob- abilitydistribution.Thus,whiletheproofitselfisdeterministic,itsdifficulty,length,or morepreciselyitsexpectedtimecomplexityisdeterminedbyaveragingoverallpossible inputs. A striking shift in the notion of proof as well as the truth associated with it em- anated from the innovation of probabilistic methods and algorithms. In this context, boththemethodor“primitive”proof-step(oftheunderlyingprogram)aswellasthecer- taintyassociated withthe proofundergoprofoundrevision.Schwartz[26] anticipated the eventualimpactof therole ofprobabilityinthe contextofthese influentialdevel- opments best: “The startling success of the Rabin-Strassen-Solovay (see Rabin [24]) algorithm,togetherwiththeintriguingfoundationalpossibilitythataxiomsofrandom- nessmayconstituteausefulfundamentalsourceofmathematicaltruthindependentof, butsupplementaryto,thestandardaxiomaticstructureofmathematics(seeChaitinand Schwartz [3]), suggests that probabilistic algorithms ought to be sought vigorously.” Thus, in this probabilistic context, both the deduction step as well as the meaning of 526 KrishnaV.Palem trutharebothassociatedwithprobabilitiesasopposedtocertainties.Forconvenience, letusrefertotheseasprobabilisticproofs(oralgorithmswhenconvenient). With this as background, we now consider the long and fruitful relationship be- tweenthenotionsofproofinthedomainofmathematicsanditsremarkableuseinthe physical sciences over the past several centuries. Historically, mathematical theories haveservedremarkablywellin characterizinganddeducingtruthsaboutthe universe inavarietyofdomains,withnotablesuccessesinmechanics(classicalandquantum), relativityand cosmology,andphysicalchemistryto namea few areas—see von Neu- mann’s [30] development of quantum mechanics as a notable example. In this role, knowledgeaboutthephysicalworldisderivedfrommathematicalframeworks,meth- ods, and proofs, which could include the abovementioned algorithmicform of proof as well. Thus, in all of the above endeavors, the direction is from (applying) mathe- maticsto(creatingknowledgeabout)physicalreality.Bycontrast,inthiswork,weare concernedwiththeoppositedirection—fromusingcomputationaldevicesrootedinthe realityofthephysicaluniversesuchastransistors,toestablishing(computationallyde- rived) mathematical facts or theories. Let us, for convenience (and without a careful andscholarlystudyofthepossibleuseofthisconceptbyphilosophersearlieron),refer to this opposing perspective as a reversal of ontological direction, wherein the phys- ical universe and its empirical laws form the basis for all deductionof mathematical facts through computational proof. To clarify, the reversal in “ontological direction” whichthiswork(andearlierpublicationsofthisauthoronwhichit isbased[19, 20]) explore,referstothefactthatthephysicaluniverseanditslawsasembodiedincomput- ing devices, form the basis for (algorithmically)generatingmathematicalknowledge, bycontrastwiththe traditionalandoppositedirectionwhereinmathematicalmethods produceknowledgeaboutthephysicalworld. To reiterate, in all of this work, the meaning we associate with proof will be that associatedwiththeexecutionofaTuringmachineprogram,andwewillbeinterestedin the“complexity”ofrealizingsucha(mechanizedproof)inthephysicaluniverse.Thus, to reiterate, we will consider a concrete and physically realizable form of a proof— suchasthatgeneratedbyatheorem-proverexecutingonaconventionalmicroprocessor, or perhaps its Archimedian predecessor—as a physical counterpart of Putnam’s [22] “verificationist” approach by contrast with (as observed by him [22]) the “Platonic” approachwith“evidencethatthemindhasmysteriousfacultiesofgraspingconcepts” (or“perceivingmathematicalobjects...”). Continuing,afirstandimportantobservationabouttheuniverseofphysicalobjects suchasmodernmicroprocessorsisthattheirinherentbehaviorisbestdescribedstatis- tically.Thus,allnotionsofdeterminismare“approximations”inthattheyareonlytrue with sufficiently high probability. (See Meindl [15] and Stein [27] for a deterministic interpretation of the values 0 and 1 within the context of switching based computing through electrical devices, to better understand this point.) Building on this observa- tion, the work described in this paper characterizes the (somewhat oversimplified in thisintroduction)factthattheprocessofcomputationalproofentailsphysical“work”, which in turn consumes energy described in its most elegant form through statistical thermodynamics. The crux of our thesis is that since nature at its very heart, or our perceptionofit,asweunderstandittoday,isstatisticalata(sufficiently)small,albeit ComputationalProofasExperiment 527 classical scale—side-stepping the debate whether “God does or does not play dice” (attributedtoEinsteintowhomastatisticalfoundationtophysicalrealitywasasource of considerable concern)—themost naturalphysical models for algorithmic proof or verificationusingfine-grainedphysicaldevicessuchasincreasinglysmalltransistors, areessentiallyprobabilistic,andtheirenergyconsumptionisacrucialfigureofmerit! Thus,anydeterministicformofcomputationalproofbasedonusingmoderncomputing devicesareessentiallyapproximationsderivedbyinvesting(sufficiently)largeamount of energy to make the probability of error small [15]. For completeness, we reiterate herethatfollowingtheprincipleofreversalofontologicaldirection,weareonlycon- cernedwiththediscoveryofmathematicalknowledgeviacomputationalproofsrealized throughthedynamicsof a physicalcomputingdevice,suchas the repeatedswitching ofsemiconductordevicesinamicroprocessor. Now,consideringthespecifictechnicalcontributionsofthiswork,first,inorderto describeandanalyzethesephysicallyrealizedproofsoralgorithms,weintroduce(Sec- tion 2) a simple energy-aware model for computing: the Bit-level (Boltzmann) Ran- dom Access Machine or BRAM , as well as its probabilistic variant, the RABRAM (in Section 2.4). Specifically, each primitivestep or transitionof these modelsinvolvesa change of state—realized in a canonicalway througha transition function associated withafinitestatecontrolasinTuringmachines[28]—thatmirrorsacorrespondingand explicitchangeinsomephysicallyrealizabledevice.Onevariantofsucharealization isthroughthenotionofaswitchingstep[15,20]whereasanearliermoreabstractvaria- tionisthroughthenotionofanemulation[19]ofthetransitioninthephysicaluniverse. Anycomputationalproof(orequivalentlyalgorithm)describedinsuchamodelhas an associated technology-independentenergy complexity, introduced as logical work in Section 3 for the deterministic as well as the probabilistic cases. Historically, the interestandsubsequentlythesuccessofprobabilisticalgorithmswithinthecontextof algorithm design, was to derive (asymptotically) faster algorithms. Assuming that all steps take (about)the same amountof energy,traditionalanalysisof time-complexity will triviallyimply thata probabilisticalgorithmmightconsumeless energy,because itcomputesandsolvesproblemsfaster—shorterrunningtimeimplieslesserswitching energy.Incontrasttothese obviousadvantages,we showin Section4 thatthe energy advantages offered by probabilistic algorithms can be more subtle and varied. Con- cretely,weprovethatforthedistinctvectorproblemorDVP ,aprobabilisticalgorithm anditsdeterministiccounterparttakethesamenumberof(time)stepsasymptotically, whereastheprobabilisticapproachyieldsenergysavingsthatgrowasn→∞. SolvingtheDVPinvolvescomputationally(intheBRAMorRABRAMmodel)prov- ingthatagivenn−tupledefinedonthesetofsymbols{0,1}hasthesymbol1inallof itsnpositions;theanswertothisdecisionquestion(ortheorem)isYESifindeedallpo- sitionsoftheinputn−tuplehavethesymbol1andtheanswerisNOotherwise.Inthis paper,weareinterestedinthefollowingdensevariantofthe DVP :theinputn−tuple eitherhasno0symbolinit,orifitdoeshavea0symbol,ithaslog(n)suchsymbols. Forthis(dense)versionoftheDVPproblem,whichforconveniencewillbereferredto asthe DVP problemthroughout(definedinSection4.1),weprovethatanovelproba- bilisticvalueamplificationalgorithm,provesthe(algorithmic)theorem,orresolvesthe associateddecisionquestionwithanerrorprobabilityboundaboveby 1 (foraconstant nc 528 KrishnaV.Palem (cid:1) (cid:3) (cid:4)(cid:2) cchosenasadesignparameter)usinganexpected(2n+logk(n))κTln 2 1−εlogn n Joules,where0<ε<1andk>2areconstants.Thealgorithmanditsassociatedanal- ysisareoutlinedinSection4. Inanearlierpublication,thisauthorproved[19]thatanydeterministicBRAMalgo- rithm for solving the DVP consumes at least (2n−log(n)+1)κTln2 Joules; this is a lowerbound.Bycombiningthesetwofacts,weshowthatthroughtheuseoftheprob- abilisticalgo(cid:1)rithm(cid:1)introduce(cid:2)d(cid:2)here,theexpectedsavingsinenergymeasuredinJoules growsasΘ nlog n , foraconstant0<ε<1,andforannbitinputtothe n−εlog(n) DVP .Thusboththesavingsaswellastheerrorprobabilityarerespectivelymonotone increasinganddecreasingfunctionsofn.Tothebestofourknowledge,thisresultisthe firstofitskindthatestablishesanasymptoticimprovementintheenergyconsumed. Thesemodelsand analysismethodologybuild on the followingresults (from[18, 20])thatbridgecomputationalcomplexityandstatistical thermodynamicsforthefirst time: a single deterministic computationstep, which correspondsto a switching step, consumesatleastκTln(2)Joules,andthisisalowerbound.Furthermore,usingprob- abilisticcomputationalsteps(orswitching),theenergyconsumedbyeachstepcanbe shownto be aslow asκTln(2p)Joules,where p≥ 1 isthe probabilitythatthetran- 2 sition is correct; (1−p) is the per-step error probability. Also, κ is the well-known Boltzmann’sconstant,T isthetemperatureofthethermodynamicsystem,andlnisthe naturallogarithm.Inallofthiswork,thephysicalmodelsarebasedonthestatisticaland hence probabilistic generalizations of switches formulated originally by Szilard [11] within the contextof clarifying the celebrated Maxwell’s demon paradox[11, 29]. A detailedcomparisonandbibliographyofrelevantworkfromtherelatedfieldreferredto astheThermodynamicsofComputingcanbefoundin[20].Additionally,Feynman[5] providesa simple and lucid introductionto the interplaybetween thermodynamically based physical models of computing, mathematical models, and abstractions such as Turingmachines. 2 The Bit-Level (Boltzmann) Random Access Machine - BRAM Inthissection,wewillintroduceourmachinemodelforcomputing,exclusivelyoper- atinginthelogicaldomain.However,toreiterate,afundamentaltheoremofthiswork isthateachofitsstatetransitions—explainedbelow—willbeassociatedwithdefinite amountsofenergyexpenditure.Furthermore,thisenergyconsumptionwillbeprecisely relatedtotheinherentamountofenergyneededtocompute,usingthismodel.Signif- icantly, a BRAM model will allow us to abstract away all aspects of the underlying physics and characterize energypurely in the world in which models of computation suchasTuringmachinesarerealized.Weanticipatethisasbeingveryhelpfulfromthe perspectiveof algorithmanalysisand design—anexercisewhich,in a BRAM , can be decoupledfromthespecificitiesofphysicalimplementations. The BRAM however does provide a bridge to the physical world through the en- ergycostsassociatedwiththetransitionsofitsfinitestatecontrol(definedbelow).This bridgetotheworldofimplementationandenergyallowsustodefinethenovelcomplex- ity measure of logical work as detailed in Section 3, which characterizesthe “energy complexity”ofthealgorithmbeingdesigned. ComputationalProofasExperiment 529 2.1 InformalIntroductiontoaBRAM Informally,a BRAM (abit-levelrandomaccessmachine1)hasaprogramwitha finite numberofstates.Thetransitionfromacurrentstatetothenextinvolvesevaluatingthe associatedtransitionfunctionleadingtothe“reading”ofoneormorebitsofaninput fromaspecificmemorylocation,transitioningtoanewstateandwritinganewvaluein adesignatedmemorylocation.Thenumberofbitsreadisdependentofthesizeofthe alphabet,tobedefinedbelow.EveryexecutionstartsinauniqueSTARTstate,andhalts uponreachingauniqueSTOPstate. Toextendsuchmodelstobeabletoaccountfortheenergyconsumed,wedefinea BRAM(somewhat)formally.Foracomputerscientist,definingaBRAMbasedonwell- understoodelementsofarandomaccessmachine(orRAM)iselementary;however,we defineithereforcompleteness.ThetextbookbyPapadimitriou[21]providesarigorous andcompleteintroductiontomodelssuchasTuringmachinesandrandomaccessma- chines including definitions of conventionalmeasures of complexity for representing time and space. This book also providesa comprehensiveintroduction to the numer- ouswell-understoodinterrelationshipsbetweenclassesof(timeandspace)complexity, andcan serveas anexcellentguideto the topicof definingmodelsof computationin classicalcontexts,notconcernedwithenergy. 2.2 DefiningaBRAM A BRAM consists of several components,which will be introducedin the rest of this section. The BRAM Program Following convention,the program P is representedas a five- tuple{PC,Σ,R,δ,Q}.Notethatconventionally,variantsoftheprogramarereferredto asthefinitestatecontrol. TheSetofStates-PCisthesetofstates.Eachstate pc ∈PChasdesignatedloca- i tionsinmemory,definedbelow,thatserverespectivelyasitsinputandoutput.Without lossofgenerality,letthestatesbe labeled1,2,3,...,|PC|. ThesetQ consistsofthree specialstates,START,STOPandUNDEFINED-STATEnotinPC. TheAlphabetofthe BRAM -Σisafinite alphabet,andwithoutlossofgenerality, we will use the set {1,2,...|Σ|}, which includes the empty symbol φ to denote this alphabet. From the standpoint of algorithm design, in most cases, it suffices to work with an alphabet drawn from the set Σ={0,1}. However, as we will discuss in this paper, the size of the alphabet |Σ| has important consequences to the precise energy behavior of the associated state transitions. Therefore,the contextswherein the more restricted alphabet is used need to be distinguished from those contexts in which the moregeneralalphabetofsize|Σ|>2isused. The Address Registers of the States in PC - These registers are places where the inputandoutputaddressesofastatearestored.Inconventionalcomputerscienceand engineering parlance, a BRAM uses a form of accessing memory that is referred to 1GivenaBRAM’seventualconnectionwithenergyanditsstatisticalinterpretation,onecanalso interprettheacronymtomeanaBoltzmannrandomaccessmachine. 530 KrishnaV.Palem as indirect addressing. We shall return to a discussion of the role of these registers in Section 2.3. The address registers, represented by the set R is partitioned into two classes Rin and Rout; these are both sets (of registers) where each register ρin ∈Rin j (ρout∈Rout)isa(potentiallyunbounded)linearlyorderedsetofelementsreferredtoas j cells<sj,1,sj,2,...,sj,k >(<tj,1,tj,2,...,tj,k>).Eachofthecellssl (tl)isassociated withavaluefromtheset{0,1,φ}.Wenotethateventhoughtheoverallalphabetmay beofsize|Σ|>2,eachcellintheregisterseitherstoresasinglebit,orisempty.Fur- thermore,ifthevalueassociatedwithsuchanelementisφ(notdefined)forsomevalue ofk(cid:5)≤k,thenthevalueassociatedwithallsj,k(cid:5)(cid:5) (tj,k(cid:5)(cid:5))isφforallk(cid:5)≤k(cid:5)(cid:5)≤k;thus,in thegeneralcase,thevaluesstoredinanyoftheaddressregistersareacontinuous“run” ofvaluesfromtheset{0,1}followedbyarun,possiblyoflengthzero,ofthesymbolφ. We associate the pair ρin ∈Rin and ρout ∈Rout uniquely with the state pc . For a j j j givenstate,intuitively,thesepairofregistersyieldtheaddressesfromwheretheinput σ is to be read, and to where the output σ(cid:5) (if any) is to be “written” respectively. Itisimportanttonotethattheseaddressescaninfactbetheregistersthemselves.The potentiallyunboundedlengthsoftheregistersdenotethefactthattherangeofaddresses being accessed (correspondingto the length of a Turing machine’stape for example) couldbeunbounded2. The Transition Function - We are now ready to define the transition function δ, whichwillplayacentralroleincharacterizingtheenergybehaviorofcomputations.In itsmostgeneralform,atransitionfunctionisbasedonanalphabetofsize|Σ|≥2. Syntactically,δ:(PC∪{START})×Σ→(PC∪Q−{START})×Σisthetransition function.Wheneverδ(pc,σ∈Σ)=(pc ,σ(cid:5)∈Σ),wesaythatδtransitionsfrom pc to i j i thenext-state pc withσasinputandσ(cid:5) astheoutput. j Some useful remarks about the transition function follow. First, we note that the stateUNDEFINED-STATEisintherangeofδ.Givenastate pci,letνidenotethenumber of symbols from Σ for which δ transitions into a state in PC∪{ STOP }, as opposed into the UNDEFINED-STATE . For the remaining(|Σ|−νi) symbols, δ transitions into UNDEFINED-STATE .(Thisisonewayofdefiningtransitionsofvarying“arity”νi as- sociatedwithstate pc,thusallowingstateswithvaryingnumberofsuccessorswithan i alphabetoffixedsize).Inthissetting,itistrivialtoverifythatthereisnolossofgener- alityindefiningδsuchthatthefirstν symbolsfromthelinearlyorderedsetΣrepresent i defined transitions whereas symbols νi+1,νi+2,...|Σ| represent undefined transitions. ThesenotionsareillustratedinFigure1.Inthesequel,wewill(mostly)beconcerned withBRAMprogramswhosetransitionfunctionhasamaximumarityoftwo.(Itistriv- ial to verify that any BRAM program with transition function of arity more than two canbereplacedwitha BRAM programwithtransitionfunctionwhosemaximumarity istwoalthoughitsenergybehaviorneednotbepreserved).Furthermore,anytransition withanarityoftwowillhenceforthbereferredtoastheBRANCHinstruction. For convenience, drawing upon graph theoretic terminology, let us refer to ν as i thefanoutof pc andfurthermore,refertostate pc asbeingasuccessorof pc ifand i j i onlyifthereexistsasymbolσ∈Σsuchthatδ(pc,σ)yields pc asthenextstate.Let i j successors denotethesetofallsuccessorsofstate pc fromPC. i i 2Inany terminatingcomputation, therewillbe alimiton thisbound, typicallyspecified asa functionofthelengthoftheinput[21]. ComputationalProofasExperiment 531 1 Input symbols 1,2,(cid:133)ν are legal i pc 2 νisuccessors Current state ν i Fig.1.Illustratingthelegalandillegalcasesofatransitionfunctionwithanalphabetof size|Σ|≥ν i Successors of PC pc' 1 Input Transition to 1 Input 2 pc‘ 2 1 pc' pc 3 1 pc‘ 4 3 2 pc' Current state 2 pc‘ 4 3 pc' 3 4 pc' Alphabet∑= {1,2,3,4} U φ 4 Fig.2.Astate,itssuccessorsandrelatedtransitions The Memory Each BRAM has a (potentially unbounded) MEMORY denoted as the setof L=(2|PC|+1)linearlyorderedsets orbanks,eachpotentiallyunbounded.As showninFigure3,elementsIand(I+1)inMEMORYaredenotedMI andMI+1where 1≤I≤2|PC|arerespectivelyusedasregistersρin∈Rinandρout∈Rout,wherei=(cid:8)I(cid:9). i i 2 Additionally, the last set ML of MEMORY, denoted M is a potentially unboundedset M<m ,m ,...,m >.Eachcellm ofmemoryisassociatedwithanelementfromthe 1 2 k j set{0,1,φ}.Informally,M isthesetoflocationswheretheinputsandoutputsvalues beingcomputedbytheBRAM“program”arestored—itistheworkspace. Recallthattheinputargumentstothetransitionfunctionδarethecurrentstate pc andtheinputvaluefromthealphabetΣ.SincetheinputcanonlybeasymbolfromΣ,a maximumoflog(|Σ|)bitsareneededtostorethisvalue3.Therefore,forconvenience, 3Unlessspecifiedotherwise,alllogarithmswrittenaslogaretothebasetwo 532 KrishnaV.Palem J → 1 2 3 4 (cid:133) 2|PC|-1 2|PC| L=2|PC| + 1 ρ1in ρ1out ρ2in ρ2out ρpcin ρpcout log∑bits location1 Scratch/ Working location2 Memory Addresses for PC Addresses for PC Addresses for PC 1 2 pc Fig.3.TheMemoryStructureoftheBRAM eachM willbepartitionedinto“locations”wherelocationL forJ≥1ismadeupof I J log(|Σ|)constituentcells;lets=(log|Σ|(J−1)).ThenLJ =<ms+1...m(s+log|Σ|)> The Memory Access Unit The value at a location L is the concatenation of the J valuesinitsconstituentcells.Sincethevalueofalocation,whendefined,isanatural numberfromtherange{1,2,...|Σ|},itisdeterminedbyabinaryinterpretation,ofthe concatenationofsymbolsfromtheset{0,1}.Ifoneofthevaluesassociatedwithany ofthecellsinL isφ,thenthevalueofthislocationisundefined. j AVALUEinMEMORYisafunctionfrom(N+×N+)intothesetΣ∪{φ}definedas follows: 1. If1≤I≤2|PC|namelyifindexIcorrespondstoaregister,thenVALUE (I,J)=§ where§isthevalueattheJth locationofM . I 2. IfI=ML,VALUE (ML,J)=§isthevalueattheJth location(LJ)ofM. ThefunctionVALUEthatisimplementedthroughthememoryaccessunitofaBRAM yields the value associated with the Jth location in one of the registers in R or at the locationL fromMdependingonthevalueofI. J Theaddressinregisterρin(orρout)istheuniquenon-negativeintegerwhosevalue i i isu,wheretheaddressisrepresentedinunary.The MAU isafunctionthatusesthese (pairof)addressesasanargument.Throughouttherestofthispaperwewillconsider analphabetwhere|Σ|=2,andthisunaryrepresentationwillacrosslocationsLbeused to analyzethe energyadvantagesofprobabilisticcomputing.Alternatealphabetsizes aswellasbinaryrepresentationswillbethetopicoffuturestudyasdiscussedbrieflyin Section6. Wedefinefunctionsreadandwritewithaddressesastheirdomain.Thus,usingcon- ventionsinspiredbyTuringmachinesasoriginallydefined[28],read (I,LOCATION) ComputationalProofasExperiment 533 and write (Σ,I,LOCATION) are respectivelyused to read the value or (over)writethe valuesassociatedwiththeconstituentcellsoflocationLinMI.The MAU istheunion of the read and write functions. It will be used to evaluate the transition function as explainedinSection2.3below. 2.3 TheComputationofaBRAM Buildingontheelementsintroducedabove,wewillnowintroducetheoperationalbe- haviorofaBRAM.GivenanarbitraryBRAMprogramP,initially,allcomputationsstart in the START state. All the registersand the memorycells are initialized from the set {0,1,φ}. It is convenientto define the operation of the BRAM inductivelyas follows. The START statetransitionsto,withoutlossofgenerality,state pc1 atwhichpointthe computationstartswheretheconcatenationofthecellsinM isinterpretedasanumber L inunaryrepresentationandisreferredtoastheinputI toP.Now,state pc issaidto 1 bethecurrentstate.Moregenerally,let pc bethecurrentstate.Instate pc ∈PC,the l l transitionfunctionisevaluated. The input to the transition function is a symbol from Σ, which is accessed using σ=read(M,LOCATION),whereLOCATIONistheaddressstoredinunaryinρin.These l notionsareillustratedinFigure4. Continuingwith the evaluation of the transition function δ(pc,σ) yields the next l state pcl(cid:5) whichthen becomesthe currentstate. Furthermore,the outputsymbolσ(cid:5) is written(usingwrite )intothe LOCATION whoseaddressisstoredinregisterρout.The l computationhaltswheneverpcl(cid:5) ≡STOP. Next state pc Output value σ(cid:146) l' Inputσ pc l δ(pc ,σ) l Evaluate READ NEXT STATE? CURRENT STATE = pc l' OUTPUT VALUE WRITE σ(cid:146) Location Location from ρin from ρIout I Fig.4.IllustratingtheEvaluationoftheTransitionFunction
Description: