answersLogoWhite

0

AllQ&AStudy Guides
Best answer

From right to left, you have the 1's bit, the 2's bit, the 4's bit and the 8's bit. If there's a 1 in the 1's bit, add 1. If there's a 1 in the 2's bit, add 2. If there's a 1 in the 4's bit, add 4. If there's a 1 in the 8's bit, add 8.

This answer is:
Related answers

From right to left, you have the 1's bit, the 2's bit, the 4's bit and the 8's bit. If there's a 1 in the 1's bit, add 1. If there's a 1 in the 2's bit, add 2. If there's a 1 in the 4's bit, add 4. If there's a 1 in the 8's bit, add 8.

View page

I assume you mean a binary representation of a number.
The "least significant bit" (usually the one to the far right but in some languages it has another placement) is "ones"
the next most significant bit are the twos
The third most significant bit are the fours
etc.

So if your number is 37
there is one 32 (the sixth most significant bit)
no 16's (the fifth most significant bit)
no 8's (the fourth most significant bit)
one 4 (the third most significant bit)
no 2's (the second most significant bit)
one 1 (the least most significant bit)

if we are to fill an 8 bit "word " we get:
0010 0101

View page

The bitwise complement or one's complement operator (~) is used to switch the state of all the bits in a value. Thus 1's become 0, and 0's become 1.

One of its many uses is to unset individual bit(s) in a bitmap. We do this with a bitwise AND of the bitmap and the bitwise complement of the bit(s) we want to unset.

Original bitmap: 01011100

Bit to unset: 00000100 (e.g., bit 2 (bits are zero based from right))

// Using one's complement and bitwise AND

~00000100 & 01011100

11111011 (one's complement of bit 2)

&

01011100 (original bitmap)

=

01011000 (original bitmap with bit 2 unset)

Note that this formula works even if bit 2 were already unset:

11111011 (one's complement of bit 2)

&

01011000 (original bitmap, with bit 2 unset)

=

01011000 (original bitmap unchanged)

View page

Dali cu ja bit s kubom

View page

A bit works by the comprehensive system dividing multiple amouts of 1's and 0's into their appropriate command.

View page
Featured study guide
📓
See all Study Guides
✍️
Create a Study Guide
Search results