[SOLVED] even parity check with data flow operators

Status
Not open for further replies.

mohsansaleem

Newbie level 3
Joined
Mar 2, 2016
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
72
hi
I want to build even parity check for the data of size [7:0] with data flow operators ?
can anyone help me ,
thanx
 

like ,

Code:
assign parity_bit =(data_in[0]^data_in[1])^(data_in[2]^data_in[3])^(data_in[4]^data_in[5])^(data_in[6]^data_in[7]);
or

Code:
assign parity_bit =(data_in[7]^data_in[6])^(data_in[5]^data_in[4])^(data_in[3]^data_in[2])^(data_in[1]^data_in[0]);
 

so will use this statment without brackets

Code:
 assign parity_bit =(data_in[7]^data_in[6])^(data_in[5]^data_in[4])^(data_in[3]^data_in[2])^(data_in[1]^data_in[0]);
to get even parity ??
 

Yes. Brackets aren't needed.

- - - Updated - - -

Sure, even parity. Check yourself with pencil and paper method.
 

Instead of all that typing, use the reduction XOR operator e.g. assign even_parity = ^data_in
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…