A banyan switch is a multistage switch with micro-switches at each stage that route the packets based on the output port represented as a binary string. For n inputs and n outputs, we have log2 n stages with nl2 micro-switches at each stage. #of stages = Iog2(8) = 3.