Project

General

Profile

Download (1.98 KB) Statistics
| Branch: | Tag: | Revision:
1 d93979b7 Arnaud Dieumegard
2
-- Copyright (C) 1996 Morgan Kaufmann Publishers, Inc
3
4
-- This file is part of VESTs (Vhdl tESTs).
5
6
-- VESTs is free software; you can redistribute it and/or modify it
7
-- under the terms of the GNU General Public License as published by the
8
-- Free Software Foundation; either version 2 of the License, or (at
9
-- your option) any later version. 
10
11
-- VESTs is distributed in the hope that it will be useful, but WITHOUT
12
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
-- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14
-- for more details. 
15
16
-- You should have received a copy of the GNU General Public License
17
-- along with VESTs; if not, write to the Free Software Foundation,
18
-- Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
19
20
-- ---------------------------------------------------------------------
21
--
22
-- $Id: ch_05_ch_05_08.vhd,v 1.3 2001-10-26 16:29:33 paw Exp $
23
-- $Revision: 1.3 $
24
--
25
-- ---------------------------------------------------------------------
26
27
entity ch_05_08 is
28
29
end entity ch_05_08;
30
31
library stimulus;
32
33
architecture test of ch_05_08 is
34
35
  constant T_pd : delay_length := 5 ns;
36
37
  signal a, b : bit := '0';
38
  signal test_inputs : bit_vector(1 to 2);
39
40
  use stimulus.stimulus_generators.all;
41
42
begin
43
44
  block_05_3_f : block is
45
46
                         signal sum, carry : bit;
47
48
  begin
49
50
    -- code from book:
51
52
    half_add : process is
53
    begin
54
      sum <= a xor b after T_pd;
55
      carry <= a and b after T_pd;
56
      wait on a, b;
57
    end process half_add;
58
59
    -- end of code from book
60
61
  end block block_05_3_f;
62
63
  block_05_3_g : block is
64
65
                         signal sum, carry : bit;
66
67
  begin
68
69
    -- code from book:
70
71
    half_add : process (a, b) is
72
    begin
73
      sum <= a xor b after T_pd;
74
      carry <= a and b after T_pd;
75
    end process half_add;
76
77
    -- end of code from book
78
79
  end block block_05_3_g;
80
81
  stimulus_05_3_f_g :
82
    all_possible_values(test_inputs, 20 ns);
83
84
  (a, b) <= test_inputs;
85
86
end architecture test;