chapter 1 09/04/13. change your password the command is: passwd in the lab first do : ssh -y onyx ...
TRANSCRIPT
Chapter 1
09/04/13
Change Your Password
The command is: passwd In the lab first do: ssh -Y onyx
You will have to see me to change it, if you forget it.
Change it to something you can remember
Computer Architecture and Language
Know Basic Computer Architecture Know Basic Software and Languages Identify Types of Programming Errors
3
COMPUTER ARCHITECTURE
4
CPU
Central Processing Unit
5
CPU
"Brain" of the Computer• Executes program instructions• Controls Other Devices• Carries out arithmetic operations• Fetches data from memory and stores
it back
6
Primary Memory
RAM Stores program while it is executed Also stores data the program needs Temporary
7
Secondary Memory
Long term storageDevices
• Hard Drive• Flash Drive• Tapes
8
Input and Output Devices
Input Devices• Let user enter data• Mouse, Keyboard, Camera
Output Devices• Let user access data in system• Display Screen, Printer, Speaker
9
Anatomy of a Computer
10
SOFTWARE
11
SoftwareComputer software refers to programs
that reside and execute electronically on the hardware.• Compilers
• Translate source code
• Operating systems• Provide the HCI (Human Computer Interface)
• Application programs• Provide problem solutions
12
Languages Machine Code
• Only code computer understands• Numeric(binary) Code
• 161 40000 45 100 127 11280• Extremely primitive
High Level Languages• More like English• Instructions more powerful• C++, Java, VB, Python• Must be translated with a Compiler
13
LanguagesThe compiler translates C++ programs into machine code.
The linker combines machine code with library code into an executable program.
C++ for Everyone by Cay HorstmannCopyright © 2012 by John Wiley & Sons. All rights reserved
Engineering Problem Solving with C++ second edition, J. ingber
15
Executing a C++ Program
Source File• printable/Readable Program file• Created with vi or other editor
Object File• nonprintable machine readable file• Created by compiler
Executable Program• nonprintable executable code• Linker links libraries with object code to create it.
Engineering Problem Solving with C++ second edition, J. ingber
16
Errors
Syntax errors• Reported by the compiler• Error in language rules, such as leaving out a ";"
Execution/Run-time errors• Reported by the operating system• Cause program to stop abnormally• e.g. Zero divide
Logic errors• Not reported• Just cause bad program results• e.g. Program converts 24 inches to 7 feet.
17
Questions
What is the purpose of the CPU? How does it know what to do?
Give an example of an input device.
Where is a program stored while it is executing?
What linux command is used to translate a C++ program into machine code?
A program to convert fahrenheit to celsius asks the user for a fahrenheit temperature then stops abnormally. What kind of error is this?
Another temperature conversion program gets a fahrenheit temperature of 32 then outputs 50 degrees celsius. What kind of error is this one?
18
Quiz Next Wednesday
Linux and Vim
Chapter 1