URL
https://opencores.org/ocsvn/yahamm/yahamm/trunk
[/] [yahamm/] [trunk/] [rtl/] [vhdl/] [yahamm_pkg.vhd] - Diff between revs 5 and 8
Show entire file |
Details |
Blame |
View Log
Rev 5 |
Rev 8 |
Line 8... |
Line 8... |
-- A hamming encoder and decoder with single-error correcting and
|
-- A hamming encoder and decoder with single-error correcting and
|
-- double-error detecting capability. The message length can be configured
|
-- double-error detecting capability. The message length can be configured
|
-- through a generic. Both the code generator matrix and the parity-check
|
-- through a generic. Both the code generator matrix and the parity-check
|
-- matrix are computed in the VHDL itself.
|
-- matrix are computed in the VHDL itself.
|
--
|
--
|
-- To Do:
|
|
-- - write docs
|
|
--
|
|
-- Author:
|
-- Author:
|
-- - Nicola De Simone, ndesimone@opencores.org
|
-- - Nicola De Simone, ndesimone@opencores.org
|
--
|
--
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
--
|
--
|
Line 435... |
Line 432... |
return GT;
|
return GT;
|
|
|
end function get_code_generator_matrix;
|
end function get_code_generator_matrix;
|
|
|
-- purpose: Calculate the number of parity bits (r) needed for the
|
-- purpose: Calculate the number of parity bits (r) needed for the
|
-- specified message length (k). The code has m = 2^r - r - 1 for r >= 2.
|
-- specified message length (k). The code has k = 2^r - r - 1 for r >= 2.
|
function calc_nparity_bits (
|
function calc_nparity_bits (
|
k : natural;
|
k : natural;
|
ONE_PARITY_BIT : boolean := false)
|
ONE_PARITY_BIT : boolean := false)
|
return natural is
|
return natural is
|
variable r : natural := 0;
|
variable r : natural := 0;
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.