1
0
mirror of https://github.com/aolofsson/oh.git synced 2025-01-30 02:32:53 +08:00
oh/common/hdl/oh_parity.v
2020-01-28 18:12:57 -05:00

22 lines
703 B
Verilog

//#############################################################################
//# Function: Calculates parity value for #
//#############################################################################
//# Author: Andreas Olofsson #
//# License: MIT (see LICENSE file in OH repository) #
//#############################################################################
module oh_parity #( parameter DW = 2 // data width
)
(
input [DW-1:0] in, // data input
output out // calculated parity bit
);
assign parity = ^in[DW-1:0];
endmodule // oh_parity