Question: Step 1. Environment Setup Our programming environment is the same as the first lab (Lab 01). In this lab, we want to continue the new




Step 1. Environment Setup Our programming environment is the same as the first lab (Lab 01). In this lab, we want to continue the new series of labs about designing a logic circuit. Particularly, in this lab, we want to write the boolean function (expression) for the output binary variables based on the standard form of the product of MAXTERMs. Product of MAXTERMs is also called Canonical Products of Sums (PoS) since each MAXTERM is an OR between the input binary variables (either in normal form X or in complement form X'), e.g., Z'+Y+X, followed by an AND on the MAXTERMs, e.g., F(Z,Y,X) = Mo+M2+M3 = (Z+Y+X) (Z+Y'+X)(Z+Y'+X'). In the previous Lab 09, we wrote a program that printed out the Boolean function in the form of a sum of minterms (Canonical Sum of Products): 01 #include 02 #include 03 84 #define INPUT_VARIABLE_COUNT 3 05 #define OUTPUT_VARIABLE_COUNT 1 06 07 void build_right_side(int truth_table[][INPUT_VARIABLE_COUNT + OUTPUT_VARIABLE_COUNT]){...} 08 void build_right_side(int truth_table[][INPUT_VARIABLE_COUNT + OUTPUT_VARIABLE_COUNT]){...} 09 void to_minterm(int truth_table[][INPUT_VARIABLE_COUNT + OUTPUT_VARIABLE_COUNT]){...} 10 int main(void) { 11 11 setbuf(stdout, NULL); 12 13 int TRUTH_TABLE_ROW_COUNT = (int) pow(2, INPUT_VARIABLE_COUNT); 14 int truth_table[TRUTH_TABLE_ROW_COUNT][INPUT_VARIABLE_COUNT + OUTPUT_VARIABLE_COUNT] = {@}; 15 const char variables[INPUT_VARIABLE_COUNT + OUTPUT_VARIABLE_COUNT] = {'z', 'y', 'X', 'F'}; 16 17 build_left_side(truth_table); 18 build_right_side(truth_table); 19 20 1/printing the header for input variables 21 for(int i = 0; i Optional! From Lab 09. 2) Canonical Pos If a user selects (2), the program should print out the Boolean function for F1 in the form of a Product of MAXTERMS (Canonical PoS) as shown below: output variable F1 = (Z+Y+X') (Z+Y'+x) (Z+Y'+X') (Z'+Y'+x) (Z'+Y' +X') If the user selects (1), the program outputs the Canonical Sum of Products as we did in Lab 09. This is optional. If the user selects (O), the program ends. Please restrict the user to enter inputs within the range {0,1} for the value of the output variable. For instance, if the user enters 2,-1, ..., print out an error message and come back to ask for correct inputs. It is required to write a modular program. Please put the part of the code that outputs a MAXTERM based on the value of input variables in a new function called to_MAXTERM() inside the main.c file. Deliverables You will prepare and submit the program in one single zip file Lab10_UWinID.zip containing the following two items: 1. The entire project folder Project including the code file (main.c or main.cpp) and executable file (main.exe in windows or main in mac/linux) 2. The result of the commands in the file Results.pdf. Simply take screenshots of the results and save (print) them into a single pdf. 2. [Optional and if necessary] A readme document in a txt file Readme.txt. It explains how to build and run the program as well as any prerequisites that are needed. Please note that if your program cannot be built and run on our computer systems, you will lose marks. In sum, your final Lab10_UWinID.zip file for the submission includes 1 folder (entire project folder), 1 image (results snapshot) and 1 txt (report). Please follow the naming convention as you lose marks otherwise. Instead of UWinID, use your own UWindsor account name, e.g., mine is hfani@uwindsor.ca, so, o Lab10_hfani.zip (75%) Project => Printing the Sum of Products [any required library, header or source files] main.c or main.cpp => Must be compiled and built with no error! main.exe or main (10%) Results.pdf (Optional) Readme.txt o O (10%) Modular Programming (using separate functions) (5%) Files Naming and Formats, and Folder Structure Step 1. Environment Setup Our programming environment is the same as the first lab (Lab 01). In this lab, we want to continue the new series of labs about designing a logic circuit. Particularly, in this lab, we want to write the boolean function (expression) for the output binary variables based on the standard form of the product of MAXTERMs. Product of MAXTERMs is also called Canonical Products of Sums (PoS) since each MAXTERM is an OR between the input binary variables (either in normal form X or in complement form X'), e.g., Z'+Y+X, followed by an AND on the MAXTERMs, e.g., F(Z,Y,X) = Mo+M2+M3 = (Z+Y+X) (Z+Y'+X)(Z+Y'+X'). In the previous Lab 09, we wrote a program that printed out the Boolean function in the form of a sum of minterms (Canonical Sum of Products): 01 #include 02 #include 03 84 #define INPUT_VARIABLE_COUNT 3 05 #define OUTPUT_VARIABLE_COUNT 1 06 07 void build_right_side(int truth_table[][INPUT_VARIABLE_COUNT + OUTPUT_VARIABLE_COUNT]){...} 08 void build_right_side(int truth_table[][INPUT_VARIABLE_COUNT + OUTPUT_VARIABLE_COUNT]){...} 09 void to_minterm(int truth_table[][INPUT_VARIABLE_COUNT + OUTPUT_VARIABLE_COUNT]){...} 10 int main(void) { 11 11 setbuf(stdout, NULL); 12 13 int TRUTH_TABLE_ROW_COUNT = (int) pow(2, INPUT_VARIABLE_COUNT); 14 int truth_table[TRUTH_TABLE_ROW_COUNT][INPUT_VARIABLE_COUNT + OUTPUT_VARIABLE_COUNT] = {@}; 15 const char variables[INPUT_VARIABLE_COUNT + OUTPUT_VARIABLE_COUNT] = {'z', 'y', 'X', 'F'}; 16 17 build_left_side(truth_table); 18 build_right_side(truth_table); 19 20 1/printing the header for input variables 21 for(int i = 0; i Optional! From Lab 09. 2) Canonical Pos If a user selects (2), the program should print out the Boolean function for F1 in the form of a Product of MAXTERMS (Canonical PoS) as shown below: output variable F1 = (Z+Y+X') (Z+Y'+x) (Z+Y'+X') (Z'+Y'+x) (Z'+Y' +X') If the user selects (1), the program outputs the Canonical Sum of Products as we did in Lab 09. This is optional. If the user selects (O), the program ends. Please restrict the user to enter inputs within the range {0,1} for the value of the output variable. For instance, if the user enters 2,-1, ..., print out an error message and come back to ask for correct inputs. It is required to write a modular program. Please put the part of the code that outputs a MAXTERM based on the value of input variables in a new function called to_MAXTERM() inside the main.c file. Deliverables You will prepare and submit the program in one single zip file Lab10_UWinID.zip containing the following two items: 1. The entire project folder Project including the code file (main.c or main.cpp) and executable file (main.exe in windows or main in mac/linux) 2. The result of the commands in the file Results.pdf. Simply take screenshots of the results and save (print) them into a single pdf. 2. [Optional and if necessary] A readme document in a txt file Readme.txt. It explains how to build and run the program as well as any prerequisites that are needed. Please note that if your program cannot be built and run on our computer systems, you will lose marks. In sum, your final Lab10_UWinID.zip file for the submission includes 1 folder (entire project folder), 1 image (results snapshot) and 1 txt (report). Please follow the naming convention as you lose marks otherwise. Instead of UWinID, use your own UWindsor account name, e.g., mine is hfani@uwindsor.ca, so, o Lab10_hfani.zip (75%) Project => Printing the Sum of Products [any required library, header or source files] main.c or main.cpp => Must be compiled and built with no error! main.exe or main (10%) Results.pdf (Optional) Readme.txt o O (10%) Modular Programming (using separate functions) (5%) Files Naming and Formats, and Folder Structure