Treść książki

Przejdź do opcji czytnikaPrzejdź do nawigacjiPrzejdź do informacjiPrzejdź do stopki
1.2EXAMPLE:CIPHERLOCK
TheonlydifferencebetweenMooreandMealymachinesisthefunctiondefinitiondescrib-
ingtheoutputsignalvalues.Statetransitionsoccuridentically.However,Mealymachines
arefasterthanMooremachinesbecausethechangeintheoutputsignaloccurswhenthe
logicthatdecidesonsuchaneedisactivated(whichusuallyentailstheneedtochange
thestate).InMooremachines,thechangeintheoutputsresultsfromthechangeinthe
state.Non-synchronizedsignalchangewiththeclocksynchronizingtheentiremachinecan
causeproblemsattheinterfacebetweendifferentmachines.Finally,Mealymachinesof-
tenhavefewerstatesthanMooremachines,whichisadvantageousbecausetheyaremore
compact.Inpractice,itisoftenmoredifficulttounderstandduetonumerousconnections
andoutputstatesdependentontheorderoftransitionsbetweenstates.
1.2
Example:Cipherlock
Atleastoneexampleshowinghoweachmachineisdesignedisworthconsidering.Letus
setthefollowingoperationofacipherlockforagate(seeFig.1.2)asthegoalofthe
project.
Thecipherlockhastwobuttonslabeled0and1.Thesignalsgeneratedbythesebut-
tonsarelabeledasBoandB1,respectively(fromtheEnglishword“button”).Eachbutton
generatesasinglepulsewhenpressed(tosimplifythediagram,althoughthisproblemwill
beaddressedlater).Enteringthecorrectkeycombinationactivatesanelectromagnet,and,
asaresult,thelockisopened.ThesignalcontrollingtheelectromagnetislabeledasL
(from“lock”):settingthesignal(L=1)indicatesopeningthelock,whileresettingthesig-
nal(L=0)indicatesclosingthelock.Thelockhasanadditionalspeakerusedformaking
warningsaboutincorrectinputcodes.ItiscontrolledbythesignalS(from“speaker”):set-
tingthesignalindicatesactivatingthespeaker,whileresettingitindicatesturningoffthe
sound.Finally,thislockhasagateclosuresensorG(from“gate”).Thissignalequals1if
thegateisclosedand0ifitisopen.Thesystemcanbeupgradedbyaddinganadditional
resetbutton(signalR)toallowforanotherattemptafterenteringthewrongcode.While
thissomewhatimpracticalsolutioncanbefurtherimprovedatalaterstage,itservesits
purposeinthediscussedexample.Inthissetup,thebuttontriggersthecancellationofthe
enteredcode.Letusassumethatthecorrectcodeis“101”.Later,thenotationAisused,
equivalenttoA=0.Thisappliestobothoutputsignalsandisequivalenttoresettingit
andinputsignalsandsignifiesatestforwhetherthesignalhasthevalueof0.
S
R
B0
0
B1
1
L
G
Fig.1.2:Schematicofacipherlockforagate
13