78 votes
Accepted

Does a byte contain 8 bits, or 9?

A byte of data is eight bits, there may be more bits per byte of data that are used at the OS or even the hardware level for error checking (parity bit, or even a more advanced error detection scheme),...
JustAnotherSoul's user avatar
50 votes

Does a byte contain 8 bits, or 9?

Traditionally, a byte can be any size, and is just the smallest addressable unit of memory. These days, 8 bit bytes have pretty much been standardized for software. As JustAnotherSoul said, the ...
Extrarius's user avatar
  • 761
32 votes

Does a byte contain 8 bits, or 9?

That text is extremely poorly worded. He is almost certainly talking about ECC (error-correcting code) RAM. ECC ram will commonly store 8-bits worth of information using 9-bits. The extra bit-per-...
BlueRaja - Danny Pflughoeft's user avatar
18 votes

Will the future quantum computers use the binary, ternary or quaternary numeral system?

The other answers are nice, but none address the question: what numeric base(s) might quantum computers use? I will answer in two parts: first, the question is a little subtle, and second, you may use ...
Lieuwe Vinkhuijzen's user avatar
18 votes

Does a byte contain 8 bits, or 9?

Generally speaking, the short answer is that a byte is 8 bits. This oversimplifies the matter (sometimes even to the point of inaccuracy), but is the definition most people (including a large number ...
Justin Time - Reinstate Monica's user avatar
8 votes

Does a byte contain 8 bits, or 9?

Note that the term byte is not well-defined without context. As far as computer architectures are concerned, you can assume that a byte is 8-bit, at least for modern architectures. This was largely ...
Dmitry Grigoryev's user avatar
6 votes

Does a byte contain 8 bits, or 9?

A byte is usually defined as the smallest individually addressable unit of memory space. It can be any size. There have been architectures with byte sizes anywhere between 6 and 9 bits, maybe even ...
Jörg W Mittag's user avatar
4 votes
Accepted

Two's complement general formula

Let $a_{N-1} \cdots a_0$ be the two's complement representation of the number $a$. The more general formula is: $$a = -a_{N-1}2^{N-1} + \sum_{i=0}^{N-2} a_i 2^i$$ (I am sure you can figure out how ...
dkaeae's user avatar
  • 4,999
4 votes
Accepted

Why does existence of predecessor imply adequacy of a numeral system?

Recall that the set of partial recursive functions $\mathcal{R}$ is defined inductively by the following rules: (zero) $\dfrac{}{\zeta : n \mapsto 0 \in \mathcal{R}}$ (successor) $\dfrac{}{\sigma : n ...
Daniel Mroz's user avatar
4 votes
Accepted

Streaming digit-to-digit conversion from decimal to hexadecimal

I don't think this is possible. Changing a high-order digit in a base-10 number -- say, changing 5000000 to 6000000 -- can change bits in its binary equivalent all the way from high-order bits to ...
j_random_hacker's user avatar
3 votes

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: ...
Ken Shirriff's user avatar
3 votes
Accepted

Binary 2s Compliment Applied Twice Gives Original - How?

First, if we wouldn't get the same number after negating it twice, it wouldn't make much sense, right? So we just need to prove that the "complement and add 1" has indeed the effect of negation, i.e.,...
Ran G.'s user avatar
  • 20.7k
3 votes

Binary 2s Compliment Applied Twice Gives Original - How?

If we look at the numbers in an unsigned way, flipping a binary number $x$ on $n+1$ bits is computing $(2^{n+1} -1) - x = M - x$. Proof for that: $x = \sum_0^n b_i2^i$. $x$ flipped : $\sum_0^n (1-b_i)...
GBathie's user avatar
  • 632
3 votes
Accepted

Convert integer of mixed radix to standard positional numeral system and vice versa

If you have numbers $x_1,\ldots,x_n$ in the ranges $x_1 \in \{0,\ldots,b_1-1\},\ldots,x_n \in \{0,\ldots,b_n-1\}$, you can get a number in the range $\{0,\ldots,b_1\ldots b_n-1\}$ using the formula $$ ...
Yuval Filmus's user avatar
3 votes
Accepted

8-bit floating-point representation

With 4 bits you can represent 16 different values: 0,1,...,15. If you want to allow negative exponents it makes sense to take (approximately) half of the possible values to mean a negative exponent. ...
adrianN's user avatar
  • 5,931
3 votes

What are the reasons for and against using normalized floating point?

Your terminology is non-standard. There are floating-point formats with an implicit leading mantissa bit, and floating-point formats with an explicit leading mantissa bit. I'm not aware that this ...
gnasher729's user avatar
  • 29.9k
3 votes

Which number representation takes the largest amount of memory?

The question seems rather bizarre. Using n bits, each representation can represent $2^n$ different values. Two of them have different representations for +0 and -0. I would assume that signed-...
gnasher729's user avatar
  • 29.9k
3 votes

Does a byte contain 8 bits, or 9?

When I started programming in 1960, we had 48 bit words with 6 bit bytes - they ware not called that name then, they were called characters. Then I worked on the Golem computer with 75 bit words and ...
Jonathan Rosenne's user avatar
2 votes

Does a byte contain 8 bits, or 9?

A byte is 8 bits. In the distant past, there were different definitions of a memory word and of a byte. The suggestion that this ambiguity is widespread or is prevalent in today's life is false. ...
TonyM's user avatar
  • 129
2 votes

Does a byte contain 8 bits, or 9?

First, the tutorial that you are referencing seems to be quite outdated, and seems to be directed at outdated versions of x86 processors, without stating it, so lots of the things you read there will ...
gnasher729's user avatar
  • 29.9k
2 votes

Binary 2s Compliment Applied Twice Gives Original - How?

This might not be a formal answer but give you a idea what happens when you do 2's complement. Take any binary number and do the following: Traverse binary bits from right to left Find the first 1 ...
manjy's user avatar
  • 41
2 votes

Overflow rule in two's complement arithmetic

Yes, if we are talking about integers. In two's complement representation with length $n$ you can only represent the integers between $-2^{n-1}$ and $2^{n-1} - 1$ (both bounds inclusive). Thus, the ...
dkaeae's user avatar
  • 4,999
2 votes
Accepted

Balanced based representation

$$\frac{8}{3}=3 - \frac13=1\cdot3^1 + 0\cdot3^0 +(-1)\cdot3^{-1}=(10.\bar{1})_3$$ Since $\frac83$ is not equal to $\dfrac p{5^i}$ for any integer $p$ and $i$, it cannot be expressed as a fixed-point ...
John L.'s user avatar
  • 38.9k
2 votes

Balanced based representation

The expression $10.\overline{1}$ should be interpreted as follows: $$ 1 \cdot 3^1 + 0 \cdot 3^0 + (-1) \cdot 3^{-1} = 3 - \frac{1}{3} = \frac{8}{3}. $$ The interpretation of balanced base $b=2d+1$ is ...
Yuval Filmus's user avatar
2 votes
Accepted

Which number representation takes the largest amount of memory?

tl;dr- The intended answer was probably "One's complement" since it wastes encoding on a negative zero. "Signed magnitude" has the same problem, but apparently some sources ...
Nat's user avatar
  • 1,351
2 votes
Accepted

Conversion from octal numerical system to binary numerical system

Its not a coincidence. It is a general result for any number represented in a positive base $b$, its representation in base $b^k$ for some positive integer $k$, is simply grouping $k$ digits in its ...
RandomPerfectHashFunction's user avatar
2 votes

How much can we trust mathematical software when working with large numbers, and how much memory it needs to work with these numbers?

Question a): Here is the output from python console. ...
John L.'s user avatar
  • 38.9k
2 votes

Streaming digit-to-digit conversion from decimal to hexadecimal

You can't do this - if you don't know whether the input is k digits or k+1 digits, then the additional decimal digit changes all or most of the hexadecimal digits. For example 100 -> 64, but 1000 -> ...
gnasher729's user avatar
  • 29.9k
2 votes
Accepted

Unsigned/signed boolean

It means your book is either (a) misleading, (b) poorly worded, or (c) wrong. Case (a) would be if the text is talking about how relational operators are implemented in CPU architecture. In many if ...
Aaron Rotenberg's user avatar
2 votes
Accepted

Is there a binary representation where the encoding distance grows with the arithmetic distance?

You can get some kind of tradeoff between unary and binary. Start by choosing some integer $k$ and set $w=2^k-1$. Then write $x$ as $x=r+w+w+\ldots+w$, where $r$ is the remainder of $x$ when divided ...
Tassle's user avatar
  • 2,522

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