Prev Problem
Next Problem

13. Parity Checker

Design a Verilog module parity_checker that computes odd and even parity of an 8-bit input using reduction operators.

Requirements

  • Module name: parity_checker
  • Input: D[7:0]
  • Outputs:
    • odd_parity (1 if the number of 1s in D is odd)
    • even_parity (1 if the number of 1s in D is even)

 

Expected behaviour

D (hex)Ones countodd_parityeven_parity
8'h00001
8'h01110
8'h03201
8'hAA401
8'hF0401
8'hFF801
Need Help? Refer to the Quick Guide below