Create a console ‘C’ application to perform the following three input logic functions. Your application should be user friendly.
- Logic Functions
- Shift Left
- Shift Right
All of the above binary functions has two inputs (AND,OR etc.) except Shift operations and the output must be displayed as binary number format. User could be asked to enter binary numbers to proceed with the specific operation. Error messages may be displayed, if the user enter non-binary values.
- Mathematical Equation
- Simple correlation function
Following mathematical function, explain the basic correlation function. This function may accept 10 input samples(x1,x2) to produce output. Detail explanations as shown below.
N – Total Number of samples
– Samples 1
– Samples 2
n – Integer number
The followings example shows the calculation for the 9 input samples
) = 5
- Expand the above equation to create a C function, which accepts buffer pointers and accept a user-defined number of samples to determine size of the buffer
- Simulating the CPU with 8 bit instruction
Create a function called “void cpu_simulation(unsigned char *PC, unsigned char *memory, unsigned char *run)”, which accepts 10 memory buffer pointers, pointer to PC and run. The details description as below.
Following the flowchart, illustrate the execution sequence of a CPU instruction. Implement this process in C, within the function call.