CENG 342 – Digital Systems
Constants and Generics Larry Pyeatt
SDSM&T
CENG 342 Digital Systems Constants and Generics Larry Pyeatt - - PowerPoint PPT Presentation
CENG 342 Digital Systems Constants and Generics Larry Pyeatt SDSM&T 4-to-1 Mulitplexer Schematic and Truth Table Boolean function: F = i 0 sel 1 sel 0 + i 1 sel 1 sel 0 + i 2 sel 1 sel 0 + i 3 sel 1 sel 0 Routing circuits Conditional
SDSM&T
1 library ieee; 2 use ieee.std_logic_1164.all; 3 use ieee.numeric_std.all; 4 5 entity cmp_2bit is 6
7
8
9 end cmp_2bit; 10 11 architecture if_arch of cmp_2bit is 12 begin 13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 end if_arch;
1 library ieee; 2 use ieee.std_logic_1164.all; 3 use ieee.numeric_std.all; 4 5 entity cmp_2bit_test is 6 end cmp_2bit_test; 7 8 architecture test_arch of cmp_2bit_test is 9
10
11 begin 12
13
14
15 16
17
18
19
20
21
22
23
25
26
27
28
29
30
31
32
33 34
35
36
37
38
39
40
41
42 43
44
45
46
47
48
49
50
53 architecture loop_test_arch of cmp_2bit_testbench is 54
55
56 begin 57
58
59 60
61
62
63
64
65
66
67
68
69
70
71
72
73 end loop_test_arch;
1
2
1 library ieee; 2 use ieee.std_logic_1164.all; 3 use ieee.numeric_std.all; 4 5 entity add_w_carry is 6
7
8
9
10 end add_w_carry;
12 architecture hard_arch of add_w_carry is 13
14 begin 15
16
17
18
19 end hard_arch;
21 architecture const_arch of add_w_carry is 22
23
24 begin 25
26
27
28
29 end const_arch;
1 entity entity_name is 2
3
4
5
6 end entity_name
1 library ieee; 2 use ieee.std_logic_1164.all; 3 use ieee.numeric_std.all; 4 5 entity gen_add_w_carry is 6
7
8
9 end gen_add_w_carry; 10 11 architecture arch of gen_add_w_carry is 12
13 begin 14
15
16
17
18 end arch;
1
2
3
4
5 ... 6
7
8
9
10
11
12