Skip to main content

Questions tagged [bit]

2 votes
5 answers
2k views

When writing platform independent software in C++, can I nowadays safely1 assume that a byte has a size of 8 bits? Or do I have to calculate it like this, for example: #include <climits> std::...
stackprotector's user avatar
4 votes
3 answers
283 views

Regarding cryptography and the issue of collisions, I posed a question as to whether it was ever possible to store every single possible combination of a bit array of a particular size, in a bit array ...
Anon's user avatar
  • 3,649
2 votes
6 answers
667 views

In software engineering, often developers will utilize three different states of a signed integer, as a trilean: This tends to be quite typical: -1 - Represents something akin to a null pointer, as in ...
Anon's user avatar
  • 3,649
-2 votes
2 answers
783 views

Today, we learnt about sign extension to solve the problem where adding positive number to another positive one gives a negative. But my professor didn't mention at all when we should use it and how ...
user128250's user avatar
1 vote
2 answers
2k views

Is there a logical reason why the integer is upgraded to 32+ bits? I was trying to make an 8bit mask, and found myself a bit disappointed that the upgrade will corrupt my equations. sizeof( quint8(0)...
Anon's user avatar
  • 3,649
1 vote
2 answers
603 views

I have implemented a simple bit vector class. However, I have some problems with understanding, how to push data to it. In a standard vector, push_back inserts new element et the end. A similar ...
Martin Perry's user avatar
0 votes
4 answers
2k views

I know that the compiler and architecture of a processor also have a role to play in this. But this is more of a "can it" rather then a "does it" question. I have already tried to research this, but ...
skyline's user avatar
  • 11
56 votes
3 answers
10k views

It's a sort of simple compression where you use one numeric variable to store many boolean / binary states, using doubling and the fact that every doubling number is 1 + the sum of all the previous ...
user56reinstatemonica8's user avatar
1 vote
2 answers
139 views

I have just encountered this sentence: Depending on the context, we may prefer to model integers as bitvectors rather than mathematical integers, since the Int type does not model overflow. I am ...
Lance Pollard's user avatar
1 vote
3 answers
976 views

I'm in the process of implementing a counting Bloom filter. This data structure is defined as a bit-array and a "width" parameter, W. The bit array stores unsigned integers, whose size is determined ...
Louis Thibault's user avatar
2 votes
3 answers
444 views

Current and common processing units are 8, 16, 32, 64, 128, etc bit. Why are their datapath multiple of 8 ? Is this all linked to the fact that the industry has settled with a 8-bit byte ? The PDP-7 ...
Benoît's user avatar
  • 129
12 votes
6 answers
1k views

I find several sources claiming that power-of-two bits in a binary word (such as 8-bits per byte) is a "good thing" or "convenient". I find no source pointing out why. From What is the history of ...
Andreas's user avatar
  • 317
3 votes
5 answers
869 views

All languages I have seen so far have multiple builtin data types (int, double, float, char, long...). But if we look closely, they are just arbitrary arrays of bits, the only difference between them ...
Ford O.'s user avatar
  • 223
26 votes
8 answers
12k views

Not so long ago I talked to my colleague and he was definitely against using bit masks because it is hard to understand all the values that are stored in the database. In my opinion it is not always a ...
Alex Ovechkin's user avatar
4 votes
4 answers
7k views

Why are most computers byte addressable instead of bit addressable? By B/b addressable I mean that processor can operate on level of single B/b. Bit addressable advantages: Booleans have size of one ...
Ford O.'s user avatar
  • 223

15 30 50 per page