Prévia do material em texto
Step 1 of 2 2.024E Below diagram shows circular modular representation. Addition & subtraction of numbers using circular modular representation is very easy. For example when the arrow is pointing to +2 and addition of +4 to that number can be done by moving the arrow up to 4 positions clockwise. Similarly for subtraction from any number can be done by moving the arrow in anticlockwise according to the number. The circular modular representation gives the correct result only if the numbers are small. 0000 0001 1111 0010 1110 +0 +1 +2 0011 -2 Subtraction 1101 of positive -3 +3 Addition of positive numbers 1100 -4 +4 0100 numbers -5 +5 1011 -6 0101 +6 -7 -8 +7 1010 0110 1001 0111 1000 Figure 1: Circular modular representation diagram Step 2 of 2 An overflow rule for addition of two's complement numbers in terms of circular modular operations are as follows, (i) If the arrow is pointing in +6 and need to add +2 causes overflow, since arrow cannot advance from +8, if so it will go to negative numbers gives the wrong result or we can say overflow occurs. Thus if the arrow is pointing to any number and adding a positive number causes overflow if the arrow is advanced through the +7 to -8 transition. (ii) If the arrow is in -6 and need to add -3(that is subtracting 3 from -6) with that causes overflow. Thus if the arrow is pointing to any number and adding a negative number (subtraction of positive number) causes overflow if the arrow is advance through the -8 to +7 transition.