in Operating System recategorized by
5,571 views
4 votes
4 votes
A bit-map can be used to keep track of which blocks are free in a file-system’s partition on disk.
Assuming, 1 KB block size and a disk size of 40 GB, what is the size of the bit map?
in Operating System recategorized by
5.6k views

4 Comments

To keep record of whether a block of 1KB is free or not, we need 1 bit.

So, number of blocks in 40GB, would be $\frac{40*2^{30}}{2^{10}}$ which is $40*2^{20}$ which is 40M. 1 bit for each. Hence, 40Mb
1
1
given ans is 5 MB
0
0
40Mb or if you want in Bytes then $\frac{40}{8}$ = 5MB

My first comment should be 40Mb instead of 40MB. I must edit
2
2

3 Answers

4 votes
4 votes
Given, Disk Size=40GB.

            Block Size=1KB.

            Since we required one bit per block.

             Number of blocks=40GB/1KB=40*(2^20)

             Therefore we require 40*(2^20) bits=5MB.
0 votes
0 votes
Number of blocks =disk size/ block size

             40GB/1KB

         40*2^30/1*2^10

         40*2^20

          40MB

1 comment

you are wrong.

So here Number of Blocks  = $\frac{40GB}{1KB}$ 

                                           = 40M ( Blocks)

So for each Block, there will require 1 bit to keep track.

So, It will be =     40M* 1 bit

                    =   40Mb ( Mega bit Not Byte)

To Convert in MB divided by 8  = $\frac{40Mb}{8}$ = 5MB.

The answer should be 5 MB.

5
5
0 votes
0 votes
I am getting  5MB

total number of bolck in File is  =  40GB/1KB

                                                        =  40 M block

and each Block Need  1 bit in Bit map then total 40 M bit are needed to represent Bit Map in memory

memory for Bit map in Byte  = 40M bit / 8 bit

                                                   =  5MB
edited by