Create a state meachine that encrypts an incoming digitalbitstream using a D-flip-flop and a Mealy Meachine. The device haveto meet these requirments:
A. The output of the encryption device matches the inputbitstream until a certain set of bits is detected (such as110). After this detection, the output is the complementedversion of the input.
B. When a second bitstream 010 is detected, the output revertsto simply matching the input stream again. Please make bothbitstreams that cause the switching action to be at least 3 bits inlength.
Please include the following for the above questions:
1. A state graph for the machine.
2. The state tables, truth tables, and K-maps that you used todesign the machine.
3. Give the example bitstream output demonstrating the machinein operation. Example bitstream: 0111010001110101