1

If a function f has a while loop or for loop, can I compile this function into an acyclic boolean circuit that ensures that each gate is topologically ordered, i.e. there is no feedback? If so, how exactly is that done, by loop expansion? And if compiling the function as a cyclic boolean circuit is allowed, does it simplify the circuit structure?

I would appreciate your answer. Thanks!

Emison Lu
  • 13
  • 3

1 Answers1

0

If your circuit can contain registers (or some other form of memory or state) (e.g., sequential logic), then yes, you can. You store the value of all variables in the registers, and you build a circuit that computes the next value of those variables after one iteration of the loop, and then the circuit runs over and over again.

If your circuit cannot contain registers or state, but only logic gates (i.e., combinational logic), then no, you cannot.

D.W.
  • 167,959
  • 22
  • 232
  • 500