The binary code of (21.125)10 isa)10101.001b)10100.001c)10101.010d)101...
Answer:
To convert a decimal number to binary, we need to divide the decimal number by 2 repeatedly and keep track of the remainders. The binary code is then obtained by reversing the sequence of remainders.
Let's convert the decimal number 21.125 to binary:
1. Integer part:
- Divide 21 by 2: Quotient = 10, Remainder = 1
- Divide 10 by 2: Quotient = 5, Remainder = 0
- Divide 5 by 2: Quotient = 2, Remainder = 1
- Divide 2 by 2: Quotient = 1, Remainder = 0
- Divide 1 by 2: Quotient = 0, Remainder = 1
The binary representation of the integer part is obtained by reversing the sequence of remainders: 10101.
2. Decimal part:
- Multiply 0.125 (the decimal part) by 2: Product = 0.25, Integer part = 0, Remainder = 0
- Multiply 0.25 by 2: Product = 0.5, Integer part = 0, Remainder = 0
- Multiply 0.5 by 2: Product = 1.0, Integer part = 1, Remainder = 1
The binary representation of the decimal part is obtained by taking the sequence of remainders: 001.
Therefore, the binary representation of the decimal number 21.125 is 10101.001.
Hence, option 'A' (10101.001) is the correct answer.
The binary code of (21.125)10 isa)10101.001b)10100.001c)10101.010d)101...
Step 1: Divide (21)10 successively by 2 until the quotient is 0.
21/2 = 10, remainder is 1
10/2 = 5, remainder is 0
5/2 = 2, remainder is 1
2/2 = 1, remainder is 0
1/2 = 0, remainder is 1
Step 2: Read from bottom (MS2) to top (LS2) as 10101
This is the binary equivalent of decimal number 21
Step 3: Binary equivalent of 0.125 is, multiplying by 2 until we get 1 and writing down the integer after each multiplication,
⇒ 0.125 × 2 = 0.25
⇒ 0.25 × 2 = 0.5
⇒ 0.5 × 2 = 1
⇒ Binary equivalent of 0.125 = 001
∴ The binary code of (21.125)10 is,
(21.125)10 = 10101.001