지수 바이어스
Exponent biasIEEE 754 부동 소수점 숫자에서 지수는 단어의 공학적 의미에 치우쳐 있다 – 저장된 값은 편향 지수라고도 하는 지수 편향에 의해 실제 값에서 상쇄된다.[1]편향은 지수를 부호화해야 작은 값과 큰 값 모두를 나타낼 수 있기 때문에 이루어지지만, 부호화 값에 대한 통상적인 표현인 두 개의 보어는 비교를 더 어렵게 만들 것이다.
이 문제를 해결하기 위해 지수를 비교에 적합한 부호화되지 않은 값으로 저장하고, 해석할 때 편향을 빼서 서명된 범위 내의 지수로 변환한다.
부호 비트가 가장 유의한 비트 위치를 차지하도록 필드를 배열하면 편향된 지수가 중간 위치를 차지하게 되고, 그러면 맨티사가 가장 유의하지 않은 비트가 되고 결과 값이 적절하게 정렬된다.부동 소수점 또는 정수 값으로 해석되는지 여부가 그렇다.그 목적은 고정점 하드웨어를 사용하여 부동소수점수 사이의 고속 비교를 가능하게 하기 위함이다.
임의 크기의 부동 소수점 숫자에 대한 치우침을 계산하려면 2k−1 - 1 공식을 적용하십시오. 여기서 k는 지수 내 비트 수입니다.[2]
부동 소수점 숫자를 해석할 때 치우침을 빼서 실제 지수를 검색한다.
- 단일 정밀한 숫자의 경우, 지수는 1 .. 254 (0과 255는 특별한 의미를 가지고 있음) 범위에 저장되며, 8비트 지수(127)에 대한 편향을 빼서 -126 .. +127 범위의 지수 값을 얻음으로써 해석된다.
- 이중 정밀한 숫자의 경우, 지수는 1 .. 2046 (0과 2047은 특별한 의미를 가지고 있음) 범위에 저장되며, -1022 .. +1023 범위의 지수 값을 얻기 위해 11비트 지수(1023)에 대한 편향을 빼서 해석된다.
- 4정밀 숫자의 경우, 지수는 1 .. 32766(0과 32767은 특별한 의미를 가지고 있음) 범위에 저장되며, 15비트 지수(16383)에 대한 편향을 빼서 -16382 .. +16383 범위의 지수 값을 얻음으로써 해석된다.
역사
IBM 704의 부동 소수점 형식은 1954년에 편향된 지수의 사용을 도입했다.
참고 항목
- 오프셋 이진수(초과 K라고도 함)
참조
- ^ Gosling, John B. (1980). "6.1 Floating-Point Notation / 6.8.5 Exponent Representation". In Sumner, Frank H. (ed.). Design of Arithmetic Units for Digital Computers. Macmillan Computer Science Series (1 ed.). Department of Computer Science, University of Manchester, Manchester, UK: The Macmillan Press Ltd. pp. 74, 91, 137. ISBN 0-333-26397-9.
[…] In floating-point representation, a number x is represented by two signed numbers m and e such that x = m · be where m is the mantissa, e the exponent and b the base. […] The mantissa is sometimes termed the characteristic and a version of the exponent also has this title from some authors. It is hoped that the terms here will be unambiguous. […] [w]e use a[n exponent] value which is shifted by half the binary range of the number. […] This special form is sometimes referred to as a biased exponent, since it is the conventional value plus a constant. Some authors have called it a characteristic, but this term should not be used, since CDC and others use this term for the mantissa. It is also referred to as an 'excess -' representation, where, for example, - is 64 for a 7-bit exponent (27−1 = 64). […]
- ^ O'Hallaron, David R.; Bryant, Randal E. (2010). Computer systems: a programmer's perspective (2 ed.). Boston, Massachusetts, USA: Prentice Hall. ISBN 978-0-13-610804-7.