78

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), but the data is eight bits and any parity bit is usually invisible to the software. A byte has been standardized to mean 'eight bits of data'. The text isn't ...


48

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 hardware may store more bits than the 8 bits of data. If you're working on programmable logic devices, like FPGAs, you might see that their internal memory is often ...


32

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-byte is used to store error correction codes. (In both cases, every byte is spread across every chip. Image courtesy of Puget Systems) This is all completely ...


20

Since this is CS and not Stackoverflow, I'm going to assume that you're asking a question about numeric analysis, and (to keep things simple) IEEE-754 floating point in particular. In that case, the answer to your question partly depends on what you mean by "easier", and partly on the details of the system. No modern CPUs that I'm aware of have an ...


19

Octal (base-8) and hexadecimal (base-16) numbers are a reasonable compromise between the binary (base-2) system computers use and decimal (base-10) system most humans use. Computers aren't good at multiple symbols, thus base 2 (where you only have 2 symbols) is suitable for them while longer strings ,numbers with more digits, are less of a problem. Humans ...


17

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 of programmers) are familiar with, and the definition nearly everyone defaults to (regardless of how many differently-sized bytes they've had to work with). ...


16

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 any numeric base, and then you work with qutrits or in general with qudits, which lead to qualitatively new intuitions! Or at any rate, I will try to make the ...


13

We use them for convenience and brevity. Hex and Oct are really outstanding compressed representations of binary. Hex in particular is well suited to condensed forms of memory addresses. Every oct digit directly maps to 3 binary bits and every hex digit to 4 binary bits. This is a result of the bases (8 and 16) being powers of 2 ($2^3$ and $2^4$). For ...


8

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 standardised by programming languages such as C, which required bytes to have at least 8 bits but didn't provide any guarantees for larger bytes, making 8 bits ...


7

If by 2**x you mean $2^x$, then yes. We can use the left-shift operator <<, i.e. we compute 1 << x. This is lightning-fast as it is a primitive machine instruction in every processor I know of. This can not be done with any base other than 2. Moreover, integer exponentiation will always be faster than real exponentiation, as floating point ...


6

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 bigger. There are also architectures where the only addressable unit is the size of the bus, on such architectures we can either say that they simply have no byte, ...


5

Binary numbers in text are a waste of space. Decimal shows no relation to powers of $2$. Often the fact that a number is, say $5\cdot 2^n-1$, is more important than how much that is.


4

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 \mapsto n + 1 \in \mathcal{R}}$ (projection) $\dfrac{}{\Pi_m^i : (n_1, \cdots n_m) \mapsto n_i \in \mathcal{R}}$ (composition) $\dfrac{\chi : \mathbb{N}^m \to \...


4

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., taking $x$ into $-x$ (and thus, $-x$ to $x$). (well, maybe except for an edge case I will mention below.) A signed number of $n$ bits, $b_{n-1}, \ldots, b_1,...


4

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 fairly-low-order bits: 10011000100101101000000 10110111000110110000000 It doesn't change the very lowest bits: Since $10 = 5\times 2$, the digit in position $k$ ...


3

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-magnitude and one's complement are used if someone values the ability to distinguish +0 and -0. If the question was "which representation takes the largest amount ...


3

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. Since at least the late 1970's, a byte has been 8 bits. The mass populace of home computers and PCs have all unambiguously used a byte as an 8-bit value in their ...


3

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 15 bit bytes. Later, 6 bit bytes were the norm, until IBM came out with the 360, and nowadays a byte is commonly equivalent to an octet, i.e. 8 bits of data. ...


3

Quantum computers use binary. But really, this is a simplification, and there is no simple answer of how quantum algorithms work that don't get into the mathematics of quantum physics and quantum computation. The best way for you to understand this subject area is to start by studying quantum computation. There are many excellent textbooks and tutorials ...


3

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 $$ x_n + b_n x_{n-1} + b_n b_{n-1} x_{n-2} + \cdots + b_n b_{n-1} \cdots b_2 x_1 = \\ x_n + b_n (x_{n-1} + b_{n-1} (x_{n-2} + \cdots )). $$ The second formula ...


3

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. By adding 7 to the exponent you map the values -7,-6,...,0,1,...,8 to the representable range. You might also want to look up two's complement.


3

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)2^i = \sum_0^n 2^i -\sum_0^n b_i2^i = (2^{n+1} - 1) - x$ Therefore, flip and add one : $y = (M - x) + 1$ Again : $z = (M - y) +1 = (M - ((M - x) + 1)) + 1$ $...


3

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: for a 4-bit number n, 1111 - n is the same as flipping the bits of n. If you try a few examples, hopefully this is obvious. Second principle: since we ignore ...


2

Introduction As already mentioned by other answers, there can be different notations for different purposes and constraints. Notations is actually an encoding as a sequence of characters, and we know from the study of algorithms and data structure that there are many ways we can encode abstract concepts, a list or a set for example, depending on what we ...


2

If 2**x is a function on integers, then I agree with Stephen's answer, shift is cheaper. But I typically see that as 2^x and ** to indicate floating point exponentiation. For this case, I would expect similar performance between ** and ^ since both exp and pow (the underlying operation for **) are both transcendental approximation operations.


2

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 not be understood by others (for example if you claim that a WORD is 2 bytes, people will either not know what you are talking about, or they will know that you ...


2

Bits are bits, i.e. entities that can have only one of two states, usually noted $0$ and $1$. Quantum computing uses qbits (I suppose it stands for quantum bits). Qbits allows "superposed" bits, i.e. entities that can sort of hold several bits in the same place, theoretically (according to current state of knowledge) an unbounded number of bits. You can ...


2

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 consider it more efficient because they neglect the sign-bit, presumably under type-erasure logic. It's also possible that the answer could've been "Excess ...


2

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 your formulas can be derived from this one.) Why does this hold? For $a \ge 0$, $a_{N - 1} = 0$ and then the value of $a$ is simply the value of the binary ...


2

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 the same, with the digits ranging from $-d$ to $d$.


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