Most Popular
1500 questions
58
votes
12 answers
Does a byte contain 8 bits, or 9?
I read in this assembly programming tutorial that 8 bits are used for data while 1 bit is for parity, which is then used for detecting parity error (caused by hardware fault or electrical disturbance).
Is this true?
xtt
- 729
- 1
- 5
- 9
58
votes
5 answers
Why is the Mersenne Twister regarded as good?
The Mersenne Twister is widely regarded as good. Heck, the CPython source says that it "is one of the most extensively tested generators in existence." But what does this mean? When asked to list properties of this generator, most of what I can…
Veedrac
- 992
- 1
- 7
- 16
58
votes
11 answers
Why would anyone want CISC?
In our computer systems lecture we were introduced to the MIPS processor. It was (re)developed over the course of the term and has in fact been quite easy to understand. It uses a RISC design, that is its elementary commands are regularly encoded…
Raphael
- 73,212
- 30
- 182
- 400
58
votes
7 answers
Why does a processor have 32 registers?
I've always wondered why processors stopped at 32 registers. It's by far the fastest piece of the machine, why not just make bigger processors with more registers? Wouldn't that mean less going to the RAM?
Matt Capone
- 701
- 1
- 6
- 5
57
votes
8 answers
How are variables stored in and retrieved from the program stack?
Apologies in advance for the naivety of this question. I am a 50 year old artist trying to properly understand computers really for the first time. So here goes.
I have been trying to understand how data types and variables are handled by a compiler…
Celine Atwood
- 689
- 1
- 6
- 4
57
votes
6 answers
Why are so many internet protocols text-based?
From what I have found, a very large amount of protocols that travel over the internet are "text-based" rather than binary. The protocols in question include, but are not limited to HTTP, SMTP, FTP (I think this one is all text-based?), WHOIS,…
IQAndreas
- 741
- 1
- 5
- 9
57
votes
4 answers
Time complexity of a compiler
I am interested in the time complexity of a compiler. Clearly this is a very complicated question as there are many compilers, compiler options and variables to consider. Specifically, I am interested in LLVM but would be interested in any thoughts…
superbriggs
- 695
- 5
- 6
57
votes
4 answers
Why polynomial time is called "efficient"?
Why in computer science any complexity which is at most polynomial is considered efficient?
For any practical application(a), algorithms with complexity $n^{\log n}$ are way faster than algorithms that run in time, say, $n^{80}$, but the first is…
Ran G.
- 20,884
- 3
- 61
- 117
56
votes
5 answers
How is this sorting algorithm Θ(n³) and not Θ(n²), worst-case?
I just starting taking a course on Data Structures and Algorithms and my teaching assistant gave us the following pseudo-code for sorting an array of integers:
void F3() {
for (int i = 1; i < n; i++) {
if (A[i-1] > A[i]) {
…
Anthony Rossello
- 611
- 5
- 5
56
votes
2 answers
How to define quantum Turing machines?
In quantum computation, what is the equivalent model of a Turing machine?
It is quite clear to me how quantum circuits can be constructed out of quantum gates, but how can we define a quantum Turing machine (QTM) that can actually benefit from…
Ran G.
- 20,884
- 3
- 61
- 117
55
votes
9 answers
How to prove a language is regular?
There are many methods to prove that a language is not regular, but what do I need to do to prove that some language is regular?
For instance, if I am given that $L$ is regular,
how can I prove that the following $L'$ is regular, too?
$\qquad…
corium
- 899
- 1
- 8
- 9
55
votes
3 answers
Why did Google not use an NP problem for their quantum supremacy experiment?
Reading discussions of the recent quantum supremacy experiment by Google I noticed that a lot of time and effort (in the experiment itself, but also in the excellent blog posts by Scott Aaronson and others explaining the results) is spent on…
Vincent
- 761
- 1
- 5
- 12
54
votes
6 answers
Why are some games np-complete?
I read the Wikipedia entry about "List of NP-complete problems" and found that games like super mario, pokemon, tetris or candy crush saga are np-complete. How can I imagine np-completeness of a game? Answers don't need to be too precise. I just…
racc44
- 667
- 2
- 7
- 11
54
votes
4 answers
What is the meaning of $O(m+n)$?
This is a basic question, but I'm thinking that $O(m+n)$ is the same as $O(\max(m,n))$, since the larger term should dominate as we go to infinity? Also, that would be different from $O(\min(m,n))$. Is that right? I keep seeing this notation,…
Zeus
- 1,712
- 1
- 13
- 15
54
votes
3 answers
Contrasting Peterson’s and Dekker’s algorithms
I am trying to understand the algorithms by Peterson and Dekker which are very similar and display a lot of symmetries.
I tried to formulate the algorithms in informal language like follows:
Peterson's: "I want to enter." …
gbag
- 719
- 1
- 6
- 9