Is there a 'normal' way to write down K-maps with more than 4 inputs?
I've just written some code to verify logic which implements n-input K-maps. The user has to initialise a square or rectangular array with the function output data, so I did a quick Google search to find out how people wrote their grids. On the net, at least, it looks like the reflected binary Gray version is the normal way to do it. It's not what I was used to, but I assumed that most people would use it.
Now that I've done it, though, I'm not so sure. For a 5-input function, for example, a reflected binary Gray map looks like this:
// /----- A -----\ // /- B -\ /- B -\ // --------------- --------------- // | x | x | x | x | | x | x | x | x | // |---------------| |---------------| // | x | x | x | x |\ | x | x | x | x |\ // --------------- E --------------- E // / | x | x | x | x |/ / | x | x | x | x |/ // D |---------------| D |---------------| // \ | x | x | x | x | \ | x | x | x | x | // --------------- --------------- // \- C -/ \- C -/
A is the MS input, and E is the LS input. The 8 columns have left-to-right ABC codings of 000, 001, 0011, and so on. The 4 rows are coded 00, 01, 11, 10 from top-to-bottom.
The coding I've used historically is different. It's still Gray-coded, of course, but it looks like this (actually, I assign A, B, C, D, E arbitrarily, but I've adjusted it to be mostly consistent with the reflected version):
// /----- A -----\ // /- B -\ /- B -\ // --------------- --------------- // | x | x | x | x | | x | x | x | x | // |---------------| |---------------| // | x | x | x | x |\ | x | x | x | x |\ // --------------- E --------------- E // / | x | x | x | x |/ / | x | x | x | x |/ // D |---------------| D |---------------| // \ | x | x | x | x | \ | x | x | x | x | // --------------- --------------- // \- C -/ \- C -/
The problem with the reflected version is that it's not easy to (manually) minimise over the 2 grids, because B has moved. In the second version, you can place the two grids over each other to get your minterms. The difference is more significant for 6 variables - it's not obvious how to minimise the first version, but the second version easily turns into a 3D toroid and you can actually visualise the groups. Note that I'm not talking about machine minimisation - this is just how a human would write and visualise a 5- or 6-input map, and how they'd want to write down the function output data.
If you use K-maps, which version do you prefer for 5- and 6-input functions? I clearly have to use the reflected version for more than 6 inputs; it's only 5 and 6 which are problems.
Thanks -
Evan