Origin
The register width of a processor determines the range of values that can be represented. Typical binary register widths include:
- 8 bits: maximum representable value 28 − 1 = 255
- 16 bits: maximum representable value 216 − 1 = 65,535
- 32 bits: maximum representable value 232 − 1 = 4,294,967,295 (the most common width for personal computers as of 2005),
- 64 bits: maximum representable value 264 − 1 = 18,446,744,073,709,551,615 (the most common width for personal computers, but not necessarily their operating systems, as of 2012),
- 128 bits: maximum representable value 2128 − 1 = 340,282,366,920,938,463,463,374,607,431,768,211,455
Since an arithmetic operation may produce a result larger than the maximum representable value, a potential error condition may result. In the C programming language, signed integer overflow causes undefined behavior, while unsigned integer overflow causes the number to be reduced modulo a power of two, meaning that unsigned integers "wrap around" on overflow. This "wrap around" is the cause of the famous "Split Screen" in Pac-Man. A "wrap around" corresponds to the fact, that e.g. if the addition of two positive integers produces an overflow, it may result in a negative number. In counting, one just starts over again from the bottom. Example: 16 bit signed integer: 30000 + 30000 = −5536.
In computer graphics or signal processing, it is typical to work on data that ranges from 0 to 1 or from −1 to 1. An example of this is a grayscale image where 0 represents black, 1 represents white, and values in-between represent varying shades of gray. One operation that one may want to support is brightening the image by multiplying every pixel by a constant. Saturated arithmetic allows one to just blindly multiply every pixel by that constant without worrying about overflow by just sticking to a reasonable outcome that all these pixels larger than 1 (i.e. "brighter than white") just become white and all values "darker than black" just become black.
Read more about this topic: Integer Overflow
Famous quotes containing the word origin:
“The real, then, is that which, sooner or later, information and reasoning would finally result in, and which is therefore independent of the vagaries of me and you. Thus, the very origin of the conception of reality shows that this conception essentially involves the notion of a COMMUNITY, without definite limits, and capable of a definite increase of knowledge.”
—Charles Sanders Peirce (18391914)
“Someone had literally run to earth
In an old cellar hole in a byroad
The origin of all the family there.
Thence they were sprung, so numerous a tribe
That now not all the houses left in town
Made shift to shelter them without the help
Of here and there a tent in grove and orchard.”
—Robert Frost (18741963)
“Each structure and institution here was so primitive that you could at once refer it to its source; but our buildings commonly suggest neither their origin nor their purpose.”
—Henry David Thoreau (18171862)