Chip operations. The code will use chips to perform operation on different sets of numbers. The results and sequences of operations will be displayed.
Description: Imagine you have a collection of specialized computing chips designed to perform a specific elementary arithmetic operation. These operations include addition, subtraction, multiplication, negation, and division. Each chip, except for the negation chip, requires two input values and produces a single output value. Due to the nature of its operation, the negation chip only needs one input and generates one output. Among these chips, there is a unique type called the output chip. This chip has one input and no output, as its sole function is to display the value it receives through its input line. For instance, if an output chip labeled O50 receives a value of 987.2, it will display a message like: “I am output chip number 50, and the value I received is 987.2.” In addition to the output chip, an input chip is designed to provide values to the computing system. This input chip feeds a value into the circuit, acting as a data source for the calculations performed by the other chips. Consider a configuration where four chips are connected in sequence to perform a series of operations. These chips are as follows:
-
A100 (Addition Chip): This chip adds two input values. It is connected to two input chips labeled I1 and I2. These input chips supply the values to be added.
-
N110 (Negation Chip): The output from the addition chip A100 is sent to the input of the negation chip N110. The negation chip takes this input value and negates it, producing a single output that is the negative of the input value.
-
M120 (Multiplication Chip): This chip requires two inputs to perform multiplication. One of its inputs is connected to the output of the negation chip N110, while the other input comes from the output of another input chip labeled I3.
-
S130 (Subtraction Chip): The output from the multiplication chip M120 is fed into one of the inputs of the subtraction chip S130. The other input to this chip comes from the output of an additional input chip labeled I4. The subtraction chip then subtracts the second input from the first and produces an output.
Finally, the output from the subtraction chip S130 is connected to the input of the output chip, labeled O50. This output chip, O50, receives and prints the final computed value from the sequence of operations. For instance, if the final value is 42.0, it would display: “I am output chip number 50, and the value I received is 42.0.”
In summary, the configuration of these chips allows a series of arithmetic operations to be performed in sequence, where each chip's output is passed as an input to the next chip in the chain. The entire process culminates in the output chip, which displays the final result of the computations. The input to your program will have the following format for the above. First, we build the circuit. Note that the first character is to add a chip to our circuit with a single letter A.
the rest of the detailed description and the base code will be found in the CS2413-ProjectTwo-Fall-2024 pdf file.
