Department of Computer Science and Information EngineeringNational Cheng Kung University, TAIWAN
HANEL
SIGNED ARITHMETIC
INSTRUCTIONSSigned 8-bit Operands(cont’)
Show how the 8051 would represent -34HSolution:1.
0011 0100 34H given in binary
2.1100 1011 invert each bit
3.1100 1100 add 1 (which is CC in hex)
Signed number representation of -34 in 2’s complement is CCHDecimalBinaryHex-1281000 000080-1271000 000181-1261000 001082...... ......-21111 1110FE-11111 1111FF00000 000000+10000 000101+20000 001002...... ......+1270111 11117F