I'm learning digital engineering and I'm also a fan of theoretical and abstract physics and mathematics. I find it amazing that you have an algebra that directly corresponds to logic circuits and if you do manipulations on paper you can see the direct result on the circuits. So I wondered if there is a generalisation of all of this, or even a kind of higher dimensional digital electronics or something like that. My guess is that it must be some kind of generalised boolean algebra, but not sure. Any suggestions? I already asked this in electrical engineering stack exchange, but I think this question may a be over the heads of the engineers there.