How can I implement the instruction jrlti (jump-register if less than immediate) in the MIPS one cycle datapath?

I have trouble implementing the instruction jrlti. I don’t have the right to modify the ALU so it must remain intact.

Here is how the instruction is defined:

[rs] < SignImm ? PC = [rt] : PC = PC + 4

Where is the comparison [rs] < SignImm handled in the mips one-cycle datapath? Do I use the ALU to handle it, if so how? What are the part that I have to add.

This is the standard datapath I’m using: enter image description here

This is what I tried to do: enter image description here

How can I do PC = [rt] and than PC = PC + 4 Please correct me on any false assumption I may have made while trying to implement the instruction.

Seeking proof of Cuckoo Cycle Conjecture

Allow me to introduce the Cuckoo Cycle Proof of Work, and conclude with a closely related Conjecture about random graphs, which I hope someone can find a proof for.

Cuckoo Cycle is named after the Cuckoo Hashtable, in which each data item can be stored at two possible locations, one in each of two arrays. A hash function maps the pair of item and choice of array to its location in that array. When a newly stored item finds both its locations already occupied, one is kicked out and replaced by the new item. This forces the kicked-out item to move to its alternate location, possibly kicking out yet another item. Problems arise if the corresponding Cuckoo graph, a bipartite graph with array locations as nodes and item location pairs as edges, has cycles. While n items, whose edges form a cycle, could barely be stored in the table, any n+1st item mapping within the same set of locations (a chord in the cycle) would not fit, as the pigeonhole principle tells us.

In the Proof-of-Work problem, we typically set n ≥ 29, and use edge indices (items) 0 .. N-1, where N = 2n. The endpoints of edge i are (siphash(i|0) % N, siphash(i|1) % N), with siphash being a popular keyed hash function. A solution is a cycle of length L in this Cuckoo graph, where typically L = 42.

Cuckoo Cycle solvers spend nearly all cycles on edge trimming; identifying and removing edges that end in a leaf node (of degree 1), as such edges cannot be part of a cycle. Trimming rounds alternate between the two node partitions.

The fraction fi of remaining edges after i trimming rounds (in the limit as N goes to infinity) appears to obey the

Cuckoo Cycle Conjecture: fi = ai-1 * ai, where a-1 = a0 = 1, and ai+1 = 1 – e-ai

fi could equivalently be defined as the fraction of edges whose first endpoint is the middle of a (not necessarily simple) path of length 2i. So far I have only been able to prove the conjecture for i ≤ 3. For instance, for i = 1, the probability that an edge endpoint is not the endpoint of any other edge is (1-1/N)N-1 ~ 1/e.

Here’s hoping someone finds an elegant proof…

A problem to maximize the number of edges in a cycle while minimizing the total weight

I encountered the problem below and the only solution I came up with is branch and bound like that is used in TSP and I don’t think the bound I used is good enough. Are there any better idea on this?

Consider a graph $ G$ that consists of an undirected bipartite graph and another vertex $ O$ that is connected to all the other vertices. Assume the weight of the edges are positive and the weights obey the triangle inequality. Find a cycle in $ G$ that involves $ O$ s.t. the total weight is $ \leq$ some given value $ t$ and maximize the total number of vertices it passes through.

Finding invariant when detecting a cycle

Let consider a connected graph $ G = (V, E)$ which is not oriented. One way to detect a cycle in such a graph is :

  1. Create an array : seen of size $ \mid V \mid$ with seen[i] = false for all $ i$

  2. Perform a DFS (or BFS) starting at the node $ 0$ .

  3. When we see a node $ i$ : we have two cases : if seen[i] = false then seen[i] = true else we found a cycle.

One idea to prove the correction of this algorithm is saying the following : if the algorithm return true it means there two nodes $ x$ and $ y$ such that when we looked at $ y$ we have : seen[y] = false and seen[x] = true thus there is a cycle namely the cycle which begin at $ x$ and use the only path that connect $ x$ and $ y$ in the DFS tree and then use the edge $ (y,x)$ .

The problem is that this is not really rigourous and I am really lokking for an invariant that we help me do the correction of this algorithm rigourously. So is there any invariant I can use here ?

Thank you very much !

Is Hamiltonian cycle problem on graphs with out-degree at most 3 NP hard?

I am trying to show a different form of Hamiltonian cycle problem is NP Hard. The problem is as follows.

We have a directed graph and each node can have at most 3 outgoing edges. Determine if this graph has a Hamiltonian cycle.

Is this problem NP hard?

I just need to find a problem to reduce to my problem but could achieve to find none.

3SAT looks friendly to me as it has 3-termed clauses but no more I progressed.

Case study on object oriented design in software engineering cell cycle biology homework help

Best research proposal about hypertension do your homework
Essay on czech republic

Buy Custom Essays, Term Papers and more


Professional Custom Writers – ORDER HERE

About that 'Us' ending… Boston U signs 5-yo with tumor to…

Case study on object oriented design in software engineering cell cycle biology homework help

Do users use their arrow keys to cycle through auto complete search results?

I’m working on a webapp/site that allows users to sign up to training courses that is aimed at the construction industry.

The main users of the website are self employed tradesman and office admins who will be booking staff onto training on their behalf.

The search input on the site has autocomplete functionality and I want to know if it’s necessary to allow users to cycle through the suggested results using their up and down arrow keys and hitting enter to select that result?

I feel like the majority of on site tradesmen will be using handheld devices and that office admins will likely use their mouse rather than using shortcuts and the arrow keys – meaning that it’s potentially unnecessary.

Is there any evidence out there that suggests it’s worth having this functionality enabled?


Swift Memory Cycle From Closure

I am working with closures and want to confirm that I do not have any memory leaks in my code. Below is my current code:

// in ImageGalleryController.swift class ImageGalleryCollectionViewController: UICollectionViewController {   var images = [Image]()  func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession) {     // assignment of closure     var cellImage = Image() { [weak self](image) in       self?.images.append(image)       self?.collectionView.reloadData()     }     // asynchronous     session.loadObjects(ofClass: NSURL.self) { urls in       if let url = urls.first as? URL {         cellImage.url = url       }     }     // asynchronous     session.loadObjects(ofClass: UIImage.self) { images in       if let image = images.first as? UIImage {         cellImage.aspectRatio = Double(image.size.height / image.size.width)       }     }   } }  // in ImageGallery.swift struct Image {   var url: URL? = nil {     didSet {       if propertiesAreSet() { handler(self) }     }   }   var aspectRatio: Double? = nil {     didSet {       if propertiesAreSet() { handler(self) }     }   }    init(handler: @escaping (Image) -> Void) {     self.handler = handler   }    var handler: (Image) -> Void    private func propertiesAreSet() -> Bool {     let bool = (url != nil && aspectRatio != nil) ? true : false     return bool   } } 

Basically my logic is that when two separate asynchronous requests get and set two separate properties on the Image struct, then I want to append that Image struct to the images array.

Which brings me to my related questions:

  • Since I am fairly new to Swift, am I properly handling memory leaks by declaring [weak self] when I create a new Image instance?
  • Should I set the closure handler to nil after it executes?
  • Is what I am doing ok or am I violating any Swift principles?

Is it still TDD if I follow the cycle for each method alone?

The question is not very expressive, anyway what I was wondering is if, if I follow the red-green-refactor cycle for each method is still TDD or if it has to be done globally.
I mean, let’s say I have 5 methods to test, I can follow two roads:

  1. Write tests for all methods, start test routine, add code to methods, add requirements to test, re-add code to methods, and so on (simplified, I know).
  2. Write test for a method and follow that cycle for that method until everything is satisfied, then move on to the next method’s test and perform the cycle again, and do this for 5 times

Number 1 is TDD, but is number 2 still TDD? I would say yes because it follows the philosophy of TDD, but I’m not sure if it’s really like that or I have to write all the tests first and then cycle “globally”.

The longest simple path on a cycle

We have n cities {1,2,3,…,n}. The city i is connected by two-way road with the city i+1. The city n is connected with the city 1 by two-way road.

The distances between cities are known. Let say they are {d1, d2,…,dn} where di is distance between i and i+1 city, dn denotes distance between n and 1 city.

enter image description here

The task is to find the longest road between two different cities in at most O(nlogn) time.