Computer Hardware and Software
Tom Kelliher, CS17
February 7, 1996
The ``body'' of a computer system.
Hierarchical organization:
- Processing Unit
- Arithmetic logic unit (ALU)
- Control unit
- Registers
- Main Memory (RAM)
- Addressable bytes = 8 bits
- I/O
- Keyboard
- Mouse
- Monitor
- Printer
- Network interface card
- Modem
- Floppy disk --- file storage
- Hard disk
- CD-ROM
- Tape drive
Secondary vs. main memory
The memory hierarchy:
- Registers
- L1 (on-chip) cache
- L2 (off-chip) cache
- RAM
- Disk
- Tape
How is data (text, numeric) stored in memory?
Numeric: stored in fixed-size pieces (bytes, words, long-words, etc.) in
binary code --- powers of 2
Text:
- Individual characters stored in individual bytes in memory as ASCII
or EBCDIC codes (see Appendix C)
- Example: `` Rose bud'' = 82 111 115 101 32 98 117 100 in ASCII
How does the computer ``decide'' whether a memory location holds a number
or a character?
The ``mind'' of a computer system. It is what makes the hardware
usable and useful.
Two categories: system software, application software
- Provides fundamental operations and controls the hardware:
- file system operations
- printing, network services
- CPU, memory management
- protection, security
- Provides an abstract view of the hardware
- Interprets and carries out the user's commands, through the
shell
- Preprocessor --- performs simple text manipulations
- Compiler --- converts a high level language program into assembly
language
- Assembler --- converts an assembly language program into machine
language
- Linker --- ``stitches'' together machine language files into a
runnable program
- Loader --- when a program is to be run, loads it into memory
Interpreted languages
- Word Processing
- Spreadsheets
- Databases
- Communications
- Games
Software layering:
A programming language is an artificial and formal language that has a
limited vocabulary consisting of a set of keywords for making up
instructions and a set of precise grammar rules.
``English-like''
Single instruction at this level corresponds to multiple instructions at
the next (assembler) level
Example:
netPay = grossPay - deductions;
Some HLLs:
- COBOL
- FORTRAN
- BASIC
- ALGOL
- Lisp
- Simula
- Pascal
- C
- Prolog
- Ada
- C++
History of C, C++
Human ``understandable'' machine code (program, language)
Single instruction at this level corresponds to a single instruction at the
next (machine) level
Example:
lw $16, gross($0)
lw $17, deduct($0)
sub $16, $16, $17
sw $16, net($0)
Machine dependent, due to oneness with machine code
- Directly readable by the computer --- binary codes
- Machine dependent
Thomas P. Kelliher
Tue Feb 6 15:39:17 EST 1996
Tom Kelliher