The row and column headers for a Karnaugh map are written in gray code and not binary. I am wondering why. Is it because that the Karnaugh map needs to wrap around, and gray code is symmetrical?


migrated from physics.stackexchange.com Mar 27 '15 at 7:53

This question came from our site for active researchers, academics and students of physics.

  • 1
    \$\begingroup\$ This would be a much better fit on electronics SE. \$\endgroup\$ – WetSavannaAnimal aka Rod Vance Mar 26 '15 at 21:51
  • \$\begingroup\$ I'm voting to close this question as off-topic because it is not really about physics and should be on Electrical Engineering instead. \$\endgroup\$ – Kyle Kanos Mar 27 '15 at 1:38

Gray code means that nearest neighbours in the K-map differ from one-another by only one bit. This means that the images of products of predicates (A and B and ...) on the K-map are connected subsets of the K-map as long as you define the K-map on the surface of a torus - so you can spot these factors easily. So you need (1) Gray codes AND (2) to put the map on a torus ("wrap around") to make this connectedness property of products work. The wrapping around has nothing directly to do with the Gray codes: it is a condition further to Gray codes that you need to make the K-map work.

Try drawing a K-map with binary ordering - you'll quickly see that the products of predicates - which are what you want to spot to get a minimum length representation of the truth function become scattered in this representation.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.