stanford
Full Member level 2
lets say we have 4 inputs
input [7:0] in[4];
To find the smallest number we want to use 4 comparators for the fastest implementation.
i.e compare (in[0], in[1]), (in[1], in[2]), (in[2], in[3]), (in[0], in[3]). From this result, you will get 4 outputs.
c0 = in[0] > in[1];
c1 = in[1] > in[2];
c2 = in[2] > in[3];
c3 = in[0] > in[3];
then we need a decoder to find the smallest. How does this decoder look like?
thanks
input [7:0] in[4];
To find the smallest number we want to use 4 comparators for the fastest implementation.
i.e compare (in[0], in[1]), (in[1], in[2]), (in[2], in[3]), (in[0], in[3]). From this result, you will get 4 outputs.
c0 = in[0] > in[1];
c1 = in[1] > in[2];
c2 = in[2] > in[3];
c3 = in[0] > in[3];
then we need a decoder to find the smallest. How does this decoder look like?
thanks
Last edited: