Lab 0 (optional (8/29/2012) - Please do not go to the lab)

You need not go to your lab. Please think and try to do this problem. Using 5 switches to sort 4 elements. (we did a switch diagram to sort three numbers with three switches in class).
Input: Three distinct numbers a,b,c
Output: sorted output of (a,b,c) - a < b < c
Algorithm:
if (a > b ) swap(a,b)
if (b > c ) swap(b,c)
if (a > b ) swap (a,b)

Each comparator/wires connects two wires and sorts the values by outputting the smaller value to one wire, and the larger to the other.