Sunday 30 June 2019

digital logic - What's the first step to learn Verilog coding to sort values?


I do not know how to start working on this problem. Should I first design the digital circuit of sorting? I am poor on both topic. Suppose I have four numbers R0, R1, R2, R3... What is the digital circuit for arranging these numbers in ascending order? I found a sorter circuit on the internet, but I'm not able to relate it to my problem.



enter image description here


Can anyone give me a hint regarding this?



Answer



The basic hardware sorting element is a module that has two inputs and two outputs. It contains a comparator and two multiplexers, and presents the smaller of the two inputs at one of its output ports, and the larger at the other output port.


There are many ways to use such a module to sort a list of items, with a wide range of space-vs.-time tradeoffs. At one extreme, you can build a completely combinatorial sorting network (with optional pipeline registers to increase throughput), but the resources required grows O(N2). I have implemented such a network to create a real-time median filter for high-definition video.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...