본문 바로가기
개발 지식

이진수<-> 십진수 소수 파트 => fractional part: Binary number <-> Decimal number

by PrettyLog 2023. 3. 26.

Decimal to Binary

To convert the fractional part of a decimal number to binary, you can use the following steps:

Multiply the fractional part by 2.
Write down the integer part of the result.
Repeat step 1 with the fractional part of the result from the previous step.
Continue this process until the fractional part becomes 0 or until you have obtained the desired number of binary digits.
For example, to convert the decimal fraction .625 to binary:

Multiply .625 by 2, which gives 1.25. Write down the integer part, which is 1.
Multiply .25 by 2, which gives .5. Write down the integer part, which is 0.
Multiply .5 by 2, which gives 1. Write down the integer part, which is 1.
Since the fractional part is now 0, we stop the process.
Write down the binary digits in the order they were obtained: 101.
The binary equivalent of the decimal fraction .625 is 0.101.
Therefore, the binary equivalent of the decimal fraction .625 is 0.101.

번역결과

십진수의 소수 부분을 이진수로 변환하려면 다음 단계를 사용할 수 있습니다.

소수 부분에 2를 곱합니다.
결과의 정수 부분을 기록합니다.
이전 단계 결과의 소수 부분으로 1단계를 반복합니다.
소수 부분이 0이 될 때까지 또는 원하는 이진수를 얻을 때까지 이 과정을 계속합니다.

예를 들어 소수점 이하 .625를 이진수로 변환하려면 다음과 같이 하십시오.

.625에 2를 곱하면 1.25가 됩니다. 정수 부분인 1을 기록합니다.
.25에 2를 곱하면 .5가 됩니다. 0인 정수 부분을 기록합니다.
.5에 2를 곱하면 1이 됩니다. 정수 부분인 1을 적으십시오.
소수 부분이 이제 0이므로 프로세스를 중지합니다.
얻은 순서대로 이진수를 적으십시오: 101.
십진 분수 .625에 해당하는 이진수는 0.101입니다.

따라서 십진 분수 .625에 해당하는 이진수는 0.101입니다.

Binary to Decimal

To convert a binary fractional part to decimal, you can use the following steps:

Write down the binary fraction, with each digit representing a power of 2 starting from the leftmost digit.
Multiply each digit by its corresponding power of 2, starting from the rightmost digit and moving left.
Add up the results of the multiplication to get the decimal equivalent of the binary fractional part.
For example, to convert the binary fraction 0.101 to decimal:

Write down the binary fraction 0.101.
Multiply the rightmost digit (1) by 2^-1 (which is 0.5), and write down the result (0.5).
Multiply the second-rightmost digit (0) by 2^-2 (which is 0.25), and write down the result (0).
Multiply the leftmost digit (1) by 2^-3 (which is 0.125), and write down the result (0.125).
Add up the results: 0.5 + 0 + 0.125 = 0.625.
The decimal equivalent of the binary fraction 0.101 is 0.625.
Therefore, the decimal equivalent of the binary fraction 0.101 is 0.625.

번역결과

이진 분수 부분을 십진수로 변환하려면 다음 단계를 사용할 수 있습니다.

가장 왼쪽 숫자부터 시작하여 각 숫자가 2의 거듭제곱을 나타내는 이진 분수를 적으십시오.
가장 오른쪽 숫자부터 시작하여 왼쪽으로 이동하면서 각 숫자에 해당하는 2의 거듭제곱을 곱합니다.
곱셈의 결과를 더하여 이진 분수 부분에 해당하는 십진수를 얻습니다.

예를 들어, 이진 분수 0.101을 십진수로 변환하려면:

이진 분수 0.101을 적으십시오.
가장 오른쪽 숫자(1)에 2^-1(0.5)을 곱하고 결과(0.5)를 기록합니다.
두 번째 오른쪽 숫자(0)에 2^-2(0.25)를 곱하고 결과(0)를 기록합니다.
맨 왼쪽 숫자(1)에 2^-3(0.125)을 곱하고 결과(0.125)를 기록합니다.
결과를 합산합니다: 0.5 + 0 + 0.125 = 0.625.
이진수 분수 0.101의 십진수 값은 0.625입니다.

따라서 이진수 분수 0.101의 십진수 값은 0.625입니다.

댓글