Design a one-hot vector system that takes a bit vector and zeros out all bits to the right of the first detected '1', starting from the most significant bit (msb) to the least significant bit (lsb). For example, transforming the input 010101 to 010000.
In another task, you are provided with a block that takes two numbers,
X
X and
Y
Y, and has two outputs: the first output yields
m
a
x
(
X
,
Y
)
max(X,Y), while the second output yields
m
i
n
(
X
,
Y
)
min(X,Y). Using this block, design a 4-to-4 sorter that processes four numbers and sorts them according to the same maximum and minimum criteria. Aim to minimize the number of blocks used.
Additionally, implement a 6-to-6 sorting block.