Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Excess-3
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Representation== Biased codes are a way to represent values with a balanced number of positive and negative numbers using a pre-specified number ''N'' as a biasing value. Biased codes (and [[Gray code]]s) are non-weighted codes. In excess-3 code, numbers are represented as decimal digits, and each digit is represented by four [[bit]]s as the digit value plus 3 (the "excess" amount): * The smallest binary number represents the smallest value ({{nobr|0 β excess}}). * The greatest binary number represents the largest value ({{nobr|2<sup>''N''+1</sup> β excess β 1}}). {| class="wikitable" |+ Excess-3, and Stibitz code |- ! Decimal ! Excess-3 ! Stibitz ! [[BCD 8-4-2-1]] ! Binary ! 3-of-6 [[CCITT]] <br/>extension<ref name="CCITT_1959"/><ref name="Steinbuch_1962"/> ! 4-of-8 [[Hamming code|Hamming]] <br/>extension<ref name="Steinbuch_1962"/> |- align="center" | '''0''' | style="background:#0FF" | '''0011''' | '''0011''' | 0000 | 0000 | β¦'''10''' | β¦'''0011''' |- align="center" | '''1''' | style="background:#0F0" | '''0100''' | '''0100''' | 0001 | 0001 | β¦'''11''' | β¦'''1011''' |- align="center" | '''2''' | style="background:#FF0" | '''0101''' | '''0101''' | 0010 | 0010 | β¦'''10''' | β¦'''0101''' |- align="center" | '''3''' | style="background:#FF8000" | '''0110''' | '''0110''' | 0011 | 0011 | β¦'''10''' | β¦'''0110''' |- align="center" | '''4''' | style="background:#F00;" | '''0111''' | '''0111''' | 0100 | 0100 | β¦'''00''' | β¦'''1000''' |- align="center" | '''5''' | style="background:#F00;" | '''1000''' | '''1000''' | 0101 | 0101 | β¦'''11''' | β¦'''0111''' |- align="center" | '''6''' | style="background:#FF8000" | '''1001''' | '''1001''' | 0110 | 0110 | β¦'''10''' | β¦'''1001''' |- align="center" | '''7''' | style="background:#FF0" | '''1010''' | '''1010''' | 0111 | 0111 | β¦'''10''' | β¦'''1010''' |- align="center" | '''8''' | style="background:#0F0" | '''1011''' | '''1011''' | 1000 | 1000 | β¦'''00''' | β¦'''0100''' |- align="center" | '''9''' | style="background:#0FF" | '''1100''' | '''1100''' | 1001 | 1001 | β¦'''10''' | β¦'''1100''' |} To encode a number such as 127, one simply encodes each of the decimal digits as above, giving (0100, 0101, 1010). Excess-3 arithmetic uses different [[algorithm]]s than normal non-biased BCD or binary [[positional system]] numbers. After adding two excess-3 digits, the raw sum is excess-6. For instance, after adding 1 (0100 in excess-3) and 2 (0101 in excess-3), the sum looks like 6 (1001 in excess-3) instead of 3 (0110 in excess-3). To correct this problem, after adding two digits, it is necessary to remove the extra bias by subtracting binary 0011 (decimal 3 in unbiased binary) if the resulting digit is less than decimal 10, or subtracting binary 1101 (decimal 13 in unbiased binary) if an [[integer overflow|overflow]] (carry) has occurred. (In 4-bit binary, subtracting binary 1101 is equivalent to adding 0011 and vice versa.)<ref>{{cite book |title=Computer Architecture and Organization |last=Hayes |first=John P. |isbn=0-07-027363-4 |date=1978 |publisher=McGraw-Hill International Book Company |page=156}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)