0% found this document useful (0 votes)
392 views

Unsigned and Signed Addition - Subtraction - Division

This document discusses signed and unsigned addition. It explains that signed numbers use the most significant bit as a sign bit, where 1 represents negative and 0 represents positive. Signed numbers can range from -128 to 127. Unsigned numbers use carry flags to detect results larger than 255. The document provides an example each of unsigned addition, signed addition of like-signed numbers, and signed addition of unlike-signed numbers.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
392 views

Unsigned and Signed Addition - Subtraction - Division

This document discusses signed and unsigned addition. It explains that signed numbers use the most significant bit as a sign bit, where 1 represents negative and 0 represents positive. Signed numbers can range from -128 to 127. Unsigned numbers use carry flags to detect results larger than 255. The document provides an example each of unsigned addition, signed addition of like-signed numbers, and signed addition of unlike-signed numbers.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 6

Unsigned And Signed Addition:

Signed Bit use 7 as a Sign bit in the most significant byte (MSB) of the group of
bytes chosen by the programmer to represent the largest number to be needed by
the program. Bits 0 to 6 of the MSB, and any other byes, express the magnitude of
the number. Signed numbers use a 1 in bit position 7 of the MSB as a negative sign
and a 0 as a positive sign.
In signed form, a single byte number may range in size from 10000000b, which is
-128d to 01111111b, which is +127d. The number 00000000b is 000d and has a
positive sign, so there are 1287d negative numbers and 128d positive numbers.
Unsigned Addition:
Unsigned numbers make use of the carry flag to detect when the result of an ADD
operations is a number larger than FFh. IF the carry is set to one after an ADD, Then
the carry can be added to a higher order byte so that the sum is not lost.

95d = 01011111b
189d = 10111101b
-------- -----------------
284d 1 00011100b = 284d
The C flag is set to 1 to account for the carry out from the sum.

Signed Addition:

Signed numbers may be added two ways: addition of like signed numbers and
addition of unlike signed numbers. If unlike signed numbers are added, then it is not
possible for the result to be larger than -128d or +127d.

-001d = 11111111d
+027d = 00011011b
-------- -----------------
+026d 00011010b = +026d
Here, there is a carry from bit 7 so the carry flag is 1. There is also a carry from bit
6, and the OV flag is 0.

You might also like