Questions tagged [bit]

A bit is a single binary digit.

A bit refers to a single binary digit, the smallest possible amount of information. In print is usually represented as either 0 or 1, with many different representations in technology, like the presence or absence of an electric current or magnetic field.

Eight bits form a single , although historically the term has been used for other sizes as well.

3593 questions
1
vote
1 answer

Identify values in BitValue column

Note: I'm not sure how best to title and tag this question so helpful edits welcome! I am reverse engineering an ASP.NET Webforms website (for which I don't have the correct version of the source code) to ASP.NET MVC using database first entity…
Ego Placebo
  • 157
  • 2
  • 14
1
vote
1 answer

32 bits and 64 bits architecture

In here, the results turn out to be 3 and 1, which makes sense to me. However, when the code is run on 64 bits architecture, the result becomes 3 and 2. Could you explain why this happens? #include void print(int* a) { int len =…
Nathan Lee
  • 75
  • 1
  • 3
  • 10
1
vote
1 answer

How To Have Modular Dependency Registration in Different Projects in Bit-Framework?

I have many projects in a solution that use bit-framework. I need to register Interfaces in each projects, and have Modular Registration. How can do that?
1
vote
1 answer

JavaScript bitwise NOT ~ doesn't produce same result

I am attempting to invert the binary digits of a base-10 value using JavaScript, according to this W3Schools page, JavaScript's Bitwise NOT operator (i.e. ~) should do just that. In an example they show ~5 resulting in a value of 10, but when I…
Brendan Whiting
  • 494
  • 3
  • 13
1
vote
2 answers

Decoding bit to find string - Requesting Huffman technique

I am trying to build a decoder for example a 100100 b 100101 c 110001 d 100000 [newline] 111111 p 111110 q 000001 The encode bits: 111110000001100100111111100101110001111110 This…
saravana14
  • 35
  • 1
  • 5
1
vote
0 answers

How to represent Binary Matrix with {0,1} bits as elements?

I written an error correction code which uses a binary generator matrix(which i have declared and initialized within the code) in which each individual element in the matrix is declared as an int(as far as i understand that the size of int in xilix…
4am
  • 105
  • 1
  • 3
  • 11
1
vote
0 answers

memcpy for bits instead of bytes

How can I do memcpy but for bits instead of bytes? Here is a mockup function I wrote. It is probably not very efficient. How would you do that ? Is there a better or more efficient way? void * memcpyBits ( void * destination, // pointer to bytes…
user1219721
  • 783
  • 1
  • 8
  • 16
1
vote
1 answer

Floating Point representation in Binary

I'm trying to print the a number stored in floating point in C and I'm struggling how to print it out. I'm doing this right now which prints the number in IEEE format. I want it printed in reverse straight from memory. How can I fix it? Thanks void…
karan1525
  • 19
  • 2
1
vote
2 answers

Use of and with negation of the number

I read this line somewhere and I can't figure out its use private void bitUpdate(int[] bit, int idx, int val) { while (idx < bit.length) { bit[idx] += val; if (bit[idx] >= MOD) bit[idx]…
nothing1
  • 23
  • 5
1
vote
2 answers

Sign extending to 32 bits, starting with n bits - C

I am new to C and getting some practice with bit manipulation. Suppose I have an n bit two's complement number such that n > 0 and n < 31. If I know the size of n in advance, how can I sign extend it to 32 bits? If n was 16 bits, int32_t…
Kyle
  • 103
  • 7
1
vote
2 answers

What happens to the bits of a float during division?

I have a homework assignment which requires me to divide a 32-bit single precision floating point integer by 2 in C using bitwise operations (if statements and for loops can also be used). The float's bits are represented as unsigned integers so we…
jburn7
  • 125
  • 2
  • 3
  • 15
1
vote
3 answers

Manually changing a group of bytes in an unsigned int

I'm working with C and I'm trying to figure out how to change a set of bits in a 32-bit unsigned integer. For example, if I have int a = 17212403u; In binary, that becomes 1000001101010001111110011. Now, supposing I labeled these bits, which are…
Veer Singh
  • 913
  • 2
  • 11
  • 26
1
vote
2 answers

Issue clearing bits in 128 bit integer array

My goal with this program is that I want to be able to set 1000 bits to 0 or 1 separately, for this I'm using an array of 128 bit integers. Now the issue is when I simply clear_bit(3), bit 35 is also being cleared (and vice versa). 3 & 35 are…
SJ19
  • 1,933
  • 6
  • 35
  • 68
1
vote
1 answer

Java - How to Extract Certain Portions of Bits Using Bit Mask?

This is the first time I am looking at bitwise operations and bit mask. I have seen some examples using C and C++, but I am looking for clarification using Java. I have the following 32-bit string 0000 0000 1010 0110 0011 1000 0010 0000 But I want…
brazjul
  • 339
  • 2
  • 5
  • 19
1
vote
0 answers

How to compute hamming code for 10 bits?

I have seen examples of hamming code detection and correction with 8 bits or 12 bits. Suppose I had the bit string: 1101 0110 11 which contains 10 bits. Do I need to add two additional bits to that bit string to complete the nibble? If so do I add…
John
  • 93
  • 2
  • 8