Most voted "bits" questions
4 questions
Sort by count of
-
11
votes2
answers17350
viewsMinimum bit amount required to represent decimal numbers
I’m making a list of computer architecture and one of the first exercises is pretty basic: What is the minimum amount of bits required to represent in binary each of the decimal numbers without…
-
5
votes2
answers458
viewsDoubt in displacement of bits in C
My question is regarding the following excerpt from a code: #include <stdio.h> int main(void){ int teste = 0, x0 = 0, x1 = 0, x2; x2 = 1; teste = ((x0|x2) | (x1|x2) << 1); printf("Valor…
-
2
votes1
answer117
viewsBit-by-bit operations (XOR)
#include <stdio.h> void main(){ int a = 356, b = 3; printf("%d\n", a ^ b); /* system("pause"); } Somebody explain to me why this xor does 359? The conversion to binary gets: 101100100 -->…
-
1
votes1
answer41
viewsUnzipping of characters
I’m having difficulty in the following exercise Using the right shift operator, the AND operator over bits and a mask, write a function called unzippaCaracters that receives the integer unsigned and…