Presentation is loading. Please wait.

Presentation is loading. Please wait.

Finite Arithmetics of Integers FORTRAN codes: INTEGER*2INTEGER HTML HTML version.

Similar presentations


Presentation on theme: "Finite Arithmetics of Integers FORTRAN codes: INTEGER*2INTEGER HTML HTML version."— Presentation transcript:

1 Finite Arithmetics of Integers FORTRAN codes: INTEGER*2INTEGER HTML HTML version

2 value sign bit 2 n  1  1 to  2 n  1 value sign bit 0 0 000 88 1 000 +10001 11 1001 +20010 22 1010 +30011 33 1011 +40100 44 1100 +50101 55 1101 +60110 66 1110 +70111 77 1111 4-bit Integers

3 Crossing boundaries (1) 1+7  0111 2 + 0001 2  1000 2   8  1  8  1001 2 + 1000 2  10001 2  1000 2   8

4 Multiplication (division) by 2 3  2  left-shift 0011 2  0110 2  6 3/2  right-shift 0011 2  0001 2  1

5 Crossing boundaries (2) 4  2  L-S 0100 2  1000 2   8  8  2  L-S 1000 2  0000 2  0 For an n-bit object, 2 n  2  2  2 n  1 gives  2 n  1.  2 n  1  2 gives 0. codes


Download ppt "Finite Arithmetics of Integers FORTRAN codes: INTEGER*2INTEGER HTML HTML version."

Similar presentations


Ads by Google