A number in a base is said to be a special number if it is equal to the sum of its own digits each raised to the power of the number of digits. A number in base ‘b’ can have digits from 0 to b-1. By default the numbers used by humans is to base 10 and called as decimal number system. A number ‘n’ from decimal number system can be converted to any base ‘b’ by repeated division of ‘n’ by ‘b’ and writing reminder of each division in reverse order. For example, number 24 is converted to base 3 as shown below:
Question
A number in a base is said to be a special number if it is equal to the sum of its own digits each raised to the power of the number of digits. A number in base ‘b’ can have digits from 0 to b-1. By default the numbers used by humans is to base 10 and called as decimal number system. A number ‘n’ from decimal number system can be converted to any base ‘b’ by repeated division of ‘n’ by ‘b’ and writing reminder of each division in reverse order. For example, number 24 is converted to base 3 as shown below:
Solution
To convert a number from decimal to any base 'b', you can follow these steps:
-
Start with the decimal number you want to convert. Let's say it is 'n'.
-
Choose the base 'b' you want to convert the number to.
-
Divide 'n' by 'b' and note down the remainder. This remainder will be the rightmost digit in the converted number.
-
Divide the quotient obtained in step 3 by 'b' again and note down the remainder. This remainder will be the next digit to the left in the converted number.
-
Repeat step 4 until the quotient becomes 0. Each time, note down the remainder as the next digit to the left in the converted number.
-
Write down the remainders obtained in reverse order. This will give you the converted number in base 'b'.
For example, let's convert the decimal number 24 to base 3:
- Divide 24 by 3. The quotient is 8 and the remainder is 0.
- Divide 8 by 3. The quotient is 2 and the remainder is 2.
- Divide 2 by 3. The quotient is 0 and the remainder is 2.
Now, write down the remainders in reverse order: 202. So, the decimal number 24 in base 3 is equal to 202.
This process can be applied to convert any decimal number to any base 'b'.
Similar Questions
The numbers that we use daily belong to the Decimal System. For example: : 0, 1, 2, 3,...2333, 99999, etc., It is also called a base-10 system.It is called base-10 number system because it uses 10 unique digits from 0 to 9 to represent any number.A base (also called the radix) is the number of unique digits or symbols (including 0) that are used to represent a given number.In Decimal System (which is base-10), a total of 10 digits (0, 1, 2, 3, 4, 5, 6, 7, 8 and 9) are used to represent a number of any size (magnitude).For example, Five Hundred and Sixty Seven is represented as 567, where567 = (5 * 102) + (6 * 101) + (7 * 100)567 = (5 * 100) + (6 * 10) + (7 * 1) [100's] [10's] [units] Similarly fractions are represented with the base (10) being raised to a negative power.Select the correct statements from the given statements.In Decimal System, 102 = (1 * 102) + (0 * 101) + (2 * 100)In Decimal System, 459 = (4 * 1100) + (5 * 110) + (9 * 11)In Decimal System, 0 = (1 * 10)In Decimal System, 0 = (0 * 100)
The numbering system which uses base-8 is called octal system. A base (also called radix) is the number of unique digits or symbols (including 0) that are used to represent a given number.In octal system (or the base-8 system), a total of 8 digits (0, 1, 2, 3, 4, 5, 6 and 7) are used to represent a number of any size (magnitude).For example, Zero is represented as 0, where0 = (0 * 80) = (0 * 1)Similarly the numbers 1 One (1), 2 and 7 are represented as follows: :1 = (1 * 80) = (1 * 1)2 = (2 * 80) = (2 * 1)...7 = (7 * 80) = (7 * 1)Now, let us try to represent the following numbers in octal system:Eighteen (18): Since 0 to 7 are the only digits that can be used to represent 18, let us divide 18 by 8 and write the quotient and remainder as follows:[quotient][remainder], i.e.: [2][2]18 = (2 * 81) + (2 * 80) = (16) + (2)Four Hundred and Twenty One (421): Since 0 to 7 are the only digits that can be used to represent 421,, let us divide it by 8 and write the quotient and remainder as follows:[quotient][remainder], i.e.: [52] [5] (further dividing 52 by 8 we get [6][4]), which is [6][4][5]421 = (6 * 82) + (4 * 81) + (5 * 80) = (384) + (32) + (5)Click on Live Demo to understand the conversion of decimal number system to octal number system.In order to differentiate from decimal numbers, octal numerals are prefixed with a leading 0 (zero).For example, to store an octal value of seven into a variable number_seven, we writeint number_seven = 07;Similarly, if we want to store an octal representation of a decimal number 9 in a variable number_nine, we writeint number_nine = 011;Click on Live Demo to understand the conversion of octal number system to decimal number system.Select all the correct statements from the given statements.In octal system, the base is 10.In octal system, decimal value of 20 is represented as 21In octal system, decimal 8 is represented as 10In octal system, decimal of 10 is written as 012
he numbering system which uses base-2 is called the binary system. In binary system (or the base-2 system), a total of 2 digits (0 and 1) are used to represent a number of any size (magnitude).For example, Zero is represented as 0, where0 = (0 * 20) = (0 * 1)Similarly, One (1) is represented as:1 = (1 * 20) = (1 * 1)Now, let us try to represent the following numbers in binary format:Two (2): Since 0 or 1 are the only digits that can be used to represent 2, let us divide 2 by 2 and write the quotient and remainder as follows:[quotient][remainder], i.e.: [1][0]2 = (1 * 21) + (0 * 20) = (2) + (0)Three (3): Since 0 or 1 are the only digits that can be used to represent 3, let us divide 3 by 2 and write the quotient and remainder as follows:[quotient][remainder], i.e.: [1][1]3 = (1 * 21) + (1 * 20) = (2) + (1)Four (4): Since 0 and 1 can be only be used to represent 4, let us divide 4 by 2 and write the quotient and remainder as follows:[quotient][remainder], i.e.: [2][0]. By repeating the above logic for 2 (whose value we already know to be [1][0]) we get [1][0][0]4 = (1 * 22) + (0 * 21) + (0 * 20)4 = (4) + (0) + (0)Fourteen (14): Since only 0 and 1 should be used, let us divide 14 by 2 and write the quotient and remainder as follows:[quotient][remainder], i.e.: [7][0], by repeating the above logic for 7 (7 = [3][1], and 3 = [1][1]) we finally get [1][1][1][0]14 = (1 * 23) + (1 * 22) + (1 * 21) + (0 * 20)14 = (8) + (4) + (2) + (0)Hundred and Fourteen (114): let us divide 114 by 2 and write the quotient and remainder as follows:[quotient][remainder], i.e.: [57][0], by repeating the above logic for 57 (57 = [28][1], 28 = [14][0], 14 = [1][1][1][0]), we finally get [1][1][1][0][0][1][0]114 = (1 * 26) +(1 * 25) +(1 * 24) +(0 * 23) + (0 * 22) + (1 * 21) + (0 * 20)114 = (64) + (32) + (16) + (0) + (0) + (2) + (0)Click on Live Demo to understand the conversion of decimal number system to binary number system.In C, binary numerals are prefixed with a leading 0b (or 0B) (digit zero followed by char 'b'). For example, to store an binary value of four into a variable binary_four, we writeint binary_four = 0b100;Click on Live Demo to understand the conversion of binary number system to decimal number system.Select the correct statements from the given statements.In binary system, decimal 10 is represented as (1 * 101)In binary system, decimal 100 = binary 1100100In binary system, decimal 10 = binary 1010In binary system, decimal 200 = binary 100100
The number system that uses base-2 is called binary number system while the number system that uses base-8 is called octal number system.In binary system (or base-2 number system,) a total of 2 digits (0 and 1) are used to represent a number of any size (magnitude), whereas in octal system (or base-8 number system,) a total of 8 digits (0, 1, 2, 3, 4, 5, 6 and 7) are used to represent a number of any size (magnitude).The largest digit in octal system is (7)8. Number (7)8 in binary is represented as (111)2. In binary system, three binary digits (bits) are being used to represent the highest octal digit.While converting an octal number to a binary number, three bits are used to represent each octal digit.The following table shows the conversion of each octal digit into its corresponding binary digits.Octal 0 1 2 3 4 5 6 7Binary 000 001 010 011 100 101 110 111For example, an octal number 0246 is converted to its corresponding binary form asOctal Number -> 2 4 6Binary Number -> 010 100 110Hence, 0246 is (010100110)2.Click on Live Demo to understand the conversion of octal number to its corresponding binary number.Similarly, while converting a binary number into its octal form, the binary number is divided into groups of 3 digits each, starting from the exterme right side of the given number . Each of the three binary digits are replaced with their corresponding octal digits.If the group of binary digits to the extreme left side of the number do not have three digits, the required number of zeros are added as a prefix to get three binary digits.For example, let us try and convert a binary number 1101100 into its corresponding octal number.Binary Number -> 1 101 100Binary Number -> 001 101 100 // After prefixing zeros on the extreme left side of the groupOctal Number -> 1 5 4Hence, the octal equivalent of the given binary 1101100 is 0154Click on Live Demo to understand the conversion of a binary number to its corresponding octal form.Select all the correct statements from the given statements.(369)8 is an octal number.Each octal digit is represented using three bits.Binary number (10101010)2 is equivalent to the octal number (252)8.An octal number (364)8 is equivalent to the binary number (011110100)2.
The number system which uses base-16 is called hexadecimal system or simply hex. A base (also called radix) is the number of unique digits or symbols (including 0) that are used to represent a given number.In hexadecimal system (or base-16 number system), a total of 16 symbols are used. Digits from 0 (zero) to 9 (nine) are used to represent values from 0 to 9 respectively and alphabets A, B, C, D, E and F (or a, b, c, d, e and f) are used to represent values from 10 to 15 respectively.In many programming languages like C, Java, etc., 0x is used as a prefix to denote a hexadecimal representation.For example, in hexadecimal number system, the value of Zero is represented as 0x0, where0 = (0 * 160) = (0 * 1)Similarly 1, 2 ...up to 9:1 = (1 * 160) = (1 * 1)2 = (2 * 160) = (2 * 1)...9 = (9 * 160) = (9 * 1)10 = A = (10 * 160) = (10 * 1)15 = F = (15 * 160) = (15 * 1)Now, let us try and represent the following numbers in hexadecimal system:Decimal number Eighteen/ 18 :Since one can only use 0 to 9 and the alphabets A to F to represent 18., let us divide 18 by 16 and write the quotient and remainder as follows:[quotient][remainder], i.e.: [1][2]18 = 0x12 = (1 * 161) + (2 * 160) = (16) + (2)One Hundred and Sixty (160).Since one can only use 0 to 9 and the alphabets A to F to represent 160., let us divide 160 by 16 and write the quotient and remainder as follows:[quotient][remainder], i.e.: [10][0], [A][0] (since 10 is represented by A)160 = 0xA0 = (10 * 161 + (0 * 160) = (160) + (0)Three Thousand Four Hundred and Sixty (3460):Since one can only use 0 to 9 and the alphabets A to F to represent 3460., let us divide it by 16 and write the quotient and remainder as follows:[quotient][remainder], i.e.: [216][4], (216 divided by 16 is [13][8], which is represented as [D][8]). So 3460 is represented as 0xD843460 = 0xD84 = (13 * 162) + (8 * 161) + (4 * 160) = (13 * 256) + (8 * 16) + (4 * 1) = (3328) + (128) + (4)Click on Live Demo to understand the conversion of a decimal number to its corresponding hexadecimal form.Note that both uppercase and lowercase letters can be used when representing hexadecimal values. For example:int hex_hundered_and_sixty = 0xA0; // or 0Xa0, however 0xA0 is preferredClick on Live Demo to understand the conversion of a hexadecimal number to its corresponding decimal form.Select all the correct statements from the given statements.In hexadecimal system, a base of 10 is used.Decimal number 101 is equal to 0x65 in hex.Hex value of 0xCAFE is equal to the decimal value 51966.0x0001 in hex is equal to 0X1 in hex to 1 in decimal number system.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.