Parity generation code

Status
Not open for further replies.

veeraj_patil

Newbie level 5
Joined
Jun 8, 2013
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Bangalore,India
Visit site
Activity points
57
I this syntax for generating parity correct ???

input [1:0] data;
output parity ;

assign parity=^(data);


Strange behavior ..giving mixture of odd and even parity.
Here's the result.

data parity
00 0
01 1
10 0
11 1

- - - Updated - - -

Ok got it,its correct.

parity=data(1)^data(0)
 


it should be ok - something else you are doing is wrong !
 

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