Write a program that emulates a Batcher-Banyan network with 8inputs and 8 outputs. No need for a bitonic sorter and can use anysorting algorithm.
1. Demonstrate that your program works in the following inputcases by showing, the before and after of packet sorting, and whereeach packet travels at each stage of your multistage network.
a. One packet
b. Two packets (different destinations)
c. Four packets (different destinations)
d. Six packets (different destinations)
e. Seven packets (different destinations)
f. Skip the sorting stage to show an example of output portcontention with two packets destined for the same output port
g. Skip the sorting stage to show an example of path contentionwith two packets destined for the same shared link
Expert Answer
Answer to Write a program that emulates a Batcher-Banyan network with 8 inputs and 8 outputs. No need for a bitonic sorter and can…