How to Convert Decimal Into Any Number System In Java - The Complete Java Certification Course 05

preview_player
Показать описание
In this lecture, lets convert decimal into binary, octal and hexa-decimal and vice versa.

The Number Systems used in computers are:

Binary number system
Octal number system
Decimal number system
Hexadecimal number system

Binary number system
It has only two digits '0' and '1' so its base is 2. Accordingly, In this number system, there are only two types of electronic pulses; absence of electronic pulse which represents '0'and presence of electronic pulse which represents '1'. Each digit is called a bit. A group of four bits (1101) is called a nibble and group of eight bits (11001010) is called a byte. The position of each digit in a binary number represents a specific power of the base (2) of the number system.

Octal number system
It has eight digits (0, 1, 2, 3, 4, 5, 6, 7) so its base is 8. Each digit in an octal number represents a specific power of its base (8). As there are only eight digits, three bits (23=8) of binary number system can convert any octal number into binary number. This number system is also used to shorten long binary numbers. The three binary digits can be represented with a single octal digit.

Decimal number system
This number system has ten digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) so its base is 10. In this number system, the maximum value of a digit is 9 and the minimum value of a digit is 0. The position of each digit in decimal number represents a specific power of the base (10) of the number system. This number system is widely used in our day to day life. It can represent any numeric value.

Hexadecimal number system
This number system has 16 digits that ranges from 0 to 9 and A to F. So, its base is 16. The A to F alphabets represent 10 to 15 decimal numbers. The position of each digit in a hexadecimal number represents a specific power of base (16) of the number system. As there are only sixteen digits, four bits (24=16) of binary number system can convert any hexadecimal number into binary number. It is also known as alphanumeric number system as it uses both numeric digits and alphabets.
Рекомендации по теме
visit shbcf.ru