How to find 1’s complement of a number

Posted on

Discover 1’s complement of a quantity

 

Algorithm for locating 1’s Complement

 

Step I : Initialize the information reminiscence.

Step II : Load the quantity in AX.

Step III : Initialize counter = 16.

Step IV : Rotate quantity by 1 bit place to left with carry.

Step V : Complement carry.

Step VI : Decrement counter.

Step VII : Test if rely = 0. If sure, go to step VIII else goto Step IV.

Step VIII : Rotate quantity by 1 bit place to left with carry to revive unique carry again.

Step IX : Show 1’s complement.

Step X : Cease.

Program Code 1’s complement of a quantity:

 

Supply projectgeek.com