1 / 24

1.6 Signed Binary Numbers

1.6 Signed Binary Numbers. 1.6 Signed Binary Numbers. 1 - Sign and Magnitude representation 2 - 1’s Complement Representation 3 - 2’s Complement Representation. Notes. 1 - The previous representation are the same for positive numbers and different for negative numbers.

kaden-head
Download Presentation

1.6 Signed Binary Numbers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 1.6 Signed Binary Numbers

  2. 1.6 Signed Binary Numbers 1 - Sign and Magnitude representation 2 - 1’s Complement Representation 3 - 2’s Complement Representation Notes 1 - The previous representation are the same for positive numbers and different for negative numbers 2 - For a signed binary number the most significant bit is used for representing the sign of the number We use 0 for positive numbers and 1 for negative numbers Example : represent +76

  3. Representing negative numbers in the previous three systems 1’s Complement of a negative number can be obtained by flipping all bits of the positive binary number 2’s Complement of a negative number can be obtained by adding 1 to the 1’s Complement or by flipping bits of the positive binary number after the first one from the right Example : represent -76

  4. Arithmetic Addition with Comparison Arithmetic Addition The addition of two numbers in the signed mgnitude system follow the rules of ordinary arithmetic. If the signed are the same, we add the two magnitudes and give the sum the common sign. If the signed are different, we subtract the smaller magnitude from the larger and give the difference the sign of the larger magnitude. EX. (+25) + (-38) = -(38 - 25) = -13

  5. Arithmetic Addition without Comparison The addition of two signed binary number with negative numbers represented in signed 2’s complement form is obtained from the addition of the two numbers, including their signed bits. A carry out of the signed bit position is discarded (note that the 4th case).

  6. Arithmetic Addition without Comparison     06 00000110 06 11111010     13 00001101 13 00001101     19 00010011 07 00000111     06 00000110 06 11111010     13 11110011 13 11110011     07 11111001 19 11101101 6

  7. Arithmetic Subtraction (+/-) A – (+B)= (+/-) A + (-B) (+/-) A – (-B)= (+/-) A + (+B) Example (-6) – (-13)= +7 In binary: (1111010 – 11110011)= (1111010 + 00001101) =100000111 after removing the carry out the result will be : 00000111

  8. 1.7 Binary Codes

  9. Binary Coded Decimal (BCD)

  10. Binary Coded Decimal (BCD) in this system each digit is represented in 4 bits For example : to represent in BCD

  11. BCD Addition Example : Evaluate the following operations in BCD System 1 – 3 + 4 2 – 4 + 8 3 - 148 + 576

  12. BCD Addition Example : Evaluate the following operations in BCD System 1 – 3 + 4 2 – 4 + 8 3 - 148 + 576 Error We must add 6 (0110) to the result

  13. BCD Addition Example : Evaluate the following operations in BCD System 1 – 3 + 4 2 – 4 + 8 3 - 184 + 576

  14. Notes 1 – In BCD Addition , we add (0110)=(6) if the result value was greater than (1001)=(9) or if the result was more than 4 digits In previous Example we added 0110 when the result was 1 - greater than 9 (1001) 2 - more than 4 digits (10000) Note : result more than 4 digit is greater than 9(1001) 

  15. Decimal Arithmetic Addition for signed numbers Example: (+375) + (- 240) = + 135 in BCD • Apply 10‘s complement to the negative number only. • Addition is done by summing all digits,including the sign digit,and discarding the end carry 0 375 +9 760 ------------ 0 135

  16. Decimal Arithmetic • Subtraction for signed and unsigned numbers • Apply 10‘s complement to the subtrahend and apply addition (same as binary case)

  17. Excess-3 (ex-3) Excess-three (ex-3)is another system to represent a number (ex-3) is like (BCD) in the way of representing number i.e. each digit is represented in 4 bits Except that : each digit is firstly incremented by three For example : to represent in ex-3

  18. Gray Code

  19. ASCII character code ASCII : American Standard Codefor Information Interchange ASCII code is used to represent characters , Symbols , … ASCII code consists of 7-bits (to represent 128 character) Upper case Letters are represented by ASCII (65 : 90) Lower case Letters are represented by ASCII (97 : 122)

  20. Error Detecting Code with even parity with odd parity ASCII A 1000001 01000001 11000001 ASCII T 1010100 11010100 01010100

  21. For more information about Number Systems and Conversations between them Check these 1 – Our Logic Book 2 - Computer Organization's Lectures 3 – Any other References

More Related