The Wayback Machine - https://web.archive.org/web/20250526221745/https://www.geeksforgeeks.org/what-is-a-nibble/
Open In App

what is a nibble ?

Last Updated : 22 May, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

A nibble is a fundamental unit of storage. It consists of 4 bits, which can represent 16 different values ranging from 0 to 15 in decimal notation. In this article, we are going to discuss every point about nibble.

What is a Nibble?

A nibble is four bits or half of a byte. Nibbles are also useful in various encoding schemes, memory addressing, and simplifying the representation of binary-coded data.

Representation of a Nibble

Below are the representations of all possible values of a nibble:

Nibble
Binary, Decimal & Hexa-Decimal Representation

Visual Representation of a Nibble

One Nibble is equivalent to 4 bits, i . e (4 bits = Nibble) , therefore nibble refers to four consecutive binary digits.

  • As we all know that in a byte there are in total 8 bits, therefore ( 1 Byte = 8 Bits )
  • Half of a byte, means 1/2 of a byte ->
  • => 1/2 Byte => 8/2 Bits
  • => 1/2 Byte => 4 bits
  • => 1/2 Byte => 1 Nibble (since we discovered above that 4 Bits = 1 Nibble)

For instance, the binary number `1010` represents a nibble with a decimal value of 10 and a hexadecimal value of `A`.

Steps to Work with Nibbles

1. Converting Binary to Decimal

  • To convert a binary nibble to its decimal equivalent, the steps are as follows
  • Write down the binary number.
  • Assign positional values starting from the right (2^0, 2^1, 2^2, 2^3).
  • Multiply each bit by its positional value.
  • Sum the results.

2. Converting Decimal to Binary

  • To convert a decimal number (0-15) to its binary equivalent:
  • Divide the decimal number by 2.
  • Write down the remainder.
  • Repeat the process with the quotient until the quotient is 0.
  • The binary number is the remainders read from bottom to top.

Let's take an Example: Decimal: 9

Step1. 9 / 2 = 4, remainder 1

Step2. 4 / 2 = 2, remainder 0

Step3. 2 / 2 = 1, remainder 0

Step4. 1 / 2 = 0, remainder 1

Result: Binary => 1001


Next Article

Similar Reads