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

Subversion Repositories idea

[/] [idea/] [trunk/] [behavioral/] [key_regulator/] [count2x.vbe] - Blame information for rev 10

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 marta
-- VHDL data flow description generated from `count2x`
2
--              date : Thu Aug  2 08:33:31 2001
3
 
4
 
5
-- Entity Declaration
6
 
7
ENTITY count2x IS
8
  PORT (
9
  clk : in BIT; -- clk
10
  rst : in BIT; -- rst
11
  q : out bit_vector(1 DOWNTO 0) ;      -- q
12
  vdd : in BIT; -- vdd
13
  vss : in BIT  -- vss
14
  );
15
END count2x;
16
 
17
 
18
-- Architecture Declaration
19
 
20
ARCHITECTURE VBE OF count2x IS
21
  SIGNAL current_state : REG_VECTOR(1 DOWNTO 0) REGISTER;       -- current_state
22
  SIGNAL current_state_s3 : BIT;                -- current_state_s3
23
  SIGNAL next_state_s3 : BIT;           -- next_state_s3
24
  SIGNAL current_state_s2 : BIT;                -- current_state_s2
25
  SIGNAL next_state_s2 : BIT;           -- next_state_s2
26
  SIGNAL current_state_s1 : BIT;                -- current_state_s1
27
  SIGNAL next_state_s1 : BIT;           -- next_state_s1
28
  SIGNAL current_state_s0 : BIT;                -- current_state_s0
29
  SIGNAL next_state_s0 : BIT;           -- next_state_s0
30
  SIGNAL next_state : BIT_VECTOR(1 DOWNTO 0);   -- next_state
31
 
32
BEGIN
33
  next_state(0) <= (next_state_s0 OR next_state_s2);
34
  next_state(1) <= (next_state_s0 OR next_state_s1);
35
  next_state_s0 <= current_state_s3;
36
  current_state_s0 <= (current_state(1) AND current_state(0));
37
  next_state_s1 <= current_state_s0;
38
  current_state_s1 <= (current_state(1) AND NOT(current_state(0)));
39
  next_state_s2 <= current_state_s1;
40
  current_state_s2 <= (NOT(current_state(1)) AND current_state(0));
41
  next_state_s3 <= current_state_s2;
42
  current_state_s3 <= (NOT(current_state(1)) AND NOT(current_state(0)));
43
  label0 : BLOCK ((NOT((clk'STABLE)) AND clk) = '1')
44
  BEGIN
45
    current_state(0) <= GUARDED (next_state(0) OR rst);
46
  END BLOCK label0;
47
  label1 : BLOCK ((NOT((clk'STABLE)) AND clk) = '1')
48
  BEGIN
49
    current_state(1) <= GUARDED (next_state(1) OR rst);
50
  END BLOCK label1;
51
 
52
q(0) <= ((current_state_s1 AND NOT(rst)) OR (
53
current_state_s3 AND NOT(rst)));
54
 
55
q(1) <= ((current_state_s2 AND NOT(rst)) OR (
56
current_state_s3 AND NOT(rst)));
57
END;

powered by: WebSVN 2.1.0

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