| ??? 07/11/00 13:36 Read: times |
#3658 - RE: 32 bit microprocessor |
> What exactly is a sighned number? One of the bits represents a > positive or negative number? The high bit does tell if the number is negative or not. If the high bit is zero, then the number is either zero or positive. > Why does taking two's complement of some numbers give the > magnitude? Would $FE have a magnitude of 1? Would the MSB > for $FE represent -. The magnatude of $FE is 2. The decimal equivalent goes like... $7F == +127 $7E == +126 ... $02 == +2 $01 == +1 $00 == 0 $FF == -1 $FE == -2 ... $F1 == -127 $F0 == -128 This way of doing signed numbers is natural for the computer. Adding 1($01) to -1($ff) naturaly gives you zero. The addition result is the same no matter if you think of $01 and $ff as unsigned or signed integers. What you need to watch out for are overflow conditions. Since the range of numbers is different between signed and unsigned, the results and overflow/underflow conditions are slightly different. If you add $71 to $63, you get $D4. $D4 is correct for an unsigned number, but an over/underflow condition happened if viewed as being a signed number. For doing things like multiply or divide of multi byte signed integers gets somewhat tricky. Usually, the numbers are converted into unsigned numbers before doing the actual multiply or divide and the proper sign is given to the result. <>< Lance. |
| Topic | Author | Date |
| 32 bit microprocessor | 01/01/70 00:00 | |
| RE: 32 bit microprocessor | 01/01/70 00:00 | |
| RE: 32 bit microprocessor | 01/01/70 00:00 | |
| RE: 32 bit microprocessor | 01/01/70 00:00 | |
| RE: 32 bit microprocessor | 01/01/70 00:00 | |
| RE: 32 bit microprocessor | 01/01/70 00:00 | |
| RE: 32 bit microprocessor | 01/01/70 00:00 | |
RE: 32 bit microprocessor | 01/01/70 00:00 |



