Computer Memory

Different types of memory (volatile-nonvolative, internal-external), implementations of nonvolatile memory (flash, optical, magnetic), differences between popular implementations: SSD, HDD, endianness Links: great video on how memory types work physically, AND gates => memory cell => register, ways to store negative numbers: youtube

32 flashcards · Computer Science · by lakesare

  1. Name 2 types of computer memory. What's the difference?

    internal (main/primary): directly accessible by CPU external (secondary/auxiliary): not directly accessible by CPU [naming comes from the old computers where external memory was kept in separate box]

  2. Name 2 examples of internal memory. What are they used for?

    RAM (random access memory) - volatile ROM (read-only memory) - nonvolatile, preprogrammed with information in the factory and used to store things like the computer's BIOS [ROM is not _really_ read-only, it can only be modified slowly]

  3. Why was random access memory called so?

    It used to be common for computers to store information on tape drives, using long spools of magnetic tape (like giant-sized versions of the music cassettes in old-fashioned Sony Walkman cassette players). If the computer wanted to access information, it had to spool backward or forward through the tape until it reached exactly the point it wanted. Links: article

  4. Name 4 ways to store non-volatile memory and examples.

    flash: SSD, flash drives optical disk: CD, DVD magnetic disk: HDD magnetic tapes: cassette

  5. How does magnetic disk type of memory work (eg HDD)?

    Circular plate of magnetic material called a platter, divided into billions of tiny areas magnetized (1) or demagnetized (0). There's an arm mechanism that moves a tiny magnet called a read-write head back and forth over the platter to read/write information

  6. How does flash type of memory work (eg SSD)?

    Using transistors (like RAM), but unusual ones. Ones that can store data after hard reset. Links: great article on flash mechanics

  7. How is non-volatile memory defined?

    Type of computer memory that can retrieve stored information even after having been power cycled (turned off and on).

  8. Name 2 competing nonvolatile data storages used in modern computers.

    HDD (Hard Disk Drive) - magnetic, nonflexible and round. SSD (Solid State Drive) - flash, solid state, because has no moving parts. HDD is what's been usually used, SSD is a cooler faster thing, but expensive.

  9. What is optical disk physically?

    Just as magnetic disk, it is a rotating plate, but data is encoded with black and white colors that's read by a laser.

  10. What does DRAM cell consist of? Why is it called so?

    Transistor and capacitor. It's called Dynamic RAM because capacitor needs periodic recharging to retain data.

  11. What does SRAM cell consist of? Why is it called so?

    6 interlocked transistors. It's called Static RAM because it stays static until rewritten and doesn't need recharging. It's faster and more expensive.

  12. Where are DRAM and SRAM used in computer memory?

    DRAM: RAM (a la main memory) SRAM: registers, cache

  13. Why is computer with high RAM faster than computer with low RAM?

    When program needs to run it needs to be loaded from nonvolatile storage to RAM so that CPU can access it. What happens if there is not enough RAM to hold the program? Some parts of the program are left in the nonvolatile storage! Which makes the program run slowly, as it needs to access slow nonvolatile storage.

  14. What is a register physically?

    Transistors => AND/ORs => flip-flops => register! Multiple transistors can be turned into AND/OR circuits, multiple AND/OR circuits can be turned into flip-flop circuit (which can store 1 bit of information), multiple flip-flops can be turned into a register.

  15. What is a register width?

    Number of bits that can be stored in a register. Therefore amount of flip-flop circuits.

  16. Contiguous and noncontiguous memory allocation?

    Contiguous allocation allocates one single contiguous block of memory to the process. Noncontiguous allocation divides the process into several blocks and place them in the different address space of the memory.

  17. How is RAM organized in computer?

    Most computers don't work with bits individually, but instead group eight bits together to form a byte. Every byte has its own address which is like its index in the array. The CPU can retrieve or set the value of any byte in memory. The CPU identifies each byte by its address. The byte is sometimes defined as the "smallest addressable unit" of memory.

  18. Name a few memories in hierarchy ending with larger and slower and cheaper.

    Registers => Cache SRAM => RAM DRAM => local nonvolatile memory storage (SSD or HDD)

  19. What do they mean by register file?

    Just a collection of registers in CPU.

  20. What are 2 common conventions for ordering bytes representing the object?

    little-endian: store object bits ordered from little end big-endian: from big end Consider a w-bit integer having a bit representation [xw−1, xw−2,...,x1, x0], where xw−1 is the most significant bit and x0 is the least. These bits can be grouped as bytes, with the most significant byte having bits [xw−1, xw−2,...,xw−8], the least significant byte having bits [x7, x6,...,x0]. Both big and little forms of endianness are widely used in digital electronics.

  21. Where's the term endianness coming from?

    From Jonathan Swift's 1726 satire, Gulliver's Travels, in which civil war erupts over whether the big end or the little end of a boiled egg is the proper end to crack open (analogous to counting from the end that contains the most significant bit or the least significant bit).

  22. Integer 500 can be represented as 111110100 in binary. Show how RAM holding 500 would look in: little-endian and big-endian.

    little-endian: 1111 0100 (F4) - first byte 0000 0001 (01) - second byte 0000 0000 (00) 0000 0000 (00) big-endian: 0000 0000 (00) 0000 0000 (00) 0000 0001 (01) - third byte 1111 0100 (F4) - fourth byte First of all we fill in 1 11110100 with zeroes, resulting in: 8-zeros 8-zeros 7-zeros 1 11110100 (because ints are saved in 4 bytes) In big-endian we start filling up memory addresses from the most significant byte. In our case - it's a byte represented by 8 zeros. In little-endian we start fillin…

  23. Something is stored as FF 05 00 00 in big-endian system. How would it be stored in little-endian?

    00 - first byte 00 - second byte 05 - third byte FF - fourth byte

  24. What technology is used for main memory in modern computers?

    Either: static RAM dynamic RAM, but with multiple cache levels in between

  25. How are fixed-point number VS floating-point number stored?

    Fixed-point number: has a specific number of bits reserved for the integer part and for the fractional part. Floating-point number: reserves a certain number of bits for the significand and for an exponent. Fixed-point: IIIII.FFFFF, e.g. 00055.12345 Floating-point: sign.exponent[8 bits].significand[23 bits]

  26. When is RAM called byte VS word addressable?

    byte addressable: if each cell in a memory is 8-bit long word addressable: if each cell in memory matches size of a word

  27. What's a cycle time?

    Time, usually measured in nanosecond ns, between the start of one RAM access to the time when the next RAM access can be started. Cycle time consists of access time (latency, the overhead of finding the right place for the memory access and preparing to access it) and transfer time. Cycle time should not be confused with processor clock cycles or clock speed, which have to do with the number of cycles per second (in megahertz or MHz ) to which a processor is paced. Links: memory timing - wikipe…

  28. What's principle of locality? What's its implication?

    Locality of reference is a an observation that programs tend to reuse data and instructions they have used recently. An implication of locality is that we can predict with reasonable accuracy what data a program will use in the near future based on its accesses in the recent past.

  29. Name and explain 2 types of reference locality.

    Temporal locality: stores data in a cache right after you use it, believing that you're likely to use it again. Spatial locality: and puts not only the address that you just accessed, but the whole block of adjacent addresses into the cache. Spatial locality says that items whose addresses are near one another tend to be referenced close together in time.

  30. How many bits is: byte [B] kilobyte [kB] megabyte [mB] gigabyte [gB]

    byte [B] - 8 bits kilobyte [kB] - 8 * 210 megabyte [mB] - 8 * 210 * 210 gigabyte [gB] - 8 * 210 * 210 * 210 Usual kilo, mega... multiply by 103 instead: 103 = 1000 210 = 1024 are close to each other, so we're calling them kilobyte etc.

  31. How many bytes is 4GB?

    230 * 22 = 232 bytes.

  32. What's memory alignment?

    Putting the data at a memory address equal to some multiple of the word size, which increases the system's performance due to the way the CPU handles memory. For example, when the computer's word size is 32 bits the data to be read should be aligned at a memory address which is some multiple of 4 bytes. When a modern computer reads from or writes to a memory address, it will do this in word sized chunks, typically 32 bits or 64 bits on modern systems.