Using Python 366 Shell Solve Problem Define Test Function Generate Binary Sequence Input M Q37021104

Using python 3.6.6 shell.  Solve the belowProblem:

  1. Define and test a function to generate the binary sequence forthe input message. For example, if the input is “abc”, then thebinary sequence is 01100001 01100010 01100011 (97 98 99).
  2. Define and test a function to generate the even parity bit forthe input message. For example, if the input is “bc”, then theparity bit will be 1 according to the message’s binary form01100010 01100011.
  3. Define and test a function to generate the covariance matrixfor an input vector. For example, if the input is v=[1, 2, 5], thenthe matrix is v*vT =

1   2     5

2   4    10

5 10   25


Solution


1)

SOURCECODE:

def

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.