Project

General

Profile

Download (2.19 KB) Statistics
| Branch: | Tag: | Revision:
1

    
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_07_ch_07_05.vhd,v 1.3 2001-10-26 16:29:34 paw Exp $
23
-- $Revision: 1.3 $
24
--
25
-- ---------------------------------------------------------------------
26

    
27
entity ch_07_05 is
28
end entity ch_07_05;
29

    
30
library bv_utilities;
31
use bv_utilities.bv_arithmetic.all;
32

    
33
architecture test of ch_07_05 is
34

    
35
begin
36

    
37
  process_07_5_a : process is
38

    
39
                             -- code from book:
40

    
41
                             procedure increment ( a : inout integer;   n : in integer := 1 ) is -- . . .
42
    -- not in book
43
  begin
44
    a := a + n;
45
  end procedure increment;
46
  -- end not in book;
47

    
48
  procedure increment ( a : inout bit_vector;  n : in bit_vector := B"1" ) is -- . . .
49
    -- not in book
50
  begin
51
    a := a + n;
52
  end procedure increment;
53
  -- end not in book;
54

    
55
  procedure increment ( a : inout bit_vector;  n : in integer := 1 ) is -- . . .
56
    -- not in book
57
  begin
58
    a := a + integer_to_bv(n, a'length);
59
  end procedure increment;
60
  -- end not in book;
61

    
62
  variable count_int : integer := 2;
63
  variable count_bv : bit_vector (15 downto 0) := X"0002";
64

    
65
  -- end of code from book
66

    
67
  begin
68

    
69
    -- code from book:
70

    
71
    increment ( count_int, 2 );
72
    increment ( count_int );
73

    
74
    increment ( count_bv, X"0002");
75
    increment ( count_bv, 1 );
76

    
77
    -- increment ( count_bv );
78

    
79
    -- end of code from book
80

    
81
    wait;
82
  end process process_07_5_a;
83

    
84

    
85
end architecture test;
(145-145/267)