Ad

Saturday, 22 June 2013

Algo#22: Swap nibbles of number.

Nibbles are nothing but chunk of 4 bits in simple language.

To swap nibbles in given number, we have to extract 4-bits chunk from number and depending on system, we have to shift them accordingly.

Following is implementation of above algorithm in c language for 8-bit system ( Imaginary ).





Please write comments if you find anything wrong or you want to add something more related to this topic.

No comments:

Post a Comment

Write your comment here.

Ad