230 likes | 378 Views
ECE 1305 Introduction to Engineering and Computer Programming. Section 01 Basic Computer Terminology. Typical Small Computer System. Computer Motherboard. System Bus. Central Processing Unit (CPU). Number Systems. Word Length. ASCII Code. ASCII Code. Computer Memory (RAM). Address.
E N D
ECE 1305Introduction to Engineering and Computer Programming Section 01 Basic Computer Terminology
Computer Memory (RAM) Address Contents
CPU/Memory Interaction Memory CPU Control Unit Register Contents ALU Bus
Fetch-Execute Cycle • Fetch the instruction at the Program Counter location. • Decode the instruction. • Load operands from main memory into the registers (if required). • Execute the instruction. • Store the results. • Increment the Program Counter. • Go to step 1.
Machine Language Program Address Contents Instruction
Assembly Language File (Text Format) Machine Language File (Binary Format) Assembler (Look-up Table) Assembly Process The assembler is a program that “translates” the mnemonic Assembly Language commands into the binary machine language.
High-Level Programming Language • It is difficult to break complicated tasks down into register-level tasks. • It is difficult to accomplish memory management at the register/address level. • Assembly Language is machine dependent. A new program must be written for each target machine. • High-level programming languages address these concerns.
Object Code Preprocessor Linker Compiler High-Level Language Programming Source Code Runtime Library Modified Source Code Executable Code
Software Design Process • Decide what you want the computer to do. This is the most important step! Discover the lost art of flow-charting. • Write the instructions in C++ to make the computer do something (Write the Code.) This is where the heavy lifting is done! • Compile and test the program. • Cry, scream or throw a tantrum when the program doesn’t work perfectly. (This step is required.) • Track down each error (bug) and fix it. • Repeat steps 3, 4 and 5 until you get assigned a new project.
Why No Program is Perfect • The programmer may not know very much about the task. (What does a computer science major know about accounting?) • A program that works perfectly for one computer/processor/accessory/software combination may not work for another. • The programmer cannot predict all of the possible user inputs/key-strokes/mouse-clicks, etc. • The program runs on top of an operating system that doesn’t always work perfectly either.
About programming • One can make the computer do just about anything one wants it to do. But… • It will take detective work on your part. • Computer software books are often not helpful enough. • It will take practice on your part. • Watching someone program, or copying someone’s code will not make you a better programmer. • This course cannot cover all of the details of C++. • The fundamental skills learned in this course may be applied to most other programming languages.