Clarification on bitstrings

Hello to all,

if I have a 32-bit unsigned integer x presented as a sequence of bits for example

1
2
3
4
5


 00000000001111111111000000000011

 


Then what does happen to it if I subtract one like x-1 ? How will x be represented after that? Is it ~x+1 ?
00000000001111111111000000000011
- 00000000000000000000000000000001
-------------------------------------------------------
00000000001111111111000000000010


search for boolean algebra tutorial
or just some video:
https://www.youtube.com/watch?v=S9LJknZTyos
Sorry, but I don`t think I get the point here.

Suppose I write something like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

 typedef unsigned long long x;  // 64 bits

    x

. . . . . . . .     
. . 1 . 1 . . .    
. 1 . . . 1 . .    
. . . . . . . .     
. 1 . . . 1 . .  
. . 1 . 1 . . .    
. . . . . . . .    
. . . . . . . .    


 



where x is some arbitrary set. What does happen to the above set if takes

x-1?
Last edited on
Please, how do I substract binary strings on two`s complement number system?
Topic archived. No new replies allowed.