Re: Algorithm to generate boolean function by using Karnaugh map
From: Carl W. (NoEmail_at_hp.com)
Date: 09/30/04
- Next message: John Woodgate: "Re: Battery level tester."
- Previous message: Rene Tschaggelar: "Re: Varying sampling..."
- In reply to: Eric K.: "Re: Algorithm to generate boolean function by using Karnaugh map"
- Next in thread: Eric K.: "Re: Algorithm to generate boolean function by using Karnaugh map"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 30 Sep 2004 19:11:44 GMT
Eric K. wrote:
> Thanks, John. But how to do it using KMAP as it is required?
As I remember (it's been years), the Q-M algorithm finds
all the 1-cubes, which is equivalent to circling every 1 in
the graph (it does something with don't-cares, too). Then,
it circles every 2-cube, which is every pair (as you would
circle them) on the Karnaugh map. It doesn't matter if
the '1' or 'X' is covered by another 2-cube already, it
circles it. I think then it does the 3-cubes (4-way squares
on the K-map) and 4-cubes, on up until it can't circle anything
bigger.
Then it chooses the minimal set of 1,2,3,4,etc.-cubes
which covers the graph. To cover the graph, you have to
have circles which cover all 1's, don't cover any 0's and
we don't care if they cover X's.
So, my guess is that you'd want to use the circling part
of Q-M hidden from the user :-), then figure out the minimal
set of cubes (hmm, I guess Q-M prefers the top cubes first),
then circle the graphical K-map in such a way that you can
lie to the user when your program prints "It's intuitively
obvious that this is the least cost function" :-).
A simple example of a K-map which shows the need to
use the Q-M "minimum set of cubes which cover the graph"
is this:
1 1 0 0
0 1 1 0
0 0 1 1
0 0 0 0
If you circle the pairs horizontally, you get 3 2-cubes.
If you circle them vertically first, then circle the
horizontal pairs, you get 4 2-cubes required to cover
the map. 3 2-cubes is typically the better (minimal
gate lead) solution.
Thanks,
Carl W.
- Next message: John Woodgate: "Re: Battery level tester."
- Previous message: Rene Tschaggelar: "Re: Varying sampling..."
- In reply to: Eric K.: "Re: Algorithm to generate boolean function by using Karnaugh map"
- Next in thread: Eric K.: "Re: Algorithm to generate boolean function by using Karnaugh map"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|