in Operating System retagged by
6,634 views
1 vote
1 vote

How much space will be required to store the bit map of a 1.3 GB disk with 512 bytes block size?

  1. 332.8 KB
  2. 83.6 KB
  3. 266.2 KB
  4. 256.6 KB
in Operating System retagged by
6.6k views

3 Comments

Write Qus properly .Qus is incomplete?
0
0
@ManojK Now sir? :D :D

And @Kanika this is how you should ask the question. welcome to Gateoverflow. Enjoy. :P
1
1
yes correct rude Sir.
0
0

6 Answers

2 votes
2 votes
Best answer

We need a bit for each block. Number of blocks = disk size/ block size

= 1.3 GB / 512 B 

This will give the size of bit map in bits. To get the byte size divide by 8 and we get 332.8 KB. For disk size, GB is taken as 1024*1024*1024 bytes and for KB it is 1024 bytes. 

Ref: https://en.wikipedia.org/wiki/Gigabyte

selected by
by

4 Comments

you got the answer. 1.3 * 2 * Mb = 2.6 Mb = 2.6 * 1024 / 8 KB = 332.8 KB.
1
1

@shilpi79 it's 2 Mb at last please sorrect it.

0
0

@Arjun sir this means 4B/2B = 2 bit ? but it's wrong.

How Byte / Byte equals bit ?

or it is like 'when nothing is there and we are finding of bit map size we have to take bit as convention.' Is this the case ?

0
0
6 votes
6 votes

In the Bitmap, I bit is required to store the information about the block. If the block is in use then its set as 1 else it set as 0. 

Given that, Total Memory = 1.3 GB = (1.3*2^27) bytes

Block size = 512 Byte = (2^9) bytes

Number of Block = (1.3*(2^27))/(2^9) = (1.3*(2^18))

We need (1.3*(2^18)) bit to store all the information about bitmap, 

Hence size of Bitmap = (1.3*(2^18)) bit = 1.3*256 KB = 332.8 KB

by

4 Comments

HOW U KNOW IT IS BIT
0
0
$2^{3}$ bits = 1 Byte.
0
0
prefix multiplier bits-to-bytes bytes-to-bits
kilo- (K) 1,000x 1Kb = 125B 1KB = 8Kb
mega- (M) 1,000,000x 1Mb = 125KB 1MB = 8Mb
giga- (G) 1,000,000,000x 1Gb = 125MB 1GB = 8Gb
tera- (T) 1,000,000,000,000x 1Tb = 125GB 1TB = 8Tb

there is difference KB (KiloByte) and Kb(kilo bit)

here 1 GB (giga byte) will be 2^30 bytes.

0
0
4 votes
4 votes
for bitmap representation 1 bit is required for each blocks

so #of block=disk size/block size

                 =1.3GB/512 B

                  =1.3*2^30B/512B

                 =1.3*2^30/2^9

                 =1.3*2^21=1.3*2*2^20=2.6M BLOCKS

FOR BITMAP METHOD SIZE REQUIRED =2.6M bits
by

3 Comments

the above answer  given by @rude is not right na?
0
0

@asu Answer driven by you is wrong.

It's right answer is 332 KB.

This question is given in Operating System by #Abraham Silberschatz & P B Galvin (edition 9th), Chapter 12 -File-System Implementation, page number - 562.

Any one can refer.

0
0
Disk Size:  1.3 G bytes = 1.3 * 2^30 bytes

Block Size:  512 bytes = 2^9 bytes

# of Blocks:  
= disk size / block size 
= 1.3 * 2^30 bytes / 2^9 bytes =  1.3 * 2^21

# of entries in bit table 
= # of blocks 
= 1.3 * 2^21

Size of bit table in bits 
= 1.3 * 2^21 bits

Size of bit table in bytes 
= size in bits / (8 bits/byte) 
= 1.3 * 2^21 / 8 bytes
= 1.3 * 2^21 / 2^3 bytes
= 1.3 * 2^18  bytes
= 1.3 * 2^8   * 2^10 bytes
= 1.3 * 256   * K bytes
= 332.8         K bytes
= 332.8K bytes
0
0
3 votes
3 votes

In the given question it is given that, block size $= 2^9$ Bytes

Disk size # $=1.3 \ GB = 1.3*2^{30}$ Bytes

Therefore, total no. of blocks in the disk $=1.3*2^{30}/2^9=1.3 * 2^{21}$ 

Now, here is the catch:

In bit-map for every block there is one bit associated with that block.

So, the space required to for bit map $= 1.3 * 2^{21}$ bits
                      $=  \frac{1.3 * 2^{21}}{8}$ Bytes
                      $= \frac{(1.3 * 2^{21}/8) }{ 2^{10}}$ KB 
                      $= 332.8$ KB
So, correct option is option no. A.

edited by
Answer:

Related questions