Sign extension

Sign extension

Sign extension is the operation, in computer arithmetic, of increasing the number of bits of a binary number while preserving the number's sign (positive/negative). This is done by appending digits to the most significant side of the number, following a procedure dependent on the particular signed number representation used.

For example, if six bits are used to represent the number +10 (binary: 001010) and the sign extend operation increases the word length to 16 bits, then the new representation is simply 0000 0000 0000 1010 (assuming the left side is the most significant bit). Thus, the fact that the original value was positive is still maintained. If ten bits are used to represent the value -15 using two's complement (11 1111 0001), and again sign extend to 16 is used, the new representation would be 1111 1111 1111 0001. Thus, by padding the left side with ones, the negativeness of the original number is maintained.

In the x86 instruction set, used by the main microprocessors of all common PCs, there are two ways of doing sign extension:
* using the instructions cbw, cwd, cwde, and cdq ("convert byte to word", "c. word to doubleword", "c. w. to extended dw.", and "c. dw. to quadword", respectively; in the x86 context, a byte has 8 bits, a word 16 bits, a doubleword and extended doubleword 32 bits, and a quadword 64 bits);
* using one of the sign extended moves, accomplished by the movsx ("move with sign extension") family of instructions.

References

* Mano, Morris M.; Kime, Charles R. (2004). "Logic and Computer Design Fundamentals" (3rd ed.), pp 453. Pearson Prentice Hall. ISBN 0-13-140539-X.


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • extension — Extension. s. f. v. Estenduë, Tout corps a extension. on ne peut s imaginer qu il y ait de la quantité, où il n y a point d extension. On dit fig. Extension de privilege, extension d authorité, pour dire, Augmentation d authorité, augmentation de …   Dictionnaire de l'Académie française

  • Sign — Any abnormality that indicates a disease process, such as a change in appearance, sensation, or function, that is observed by a physician when evaluating a patient. * * * 1. Any abnormality indicative of disease, discoverable on examination of… …   Medical dictionary

  • sign — {{Roman}}I.{{/Roman}} noun 1 sth that shows that sth exists/may happen ADJECTIVE ▪ classic, clear, definite, distinct, obvious, real, sure, telltale, unmistakable …   Collocations dictionary

  • Sign relation — A sign relation is the basic construct in the theory of signs, also known as semeiotic or semiotics, as developed by Charles Sanders Peirce.AnthesisThus, if a sunflower, in turning towards the sun, becomes by that very act fully capable, without… …   Wikipedia

  • Extension (semantics) — In any of several studies that treat the use of signs, for example in linguistics, logic, mathematics, semantics, and semiotics, the extension of a concept, idea, or sign consists of the things to which it applies, in contrast with its… …   Wikipedia

  • Sign, toe — An important neurologic test based upon what the toes do when the sole of the foot is stimulated. If the big toe goes up, that may mean trouble. The toe sign, also called the Babinski reflex, is obtained by stimulating the external portion (the… …   Medical dictionary

  • extension — noun 1 (BrE) part added to a building ⇨ See also ↑addition ADJECTIVE ▪ planned, proposed ▪ home, kitchen ▪ one storey, two storey …   Collocations dictionary

  • Sign, Babinski — A neurologic reflex that constitutes an important medical examination based upon what the big toe does when the sole of the foot is stroked. If the big toe goes up, that may well mean trouble. The Babinski sign is obtained by stimulating the… …   Medical dictionary

  • Street sign theft — occurs when street signs are stolen, often to be used as decorations, but also sometimes to avoid obeying the law by claiming later the sign was not there.Fact|date=January 2008 Although the theft often seems arbitrary, unusual or amusing signs… …   Wikipedia

  • Little River Extension — Infobox road highway name = Ganatchio Trail Little River Extension marker alternate name = Little River Bike Trail, Little River Parkway length = 4.0 km (2.5 miles) direction = North/South starting terminus = Roundabout/traffic circle with… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”