高級語言程序設(shè)計_第1頁
高級語言程序設(shè)計_第2頁
高級語言程序設(shè)計_第3頁
高級語言程序設(shè)計_第4頁
高級語言程序設(shè)計_第5頁
已閱讀5頁,還剩28頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

2024/1/23BUPT-PRF1Lecture1

Introduction:Computers&Programming萬巖2024/1/23BUPT-PRF2ContentComputerHistory&HardwareHistoryHardwareBits&BytesComponentsComputerSoftware&ProgrammingLanguageDevelopmentofC(Textbook1.1,1.2)2024/1/23BUPT-PRF3HistoryAtanasoff-BerryComputer(ABC,1937)HumanoperatormanipulatedexternalwiringElectricalNumericalIntegratorandComputer(ENIAC,1946)Vacuumtubes(電子管)MarkI(1944)Mechanicalrelayswitches(繼電器開關(guān))ElectronicDelayedStorageAutomaticComputer(EDSAC,1949)IncorporatedaformofmemoryTheprinciplewasdevelopedbyJohnVonNeumann2024/1/23BUPT-PRF4History:ElectricalNumericalIntegratorandComputer(ENIAC,1946)

-Vacuumtubes2024/1/23BUPT-PRF51.1ComputerHardwareComputersareconstructedfromphysicalcomponentsreferredtoasHardwareHardwarefacilitatesthestorageandprocessingofdataunderthedirectionofastoredprogram–

SoftwareComputerhardwaredoesnotstoredatausingthesamesymbolsthathumansdo2024/1/23BUPT-PRF61.2Components2024/1/23BUPT-PRF7CentralProcessingUnit(CPU)Controlunit:directsandmonitorstheoveralloperationofthecomputerKeepstrackofwherethenextinstructionresidesIssuesthesignalsneededtobothreaddatafromandwritedatatootherunitsinthesystemExecutesallinstructionsArithmeticandLogicUnit(ALU):performsallofthecomputations,suchasaddition,subtraction,comparisons,andsoon,thatacomputerprovidesCPUsareconstructedasasinglemicrochip,whichisreferredtoasamicroprocessor2024/1/23BUPT-PRF8Microprocessor2024/1/23BUPT-PRF9MainMemoryUnitStoresdataandinstructionsassequenceofbytesAprogrammustresideinmainmemoryifitistooperateonthecomputerConstructedasRandomAccessMemory(RAM)EverysectionofmemorycanbeaccessedrandomlyasquicklyasanyothersectionDataislostwhenpoweristurnedoffSizeisusuallyspecifiedinbytes(MBorGB)2024/1/23BUPT-PRF10SecondaryStorageUsedaspermanentstorageforprogramsanddataMagnetictape,magneticdisks,andCD-ROMsDirectaccessstoragedevice(DASD):allowsacomputertoreadorwriteanyonefileorprogramindependentofitspositiononthestoragemediumMagneticharddiskconsistsofrigidplattersthatspintogetheronacommonspindleInitially,themostcommonmagneticdiskstoragedevicewastheremovablefloppydisk2024/1/23BUPT-PRF11Input/OutputUnitTheinput/output(I/O)unitprovidesaccesstothecomputer,allowingittoinputandoutputdataItistheinterfacetowhichperipheraldevices(外圍設(shè)備),suchaskeyboards,console(控制臺)screens,andprinters,areattached2024/1/23BUPT-PRF121.ComputerHardware:SummaryHaveyouusedcomputersbefore?When?Forwhatpurpose?Hardware:(describeyourcomputer)CentralProcessingUnit(CPU):ALU,controlMemory:primarystorageSecondarystorage:harddisk,floppydisk,flashingdisk,compactdiskI/Odevices:keyboard,mouse,monitor,projector,printer,scanner…,etc.2024/1/23BUPT-PRF131.3Bits(位)andBytes(字節(jié))ThesmallestandmostbasicdataiteminacomputerisabitOpenorclosedswitch0or1Thegroupingof8bitstoformalargerunitisreferredtoasabyteCanrepresentanyoneof256distinctpatternsThecollectionsofpatternsconsistingof0sand1susedtorepresentletters,singledigits,andothersinglecharactersarecalledcharactercodes(字符碼),suchasASCII.2024/1/23BUPT-PRF142.ComputerSoftware&ProgrammingLanguagesSoftware:OperatingSystem(OS,操作系統(tǒng)),Tools,Applicationsoftware,etc.Programming:writinginstructionsinalanguagethatthecomputercanrespondtoandthatotherprogrammerscanunderstandProgramminglanguage:setofinstructionsthatcanbeusedtoconstructaprogram2024/1/23BUPT-PRF152.ComputerSoftware&ComputerLanguagesComputerprogramminglanguagearedesigned(1)tomaketheprogrammingprocesseasier;(2)tocapitalizeonaspecialfeatureofthehardware;(3)tomeetaspecialrequirementofanapplicationDifferentlevelsHighlevellanguageLowlevellanguageAssemblylanguageMachineLanguageThefirstprogramminglanguagetolearnisC,ahighlevellanguage.2024/1/23BUPT-PRF16MachineLanguage

(機器語言)Executableprogram(可執(zhí)行程序):programthatcanoperateacomputerExecutableprogramsarewrittenwithbinarynumbers,whichisacomputer’sinternallanguage(machinelanguage)Anexampleofasimplemachinelanguageprogramcontainingtwoinstructionsis:01000000000010(+)10000000000011(-)2024/1/23BUPT-PRF17AssemblyLanguage

(匯編語言)Machine

languageismachinedependableandtimeconsumingtowriteAssemblylanguage:

usesthesubstitutionofword-likesymbolsfortheoperation,anddecimalnumbersandlabelsformemoryaddressesLOADfirstADDsecondMULfactorSTOREanswer2024/1/23BUPT-PRF18AssemblyLanguage(continued)2024/1/23BUPT-PRF19Low-andHigh-LevelLanguagesMachineandassemblylanguagesarelow-levellanguagesbecausetheybothuseinstructionsthataredirectlytiedtoonetypeofcomputerAHighlevellanguageusesinstructionsthatresemblehumanlanguages,suchasEnglish,andcanberunonallcomputers.CisaHigh-levellanguageAnswer=(first+second)*factorAFirstBookofANSIC,FourthEdition20Low-andHigh-LevelLanguagesProgramswritteninacomputerlanguagearereferredtoassourceprogramsandsourcecodeWheneachstatementinahigh-levelsourceprogramistranslatedindividuallyandexecutedimmediatelyupontranslation,theprogramminglanguageiscalledaninterpretedlanguageInterpreter:programthattranslateseachstatementinahigh-levelsourceprogramandexecutesitimmediatelyupontranslation2024/1/23BUPT-PRF21Low-andHigh-LevelLanguages(continued)Compiledlanguage:thestatementsinahigh-levelsourceprogramaretranslatedasacompleteunitbeforeanyindividualstatementisexecutedCompilerTheoutputproducedbythecompileriscalledanobjectprogram(目標(biāo)程序)Linker:combinesadditionalmachinelanguagecodewiththeobjectprogramtocreateafinalexecutableprogram2024/1/23BUPT-PRF22Low-andHigh-LevelLanguages(continued)2024/1/23BUPT-PRF23

CompilationProcess:SummaryCompilationprocessistotranslateahigh-levelprogramminglanguagetolower-levelmachinelanguage(seefigure).Edit(編輯)

asourcefile;Compile(編譯)thesourcefile(transferahighlevelprogramminglanguagetothelowerlevelmachinelanguage);Link(鏈接)compiledobjectfilestoanexecutablefiles;Debug(調(diào)試)process:syntaxerrors,logicerrorsTerms:Edit,compile,linkSourcefile(),objectfile,executablefileFilename,sourcefile,rootname,extensionAFirstBookofANSIC,FourthEdition24ProceduralandObject-OrientedLanguagesProcedurallanguage:instructionsareusedtocreateself-containedunits,calledproceduresProcedure:acceptsdataasinputandtransformsitinsomemannertoproduceaspecificresultasoutputAlsocalledfunctionormethodProceduresconformingtostructureguidelinesareknownasstructuredproceduresAFirstBookofANSIC,FourthEdition25ProceduralandObject-OrientedLanguages(continued)Structuredlanguage:high-levelprocedurallanguage(e.g.,C)thatenforcesstructuredproceduresObject-orientedlanguages:languageswithobjectorientationsuchasC++,Java,VisualBasic,andC#AFirstBookofANSIC,FourthEdition26ProceduralandObject-OrientedLanguages(continued)AFirstBookofANSIC,FourthEdition27ApplicationandSystemSoftwareApplicationsoftware:programswrittentoperformparticulartasksrequiredbyusersSystemsoftware:collectionofprogramsthatmustbereadilyavailabletoanycomputersystemtoenablethecomputertooperateAFirstBookofANSIC,FourthEdition28ApplicationandSystemSoftware(continued)Operatingsystem:setofsystemprogramsusedtooperateandcontrolacomputerMultiusersystem:handlesmultipleusersconcurrentlyOperatingsystemsthatpermiteachusertorunmultipleprogramsarereferr

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論