Question: Please help, please show your code and your output. Thank you so much Write a C++ program that reads in integers as input parameters. The

Please help, please show your code and your output. Thank you so much

Write a C++ program that reads in integers as input parameters. The integer inputs are the positions of the minterms of the function of 3 boolean variables x, y, z. It prints out the expression in SOP form. It then simplifies it by pairing terms that only have one variable changed between them. It then prints out the simplified expression. For example

 $ ./sop 1 3 6 7 Original expression for ( m1 + m3 + m6 + m7 ): x'y'z + x'yz + xyz' + xyz Simplified expression: x'z + xy $ ./sop 0 1 2 3 Original expression for ( m0 + m1 + m2 + m3 ): x'y'z' + x'y'z + x'yz' + x'yz Simplified expression: x' $ ./sop 0 3 5 7 4 Original expression for ( m0 + m3 + m5 + m7 + m4 ): x'y'z' + x'yz + xy'z + xyz + xy'z' Simplified expression: xy'z + y'z' + yz 

Hint:

 You may check whether the i-th bit of a binary number n is 1 or 0 using the bitwise & operator: if ( (( n >> i ) & 0x1) == 0 ) the i-th bit of n is 0 else the i-th bit is of n is 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!