Project

General

Profile

Download (3.77 KB) Statistics
| Branch: | Tag: | Revision:
1
library IEEE;
2

    
3
use IEEE.std_logic_1164.ALL;
4

    
5
entity simple_registers is
6
   port
7
   (
8
      i_clock: in std_logic;
9
      i_reset: in std_logic;
10
      i_a:     in std_logic;
11
      i_b:     in std_logic;
12
      i_c:     in std_logic;
13
      o_a:     out std_logic;
14
      o_b:     out std_logic;
15
      o_c:     out std_logic
16
   );
17
end entity simple_registers;
18

    
19
architecture Behavioral of simple_registers is
20
   signal flipflop_0: std_logic;
21
   signal flipflop_1: std_logic;
22
   signal flipflop_2: std_logic;
23
   signal flipflop_3: std_logic;
24
   signal flipflop_4: std_logic;
25
   signal flipflop_5: std_logic;
26
begin
27
   -- (is_simple_register_of flipflop_0 i_a i_clock)
28
   -- (not (is_async_register_of flipflop_0 i_a i_clock))
29
   -- (not (is_sync_register_of flipflop_0 i_a i_clock))
30
   process (i_clock)
31
   begin
32
      if (rising_edge(i_clock))
33
      begin
34
         flipflop_0 <= i_a;
35
      end if;
36
   end process;
37

    
38
   -- (is_simple_register_of flipflop_1 i_a i_clock)
39
   -- (not (is_async_register_of flipflop_1 i_a i_clock))
40
   -- (not (is_sync_register_of flipflop_1 i_a i_clock))
41
   process (i_clock)
42
   begin
43
      if (i_b = '1')
44
      begin
45
         if (rising_edge(i_clock))
46
         begin
47
            flipflop_1 <= i_a;
48
         end if;
49
      else
50
         if (rising_edge(i_clock))
51
         begin
52
            flipflop_1 <= i_a;
53
         end if;
54
      end if;
55
   end process;
56

    
57
   -- (is_simple_register_of flipflop_2 i_a i_clock)
58
   -- (not (is_async_register_of flipflop_2 i_a i_clock))
59
   -- (not (is_sync_register_of flipflop_2 i_a i_clock))
60
   process (i_clock)
61
   begin
62
      o_a <= i_a;
63
      if (i_b = '1')
64
      begin
65
         o_b <= (not i_a);
66
         if (rising_edge(i_clock))
67
         begin
68
            o_c <= flipflop_2;
69
            flipflop_2 <= i_a;
70
         end if;
71
      else
72
         if (rising_edge(i_clock))
73
         begin
74
            o_c <= (not flipflop_2);
75
            flipflop_2 <= i_a;
76
         end if;
77
      end if;
78
   end process;
79

    
80
   -- (is_simple_register_of flipflop_3 i_a i_clock)
81
   -- (not (is_async_register_of flipflop_3 i_a i_clock))
82
   -- (not (is_sync_register_of flipflop_3 i_a i_clock))
83
   process (i_clock)
84
   begin
85
      o_a <= i_a;
86
      if (i_b = '1')
87
      begin
88
         o_b <= (not i_a);
89
         if (rising_edge(i_clock))
90
         begin
91
            o_c <= flip_flop_3;
92
            if (i_c = '1)
93
            then
94
               flipflop_3 <= i_a;
95
            else
96
               flipflop_3 <= i_a;
97
            end if;
98
         end if;
99
      else
100
         if (rising_edge(i_clock))
101
         begin
102
            o_c <= (not flip_flop_3);
103
            flipflop_3 <= i_a;
104
         end if;
105
      end if;
106
   end process;
107

    
108
   -- (not (is_simple_register_of flipflop_4 i_a i_clock))
109
   -- (not (is_async_register_of flipflop_4 i_a i_clock))
110
   -- (not (is_sync_register_of flipflop_4 i_a i_clock))
111
   -- This is still a flipflop, but not one that simply stores 'i_a', instead
112
   -- it seems to have an "enable" signal (i_c = '1').
113
   process (i_clock)
114
   begin
115
      o_a <= i_a;
116
      if (i_b = '1')
117
      begin
118
         o_b <= (not i_a);
119
         if (rising_edge(i_clock))
120
         begin
121
            o_c <= flipflop_4;
122
            if (i_c = '1')
123
            then
124
               flipflop_4 <= i_a;
125
            end if;
126
         end if;
127
      else
128
         if (rising_edge(i_clock))
129
         begin
130
            o_c <= (not flipflop_4);
131
            flipflop_4 <= i_a;
132
         end if;
133
      end if;
134
   end process;
135

    
136
   -- (is_simple_register_of flipflop_0 i_a i_clock)
137
   -- (not (is_async_register_of flipflop_0 i_a i_clock))
138
   -- (not (is_sync_register_of flipflop_0 i_a i_clock))
139
   process (i_clock)
140
   begin
141
      if (rising_edge(i_clock))
142
      begin
143
         flipflop_0 <= (not i_a);
144
      end if;
145
      if (rising_edge(i_clock))
146
      begin
147
         flipflop_0 <= i_a;
148
      end if;
149
   end process;
150
end architecture;
(4-4/6)