Questions tagged as 'bits'

2
answers

Minimum number of bits 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 needed to represent each of the unsigned decimal numbers in binary?       a) 4095   b) 65534   c) 42319 I...
asked by 24.04.2017 / 22:33
2
answers

Doubling bit shift in C

My question is regarding the following snippet of 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 de teste: %d ", tes...
asked by 29.04.2017 / 01:44
1
answer

Character unpacking

I'm having difficulty in the following exercise    Using the right shift operator, the AND operator on bits, and a mask, write a function called uncompressingCharacters that receives the integer   unsigned and unzip it into two characters fro...
asked by 03.09.2018 / 14:48