mirror of
https://github.com/aolofsson/oh.git
synced 2025-01-30 02:32:53 +08:00
22 lines
703 B
Verilog
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
|
|
|
|
|
|
|
|
|