The binary number system11001010,0001,00010,000.0001.000,000100.00010710610510410310210110099=9941643216821282726242025232221111000010032002+64++++1++=99
The binary number system
RaspberryPiGPIO HEADERSRCAVIDEOOUTJIAGAUDIOOUTHEADERSSTATUSLEDSDSIDISPLAYCONNECTORTPRSDCARDSLOT(BACKOFBOARD)USB2.0MICROUSBPOWERBROADCOMCSICONNECTOR(5V1ADC)BCM2835CAMERAARM11700MHZETHERNETOUTHDMIOUTONLYON256MBMODELS
Raspberry Pi
8BelowYour ProgramApplicationsoftwareArplatioeoian.Written in high-level language (HLL).SystemsoftwareSasnemona.Compiler:translates HLLcodeto machine code:Operating System:service codeHardware.Handlinginput/outputManagingmemoryand storageSchedulingtasks&sharingresources。Hardware。Processor,memory,/Ocontrollers
Below Your Program • Application software • Written in high-level language (HLL) • System software • Compiler: translates HLL code to machine code • Operating System: service code • Handling input/output • Managing memory and storage • Scheduling tasks & sharing resources • Hardware • Processor, memory, I/O controllers 8
9From C programs to executiontemp =v[k];HighLevel Languagev[k]=v[k+i]Program(e.g.,C)v[k+1] =temp;Compilerw$t0, 0($2)Anythingcanberepresentedw$t1, 4($2)AssemblyLanguageasanumber,$t1.0$2SWProgram(e.g.,MIPS)i.e.,dataorinstructions$to, 4($2)SWAssembler00001001110001101010111101011000MachineLanguage1010111101011000000010011100011011000110101001011000000010011111Program(MIPS)01011000000010011100011010101111MachineInterpretationHardwareArchitecture DescriptionRegister File(e.g.,blockdiagrams)ALUArchitectureImplementation..LogicCircuitDescription5(CircuitSchematicDiagrams)
From C programs to execution 9 lw $t0, 0($2) lw $t1, 4($2) sw $t1, 0($2) sw $t0, 4($2) High Level Language Program (e.g., C) Assembly Language Program (e.g., MIPS) Machine Language Program (MIPS) Hardware Architecture Description (e.g., block diagrams) Compiler Assembler Machine Interpretation temp = v[k]; v[k] = v[k+1]; v[k+1] = temp; 0000 1001 1100 0110 1010 1111 0101 1000 1010 1111 0101 1000 0000 1001 1100 0110 1100 0110 1010 1111 0101 1000 0000 1001 0101 1000 0000 1001 1100 0110 1010 1111 Logic Circuit Description (Circuit Schematic Diagrams) Architecture Implementation Anything can be represented as a number, i.e., data or instructions
10FromCprogramstoexecution·Compiler:Source code → assembly language (may beskipped) → machine code·Assembler:Assembly code → machine code.Machine code consists of instructions understood by theCPU.EachinstructionisexecutedbyCPUDataprocessing(arithmetic,logic)DatastorageDatamovement。Control/management
From C programs to execution • Compiler: Source code → assembly language (may be skipped) → machine code • Assembler: Assembly code → machine code • Machine code consists of instructions understood by the CPU • Each instruction is executed by CPU • Data processing (arithmetic, logic) • Data storage • Data movement • Control/management 10