Sunday, July 26, 2009

Transform the boolean expression F = ABC + A'C' + A'B' as Follows :?

Transform the boolean expression F = ABC + A'C' + A'B' as Follows :





a) To an expression that uses only AND and NOT operators.





b) a) To an expression that uses only OR and NOT operators.





hope you could help me on these question.. i will very appreicate ..thx

Transform the boolean expression F = ABC + A'C' + A'B' as Follows :?
These just need the application of DeMorgan's theorem.


For a full explanation, see the reference. The general


identities of interest are:





A|B = NOT(A' %26amp; B')


A%26amp;B = NOT(A' | B')











Original expression


--------------------------------------


F = ABC + A'C' + A'B'











Problem A: Convert to AND and NOT


--------------------------------------





F = NOT( NOT(A%26amp;B%26amp;C) %26amp; NOT(A' %26amp; C') %26amp; NOT(A' %26amp; B'));











Problem B: Convert to OR and NOT


--------------------------------------


F = NOT(A'|B'|C') | NOT(A|C) | NOT(A|B);











In order to check this, I translated the logical


expression into "C". This program computes the


original function as "f1", the AND/NOT function


as "f2", and the OR/NOT function as "f3".








#include %26lt;stdio.h%26gt;





/* F = ABC + A'C' + A'B' */





int


main(int argc, char*argv[])


{


  int f1, f2, f3;





  for (int a=0; a%26lt;2; a++) {


  for (int b=0; b%26lt;2; b++) {


  for (int c=0; c%26lt;2; c++) {





    f1 = (a%26amp;b%26amp;c) | (!a)%26amp;(!c) | (!a)%26amp;(!b);





    f2 = !(!(a%26amp;b%26amp;c) %26amp; !(!a %26amp; !c) %26amp; !(!a %26amp; !b));





    f3 = !(!a|!b|!c) | !(a|c) | !(a|b);





    printf("%d %d %d ==%26gt; %d %d %d \n",a,b,c,f1,f2,f3);





  }


  }


  }





  return 0;


}





Then to test it, note that all three computation generate


the same output:





    $ cc logical.c


    $ a.out


    0 0 0 ==%26gt; 1 1 1


    0 0 1 ==%26gt; 1 1 1


    0 1 0 ==%26gt; 1 1 1


    0 1 1 ==%26gt; 0 0 0


    1 0 0 ==%26gt; 0 0 0


    1 0 1 ==%26gt; 0 0 0


    1 1 0 ==%26gt; 0 0 0


    1 1 1 ==%26gt; 1 1 1











.


No comments:

Post a Comment