Granularity

Learn how to compare bytes, halfwords, words, and double words in terms of granularity.

Granularity

Memory is divided into granules, or chunks of different sizes, to store data fields. Granules help us manage and access data in an organized way.

Fine and coarse granularity both have advantages and disadvantages. On one hand, fine granularity may cause input and storage overheads, but on the other, coarse granularity offers less flexibility in changing parts of the data.

Memory space is generally divided into bytes, halfwords, words, and double words.

Using hexadecimal numbers

The hexadecimal number system has a base value of 1616.

Hexadecimal representation in C/C++

To indicate that we are using hexadecimal numbers in C/C++ language, we prefix them with 0x. For example:

Get hands-on with 1400+ tech skills courses.