Term
What is the order of binary prefixes, starting from Ki and ending in Ei? What are their values in bytes (base 2)? |
|
Definition
- Ki = kibi = 2^10 bytes
- Mi = mebi = 2^20 bytes
- Gi = gibi = 2^30 bytes
- Ti = tebi = 2^40 bytes
- Pi = pebi = 2^50 bytes
- Ei = exbi = 2^60 bytes
|
|
|
Term
How many 2 KiB chunks are there in 1 GiB? |
|
Definition
- 1 GiB = 2^30 bytes
- 2 KiB = 2 × 2^10 = 2^11 bytes
- answer: 2^30 / 2^11 = 2^19 chunks
|
|
|
Term
How many 8 KiB chunks are there in 128 MiB? |
|
Definition
- 128 MiB = 2^7 * 2^20 = 2^27 bytes
- 8 KiB = 2^3 × 2^10 = 2^12 bytes
- answer: 2^27 / 2^13 = 214 chunks
|
|
|
Term
If you have n number of chunks to store what range of bit addresses are needed? |
|
Definition
You need ceiling[log2(n)]-bit addresses. |
|
|
Term
How many bits in an address are needed to store 7 chunks of data. |
|
Definition
ceiling[log2(7)] bits = 3 bits are needed. So a 3-bit address is needed |
|
|
Term
Say we have a parking lot with 3000 spots, and we structure them in blocks of 100 spots. What is the index of spot 3212 in its block? |
|
Definition
Block index = (Global index) % (spots/block) = 3212 % 100 = 12 |
|
|
Term
Say we have a parking lot with 3000 spots, and we structure them in blocks of 100 spots. In what block is spot 3212? |
|
Definition
Answer from slides:
Block = floor[(Global index) / (spots/block)] = floor(3212 / 100) = 32
My answer:
Block = ceiling[(Global index) / (spots/block)] = ceiling(3212 / 100) = 33
Logic:
block 1: 1-100
block 2: 101-200
...
block 31: 3101-3100
block 32: 3201-3200
block 33: 3201-3300 |
|
|
Term
Say we have a parking lot with 3000 spots, and we structure them in blocks of 100 spots. What is the global index of spot 5 in block 20? |
|
Definition
Answer from slides:
Global index = (block * spots/block) + local index = (20 * 100) + 5 = 2005
My answer:
Global index = [(block - 1) * spots/block] + local index = 1905
Logic:
block 1: 1-100
block 2: 101-200
...
block 18: 1701-1800
block 19: 1801-1900
block 20: 1901-2000 |
|
|
Term
Say we have a parking lot with 800 spots, and we structure them in blocks of 10 spots. What is the index of spot 312 in its block? |
|
Definition
|
|
Term
Say we have a parking lot with 800 spots, and we structure them in blocks of 10 spots. In what block is spot 145? |
|
Definition
Answer from slides: block = 14
My answer:
block = ceiling(145/10) = 15
Logic:
block 1: 1-10
block 2: 11-20
block 3: 21-30
block 4: 31-40
block 5: 41-50
block 6: 51-60
block 7: 61-70
block 8: 71-80
block 9: 81-90
block 10: 91-100
block 11: 101-110
block 12: 111-120
block 13: 121-130
block 14: 131-140
block 15: 141-150 |
|
|
Term
Say we have a parking lot with 800 spots, and we structure them in blocks of 10 spots. What is the global index of spot 8 in block 12? |
|
Definition
Answer from slides: 128
My answer:
Global index = [(block - 1) * spots/block] + index
= [(12 - 1) * 10] + 8
= 118
Logic:
block 1: 1-10
block 2: 11-20
block 3: 21-30
block 4: 31-40
block 5: 41-50
block 6: 51-60
block 7: 61-70
block 8: 71-80
block 9: 81-90
block 10: 91-100
block 11: 101-110
block 12: 111-120
|
|
|