Section Exercises

True or False

chevron-rightIn the memory hierarchy, the closer a memory level is to the processor, the slower it is.hashtag

False!

The closer a level of the memory is to the processor, the more expensive the technology that it is using is, meaning that they are faster but smaller in size. As a reminder, the closest level of memory is represented by the registers followed by the cache levels.

chevron-rightBits are processed in words.hashtag

True!

Bits are grouped into words at different scales (e.g., quad-words) for various purposes such as storing more information.

Note: a word length (number of bits in a group) can vary from 16 to 64 bits, depending on the computer's architecture.

chevron-rightIn Little-Endian, the leftmost bytes are the most significant bytes.hashtag

False!

In Little-Endian, the rightmost bytes are the most significant, while in Big-Endian, the leftmost bytes are the most significant.

chevron-rightMost personal computers work in Little-Endian.hashtag

True!

In personal/normal computers the significance of the bytes goes from right to left.

chevron-rightThe term "spatial locality" suggests that if a specific memory location is accessed, nearby memory locations are likely to be accessed soon.hashtag

True!

If we see the memory as in the analogy used in Computer Organization and Designarrow-up-right, we can motivate this definition as follows. The memory is like a library and each address is a book. If you want to learn more about, for example, ARM architecture, you will look for a book that explains this subject. You will most likely find such a book on the "Computer Organization" shelf. Reading this book you find another related subject that gets your attention so you go to the same "Computer Organization" section to find a book about this new subject. The memory works similarly. If an address is referenced, then it is very likely that an address close by will be referenced soon.

chevron-rightThe BSS segment holds initialized data.hashtag

False!

The BSS segment holds uninitialized data, more precisely, global or static variables that are either uninitialized or initialized to zero. The Data segment holds initialized data.

chevron-rightSRAM is more expensive and faster than DRAM.hashtag

True!

SRAM uses six to eight transistors per bit of storage, while DRAM uses just one transistor per bit of storage. Because of that SRAM is more expensive, but despite this fact, it is much faster than DRAM and it is mostly used in the cache levels (L1, L2, L3).

chevron-rightThe rsp register keeps track of the bottom of the current stack frame while rbp denotes the top of the stack.hashtag

False!

The rsp register keeps track of the top of the stack, while rbp denotes the bottom of the current stack frame.

chevron-rightIn order to reserve space on the stack you need to subtract from rsp multiples of 8 bytes.hashtag

True!

The stack grows from higher to lower addresses and rsp keeps track of the top of the stack, so, in order to reserve space on the stack, you need to subtract from rsp multiples of 8 bytes.

Keep in mind that in most of the assignments from this lab manual, you need to make sure that the stack is aligned, meaning that you always subtract multiples of 16 bytes.

Multiple Choice

Which region of the memory is dynamically allocated?

chevron-rightStackhashtag

False!

chevron-rightHeaphashtag

True!

chevron-rightQueuehashtag

False!

chevron-right.bsshashtag

False!

What memory technologies are used for cache and main memory?

chevron-rightSRAM, flash memoryhashtag

False!

Indeed SRAM is used for cache levels, but flash memory, a nonvolatile memory, is used for secondary memory and not for main memory.

chevron-rightflash memory, magnetic diskhashtag

False!

Both flash memory and magnetic disks are used for secondary memory.

chevron-rightDRAM, SRAMhashtag

False!

DRAM is used for main memory, while SRAM is used for cache levels.

chevron-rightSRAM, DRAMhashtag

True!

DRAM uses one transistor for one bit of storage, while SRAM uses six to eight transistors per bit in order to prevent the information from being disrupted when a read operation is performed. Moreover, DRAM is slower and cheaper than SRAM. Because of those differences between DRAM and SRAM, DRAM is used for main memory, while SRAM is used in cache levels close to the processor.

chevron-rightmagnetic disk, DRAMhashtag

False!

While DRAM is used for main memory, magnetic disks are used for secondary memory.

Last updated