Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Calculate FAT

Tags:

fat

I am learning about FAT file system and how to calculate FAT size. Now, I have this question:

Consider a disk size is 32 MB and the block size is 1 KB. Calculate the size of FAT16.

Now, I know that to calculate it, we would multiply the number of bits per entry with the number of blocks. So first step would be to calculate the number of blocks = (32MB)/(1KB) = 2^15 = 32 KB blocks.

Then, we would put that into the first equation to get = 2^16 * 2^15 = 2^19 Now, up to here I understand and I had thought that that is the answer (and that is how I found it to be calculated in http://pcnineoneone.com/howto/fat1.html).

However, the answer I was given goes one step further to divide 2^19 by (8*1024) , which would basically give an answer of 64KB. Why is that? I have searched for hours, but could find nothing.

Can someone explain why we would perform the extra step of dividing 2^19 by (8*1024)? oh, and the other question stated that the block size is 2KB and so it divided the end result by(8*1024*1024) ... where is the 8 and 1024 coming from? please help

like image 268
Favn Hghksd Avatar asked Nov 14 '22 05:11

Favn Hghksd


1 Answers

you are using FAT16. Clusters are represented with 16 bits which means 16/8=2 bytes. To get size in bytes the result should be divided by 8.to get result in kilobytes you should divide your result by 8*1024

like image 50
hit Avatar answered May 19 '23 13:05

hit