This is the implementation result of Insert Sort primitive with Max_sort_number=1024:
Important
The max sort number should be less than 1024 because array partition can only support array size smaller then 1024. For arbitary sort number, Merge Sort primitive is required Internals of Merge Sort
Caution
The size of input stream should be larger than the max sort number, otherwise the internal shift register is not fully initialized.
This insertSort
primitive has one port for key input, one port for payload input, one port for key output, one port for payload output and one boolean sign for indicating ascending sort or descending sort.