# Tag Info

## Hot answers tagged binary

Accepted

### How can I multiply a binary representation by ten using logic gates?

I assume that the task is to compute $mul(10, a)= 10a$. You don't need to do multiplication. A single binary adder is enough since $$10a = 2^3a + 2a$$ meaning you add one-time left-shifted $a$ to 3-...
• 9,612

### Signed and unsigned numbers

Short version: it doesn't know. There's no way to tell. If 1111 represents -7, then you have a sign-magnitude representation, where the first bit is the sign and ...
• 6,940

### Shannon Entropy of 0.922, 3 Distinct Values

Here is a concrete encoding that can represent each symbol in less than 1 bit on average: First, split the input string into pairs of successive characters (e.g. AAAAAAAABC becomes AA|AA|AA|AA|BC). ...
• 281
Accepted

### Signed and unsigned numbers

The short and simple answer is: it doesn't. No modern mainstream CPU ISA works the way you think it does. For the CPU, it's just a bit pattern. It's up to you, the programmer, to keep track of what ...
• 5,141
Accepted

### Shannon Entropy of 0.922, 3 Distinct Values

The entropy you've calculated isn't really for the specific string but, rather, for a random source of symbols that generates $A$ with probability $\tfrac{8}{10}$, and $B$ and $C$ with ...
• 80.2k

• 1,319

### What are some uses of the Thue-Morse sequence in computer science?

I don't know if this counts as an application but at least it shows up. When using a polynomial rolling hash, it's tempting to do it modulo $2^{32}$ or $2^{64}$ (depending on the word size of the ...
• 428

### Why the 127 encodings of ASCII needed to be extended to 256?

The question of how foreign languages justifies expanding the encoding in actual usage is well explained by earlier answers. The question of why foreign languages would affect the American Standard ...
• 108

### Binary 2s Compliment Applied Twice Gives Original - How?

The other answers have given rigorous mathematical answers, so I'll try to give a more intuitive way to understand 2's complement. I'll use 4-bit numbers like the original example. First principle: ...
• 276

• 141k

### Signed and unsigned numbers

I'd like to give an addition to the answers already made: In most other answers it is noted that in twos-complement arithmetic the result is the same for signed and unsigned numbers: ...

Only top scored, non community-wiki answers of a minimum length are eligible