Number Systems
Learning Objectives
- Learn about number systems.
- Understand digits and bases of different number systems.
- Represent values in decimal, binary, octal, and hexadecimal number systems.
- Convert between decimal and binary.
- Convert from decimal to octal and hexadecimal number systems.
Introduction to Number Systems
- Computers operate using the binary system (0s and 1s).
- Number systems are used to represent different quantities.
- Computers translate inputs (letters, words, graphics, videos) into binary numbers.
- Various number systems exist, including octal and hexadecimal, which use combinations of digits to represent quantities.
Need for Number Systems
- Humans use numbers like 1, 2, 3, etc., for counting.
- Computers understand machine language (0s and 1s).
- Inputs given to the computer are converted into machine language.
Value of Digits in a Number
The value of each digit depends on:
- The face value of the digit (e.g., 1, 2, 5, 6).
- The place value of the digit (units, tens, hundreds, thousands, etc.).
- The base value of the number system.
Types of Number Systems
- Decimal Number System
- Binary Number System
- Octal Number System
- Hexadecimal Number System
Decimal Number System
- Consists of ten digits (0 to 9).
- Base 10.
- Numbers are used individually or in groups (e.g., 25, 8, 256, 295).
- The subscript 10 indicates a decimal number [e.g., , , ].
- Example: 1256 can be explained as:
- (Thousands) = 1000
- (Hundreds) = 200
- (Tens) = 50
- (Units) = 6
- Total: 1000 + 200 + 50 + 6 = 1256
Binary Number System
- Also called base 2 number system.
- Uses only two digits: 0 and 1.
- 0 represents the OFF state, and 1 represents the ON state of a signal.
- The subscript 2 indicates a binary number [e.g., , , ].
Octal Number System
- Consists of 8 digits (0 to 7).
- Base 8.
- The subscript 8 indicates an octal number [e.g., , , ].
Hexadecimal Number System
- Consists of 16 digits (0 - 15), represented by 0-9 and A-F (where A=10, B=11, C=12, D=13, E=14, F=15).
- Base 16.
- The subscript 16 indicates a hexadecimal number [e.g., , , ].
- One hexa digit is sometimes referred to as a nibble.
Representing Values in Different Number Systems
- A decimal value can be represented in binary, octal, and hexadecimal systems.
Conversion of Decimal Number into Binary Number
Steps:
- Divide the number by 2.
- Write down the remainder and divide the quotient again by 2.
- Repeat step 2 until the quotient is zero.
- Example 1: Convert 125 into binary form.
- 125 ÷ 2 = 62, Remainder 1
- 62 ÷ 2 = 31, Remainder 0
- 31 ÷ 2 = 15, Remainder 1
- 15 ÷ 2 = 7, Remainder 1
- 7 ÷ 2 = 3, Remainder 1
- 3 ÷ 2 = 1, Remainder 1
- 1 ÷ 2 = 0, Remainder 1
- So,
- Example 2: Convert 76 into binary form.
- 76 ÷ 2 = 38, Remainder 0
- 38 ÷ 2 = 19, Remainder 0
- 19 ÷ 2 = 9, Remainder 1
- 9 ÷ 2 = 4, Remainder 1
- 4 ÷ 2 = 2, Remainder 0
- 2 ÷ 2 = 1, Remainder 0
- 1 ÷ 2 = 0, Remainder 1
- So,
Conversion of Binary Number into Decimal Number
Steps:
- Multiply each binary digit with multiples of 2, starting from the right.
- Increase the power of 2 one by one.
- Sum up all the products to get the decimal form.
- Example 1: Convert into decimal form.
- Thus,
- Example 2: Convert into decimal form.
- Thus
Conversion of a Decimal Number into Octal Number
Steps:
- Divide the number by 8.
- Write down the remainder and divide the quotient again by 8.
- Repeat step 2 until the quotient is less than 8.
- Example 1: Convert 65 to octal number system.
- 65 ÷ 8 = 8, Remainder 1
- 8 ÷ 8 = 1, Remainder 0
- So,
- Example 2: Convert 145 into octal number system.
- 145 ÷ 8 = 18, Remainder 1
- 18 ÷ 8 = 2, Remainder 2
- So,
Conversion of a Decimal Number to Hexadecimal Number
Steps:
- Divide the number by 16.
- Write down the remainder and divide the quotient again by 16.
- Repeat step 2 until the quotient is less than 16.
- Example 1: Convert 34 into hexadecimal number.
- 34 ÷ 16 = 2, Remainder 2
- So,
- Example 2: Convert 135 into hexadecimal number.
- 135 ÷ 16 = 8, Remainder 7
- So,
Summary
- A number system is a way to represent different quantities.
- The decimal number system consists of ten digits (0 to 9) with base 10.
- The base of the binary number system is 2.
- The octal number system consists of 8 digits (0-7) with base 8.
- The hexadecimal number system consists of 16 digits (0-9, A-F) with base 16.
Remembered Perception
- Aryabhatta gave the concept of 0 .