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

Subversion Repositories line_codes

[/] [line_codes/] [trunk/] [rtl/] [vhdl/] [hdb1_enc.vhd] - Blame information for rev 8

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 ribamar
 
2
-- implementation of the HDB1 encoder. 
3
 
4
entity hdb1_enc is
5
        port (
6
        clr_bar,
7
        clk         : in    bit; -- clock input.
8
        e           : in    bit; -- input.
9
        s0, s1      : out   bit  -- output.
10
        );
11
end hdb1_enc;
12
 
13
architecture behaviour of hdb1_enc is
14
        signal q0, q1, q2    : bit;      -- 3 flipflops for 6 states. 
15
begin
16
     process (clk, clr_bar) begin
17
        if clr_bar = '0' then
18
                q0 <= '0';
19
                q1 <= '0';
20
                q2 <= '0';
21
                s0 <= '0';
22
                s1 <= '0';
23
        elsif clk'event and clk = '1' then
24
 
25
                q0 <= (e and (not q1))
26
                      or ((not e) and (not q0) and  q1 and q2 )
27
                      or ((not e) and q0 and  q1 and (not q2) );
28
 
29
                q1 <= (e and (not q1))
30
                      or ((not q1) and q2)
31
                      or ((not e) and q1 and (not q2));
32
 
33
                q2 <= (not e) and (not q2);
34
 
35
                s0 <= ((not q1) and (not q2))
36
                      or ((not e)and q1 and q2);
37
 
38
                s1 <= (q1 and (not q2))
39
                      or ((not e) and (not q1) and q2);
40
 
41
        end if;
42
     end process;
43
end behaviour;

powered by: WebSVN 2.1.0

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