MATLAB Answers

Testing vector for parity bits

조회 수: 1(최근 30일)
David Jones
David Jones 2020년 9월 28일
댓글: Ameer Hamza 2020년 9월 29일
Hi
I have 55 bits in a vector I need to test for parity, the first 4 bits are the data the 5 bit is the parity bit this reapeats 11 times, can anyone please help me to extract and test the data blocks.
Thank You
David

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 9월 28일
편집: Ameer Hamza 2020년 9월 28일
Try something like this
x = % 55 element vector
x_new = reshape(x, 5, []).';
data = x_new(:, 1:4);
parity = x_new(:, 4);
Each row in 'data' contains for bits, and their corresponding parity is stored in 'parity'.
  댓글 수: 2
Ameer Hamza
Ameer Hamza 2020년 9월 29일
I am glad to be of help!

댓글을 달려면 로그인하십시오.

추가 답변(0개)

태그

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by