# Building a formula to pass n bits though the minimum number of circuts

I have a circuit X which has 4 inputs A0,B0,A1,B1 and 2 outputs A2,B2. For n of A,B bits, I need them to pass through X. I'm trying to build an equation on how many circuits X I need for n bits. For example, for n=8 we need 7 circuits:

I found out that for 2<=n<=7 we need n-1 X cuirits, but I know that for n=32 we need to get 30. What is the right formula?

• So each level is half the number of the previous level. Now sum these up. Hint: Geometric progression. – Eugene Sh. Jul 16 '19 at 17:49
• I don't understand what the "X" boxes are supposed to do. How is the output of an X box related to the input of that box? How do you know that you need 30 X boxes for n=32, because I am skeptical of that answer. – Elliot Alderson Jul 16 '19 at 17:50
• Indeed, for 32 bits you need 15 boxes. At least if the other information in the question is correct. – Eugene Sh. Jul 16 '19 at 17:52