5

I got the following Karnaugh Maps but I am still having problems working out the expression for XOR from each table.

                Table 1
                -------
                  WZ
         00    01   11   10
       -----------------------
    00 |     |    |    |  1  |
       -----------------------
    01 |  1  |    |    |     |
       -----------------------
XY  11 |     |    |    |  1  |
       -----------------------
    10 |  1  |    |    |     |
       -----------------------


                Table 2 
                -------
                   WZ
         00     01   11   10
       -----------------------
    00 |     |  1  |     |   |
       -----------------------
    01 |     |     |  1  |   |
       -----------------------
XY  11 |     |  1  |     |   |
       -----------------------
    10 |     |     |  1  |   |
       -----------------------

It is XORs, but how can I easily deduce the XOR expressions?

Kit Ostrihon
  • 824
  • 2
  • 14
  • 36
Hakim Marley
  • 330
  • 2
  • 5
  • 19
  • It is unclear to me. What do you mean by deduce the XOR expressions? – axelduch Jan 08 '16 at 23:46
  • Well, what are the expressions from the above tables? The only idea i have is that the they are XOR. Like lets say in the first one, it could be X xor Y xor Z xor W...but i doubt am right – Hakim Marley Jan 08 '16 at 23:54

4 Answers4

4

I would not dismiss the variable z from the expression, because I think, the expression ¬z·(¬x·y·¬w + ¬x·w·¬y + ¬y·¬w·x + w·y·x) is not equal to (¬x·y·¬w + ¬x·w·¬y + ¬y·¬w·x + w·y·x). That would mean, that the K-map contains four doubles of ones, but there is only four singles.

I would rather find the expression in the K-map and then use the laws of Boolean algebra.

K-map of expression including 3-input xor and 3-input xnor

For the first table:

¬x·¬y·w·¬z + ¬x·y·¬w·¬z + x·y·w·¬z + x·¬y·¬w·¬z

¬z·((¬x + ¬y + w)·(¬x + y + ¬w)·(x + y + w)·(x + ¬y + ¬w))       //distributivity

¬z· (¬x + ¬y + w)·(¬x + y + ¬w)·(x + y + w)·(x + ¬y + ¬w)        //relaxed syntax

¬z· (¬x·¬x + ¬x·y + ¬x·¬w + ¬y·¬x + ¬y·y + ¬y·¬w + w·¬x + w·y + w·¬w)·
    (x·x + x·¬y + x·¬w + y·x + y·¬y + y·¬w + w·x + w·¬y + w·¬w)  //distributivity

Because of the laws of

  • idempotence (e.g.: ¬x·¬x=¬x),
  • absorption (e.g.:¬x + ¬x·y=¬x)
  • and complementation (e.g.: ¬x·x=0)

the expression is equivalent to:

¬z· (¬x                           +   0  + ¬y·¬w        + w·y +  0)·
    ( x  +                   +  0   + y·¬w +     + w·¬y +  0  )

¬z· (¬x + ¬y·¬w + w·y)·(x + y·¬w + w·¬y)     //just formatted

¬z· (¬x·x + ¬x·y·¬w + ¬x·w·¬y 
     + ¬y·¬w·x + ¬y·¬w·y·¬w + ¬y·¬w·w·¬y
     + w·y·x + w·y·y·¬w + w·y·w·¬y)          //distributivity

¬z· (  0  + ¬x·y·¬w + ¬x·w·¬y 
     + ¬y·¬w·x +     0      +      0
     + w·y·x +    0     +     0   )          //using the three laws↑ again

¬z· (¬x·y·¬w + ¬x·w·¬y + ¬y·¬w·x + w·y·x)    //how the 3-input XOR is defined

¬z· (x xor y xor w)

For the second table:

¬x·¬y·¬w·z + ¬x·y·w·z + x·y·¬w·z + x·¬y·w·z

z·((¬x + ¬y + ¬w)·(¬x + y + w)·(x + y + ¬w)·(x + ¬y + w))        //distributivity

z· (¬x + ¬y + ¬w)·(¬x + y + w)·(x + y + ¬w)·(x + ¬y + w)         //relaxed syntax

z· (¬x·¬x + ¬x·y + ¬x·w + ¬y·¬x + ¬y·y + ¬y·w + ¬w·¬x + ¬w·y + ¬w·w)·
   (x·x + x·¬y + x·w + y·x + y·¬y + y·w + ¬w·x + ¬w·¬y + ¬w·w)   //distributivity

z· (  ¬x +                      +   0  + ¬y·w +       + ¬w·y +   0 )·
   ( x  +                  +  0   + y·w +      + ¬w·¬y +   0 )

z· (¬x + ¬y·w + ¬w·y)·(x + y·w + ¬w·¬y)     //just formatted

z· (¬x·x + ¬x·y·w + ¬x·¬w·¬y
    + ¬y·w·x + ¬y·w·y·w + ¬y·w·¬w·¬y
    + ¬w·y·x + ¬w·y·y·w + ¬w·y·¬w·¬y)       //distributivity

z· (  0 + ¬x·y·w + ¬x·¬w·¬y
    + ¬y·w·x +     0    +     0
    + ¬w·y·x +     0    +     0)            //using the three laws↑ again

z· (¬x·y·w + ¬x·¬w·¬y + ¬y·w·x + ¬w·y·x)    //how the 3-input XNOR is defined

z· (x xnor y xnor w)
Kit Ostrihon
  • 824
  • 2
  • 14
  • 36
3

The first table contains an Xor expression :

`First table`
                       w
    \ wz          ___________
 xy  \-----------------------+
     |     |     |     |  1  |
     +-----+-----+-----+-----+
     |  1  |     |     |     | |
     +-----+-----+-----+-----+ | y
   | |     |     |     |  1  | |
 x | +-----+-----+-----+-----+
   | |  1  |     |     |     |
     +-----------------------+
            ___________
                 z

as you could see the middle of the table (Z area) is fake. that is, the table function is :

F(Table1) = w'x'yz' + wx'y'z' + w'xy'z' + wxyz'

in binary form you could see a zero column :

F(Table) = 0010   eliminating Z    F(xor)= 001
           0100  ---------------\          010
           1110  ---------------/          111
           1000                            100
              ^--> fake

and the final table must be something like this :

`simplified xor table`
                w
      \ w 0   __1__
   xy  \-----------+
    00 |     |  1  |
       +-----+-----+
    01 |  1  |     | |
       +-----+-----+ | y    And " F = wy' + w'y " is an Xor only
   |10 |  1  |     | |      between 2 variables, right?
 x |   +-----+-----+
   |11 |     |  1  |
       +-----------+


The second table just contains an Xnor expression of the first one :

`Second Table`
F(Table2) = w'xyz + wxy'z + w'x'y'z + wx'yz
                          w
       \ wz          ___________
    xy  \-----------------------+        negation of table 2 is table 1 and vise versa
        |     |  1  |     |     |      F(Table2) = 1101    F(Table2)'= F(Table1) = 0010
        +-----+-----+-----+-----+                  1011                            0100
        |     |     |  1  |     | |                0001                            1110
        +-----+-----+-----+-----+ | y              0111                            1000
      | |     |  1  |     |     | |                   ^--> fake                       ^
    x | +-----+-----+-----+-----+         
      | |     |     |  1  |     |         
        +-----------------------+
           ^   ___________   ^
           ^        z        ^
           ^                 ^
           ^--------z'-------^

    the final table is:
                w
      \ w 0   __1__
   xy  \-----------+
    00 |  1  |     |
       +-----+-----+
    01 |     |  1  | |
       +-----+-----+ | y    And " F = w'y' + wy " is an Xnor
   |10 |     |  1  | |
 x |   +-----+-----+
   |11 |  1  |     |
       +-----------+

Always remember the tables that contain the zigzag pattern
are either an Xor or Xnor expression.

Student
  • 805
  • 1
  • 8
  • 11
  • 1
    congratulation!, you got first gold badge. i dont know why community recently reject my edits. i wonder why? you are expert in editing... – BattleTested_закалённый в бою Jul 29 '18 at 18:11
  • @Mohammadreza Panahi, thank you very kindly. At first, before touching to any post, I tried to analyze what experienced editors are doing to make posts more readable by proper usage of different tags. Of course, I made some mistakes, but gradually _Dos and Don't_ revealed themselves by the number of approved and rejected proposals. Don't take it personally, just do what you believe is the best way to do the job and every time try to make your edit better than before -- `one inch at a time!` (BTW, don't forget to use Grammarly to make your job easier) – Student Jul 29 '18 at 20:13
1

Just put a copy of this map on the right hand side of it (or left, no difference) and then choose two tilted cubes. Now, we write the simplified function for both of them:

(A = 1) (AND) (B=0 when C=1 and B=1 when C=0) (OR) (A = 0) (AND) (B=0 when C=0 and B=1 when C=1) that finaly gives this:

(A AND (B XOR C)) OR (¬A AND (B XNOR C))

on paper

M-J
  • 1,028
  • 11
  • 15
1

Basic rule for xor is that it gives 1 when odd number of input are 1. So in KMAP just see if 1 is present in all the odd number of 1's. Like WXYZ ( 0010, 1110 etc) if all gives 1 than there is a XOR in kmap.