How can we help?

You can also find more resources in our Help Center.

30 terms

Anatomy and Function of Computer

STUDY
PLAY
Central Processing Unit
CPU
Program control, arithmetic, data movement
CPU
locates and executes program instructions
CPU
Millions of transistors
CPU
Has RAM, ROM and Secondary Storage
Memory
Random Access Memory (Read and write memory)
RAM
Read Only Memory (contains certain program that must always be present)
ROM
The hard drive (provides persistent storage)
Secondary Storage
Set of electrical lines that connect CPU, RAM, slots and other connectors
Bus
Holds CPU, memory, bus, card slots
Motherboard
Includes display, printer, mouse, keyboard, speakers, modem
Peripherals
allow computer to talk to other devices (central data storage, printer, other comps)
Networks
Extremely primitive, encoded as numbers, thousands of instructions
Machine Instructions
use computer to translate, assigns short names to commands, makes reading easier, translated into machine instructions, processor dependent
Assembler
Easiest to read and write, translated by compilers into machine instructions,, independent of underlying hardware
Higher Level Languages
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!\n";
return 0;
}
Compile a Simple Program
main function
int main ()
end of main function (0 signals successful program run)
return
escape character
\
stdout object
cout
send to operator
<<
faulty input, not quite legal C++, compiler finds errors
syntax errors
program doesn't do what its supposed to do and harder to find
Logic or Run-time Error
result is outside computer's numeric range
Overflow and Roundoff Errors
Validating program correctness, important
Testing
find source of error
Debugging
crafting programs to limit, minimize, localize errors
defensive programming
shield user from compilation details (enter code in window, click button to compile, click another to run)
Integrated Desktop Environments
Compiler translates your C++ source into object code, linker takes object files and code from various libraries, outputs as executable file, libraries contain translated code
Compilation Process
unambiguous, executable, and terminating
Algorithms