The Program Abstraction Revealed as the Software/Hardware Reality: Data Storage and Memory

Tom Kelliher, CS18

Feb. 16, 1996

The Program Abstraction

Control Abstractions

Data Abstractions

C/C++ less abstract than BASIC

Constants

Scalar Integer Types

Plus unsigned

Scalar Float Types

Structured Types

The Software/Hardware Reality

Memory

Main memory --- RAM

Running program allocates memory for different purposes:

Control Reality

Each instruction stored in a word of memory

Data Reality

All values are binary

Integer Values

Signed, unsigned two's complement representation

Consider the four bit number:

Signed value:

Unsigned value:

Examples:

Smallest, largest values for each representation?

Formulas for ranges of n-bit numbers?

Scalar Storage

Examples

Array Storage

Locating a specific element: indexing

Address of the element array[i]:

address = AddressOfStartOfArray + sizeof(elementType) * i

Examples



Thomas P. Kelliher
Thu Feb 15 09:31:38 EST 1996
Tom Kelliher