ArticleslgStudy

computer science

Decimal32 floating-point format

Decimal32 floating-point format is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Decimal32 floating-point format rather than just read about it. In short: In computing, decimal32 is a decimal floating-point computer numbering format that occupies 4 bytes (32 bits) in computer memory. Purpose and use Like the binary16 and binary32 formats, decimal32 uses less space than the actually most common format binary64.

Key takeaways

  • Decimal32 floating-point format belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Decimal32 floating-point format to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Decimal32 floating-point format from memory before moving on to harder problems.

Reference excerpt

In computing, decimal32 is a decimal floating-point computer numbering format that occupies 4 bytes (32 bits) in computer memory.

Purpose and use Like the binary16 and binary32 formats, decimal32 uses less space than the actually most common format binary64.

Range and precision decimal32 supports 'normal' values, which can have 7 digit precision from ±1.000000×10^−95 up to ±9.999999×10^+96, plus 'subnormal' values with ramp-down relative precision down to ±1.×10^−101 (one digit), signed zeros, signed infinities and NaN (Not a Number). The encoding is somewhat complex, see below. The binary format with the same bit-size, binary32, has an approximate range from subnormal-minimum ±1×10^−45 over normal-minimum with full 24-bit precision: ±1.1754944×10^−38 to maximum ±3.4028235×10^38.

Encoding of decimal32 values decimal32 values are encoded in a 'not normalized' near to 'scientific format', with combining some bits of the exponent with the leading bits of the significand in a 'combination field'.

Besides the special cases infinities and NaNs there are four points relevant to understand the encoding of decimal32.

BID vs. DPD encoding, binary integer decimal using a positive integer value for the significand, software centric and designed by Intel, vs. densely packed decimal encoding for all except the first digit of the significand, hardware centric and promoted by IBM(r), differences see below. Both alternatives provide exactly the same range of representable numbers: up to 7 digits of significand and 3 × 26 = 192 possible exponent values. IEEE 754 allows these two different encodings, without a concept to denote which is used, for instance in a situation where decimal32 values are communicated between systems. In contrast to the binary formats, the significands of decimal formats are not normalized (the leading digits are allowed to be 0), and thus most values with less than 7 significant digits have multiple possible representations. 1000000 × 10−2=100000 × 10−1=10000 × 100=1000 × 101 all have the value 10000. These sets of representations for a same value are called cohorts, the different members can be used to denote how many digits of the value are known precisely. The encodings combine two bits of the exponent with the leading 3 to 4 bits of the significand in a 'combination field', different for 'big' vs. 'small' significands. That enables bigger precision and range, in trade-off that some simple functions like sort and compare, very frequently used in coding, do not work on the bit pattern but require computations to extract exponent and significand and then try to obtain an exponent aligned representation. This effort is partly balanced by saving the effort for normalization, but contributes to the slower performance of the decimal formats. Beware: BID and DPD use different bits of the combination field for that, see below. Different understanding of significand as integer vs. fraction, and acc. different bias to apply for the exponent (for decimal32 what is stored in bits can be decoded as base to the power of 'stored value for the exponent minus bias of 95' times significand understood as d0 . d−1 d−2 d−3 d−4 d−5 d−6 (note: radix dot after first digit, significand fractional), or base to the power of 'stored value for the exponent minus bias of 101' times significand understood as d6 d5 d4 d3 d2 d1 d0 (note: no radix dot, significand integral), both produce the same result [2019 version of IEEE 754 in clause 3.3, page 18]. Both applies to BID as well as DPD encoding. For decimal formats the second view is more common, while for binary formats the first, the biases are different for each format.) In all cases for decimal32, the value represented is

(−1)sign × 10exponent−101 × significand, with the significand understood as positive integer. Alternatively it can be understood as (−1)sign × 10exponent−95 × significand with the significand digits understood as d0 . d−1 d−2 d−3 d−4 d−5 d−6, note the radix dot making it a fraction. For ±Infinity, besides the sign bit, all the remaining bits are ignored (i.e., both the exponent and significand fields have no effect). For NaNs the sign bit has no meaning in the standard, and is ignored. Therefore, signed and unsigned NaNs are equivalent, even though some programs will show NaNs as signed. The bit m5 determines whether the NaN is quiet (0) or signaling (1). The bits of the significand are the NaN's payload and can hold user defined data (e.g., to distinguish how NaNs were generated). Like for normal significands, the payload of NaNs can be either in BID or DPD encoding. Be aware that the bit numbering used in the tables for e.g. m10 … m0 is in opposite direction than that used in the document for the IEEE 754 standard G0 … G10.

The resulting 'raw' exponent is a 8 bit binary integer where the leading bits are not '11', thus values 0 ... 10111111b = 0 ... 191d, appr. bias is to be subtracted. The resulting significand could be a positive binary integer of 24 bits up to 1001 1111111111 1111111111b = 10485759d, but values above 107 − 1 = 9999999 = 98967F16 = 1001100010010110011111112 are 'illegal' and have to be treated as zeroes. To obtain the individual decimal digits the significand has to be divided by 10 repeatedly.

The resulting 'raw' exponent is a 8 bit binary integer where the leading bits are not '11', thus values 0 ... 10111111b = 0 ... 191d, appr. bias is to be subtracted. The significand's leading decimal digit forms from the (0)cde or 100e bits as binary integer. The subsequent digits are encoded in the 10 bit 'declet' fields 'tttttttttt' according the DPD rules (see below). The full decimal significand is then obtained by concatenating the leading and trailing decimal digits. The 10-bit DPD to 3-digit BCD transcoding for the declets is given by the following table. b9 … b0 are the bits of the DPD, and d2 … d0 are the three BCD digits. Be aware that the bit numbering used here for e.g. b9 … b0 is in opposite direction than that used in the document for the IEEE 754 standard b0 … b9, add. the decimal digits are numbered 0-base here while in opposite direction and 1-based in the IEEE 754 paper. The bits on white background are not counting for the value, but signal how to understand / shift the other bits. The concept is to denote which digits are small (0 … 7) and encoded in three bits, and which are not, then calculated from a prefix of '100', and one bit specifying if 8 or 9.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Decimal32 floating-point format

Start with the simplest possible case. Write down what Decimal32 floating-point format claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Decimal32 floating-point format before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Decimal32 floating-point format ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Decimal32 floating-point format

In research
Decimal32 floating-point format appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Decimal32 floating-point format in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Decimal32 floating-point format is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer arithmetic, Data types, Floating point types, so understanding it makes those chapters shorter.
In everyday life
Look for Decimal32 floating-point format outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Decimal32 floating-point format” →

How to study Decimal32 floating-point format in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Decimal32 floating-point format means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Decimal32 floating-point format out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Decimal32 floating-point format in simple terms?

In computing, decimal32 is a decimal floating-point computer numbering format that occupies 4 bytes (32 bits) in computer memory. Purpose and use Like the binary16 and binary32 formats, decimal32 uses less space than the actually most common format binary64.

Why does Decimal32 floating-point format matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Decimal32 floating-point format?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Decimal32 floating-point format.

Tags

  • Computer arithmetic
  • Data types
  • Floating point types

Keep exploring