160k views
4 votes
Write the decimal number 123 as a binary number and as a number base 8

1 Answer

3 votes

Final answer:

To convert the decimal number 123 to binary, divide it by 2 repeatedly and note the remainders. The binary representation of 123 is 1111011. To convert it to base 8, divide it by 8 repeatedly and note the remainders. The base 8 representation of 123 is 173.

Step-by-step explanation:

To convert the decimal number 123 to binary, you can use the process of division by 2. Here are the steps:

  1. Divide 123 by 2, and note the quotient and remainder. The remainder is 1, and the quotient is 61.
  2. Divide the quotient from step 1 (61) by 2 again, and note the new quotient and remainder. The remainder is 1, and the quotient is 30.
  3. Repeat step 2 with the new quotient (30). The remainder is 0, and the quotient is 15.
  4. Continue dividing the quotients by 2 and noting the remainders until the quotient is 0. The sequence of remainders is reversed to get the binary representation of 123, which is 1111011.

To convert the decimal number 123 to base 8, also known as octal, you can use the process of division by 8. Here are the steps:

  1. Divide 123 by 8, and note the quotient and remainder. The remainder is 3, and the quotient is 15.
  2. Divide the quotient from step 1 (15) by 8 again, and note the new quotient and remainder. The remainder is 7, and the quotient is 1.
  3. Repeat step 2 with the new quotient (1). The remainder is 1, and the quotient is 0.
  4. Continue dividing the quotients by 8 and noting the remainders until the quotient is 0. The sequence of remainders is reversed to get the base 8 representation of 123, which is 173.

User Puddleglum
by
7.8k points