OpenCores
URL https://opencores.org/ocsvn/line_codes/line_codes/trunk

Subversion Repositories line_codes

[/] [line_codes/] [trunk/] [rtl/] [vhdl/] [hdb1_dec.vhd] - Diff between revs 5 and 8

Only display areas with differences | Details | Blame | View Log

Rev 5 Rev 8
 
 
-- implementation of the HDB1 decoder. 
-- implementation of the HDB1 decoder. 
 
 
entity hdb1_dec is
entity hdb1_dec is
        port (
        port (
        clr_bar,
        clr_bar,
        clk, e0, e1 : in    bit; -- inputs.
        clk, e0, e1 : in    bit; -- inputs.
        s           : out   bit  -- output.
        s           : out   bit  -- output.
        );
        );
end hdb1_dec;
end hdb1_dec;
 
 
architecture behaviour of hdb1_dec is
architecture behaviour of hdb1_dec is
     signal q0, q1: bit;  -- two flipflops.
     signal q0, q1: bit;  -- two flipflops.
begin
begin
     process (clk, clr_bar) begin
     process (clk, clr_bar) begin
                if clr_bar = '0' then
                if clr_bar = '0' then
                        q0 <= '0';
                        q0 <= '0';
                        q1 <= '0';
                        q1 <= '0';
                        s  <= '0';
                        s  <= '0';
                elsif clk'event and clk = '1' then
                elsif clk'event and clk = '1' then
                        s  <= ( q0 and (not e0) ) or ( q1 and (not e1) );
                        s  <= ( q0 and (not e0) ) or ( q1 and (not e1) );
                        q0 <= (not q0) and e0;
                        q0 <= (not q0) and e0;
                        q1 <= (not q1) and e1;
                        q1 <= (not q1) and e1;
                end if;
                end if;
     end process;
     end process;
end behaviour;
end behaviour;
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.