I am trying to write code for a cyclic code encoder in VHDL, but I am not able to visualize how to approach the problem. Right now all I have is an entity and a few diagrams showing my approach as to how I want to build it. If anyone could help me out or point me in the right direction it would be really helpful.
Code for the entity I've written
-- generator matrix is 1 + D + D^3
-- g0 = 1
-- g1 = 1
-- g2 = 0
-- g3 = 1
library IEEE;
use ieee.std_logic_1164.all;
use ieee.std_logic_signed.all;
entity cc_7_4 is
generic (
n : integer :=7 ;-- CW length
k : integer :=4 ;-- message length
port(
message_input : in std_logic_vector(k-1 downto 0) ;-- input data
clk : in std_logic ;-- input clk
D : inout std_logic_vector((n-k-1) downto 0):="000" ;-- pipo shift register to generate the parity bits
Q : inout std_logic_vector((n-k-1) downto 0) ;-- pipo shift register to generate the parity bits
rst : in std_logic ;-- input reset
output : out std_logic_vector(6 downto 0)) ;-- output data
end cc_7_4;