Section Exercises

True or False

In the memory hierarchy, the closer a memory level is to the processor, the slower it is.

False!

The closer a level of the memory is to the processor, the more expensive is the technology that it is using, 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.

Bits are processed in words.

True!

Individually, bits are almost insignificant, so they are processed in groups named words.

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

In Little-Endian, the leftmost bytes are the most significant bytes.

False!

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

Most personal computers work in Little-Endian.

True!

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

The spatial locality refers to the fact that when an address is referenced, then the addresses close by to this one will be referenced soon.

True!

If we see the memory as in the analogy used in "Computer Organization and Design" [reference], 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.

The BSS segment holds initialized data.

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.

SRAM is more expensive and faster than DRAM.

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 dispite this fact, it is much more faster than DRAM and it is mostly used in the cache levels.

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

False!

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

In order to reserve space on the stack you need to subtract from rsp multiples of 8 bytes.

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?

Stack

False!

Heap

True!

Queue

False!

.bss

False!

What memory technologies are used for cache and main memory?

SRAM, flash memory

False!

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

flash memory, magnetic disk

False!

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

DRAM, SRAM

False!

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

SRAM, DRAM

True!

DRAM is using one transistor for one bit of storage, so it uses less area per bit of memory than SRAM which uses six to eight transistors per bit in order to prevent the information to be disrupted when read operation is performed. Moreover, DRAM is slower and cheaper than SRAM. Because of this DRAM is used for main memory, while SRAM in cache levels close to the processor.

magnetic disk, DRAM

False!

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

Last updated