# Pingala’s Algorithm Part VII: From Ganas to Octal and Hexadecimal This is in continuation of my earlier article How Pingala created the Binary Number System

Let us consider a 16-bit number:
1011 1100 1101 0101
It is very tedious to read and write long series of binary numbers.

Let us form a unit of 3 bits. The values represented by a group of 3 bits will range from 000 to 111. That is, from 0 to 7. One octal digit (base-8 number system) can also represent values from 0 to 7.

The same way we can make a unit of 4 bits. The values represented by a group of 4 bits will range from 0000 to 1111. That is, from 0 to 15. One hexadecimal digit (base-16 number system) can also represent values from 0 to 15.

Let me list out the binary, octal and hexadecimal representations of decimal numbers from 0 to 32. Refer to Table no. 1. We can substitute a group of 3 bits with an octal digit. Let us rewrite the above binary number as an octal number. Refer to Table no. 2. We can substitute a group of 4 bits with a hexadecimal digit. Let us rewrite the above binary number as a hexadecimal number. Refer to Table no. 3. Octal and hexadecimal numbers can be used to write binary numbers in a compact form. Computer scientists use octal (Base-8 number system) and hexadecimal (Base-16 number system) numbers as an aid to read and write binary numbers.

Do you know who was the first person to develop such a concept? It was Pingala, who had developed it in his work Chandahshastra (composed around 2nd century BCE).

Pingala had developed a method to write sequences of Guru and Laghu syllables in a compact way. He had grouped 3 syllables into a unit called a Gana (गण). Each of the total 8 combinations of 3 syllables was represented by a Sanskrit character (अक्षर). The first 8 sutras of Chandahshastra give us these representations.

धी श्री स्त्री म् |  (छन्दः शास्त्रम् 1.1)

धी श्री स्त्री is a mnemonic and धी श्री स्त्री are all Guru syllables. Pingala tells us that GGG combination is called the म् gana.

Table No. 4 lists the sutras, corresponding sequences of Guru and Laghu syllables,

and the gana which represents them.

Table No. 4 Let me illustrate the benefit of using ganas with an example.

या सृष्टिः स्रष्टुराद्या वहति विधिहुतं या हविर्या च होत्री
ये द्वे कालं विधत्तः श्रुतिविषयगुणा या स्थिता व्याप्य विश्वम् ।
यामाहुः सर्वबीजप्रकृतिरिति यया प्राणिनः प्राणवन्तः
प्रत्यक्षाभिः प्रपन्नस्तनुभिरवतु वस्ताभिरष्टाभिरीशः ॥ १॥

This is the first verse of Kalidasa’s Abhijnanasakuntalam which is composed in the Sragdhara (स्रग्धरा) meter. Sragdhara has 21 syllables in each of its quarters. The pattern of Gurus and Laghus in Sragdhara is GGGGLGG LLLLLLG GLGGLGG. This can be written in a compact form using the ganas as मरभनययय.

This is one amongst many inventions that we think are modern but which have their roots in ancient India.

Explore Pingala’s Algorithm  Part III,  III,  IV, V, and VI