instruction stringlengths 0 29.8k ⌀ |
|---|
null |
We know that there are basically 3 fundamental parts of a processor namely :
1. Control Unit (CU)
2. Arithmetical Logic Unit (ALU)
3. Clock
Also we know that they maintain several important and different functions of the processor.
However, if we had to arrange them according to their importance/priority , t... |
What is the most critical component of a processor? |
|priority-queues|critical-section| |
This seems to be a correct characterization of trees, here is my proof of it (hope there is no mistake).
Let $G = (V, E)$ an undirected graph. Denote $(P)$ the property "$G$ is connected and between each pair of vertices of same degree, there is an unique path connecting them."
Suppose there exists a graph verify... |
null |
I am answering late and I guess you may have found the answer. According to [geeksforgeeks][1], your solution is correct since **true**, **anti** and **output** dependance are types of Data Dependences. The article urgue that hazards and dependences are used interchangeably. Meaning they are the same.
[1]: https:... |
null |
I am a teacher of undergrad graph theory and we tend to invent some weird (and false) characterizations of trees and recently I stumbled upon this one.
Is the following true?
$G$ is a tree if and only if $G$ is connected and between each pair of vertices of same degree, there is an unique path connecting them.
I... |
null |
This seems to be a correct characterization of trees, here is my proof of it (hope there is no mistake).
Let $G = (V, E)$ an undirected graph. Denote $(P)$ the property "$G$ is connected and between each pair of vertices of same degree, there is an unique path connecting them."
Suppose there exists a graph verify... |
{"Voters":[{"Id":79440,"DisplayName":"Nathaniel"}]} |
null |
The clock is not a significant part of the CPU. Both the controller and ALU are complex. You can add the register bank. |
I'm looking for an algorithm that is closely related to [2-dimensional nesting][1] (also known as lay planning).
The main differences between this and normal nesting are:
* A fixed number of elements to be placed
* The elements cannot rotate
* The elements must be placed in as _small_ an area as possible, as oppo... |
This seems to be a correct characterization of trees, here is my proof of it (hope there is no mistake).
Let $G = (V, E)$ an undirected graph. Denote $(P)$ the property "$G$ is connected and between each pair of vertices of same degree, there is an unique path connecting them."
Suppose there exists a graph verify... |
{"Voters":[{"Id":79440,"DisplayName":"Nathaniel"}]} |
I'm looking for an algorithm that is closely related to [2-dimensional nesting][1] (also known as lay planning).
The main differences between this and normal nesting are:
* A fixed number of elements to be placed
* The elements cannot rotate
* The elements must be placed in as _small_ an area as possible, as oppo... |
I'm looking for an algorithm that is closely related to [2-dimensional nesting][1] (also known as lay planning, bin packing, and the cutting stock problem).
The main differences between this and normal nesting are:
* A fixed number of elements to be placed
* The elements cannot rotate
* The elements must be place... |
This seems to be a correct characterization of trees, here is my proof of it (hope there is no mistake).
Let $G = (V, E)$ an undirected graph. Denote $(P)$ the property "$G$ is connected and between each pair of vertices of same degree, there is an unique path connecting them."
Suppose there exists a graph verify... |
I'm looking for an algorithm that is closely related to [2-dimensional nesting][1] (also known as lay planning, bin packing, and the cutting stock problem).
The main differences between this and normal nesting are:
* A fixed number of elements to be placed
* The elements cannot rotate
* The elements must be place... |
In modern computers, the time for an operation cannot be measured, full stop. Because it is highly non-deterministic.
The running time depends on important factors such as memory response time (across several levels of cache plus virtual memory), as well as (hyperthreaded) pipeline utilization. In addition, for the ... |
The problem is NP-hard: the special case of $N=1$ is the traveling salesman problem. Therefore, you can't expect any efficient algorithm that will always work.
A reasonable approach in practice is to use integer linear programming (ILP). The problem you are describing could be viewed as basically an operations res... |
In a B-Tree, one of the rules is:
*Every node (except the root) is at least half full*
But then, in a 4-way B-Tree, we have the following case. Suppose we want to insert $10,20,30,40$ to the tree.
After inserting the 3 first element we get the following root:
[10 20 30]
After adding the 40, we sp... |
Confusion about B-Tree |
|data-structures|search-trees|b-tree| |
According to [wikipedia](https://en.wikipedia.org/wiki/B-tree#Definition), the condition of being half-full only applies on internal nodes, and it concerns the number of children, not the number of keys (which is always one less than the number of children, except for leaves).
In your example, the node [40] is a lea... |
Im trying to understand the following question. Suppose $h,f:\{-1,1\}^n\rightarrow \{-1,1\}$ satisfy $\sum_x h(x)f(x)\leq 0.5$, then one can rewrite this as $\textsf{Pr}_x [h(x)=f(x)]\leq 3/4$. Can we use this statement to show: there exists $i\in [n]$ such that $\sum_i h(x)f(x)h(x^i)f(x^i)$ is small (where small here ... |
influence of neighourhood points |
|probability-theory|boolean-algebra|boolean-complexity| |
Consider the following game:
You are given a set $S$ and a fixed list $q_1$, $q_2$, ..., $q_n$ of yes or no questions about the elements of $S$. Your opponent chooses an element of $S$ without telling you which. You then guess a series of questions taken from the list and your opponent answers truthfully answer "yes" ... |
Known results for games like "twenty questions"? |
|complexity-theory| |
Consider the following game:
You are given a set $S$ and a fixed list $q_1$, $q_2$, ..., $q_n$ of yes or no questions about the elements of $S$. Your opponent chooses an element of $S$ without telling you which. You then ask a series of questions taken from the list and your opponent answers truthfully answer "yes" or... |
Consider the following game:
You are given a set $S$ and a fixed list $q_1$, $q_2$, ..., $q_n$ of yes or no questions about the elements of $S$. Your opponent chooses an element of $S$ without telling you which. You then ask a series of questions taken from the list and your opponent truthfully answers "yes" or "no" t... |
No. Suppose $h$ is the parity function and $f(x)=-h(x)$. Then $\sum_x h(x) f(x) = -2^n \le 0.5$, but
$\sum_i h(x) f(x) h(x^i) f(x^i) = n$ (which is as large as it can get) for all $x$. |
This is the problem of building a [decision tree](https://en.wikipedia.org/wiki/Decision_tree) of minimal depth. Each question is a feature that you can branch on in a node of the tree. The tree structure captures the adaptive nature of the queries.
See [ID3](https://en.wikipedia.org/wiki/ID3_algorithm) for one he... |
null |
null |
null |
I'm looking for an algorithm that is closely related to the [2-dimensional nesting problem][1] (also known as lay planning, bin packing, and the cutting stock problem).
The main differences between this and normal nesting are:
* A fixed number of elements to be placed
* The elements cannot rotate
* The elements m... |
null |
In the "Hamilton cycle" problem, two nodes are either connected or not connected. Let's replace this with a "Travelling salesman" instance, where any two connected nodes have a distance of 1, and any two unconnected nodes have a distance of 2. If there is a Hamilton cycle, then the TSP instance has a solution of length... |
null |
Can CYK algorithm be used for ambiguous context free grammar? |
Can CYK algorithm be used even if the grammar is ambiguous? |
|context-free|parsers| |
Does the answer depend on the number of bytes requested? If it is forced to keep a buffer due to some unknown device/diver, can it optimize and skip the buffer if it's going to be a disk read? I'm looking for any insight beyond "It's implementation dependent".
How I got here:
C++ implementations of POSIX complian... |
Does the Posix read() system call for FILE* have an internal buffer in the kernel? |
|operating-systems|c|c++|os-kernel| |
I would say the *control unit*.
Every processor must be able to process a sequence of instructions in order.
It's possible (but tricky, and very silly) to design a processor with no ALU. The processor might have two instructions: copy address X to address Y, and branch to address Y. I suspect this is enough to im... |
I would say the *control unit*.
Every processor must be able to process a sequence of instructions in order.
It's possible (but tricky, and very silly) to design a processor with no ALU. The processor might have one instructions: copy address X to address Y and branch to address Z. I suspect this is enough to imp... |
null |
null |
> ssize_t read(int fd, void *buf, size_t count);
This asks the OS to copy into `buf`, all available data, but no more than `count` bytes.
For storage devices where seeking isn't practical or possible (e.g. tape drives and punched card readers), it is the caller's responsibility to ensure that the provided buffer ... |
I would say the *control unit*.
Every processor must be able to process a sequence of instructions in order.
It's possible (but tricky, and very silly) to design a processor with no ALU\*\*. The processor might have one type of instruction: copy address X to address Y and branch to address Z. I suspect this is en... |
I'm currently in need of the inverse operation of the concatenation of 2 regular languages.
Formally, for 3 regular languages $A,B,C$ such that $A \cdot B = C$, only $A$ and $C$ are known, and $\forall w \in B: A \cdot (B \setminus \{w\}) \neq C$ ($B$ should be the smallest language that fulfills the equation).
... |
Yes, [CYK][1], and related algorithms such as [Earley's][2] and [GLR][3], work for ambiguous grammars. CYK requires converting the grammar into Chomsky Normal Form first; doing so does not affect its ambiguity.
[1]: https://en.wikipedia.org/wiki/CYK_algorithm
[2]: https://en.wikipedia.org/wiki/Earley_parser
... |
I'm currently in need of the inverse operation of the concatenation of 2 regular languages.
Formally, for 3 regular languages $A,B,C$ such that $A \cdot B = C$, only $A$ and $C$ are known, and $\forall w \in B: A \cdot (B \setminus \{w\}) \neq C$ ($B$ should be the smallest language that fulfills the equation).
... |
I think you will get your answer by following some other questions instead of this one.
1- is assembler a system software?
2- is the first assembler written in machine language? ([vist here][1])
3- what happens when we turn on the computer? what is BIOS and how does it work? what is bootloader? etc.
I hop... |
I'm currently in need of the inverse operation of the concatenation of 2 regular languages.
Formally, for 3 regular languages $A,B,C$ such that $A \cdot B = C$, only $A$ and $C$ are known, and $\forall w \in B: A \cdot (B \setminus \{w\}) \subset C$ ($B$ should be the smallest language that fulfills the equation).
... |
Let $L\in R, L_2\in RE$ and $n\in N$.
Define $L_n=${$w|w\in L \vee (w\in L_2 \wedge |w|\leq )$}
Find a decider for $L_n$
For the right hand side, I thought I could check the length of and then simulate the recognizer that recognizes $L_2$ until it accepts. I don't know how many steps it'll take the machine t... |
Finding a decider |
|turing-machines|computability| |
I'm currently in need of the inverse operation of the concatenation of 2 regular languages.
Formally, for 3 regular languages $A,B,C$ such that $A \cdot B = C$, only $A$ and $C$ are known, and $B$ is the smallest language that fulfills the equation (which implies $\forall w \in B: A \cdot (B \setminus \{w\}) \subse... |
This article from IBM ([link][1]) talks about Memory hierarchy in its actual hardware parts.
> NUMA
>
> While operating systems present memory to the running applications as a unified space, modern large systems have memory organized in a hierarchy, by core, chip, module, socket, node, and chassis/central process... |
Memory Hierarchy Mappings to real world |
|cpu-cache|memory-hardware|os-kernel|cache| |
I'm researching static recompilation but there doesn't seem to be too much information about the subject. I've heard that dynamic recompilation (emulation) can be up to 6 times slower than native assembly, but I'm curious why we aren't able to translate to a different architecture ahead of time. Even though some instru... |
Why is static recompilation not possible? |
|computer-architecture|assembly| |
You do not have to construct the machine, you only have to show one exists. The language $\{w\in L_2 \mid |w|\le n\}$ is finite, even if we do not know any of its elements. |
Assuming this set of instructions:
1. declare variable 'A' which has value 5
1. declare variable 'B' which has value 2
From what I've understood, those instructions are loaded into RAM an then read by CPU, they are composed by OPCODE + Data. So, lets assume that the opcode to set a value for a specific RAM addre... |
Are variables stored again in RAM? |
|memory-hardware|memory-allocation| |
|computer-architecture|cpu|memory-hardware|memory-allocation| |
Given doubly linked list $L$ that contains $n$ elements of numbers. Between QuickSort, and MergeSort and InsertionSort, which algorithm preferred to sorting $L$ by just swapping links of $L$?
I think the InsertionSort is better option but I have no any idea to show that that minimize number of changing pointers. An... |
Sort doubly linked list with just manipulating pointers |
|algorithms|sorting| |
I know that there are [many techniques to represent graphs][1].
Suppose I have a directed massive 3D graph with 50,000 nodes at maximum.
Suppose the graph looks somewhat like the following:
[![enter image description here][2]][2]
Suppose each node of the graph has three pieces of information:
1. A 30-ch... |
What is the most efficient way to represent an directed dynamic massive 3D graph? |
|graphs|data-structures|simulation| |
50,000 nodes is very small and will fit in memory. Use any standard data structure for representing graphs, e.g., https://en.wikipedia.org/wiki/Adjacency_list (see also https://en.wikipedia.org/wiki/Adjacency_matrix). |
null |
I know that there are [many techniques to represent graphs][1].
Suppose I have a directed massive 3D graph with 100,000 nodes at maximum.
Suppose the graph looks somewhat like the following:
[![enter image description here][2]][2]
Suppose each node of the graph has three pieces of information:
1. A 30-c... |
Static recompilation is hard, because it is hard to statically figure out which instructions need to be recompiled and figure out how to compile them. It's not impossible, but it can be extremely challenging.
Given a binary executable, it is hard to reliably find all of the executable code statically, due to the pr... |
In Cormen's *Introduction to Algorithms*, he states the the LP relaxation for the minimum vertex cover approximation problem is $ \begin{align*}
&\sum\limits_{v \in V}w(v)x(v) \tag{35.15} \\
x(u) + x(v) &\geq 1 \text{ for each } u, v \in E \tag{35.16} \\
x(v) & \leq 1 \text... |
LP Approximation for Vertex Cover Problem |
|algorithms|graphs|linear-programming|vertex-cover| |
You could delete this constraint, but it would still be verified in a solution: if there is a solution satisfying all other contraints and $x(v) > 1$ for a certain $v$, then the same solution with $x(v) = 1$ still satisfy the constraints. Since weights are positive, the sum with $x(v) = 1$ would be lesser than the sum ... |
Minimizing the number of changing pointers is equivalent to minimizing number of swaps, which is obtained by Selection Sort. |
Yes and no. Depending on the instruction addressing mode, you may have the data stored in the instruction itself(immediate), no data(implicit), in some register(register), or at a memory location(direct/indirect). There are much more addressing modes available which combine one or more of such addressing modes.
Are... |
null |
This article from IBM ([link][1]) talks about Memory hierarchy in its actual hardware parts.
> NUMA
>
> While operating systems present memory to the running applications as a unified space, modern large systems have memory organized in a hierarchy, by core, chip, module, socket, node, and chassis/central process... |
This article from IBM ([link][1]) talks about Memory hierarchy in its actual hardware parts.
> NUMA
>
> While operating systems present memory to the running applications as a unified space, modern large systems have memory organized in a hierarchy, by core, chip, module, socket, node, and chassis/central process... |
There are two standard ways to compute running time. Both are valid. Each conveys slightly different information, and which one is more useful may depend on the circumstance.
One approach is to compute the running time in terms of the number of bit-operations. For instance, it takes $O(B^2)$ bit operations to mul... |
null |
null |
Intervals $i = [s_i, f_i]$ have start time $s_i$ and finish time $f_i$. At a timepoint $t$, let $a(t)$ be the intervals that contain $t$, i.e. the intervals $i$ s.t. $s_i \leq t \leq f_i$.
Sort the intervals by end-point and start iterating over integers $t = 0 ... \max{f_i}^\dagger$. The insight is that we _always... |
Intervals $i = [s_i, f_i]$ have start time $s_i$ and finish time $f_i$. At a timepoint $t$, let $a(t)$ be the intervals that are available at $t$, i.e. those which contain $t$, i.e. the intervals $i$ s.t. $s_i \leq t \leq f_i$. Furthermore, let $c(t)$ be the _critical intervals_. Those are the intervals that start at... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.