CDA-4101 Lecture 4 Notes



Memory

Memory - where programs and data are stored
  • Primary Memory - fast, volatile (this lecture)
  • Secondary Memory - slower, larger, permanent (next lecture)

Bits


Recent Memory News

Recent news story about atomic level memories:
(Himpsel, et. al., U. Wiscosin, Madison, 9/3/2002)
  • small channels where there either is or is not an atom
  • requires expensive scanning/tunnelling microscope equipment
  • provides a storage density a million times greater than a CD-ROM, today's conventional means of storing data.
  • Similar to the way DNA encodes information (moleculoar level).

Encoding

  • we have bits in the hardware, but letters, numbers, words, shapes, concepts and ideas are our world's data that need to be stored.
  • language itself is an encoding, where the alphabet is the "hardware" we can encode our ideas in.
  • Just like learning a new language, computer scientists/engineers need to learn a new encoding and map it back to a more natural representation.

Complications

ASCII Codes          EBCDIC Codes

Octal and Hexadecimal


Memory Layout


Addresses

  • also represented in binary
  • number of addressable memory locations defines how many bits are needed to represent all addresses

    e.g., a 32 bit machine, usually means addresses limited to 32 bits, so it can address 232 distinct memory addresses

Words


Little-endian vs. Big endian

Conflict: where is most significant bit/byte?


Endian-ness for words


Transfer: Big endian to Little Endian


Transfer and Swap: Big endian to Little Endian


Real Machine Endian-ness

Big-endian: Little Endian Both
IBM mainframes
Motorola processors (i.e., MACs)
IBM PCs/clones Power-PC

Error-Correcting Codes


Hamming Distance


Hamming Distance for Detection


Hamming Example


Hamming Example (cont)


Hamming Distance for Correction


How many Check Bits?

Table of Lower Bounds

Hamming Codes

Read the details of the algorithm and understand it; there is a homework problem about it.


Cache Memory


Cash!
  • memory is typically small and fast, or large and slow
  • caching is a way to use these two type of memory to get the effect of a fast large memory.
  • larger, cheaper RAM is much slower than the CPUs speeds
  • memories can be built faster, but more expensive.

Principle of Locality


Cache Issues


Cache: Logical Location


Cache Math

    n = number of memory accesses
    f = number found in cache
    c = cache access time
    m = memory access time

Cache Design Issues


Multiple caches


Memory packaging