calculating maximum volume size of fat 32 and HDFS - hadoop

I am trying to calculate the max volume and file size for fat 32 and hdfs. for fat32 i have 4096 bytes sector size and 2^32 possible sectors . so 2^32 * 4096 = 1.759218604×10¹³ bytes or 17.6TB for the Volume size. But this should be 16TB according to the texts.
The same for HDFS: i have a block size (sector size) of 64mb and 63 bits to index the sectors and I do the same calculation : 2^63 * 64 = 590.29 YB . But this should equal 512 YB according to the texts . YB = Yota bytes = 10^12TB

I'm not sure where you got your "according to the texts" from. Max volume size for a FAT32 file system is 32 GB for Windows 2000 and 127.53 GB for Windows 98 (Reference)
You also need to be careful with your byte calculations. Make sure you know if the texts you are referring to are using 2^n or 10^n for their reporting. 1 Terabyte (TB) = 10^12 bytes and 1 Tibibyte (TiB) = 2^40 bytes. So, 2^32 * 2^12 (4096) = 2^44 = 16 * 2^40 = 16 TiB.
Similarly, 2^63 * 2^6 (64) = 2^69 = 2^9 * 2^60 = 512 EiB
Your calculation of 590.29 YB is not correct... it works out to EB not YB. 1 EB = 10^18 bytes and 1 YB = 10^24 bytes
It's also worth noting that a lot times TB is used as short hand for TiB.

Related

Is 1KB = 1.024 bytes OR 1.000 bytes?

Everyone keeps saying that
1'000 KB = 1 MB (decimal) -> Megabyte (MB) 10^6 Byte = 1 000 000 Byte
1'024 KB = 1 MiB (binary) -> Mebibyte (MiB) 2^20 Byte = 1 048 576 Byte
But when you look at windows properties of a folder, you get:
Which clearly uses 1KB = 1024bytes (and it's not this "MiB" but still uses 1024). So, what's the veredict?
Is 1KB = 1.024 bytes OR 1.000 ?
Yes, in causal discourse, it is either one - context sensitive.
Memory size tends to use 1024.
File size tends to use 1000.
Exceptions are common.
Else see Kilobyte.
Pedantic concerns like this include using K, when k should be used as in 1kB.

suppose there is a computer with 18 bits address space and the cell size is 8 bits, then what is the smallest and highest address?

suppose there is a computer with 18 bits address space and the cell size is 8 bits, then
What is the smallest and highest address?
What will be the possible largest memory size of this computer in bytes, kilobytes and megabytes?
What is the smallest and highest address?
smallest Address = 0x0000 (HEX)
highest address = 2^18 / 8
= 32768 = 0x8000 (HEX)
What will be the possible largest memory size of this computer in
bytes, kilobytes and megabytes?
Memory Size = 2^18 X 8 bits
Memory Size = 262,144B (Bytes)
Memory Size = 262,144/1024 KB = 256 KB
Memory Size = 256/1024 MB = 0.25 MB
Note::
For more convenient representation the units KiB and MiB are used:
in that Case The memory size is 2048KiB OR 2MiB

Why are kilo, mega and giga - bytes named after "bytes", if they all have 10 of more bits when bytes have 8 bits?

I get why we have the number 1024 instead of 1000 to use the suffix "kilo" in computing (computer uses base 2, so 2 ^ 10, blah blah blah). So I get the kilo part, but why is it called a kilo - "byte"? To make a kilo - "byte", we need to use bits with 10 digits from 0000000000 to 1111111111. That is not 8 digits, shouldn't it be called something else.
I.e. a kilobyte is not 1024 groupings of 8 bit binary digits, it is 1024 groups of 10 bit binary digits and a megabyte has even more than 10 binary digits - not 8. If asked how many bits are in 1 kilobytes, people calculate it as 1*1024*8. But that's wrong! It should be 1*1024*10.
I.e. a kilobyte is not 1024 groupings of 8 bit binary digits, it is
1024 groups of 10 bit binary digits
You are confusing the size of a byte with the size of the value needed to address those bytes.
On most systems a byte is 8 bits, which means 1000 bytes is exactly 1000*8 bits, and 2000 bytes is exactly 2000*8 bits (i.e. exactly the double, which makes sense).
To address or index those bytes you need 10 bits in the first example (2^10) and 11 bits in the second (2^11 up to 2048 bytes). It wouldn't make a lot of sense if the size of a byte was changing when there are more bytes in a data structure.
As for the 1000 (kilobyte) vs 1024 (kibibyte):
1 kB (kilobyte) = 10^3 = 1000
1 KiB (kibibyte) = 2^10 = 1024
A kilobyte used to be generally accepted as being 1024 bytes. However at some point hard disk manufacturers started to count 1 kB as 1000 bytes (kilo being 1000 which is actually correct):
1 GB = 1000^3 = 1000000000
1 GiB = 1024^3 = 1073741824
Windows still used 1 kB = 1024 bytes to show the hard disk size, i.e. it showed 954MB for 1GB of hard disk space. I remember a lot of customers complaining about that when checking, for example, the size of their 250GB drive which only showed 233GB in Windows.

MIPS N-way associative cache

This is a question about memory organization which I have had very difficulty to understand,
Assume we have an N-way set associative cache with the capacity 4096bytes. The
set field size of the address is 7 bits and the tag field 21 bits. If we assume that
the cache is used together with a 32-bit processor, what is then the block size (in
bytes), how many valid bits does the cache contain, and what is the associativity of
the cache?
Here are some equation that is good to know in order to solve question of these type.
Parameter to know
C = cache capacity
b = block size
B = number of blocks
N = degree of associativity
S = number of set
tag_bits
set_bits (also called index)
byte_offset
v = valid bits
Equations to know
B = C/b
S = B/N
b = 2^(byte_offset)
S = 2^(set_bits)
Memory Address
|___tag________|____set___|___byte offset_|
Now to the question
known:
C = 4096 bytes
set_bits = 7
tag_bits = 21
32 bits address field
Asked:
b?
N?
v?
Simply subtract the tag_bits and set_bits from the 32 bit field this gives you the byte_offset.
byte_offset = 32-21-7 = 4 bits
b = 2^4 = 16 bytes
S = 2^7 = 128 set
B = C/b = 4096/16 = 256
N = B/S = 256/128 = 2
v = B = 256 valid bits
So, we have the following information about the processor and the cache -
Cache Size = 4096 B
Address bits = 32
Index bits = 7
Tag bits = 21
From the above information you can quickly calculate the number of bits required for the offset field -
Offset bits = Address bits - Tag bits - Index bits
Offset bits = 32 - 21 - 7 = 4
Offset bits = 4
Using the offset bits, you can find the block size, 2**offset bits
Block Size = 16 bytes
Next thing is the associativity of the cache
We know that the index bits = 7.
This means we have 128 blocks. Each block is 16 bytes wide.
Therefore, the number of ways in the cache would be -
Number of ways = Cache Size / (number of blocks * block Size)
Number of ways = 2
Hence the associativity is 2.
Regarding the number of valid bits. Each block requires a valid bit. Hence the number of valid bits would be -
Valid bits = 128*2
Valid bits = 256

Direct Table & Lookup Table

How to measure memory size of an image in direct coding 24-bit RGB color model & in 24-bit 256-entry loop-up table representation. For example: Given an image of resolution 800*600. how much spaces are required to save the image using direct coding and look-up table.
For a regular 24-bit RGB representation most probably you just have to multiply the number of pixel on number of bytes per pixel. 24 bits = 3 bytes, so the size is 800 * 600 * 3 bytes = 1440000 bytes ≈ 1.37 MiB. In some cases you may have rows of an image aligned on some boundary in memory, usually 4 or 8 or 32 bytes. But since 800 is divisible by 32, this will not change anything, still 1.37 MiB.
Now, for a look-up table, you have 1 byte per pixel, since you have only to address one entry in the table. This yields 800 * 600 * 1 = 480000 bytes ≈ 0.46 MiB. Plus the table itself: 256 colors, 24 bits (3 bytes) each - 256 * 3 = 768 bytes. Negligible comparing to the size of the image.

Resources