5-bit odd parity checker
I am trying to code a 5-bit Mealy odd parity checker. I got some of the code written (the reset, the next state logic, and the output logic) except the part where the checking happens for the 5-bit output. How can I check a 5-bit variable if the number of 1'b1 in it is odd? module parity (clk, rst, w,z); input clk, rst, w; reg [1:0] present, next; output reg z; parameter s0 = 4'b0000, s1 = 4'b0001, s2 = 4'b0010, s3 = 4'b0011, s4 = 4'b0100, s5 = 4'b0101, s6 = 4'b0110, s7 = 4'b0111, s8 = 4'b1000, s9 = 4'b1001, s10 = 4'b1010; // Reset always @(posedge clk, posedge rst) begin if(rst) present <= s0
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.