Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The implementation for func_increment() should just be this, as we were not given anything else relating to it: void func_increment(int a[], int result[]); Lab# Date
The implementation for func_increment() should just be this, as we were not given anything else relating to it: void func_increment(int a[], int result[]);
Lab# Date Title Grade Release Date Lab 08 Week 08 Truth Table Due Date March 02, 2021 Tuesday Midnight AoE Wednesday 7 AM EDT March 08, 2021 This lab's objectives will be to master the topics in logic circuit design by implementing the algorithms with a programming language, herein, C/C++. Step 1. Environment Setup Our programming environment is the same as the first lab (Lab 01). In this lab, we want to start a new series of labs about designing a logic circuit. Particularly, in this lab, we want to create a truth table for a given number of input binary variables and output binary variables. 1) As we discussed in the lectures, the first step in designing a logic circuit is to build a truth table with columns for input binary variables and columns for output binary variables. Also, we have to create rows for different values of the input binary variables, either 0 or 1 for each input binary variable. For example, given 3 input binary variables and 1 output binary variable, the truth table would have 4 columns and 23=8 rows. 2) Next, we have to pick names for the input and output binary variables. For instance, for 3 input binary variables, we can choose Z, Y, X and for the single output binary variable, we can choose F. 3) Then, we have to look at those rows that make the output binary variable 1 and write the output binary variable as a Boolean function (expression) of the input binary variables in the form of a sum of minterms (canonical sum of products). For instance, F = m(0,2,3) = Z'Y'X' + Z'YX' + Z'YX. 4) Finally, we sketch the logic circuit using the schematic symbols of the NOT, AND and OR logic gates. In this lab, we want to write a program that does the 1st and 2nd steps. That is, we want to write a program that outputs the truth table. In the following code, I assume that there are 3 input binary variables (line#04), there is 1 output binary variable (line#05), and as a result, the truth table is going to have 2^(#input variables) = 23=8. I defined the truth table as a 2-D array of integer values with size 8 rows x 4 columns (line#15). Please pay attention that in C/C++, the '^' symbol is reserved for the bitwise XOR operator and cannot be used for the power operator (line#11,12). In C/C++, we can use the pow(a, b) function available in math.h library to return a to the power of b as shown in line#14. Also, note that the format specifier for char is "%c". 01 #include
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started