menu
techminis

A naukri.com initiative

google-web-stories
Home

>

ML News

>

Learn with...
source image

Medium

1d

read

262

img
dot

Image Credit: Medium

Learn with me: Why use the two’s compliment ?

  • In a 3-bit integer system, initially representing only positive numbers allowed for 8 numbers from 0 to 7.
  • To represent negative integers in a 3-bit system, three methods were discussed: using the leftmost bit for sign (problems with dual representation of 0), 1's compliment (fixes dual representation but has overflow issues), and two's compliment.
  • Two's compliment method involves calculating 1's compliment and adding 1 to it, allowing for a single representation of 0 and enabling proper subtraction operations.
  • Two's compliment is preferred as it utilizes all 8 permutations in a 3-bit system, resolves the issue of dual representation of 0, and facilitates subtraction operations similar to binary addition.

Read Full Article

like

15 Likes

For uninterrupted reading, download the app