Presentation is loading. Please wait.

Presentation is loading. Please wait.

Representation of Integers HKCE Computer Studies Education Department 2000.

Similar presentations


Presentation on theme: "Representation of Integers HKCE Computer Studies Education Department 2000."— Presentation transcript:

1

2 Representation of Integers HKCE Computer Studies Education Department 2000

3 Sign-and-magnitude 符號數值表示法 1 1 0 0 1 1 0 1 Sign 0 Pos 1 Neg Magnitude

4 3-bit example 011 010 001 000 +3+2+1+0+3+2+1+0 111 110 101 100 -3-2-1-0-3-2-1-0

5 011 010 001 000 100 101 110 111 +3 +2 +1 -2 -3 +0 or -0 ?

6 Two’s Complement 二進制補碼 counter on cassette recorder … 001 000 111... Play Reverse

7 011 010 001 000 100 101 110 111 Negative Positive +3 +2 +1 0 -2 -3 -4

8 2’s Complement of 1. Positive Number 2. Binary Format 3. Interchange 0’s and 1’s 4. Add 1 to code 25 00011001 11100110 11100111 - 25

9 2’s Complement of 1. Positive Number 2. Binary Format 3. Interchange 0’s and 1’s 4. Add 1 to code 103 01100111 10011000 10011001 - 103 Ex.

10 2’s Complement of 1. Positive Number 2. Binary Format 3. Interchange 0’s and 1’s 4. Add 1 to code 149 10010101 01101010 01101011 = +107 Why? - 149 Ex.

11 What is the decimal form of the 2’s complement value, 10101010 ?

12 Home Assignment Reply the email on home assignment. Visit the web pages in the email for the preparation of the next lesson.


Download ppt "Representation of Integers HKCE Computer Studies Education Department 2000."

Similar presentations


Ads by Google