Re: Bitwise problem
If i use '555', 2048 will be used instead of 128 because each number represents nibble.
Yes and No - it depends of program that you will make. You can operate with any bit that is higher or equal with highes possible bit of your variable.
We were talking about byte. You know byte consists of 8 bits. As a rule, processor is operating with bytes. 2 bytes = 16 bits, and highest one will be 32768.
You see, that is not so suitable to think in decimal system, so most programmers are thinking in hexadecimal system. It is much easer.
Look:
128 = 80h
Nibble is a half of a byte. So, there are 2 nibbles in byte. Hexadecimal number consists of two nibbles: 8 and 0 here.
There are 4 bits in nibble and to convert quickly you have to keep in mind only 4 numbers 1, 2, 4, 8.
So:
80h = (8+0+0+0) (0+0+0+0)=10000000b
71h = (0+4+2+1) (0+0+0+1)=01110001b
35h = (0+0+2+1) (0+4+0+1)=00110101b
7Bh = (0+4+2+1) (8+0+2+1)=01111011b
You see, it is very easy to convert from hex to bin and vica versa. So, try to think in hexadecimal system.
P.S. Hex system number sequence is: 1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,10,11, ... ,1D,1E,1F,20, ... ,FD,FE,FF,100,101, ...