9. Primary Memory 1,099,511,627,776 40 2 TB Terabyte 1,073,741,824 30 2 GB Gigabyte 1,048,576 20 2 MB Megabyte 1,024 10 2 KB Kilobyte 1 0 2 Byte Number of bytes POWER OF 2 SYMBOL UNIT
10. Primary and Secondary Memory Comparison Slow Cheap Large capacity Not connected directly to the processor Fast Expensive Low capacity Connects directly to the processor Secondary memory Primary memory
11.
12.
13. Fetch-Decode-Execute Cycle (cont’d) Main Memory Control Unit Arithmetic/Logic Unit 1 2 3 4 Instruction Cycle Execution Cycle Fetch Decode Execute Store cpu RAM
19. Computer Languages Computer language evolution The only language understood by a computer is machine language. Note:
20. Writing, Editing, Compiling, and Linking Programs typical Java environment Primary Memory . . . . . . Disk Disk Disk Editor Compiler Class Loader Program is created in an editor and stored on disk in a file ending with .java . Compiler creates bytecodes and stores them on disk in a file ending with .class . Class loader reads .class files containing bytecodes from disk and puts those bytecodes in memory. Phase 1 Phase 2 Phase 3 Primary Memory . . . . . . Bytecode Verifier Bytecode verifier confirms that all bytecodes are valid and do not violate Java’s security restrictions. Phase 4 Primary Memory . . . . . . Interpreter Interpreter reads bytecodes and translates them into a language that the computer can understand, possibly storing data values as the program executes. Phase 5
22. System Development Model Figure 1-12 System development model An old programming proverb: Resist the temptation to code. Note: Pseudocode A precise algorithmic description of program logic. Note: