1 / 14

1’s and 2’s complement

1’s and 2’s complement. One’s Complement (4-bit binary). ( + )  ditulis seperti biasa ( - )  “1” diubah menjadi “0” dan “0” diubah menjadi “1”. Two’s Complement (4-bit binary). ( + )  ditulis seperti biasa ( - )  “1” diubah menjadi “0” dan “0” diubah menjadi “1”

Download Presentation

1’s and 2’s complement

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’s and 2’s complement

  2. One’s Complement (4-bit binary) ( + )  ditulissepertibiasa ( - )  “1” diubahmenjadi “0” dan “0” diubahmenjadi “1”

  3. Two’s Complement (4-bit binary) ( + )  ditulissepertibiasa ( - )  “1” diubahmenjadi “0” dan “0” diubahmenjadi “1” Tambahkan “1”

  4. Contoh 2’s Complement Desimal = (+5) Binary = 0101 Desimal = (-5) Binary : Ubahke binary biasa = 0101 Ganti “0” menjadi “1” dan “1” menjadi “0” = 1010 Tambahkandengan “1” = 1011

  5. Penjumlahanpada binary • 0 + 0 = 0 • 0 + 1 = 1 • 1 + 0 = 1 • 1 + 1 = 0, and carry 1 to the next more significant bit

  6. Contohpenjumlahan binary 1 1 0  0  0  1  1  0  1  0   =   26 + 0  0  0  0  1  1  0  0   =   12 0  0  1  0  0  1  1  0   =   38

  7. Penguranganpada binary • 0 - 0 = 0 • 0 - 1 = 1, and borrow 1 from the next more significant bit • 1 - 0 = 1 • 1 - 1 = 0

  8. Contohpengurangan binary

  9. Penjumlahanpada 1’s complement 6 + 3 = …. 6 - 3 = …. 6 - 3 ---- 3 6 3 == 9 0110 - 0011 0011

  10. Penguranganpada 1’s complement 1 2 3 overflow 4 5

  11. Penguranganpada 1’s complement

  12. Penjumlahanpada2’s complement 5 +2 = … 0101 5 + 0010 2 0111 7 5 + (-2) = … 0101 5 + 1110 -2 10011 3

  13. Penguranganpada 2’s complement

  14. Penguranganpada 2’s complement Overflow : Discard!!!

More Related