Difference between revisions of "Template:Densely packed decimal"

From blackwiki
Jump to navigation Jump to search
(Undid revision 620789947 by User:Dazitzel; it seems unnecessarily verbose., as the control bits are already quite prominently displayed. Underlined (8-9) to make things even clearer.)
imported>Matthiaspaul
(CE)
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{| class="wikitable" border="1" style="text-align:center"
+
{| class="wikitable" style="text-align:center"
|+Densely packed decimal encoding rules<ref name=Cowlishaw2000>{{cite web |url=http://speleotrove.com/decimal/DPDecimal.html |title=Summary of Densely Packed Decimal encoding |last=Cowlishaw |first=M. F. |authorlink=Mike Cowlishaw |date=2000-10-03 |accessdate=2008-09-10}}</ref>
+
|+Densely packed decimal encoding rules<ref name="Cowlishaw_2000">{{cite web |author-first=Michael Frederic |author-last=Cowlishaw |author-link=Michael Frederic Cowlishaw |publisher=[[IBM]] |title=A Summary of Densely Packed Decimal encoding |orig-year=2000-10-03 |date=2007-02-13 |url=http://speleotrove.com/decimal/DPDecimal.html |access-date=2016-02-07 |url-status=live |archive-url=https://web.archive.org/web/20150924145411/http://speleotrove.com/decimal/DPDecimal.html |archive-date=2015-09-24}}</ref>
 
|-
 
|-
!scope="col" colspan="10"| DPD encoded value
+
! scope="col" colspan="11"|DPD encoded value
|rowspan="10"|
+
| rowspan="10"|
!scope="col" colspan="5"| Decimal digits
+
! scope="col" colspan="6"|Decimal digits
 
|-
 
|-
!scope="col"| b9 !!scope="col"| b8 !!scope="col"| b7 !!scope="col"| b6 !!scope="col"| b5
+
! scope="col"|Code&nbsp;space (1024&nbsp;states<!-- 0..1023 -->)
!scope="col"| b4 !!scope="col"| b3 !!scope="col"| b2 !!scope="col"| b1 !!scope="col"| b0
+
! scope="col"|b9 !! scope="col"|b8 !! scope="col"|b7 !! scope="col"|b6 !! scope="col"|b5
!scope="col"| d2 !!scope="col"| d1 !!scope="col"| d0
+
! scope="col"|b4 !! scope="col"|b3 !! scope="col"|b2 !! scope="col"|b1 !! scope="col"|b0
!scope="col"| Values encoded
+
! scope="col"|d2 !! scope="col"|d1 !! scope="col"|d0
!scope="col"| Description
+
! scope="col"|Values encoded
 +
! scope="col"|Description
 +
! scope="col"|Occurrences (1000&nbsp;states<!-- 000..999 -->)
 
|-
 
|-
|style="background:#cef2e0"|a||style="background:#cef2e0"|b||style="background:#cef2e0"|c||style="background:#cedff2"|d||style="background:#cedff2"|e||style="background:#cedff2"|f||'''0'''||style="background:#ddcef2"|g||style="background:#ddcef2"|h||style="background:#ddcef2"|i||style="background:#cef2e0"|0'''abc'''||style="background:#cedff2"|0'''def'''||style="background:#ddcef2"|0'''ghi'''||(0–7) (0–7) (0–7) || Three small digits
+
| 50.0% (512&nbsp;states)
 +
| style="background:#cef2e0"|a || style="background:#cef2e0"|b || style="background:#cef2e0"|c || style="background:#cedff2"|d || style="background:#cedff2"|e || style="background:#cedff2"|f || '''0''' || style="background:#ddcef2"|g || style="background:#ddcef2"|h || style="background:#ddcef2"|i || style="background:#cef2e0"|0'''abc''' || style="background:#cedff2"|0'''def''' || style="background:#ddcef2"|0'''ghi''' || (0–7) (0–7) (0–7) || Three small digits
 +
| 51.2% (512&nbsp;states)
 
|- style="background:#f2f2f2"
 
|- style="background:#f2f2f2"
|style="background:#cef2e0"|a||style="background:#cef2e0"|b||style="background:#cef2e0"|c||style="background:#cedff2"|d||style="background:#cedff2"|e||style="background:#cedff2"|f||'''1'''||'''0'''||'''0'''||style="background:#ddcef2"|i||style="background:#cef2e0"|0'''abc'''||style="background:#cedff2"|0'''def'''||style="background:#ddcef2"|100'''i'''||(0–7) (0–7) {{Uu|(8–9)}} ||rowspan=3| Two small digits,<br/>one large
+
| rowspan=3|37.5% (384&nbsp;states)
 +
| style="background:#cef2e0"|a || style="background:#cef2e0"|b || style="background:#cef2e0"|c || style="background:#cedff2"|d || style="background:#cedff2"|e || style="background:#cedff2"|f || '''1''' || '''0''' || '''0''' || style="background:#ddcef2"|i || style="background:#cef2e0"|0'''abc''' || style="background:#cedff2"|0'''def''' || style="background:#ddcef2"|100'''i''' || (0–7) (0–7) (8–9) || rowspan=3| Two small digits,<br/>one large
 +
| rowspan=3|38.4% (384&nbsp;states)
 
|- style="background:#f2f2f2"
 
|- style="background:#f2f2f2"
|style="background:#cef2e0"|a||style="background:#cef2e0"|b||style="background:#cef2e0"|c||style="background:#ddcef2"|g||style="background:#ddcef2"|h||style="background:#cedff2"|f||'''1'''||'''0'''||'''1'''||style="background:#ddcef2"|i||style="background:#cef2e0"|0'''abc'''||style="background:#cedff2"|100'''f'''||style="background:#ddcef2"|0'''ghi'''||(0–7) {{Uu|(8–9)}} (0–7)
+
| style="background:#cef2e0"|a || style="background:#cef2e0"|b || style="background:#cef2e0"|c || style="background:#ddcef2"|g || style="background:#ddcef2"|h || style="background:#cedff2"|f || '''1'''||'''0'''||'''1''' || style="background:#ddcef2"|i || style="background:#cef2e0"|0'''abc''' || style="background:#cedff2"|100'''f''' || style="background:#ddcef2"|0'''ghi''' || (0–7) (8–9) (0–7)
 
|- style="background:#f2f2f2"
 
|- style="background:#f2f2f2"
|style="background:#ddcef2"|g||style="background:#ddcef2"|h||style="background:#cef2e0"|c||style="background:#cedff2"|d||style="background:#cedff2"|e||style="background:#cedff2"|f||'''1'''||'''1'''||'''0'''||style="background:#ddcef2"|i||style="background:#cef2e0"|100'''c'''||style="background:#cedff2"|0'''def'''||style="background:#ddcef2"|0'''ghi'''||{{Uu|(8–9)}} (0–7) (0–7)
+
| style="background:#ddcef2"|g || style="background:#ddcef2"|h || style="background:#cef2e0"|c || style="background:#cedff2"|d || style="background:#cedff2"|e || style="background:#cedff2"|f || '''1''' || '''1''' || '''0''' || style="background:#ddcef2"|i || style="background:#cef2e0"|100'''c''' || style="background:#cedff2"|0'''def''' || style="background:#ddcef2"|0'''ghi''' || (8–9) (0–7) (0–7)
 
|-
 
|-
|style="background:#ddcef2"|g||style="background:#ddcef2"|h||style="background:#cef2e0"|c||'''0'''||'''0'''||style="background:#cedff2"|f||'''1'''||'''1'''||'''1'''||style="background:#ddcef2"|i||style="background:#cef2e0"|100'''c'''||style="background:#cedff2"|100'''f'''||style="background:#ddcef2"|0'''ghi'''||{{Uu|(8–9)}} {{Uu|(8–9)}} (0–7) ||rowspan=3| One small digit,<br/>two large
+
| rowspan=3|9.375% (96&nbsp;states)
 +
| style="background:#ddcef2"|g || style="background:#ddcef2"|h || style="background:#cef2e0"|c || '''0''' || '''0''' || style="background:#cedff2"|f || '''1''' || '''1''' || '''1''' || style="background:#ddcef2"|i || style="background:#cef2e0"|100'''c''' || style="background:#cedff2"|100'''f''' || style="background:#ddcef2"|0'''ghi''' || (8–9) (8–9) (0–7) || rowspan=3| One small digit,<br/>two large
 +
| rowspan=3|9.6% (96&nbsp;states)
 
|-
 
|-
|style="background:#cedff2"|d||style="background:#cedff2"|e||style="background:#cef2e0"|c||'''0'''||'''1'''||style="background:#cedff2"|f||'''1'''||'''1'''||'''1'''||style="background:#ddcef2"|i||style="background:#cef2e0"|100'''c'''||style="background:#cedff2"|0'''def'''||style="background:#ddcef2"|100'''i'''||{{Uu|(8–9)}} (0–7) {{Uu|(8–9)}}
+
| style="background:#cedff2"|d || style="background:#cedff2"|e || style="background:#cef2e0"|c || '''0''' || '''1''' || style="background:#cedff2"|f || '''1''' || '''1''' || '''1''' || style="background:#ddcef2"|i || style="background:#cef2e0"|100'''c''' || style="background:#cedff2"|0'''def''' || style="background:#ddcef2"|100'''i''' || (8–9) (0–7) (8–9)
 
|-
 
|-
|style="background:#cef2e0"|a||style="background:#cef2e0"|b||style="background:#cef2e0"|c||'''1'''||'''0'''||style="background:#cedff2"|f||'''1'''||'''1'''||'''1'''||style="background:#ddcef2"|i||style="background:#cef2e0"|0'''abc'''||style="background:#cedff2"|100'''f'''||style="background:#ddcef2"|100'''i'''||(0–7) {{Uu|(8–9)}} {{Uu|(8–9)}}
+
| style="background:#cef2e0"|a || style="background:#cef2e0"|b || style="background:#cef2e0"|c || '''1''' || '''0''' || style="background:#cedff2"|f || '''1''' || '''1''' || '''1''' || style="background:#ddcef2"|i || style="background:#cef2e0"|0'''abc''' || style="background:#cedff2"|100'''f''' || style="background:#ddcef2"|100'''i''' || (0–7) (8–9) (8–9)
 
|- style="background:#f2f2f2"
 
|- style="background:#f2f2f2"
|x||x||style="background:#cef2e0"|c||'''1'''||'''1'''||style="background:#cedff2"|f||'''1'''||'''1'''||'''1'''||style="background:#ddcef2"|i||style="background:#cef2e0"|100'''c'''||style="background:#cedff2"|100'''f'''||style="background:#ddcef2"|100'''i'''||{{Uu|(8–9)}} {{Uu|(8–9)}} {{Uu|(8–9)}} || Three large digits
+
| 3.125% (32&nbsp;states, 8&nbsp;used)
 +
| x || x || style="background:#cef2e0"|c || '''1''' || '''1''' || style="background:#cedff2"|f || '''1''' || '''1''' || '''1''' || style="background:#ddcef2"|i || style="background:#cef2e0"|100'''c''' || style="background:#cedff2"|100'''f''' || style="background:#ddcef2"|100'''i''' || (8–9) (8–9) (8–9) || Three large digits, bits b9 and b8 are [[don't care]]
 +
| 0.8% (8&nbsp;states)
 
|}<noinclude>
 
|}<noinclude>
  
Line 34: Line 44:
 
== References ==
 
== References ==
 
{{reflist}}
 
{{reflist}}
 
+
* {{cite journal |title=Densely Packed Decimal Encoding |author-first=Michael Frederic |author-last=Cowlishaw |author-link=Michael Frederic Cowlishaw |journal=[[IEE Proceedings Computers and Digital Techniques]] |volume=149 |issue=3 |pages=102–104 |publisher=[[Institution of Electrical Engineers]] (IEE) |date=May 2002 |issn=1350-2387 |doi=10.1049/ip-cdt:20020407 |url=http://ieeexplore.ieee.org/xpl/login.jsp?reload=true&arnumber=1008829 |access-date=2016-02-07}}
*{{cite journal |last=Cowlishaw |first=M. F. |authorlink=Mike Cowlishaw |title=Densely packed decimal encoding |journal=IEE Proceedings &ndash; Computers and Digital Techniques |issn=1350-2387 |volume=149 |issue=3 |pages=102–104 |publisher=[[Institution of Electrical Engineers]] | date=May 2002 |doi=10.1049/ip-cdt:20020407}}
+
* {{cite web |title=Packed Decimal Encoding IEEE-754r |author-first=Jo H. M. |author-last=Bonten |orig-year=2006-10-05 |date=2007-07-18 |url=http://home.hetnet.nl/~jhm.bonten/computers/bitsandbytes/wordsizes/ibmpde.htm#dense |access-date=2008-09-10 |url-status=dead |archive-url=https://web.archive.org/web/20070824053303/http://home.hetnet.nl/mr_1/81/jhm.bonten/computers/bitsandbytes/wordsizes/ibmpde.htm |archive-date=2007-08-24}}
*{{cite web |url=http://home.hetnet.nl/~jhm.bonten/computers/bitsandbytes/wordsizes/ibmpde.htm#dense |title=Packed Decimal Encoding IEEE-754r |first=J.H.M. |last=Bonten |archiveurl=http://web.archive.org/web/20070824053303/http://home.hetnet.nl/mr_1/81/jhm.bonten/computers/bitsandbytes/wordsizes/ibmpde.htm |archivedate=2007-08-24 |accessdate=2008-09-10}}
 
 
</noinclude>
 
</noinclude>

Latest revision as of 13:03, 24 June 2020

Densely packed decimal encoding rules[1]
DPD encoded value Decimal digits
Code space (1024 states) b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 d2 d1 d0 Values encoded Description Occurrences (1000 states)
50.0% (512 states) a b c d e f 0 g h i 0abc 0def 0ghi (0–7) (0–7) (0–7) Three small digits 51.2% (512 states)
37.5% (384 states) a b c d e f 1 0 0 i 0abc 0def 100i (0–7) (0–7) (8–9) Two small digits,
one large
38.4% (384 states)
a b c g h f 1 0 1 i 0abc 100f 0ghi (0–7) (8–9) (0–7)
g h c d e f 1 1 0 i 100c 0def 0ghi (8–9) (0–7) (0–7)
9.375% (96 states) g h c 0 0 f 1 1 1 i 100c 100f 0ghi (8–9) (8–9) (0–7) One small digit,
two large
9.6% (96 states)
d e c 0 1 f 1 1 1 i 100c 0def 100i (8–9) (0–7) (8–9)
a b c 1 0 f 1 1 1 i 0abc 100f 100i (0–7) (8–9) (8–9)
3.125% (32 states, 8 used) x x c 1 1 f 1 1 1 i 100c 100f 100i (8–9) (8–9) (8–9) Three large digits, bits b9 and b8 are don't care 0.8% (8 states)

Information

This is for transclusion in Densely packed decimal, Decimal32, Decimal64 and Decimal128. Only the table, above, will be included.

References

  1. Cowlishaw, Michael Frederic (2007-02-13) [2000-10-03]. "A Summary of Densely Packed Decimal encoding". IBM. Archived from the original on 2015-09-24. Retrieved 2016-02-07.