Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Encoding a string using base4

iamge

I am confused on this example. How can a string made up of a,b,c,d be converted using base4 representation in this way?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

How can a string made up of a,b,c,d be converted using base4

In this case a,b,c,d are digits, traditionally 0…9 are used for system with base <= 10, but other characters might be used. For example say you might write binary number using - and +.

Note that various base systems are working same way, but are just using subsequent powers of different number. Consider 21231 in base-10 system, it is:

2 * 10 ** 4 + 1 * 10 ** 3 + 2 * 10 ** 2 + 3 * 10 ** 1 + 1 * 10 ** 0
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading