×

Bit Vector in Operating System

What is Bit vector?

Bit vector is one of the most important methods used in the free space management of operating system. Free space management which is used by the operating system leads the free space in the hard disk that’s why we call it free space management. OS generally leads a free space list to keep the track of free space disk. Free space list contains all disk blocks which are not allocated to any file or directory.

Bit vector in Operating System

What is Bit?

Bit is also known as unit of information used in computing which can have only one of two values either 1 or 0.

Bit vector also known as bitmap is generally used to implement the free space list. In this method, every block symbolizes of a bit (0 or 1). Condition 1, when a block has bit 0 means block is allocated. Condition 2, when block have 1 bit which means block is free or no memory allocation. It refers to the special type of indexing which use bitmaps. This method is generally used for big databases.

  1. A bit vector size is identical to the number of disks blocks is used.
  2. If ith block is free then the bit vector value at ith location will be 0, otherwise 1.
  3. Memory requirements for storing the bit vectors also increase with the increase in size of the disk.

Advantages of Bit vector

Advantages of bit vector are as follows:

  1. It is simple and easy to understand.
  2. It consumes less memory.
  3. It is well organized to find free spaces.

Disadvantages of Bit vector

Disadvantages of bit vector are as follows:

  1. OS goes through all the blocks until it finds a free block.
  2. To find free block, OS may need to search the whole bit vector.
  3. It requires some special hardware support in some conditions.

Need of Bitmap

Now, we take an example to explain the working of bitmap. Assume that there is a company which holds an employee table with entries like empno, empname, designation, income etc. As we all know employees in any organization are hired once in a year which means the table is less updated and endure static most of the time. But the columns will always concurrent used in queries to retrieve data like: no of female candidates in the company and many more. In this situation, we need a method which is known as a file organization method which is capable enough to provide quick results. But any of the traditional file organization method is not that fast to provide quick results. Therefore, we switch better method of storing and retrieving data known as bitmap indexing.

Applications

The bitmap has number of applications in areas where the space as well as the efficiency is at premium. Most commonly, they are used to represent a simple group of Boolean flags or an ordered sequence of Boolean values.

  1. They are used for the priority queues, where the bit at index k is set if and only if k is in the queue.
  2. They are also used for the allocation of memory pages, disk sectors etc. In such cases term bitmap may also use. This term is generally used to refer to raster images which use multiple bit or pixel.
  3. Bloom filter which is one of the most important type of application of bitmaps. It is used to store the huge sets in small space in exchange for a small probability. It is also possible to build probabilistic hash tables based on bit arrays which accepts false positive or negatives.
  4. They are also a useful abstraction for examining the streams of compressed data, which often contain element that occupy portions of bytes or are not byte aligned, for example the compressed human coding representation of a single 8-bit character can be anywhere from 1 to 255 bits along.
  5. Bit maps and operations on them are also important for developing the succinct data structures, which is close to the minimum amount applicable space. In this context, operations like searching the nth bit up to the certain position become important.

Related Topics

Evolution of Operating System

Evolution of Operating System The evolution of various types of operating systems can be briefly described as follows: Serial Processing Since 1950, the operating system started to be in use. Before 1950, there...

5 minutes read.

Memory Management in Operating System

The term "Main Memory" refers to the computer's internal physical memory. It is distinguished from external mass storage devices like disk drives by using the term "main." RAM is another...

4 minutes read.

Producer-Consumer Problem in OS

What is Producer-Consumer Problem? The Producer-Consumer problem is a classical problem. The Producer-Consumer problem is used for multi-process synchronization, which means synchronization between more than one processes. In this problem, we have one producer...

4 minutes read.

What is Deadlock in OS?

Deadlock in Operating System In an Operating System, a process uses various resources, and the resources are used in the following manner: Request the ResourceUse the ResourceRelease the Resource In the Operating System, Deadlock is a condition...

4 minutes read.

Difference between C-LOOK and C-SCAN Disk Scheduling Algorithm

Disk scheduling is used by operating systems to arrange the arrival of I/O requests to the disc. I/O scheduling is another name for disc scheduling. Disk scheduling is necessary because...

4 minutes read.

Operating System Properties

The Properties of Operating System are: Batch processingMultitaskingMulti-programmingInteractivityReal-Time SystemDistributed Environmentspooling 1. Batch Processing In Batch Processing, the OS first gathers the data and programs together in a batch, then processing starts. The operating system...

3 minutes read.

Ubuntu Operating System

Ubuntu Operating System Ubuntu is an open-source and a Linux based operating system. Ubuntu is developed for the Network Servers, Computers, and Smartphones. The Ubuntu operating system was developed by Canonical...

3 minutes read.

Difference between Process and Program in the Operating System

What is a process in the Operating System? A process is a program that is going through the execution. It also helps us to execute all the lines of code in...

4 minutes read.

Kernel in OS

What is Kernel in OS? The kernel is the core component in the operating system. The job of the kernel is to handle the communication between the hardware and the software. ...

2 minutes read.

Real-time Operating System

In this essay, we will thoroughly understand the real-time operating system. Real-Time Operating System: What do you mean? For any task to be completed, a real-time operating system (RTOS), a special-purpose operating...

5 minutes read.

Need of Operating System

There are various needs of operating system: Managing Input-Output UnitThe Operating system as a platform for application programsMultitaskingConsistent user interface Managing Input-Output Unit: - With the help of the operating system, the...

2 minutes read.

Process Scheduling in Operating System

Process Scheduling is an essential component of a Multiprogramming Operating System. So now let’s understand how it works by taking a real-life example. Suppose that you want to call someone...

6 minutes read.

Resource Allocation Graph in Operating System

Resource Allocation Graph in OS We use the resource allocation graph for the pictographic representation of the state of a system. The resource allocation graph contains all the information related to the processes that...

5 minutes read.

FCFS (First-Come-First-Serve) Disk Scheduling Algorithm

FCFS Disk Scheduling Algorithm FCFS (First-Come-First-Serve) is the easiest disk scheduling algorithm among all the scheduling algorithms. In the FCFS disk scheduling algorithm, each input/output request is served in the order...

4 minutes read.

Multi-user Operating Systems

Introduction Since only one user may interact with the computer at any given time, the operating system we use on our personal computers, laptops, tablets, and phones is sometimes referred to...

8 minutes read.

Process State in OS

The Process passes from different states, from its formation to completion. The following are the states of the Process. NewReadyRunningBlock or WaitTerminated or CompletedSuspend readySuspend wait or suspend blocked 1. New: - The state in which a process...

2 minutes read.

CPU Scheduling in OS

What is Scheduling? Scheduling is the process that is used to share the computing resources such as memory, processor time, and bandwidth to the different processes, data flows, threads, and applications that need...

5 minutes read.

Difference between Rotational Latency and Disk Assess Time in Disk Scheduling

Disk scheduling is used by operating systems to arrange the arrival of I/O requests to the disc. Disk scheduling is necessary because several I/O requests may occur from various processes,...

4 minutes read.

Page Table in Operating System

What is a Page Table? A page table is a data structure used by an operating system (OS) to store information about the physical location of the pages in a computer's...

6 minutes read.

Starvation in Operating System

Starvation is one of the major problems occurring when resource management is not done properly. This problem arises in the operating system when the resources are not being allocated for...

4 minutes read.