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

Subversion Repositories ttl_library

[/] [ttl_library/] [trunk/] [TTLParts.vhd] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 david237
-----------------------------------------------------------------------
2
-- Bipolar TTL models (VHDL)                                         --
3
-- David R Brooks                                                    --
4
-- May, 2016.  Perth, Australia                                      --
5
-- Compliance: VHDL 2008                                             --
6
-- NB Simulation only: they are not synthesizable.                   --
7
-- Based on: Fairchild TTL Data Book (see for pinouts)               --
8
--           Signetics Low-Power Schottky Pocket Guide, 1978         --
9
-- Part names are in Texas format, ie SN74LSxxN                      --
10
-- The LS part is given when available, else the basic 74 part.      --
11
-- Pinouts & naming agree with Altium libraries & VHDL netlister.    --
12
-----------------------------------------------------------------------
13
 
14
-----------------------------------------------------------------------
15
-- SN74LS00N: Quad 2-input NAND gate (Pinout A)
16
--            Verified 28/05/2016
17
-----------------------------------------------------------------------
18
library ieee;
19
    use ieee.std_logic_1164.all;
20
 
21
    use work.LSTTL.all;
22
    use work.TTLPrivate.all;
23
 
24
entity SN74LS00N is
25
generic(
26
    tPLH : time := 10 ns;
27
    tPHL : time := 10 ns
28
);
29
port(
30
    X_1  : in    std_logic;  -- 1A
31
    X_2  : in    std_logic;  -- 1B
32
    X_3  : out   std_logic;  -- 1Y\
33
    X_4  : in    std_logic;  -- 2A
34
    X_5  : in    std_logic;  -- 2B
35
    X_6  : out   std_logic;  -- 2Y\
36
    X_7  : inout std_logic;  -- GND
37
    X_8  : out   std_logic;  -- 3Y\
38
    X_9  : in    std_logic;  -- 3B
39
    X_10 : in    std_logic;  -- 3A
40
    X_11 : out   std_logic;  -- 4Y\
41
    X_12 : in    std_logic;  -- 4B
42
    X_13 : in    std_logic;  -- 4A
43
    X_14 : inout std_logic   -- Vcc 
44
);
45
end entity SN74LS00N;
46
 
47
architecture BEHAV of SN74LS00N is
48
    signal A : TTLInputs (1 to 4, 1 to 2);
49
    signal Y : TTLOutputs(1 to 4);
50
 
51
begin
52
    A <= ( (X_1, X_2), (X_4, X_5), (X_9, X_10), (X_12, X_13) );
53
 
54
    (X_3, X_6, X_8, X_11) <= Y;
55
 
56
    G: TTLgate
57
    generic map(
58
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
59
        invert => '1',      -- '1' will invert the output
60
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
61
        tPLH   => tPLH,
62
        tPHL   => tPHL
63
    )
64
    port map(
65
        ins   => A,
66
        outs  => Y
67
    );
68
 
69
end architecture BEHAV;
70
 
71
-----------------------------------------------------------------------
72
-- SN7401N: Quad 2-input NAND gate (open collector) (Pinout A)
73
--          Verified 29/05/2016
74
-----------------------------------------------------------------------
75
library ieee;
76
    use ieee.std_logic_1164.all;
77
 
78
    use work.LSTTL.all;
79
    use work.TTLPrivate.all;
80
 
81
entity SN7401N is
82
generic(
83
    tPLH : time := 45 ns;
84
    tPHL : time := 15 ns
85
);
86
port(
87
    X_1  : out   std_logic;  -- 1Y\
88
    X_2  : in    std_logic;  -- 1A
89
    X_3  : in    std_logic;  -- 1B
90
    X_4  : out   std_logic;  -- 2Y\
91
    X_5  : in    std_logic;  -- 2A
92
    X_6  : in    std_logic;  -- 2B
93
    X_7  : inout std_logic;  -- GND
94
    X_8  : in    std_logic;  -- 3B
95
    X_9  : in    std_logic;  -- 3A
96
    X_10 : out   std_logic;  -- 3Y\
97
    X_11 : in    std_logic;  -- 4B
98
    X_12 : in    std_logic;  -- 4A
99
    X_13 : out   std_logic;  -- 4Y\
100
    X_14 : inout std_logic   -- Vcc
101
);
102
end entity SN7401N;
103
 
104
architecture BEHAV of SN7401N is
105
    signal A : TTLInputs (1 to 4, 1 to 2);
106
    signal Y : TTLOutputs(1 to 4);
107
 
108
begin
109
    A <= ( (X_2, X_3), (X_5, X_6), (X_8, X_9), (X_11, X_12) );
110
 
111
    (X_1, X_4, X_10, X_13) <= Y;
112
 
113
    G: TTLgate
114
    generic map(
115
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
116
        invert => '1',      -- '1' will invert the output
117
        ohigh  => 'Z',      -- '1' = normal, 'Z' = open collectors
118
        tPLH   => tPLH,
119
        tPHL   => tPHL
120
    )
121
    port map(
122
        ins   => A,
123
        outs  => Y
124
    );
125
 
126
end architecture BEHAV;
127
 
128
-----------------------------------------------------------------------
129
-- SN74LS02N: Quad 2-input NOR gate (Pinout A)
130
--            Verified 29/05/2016
131
-----------------------------------------------------------------------
132
library ieee;
133
    use ieee.std_logic_1164.all;
134
 
135
    use work.LSTTL.all;
136
    use work.TTLPrivate.all;
137
 
138
entity SN74LS02N is
139
generic(
140
    tPLH : time := 15 ns;
141
    tPHL : time := 15 ns
142
);
143
port(
144
    X_1  : out   std_logic;  -- 1Y\
145
    X_2  : in    std_logic;  -- 1A
146
    X_3  : in    std_logic;  -- 1B
147
    X_4  : out   std_logic;  -- 2Y\
148
    X_5  : in    std_logic;  -- 2A
149
    X_6  : in    std_logic;  -- 2B
150
    X_7  : inout std_logic;  -- GND
151
    X_8  : in    std_logic;  -- 3B
152
    X_9  : in    std_logic;  -- 3A
153
    X_10 : out   std_logic;  -- 3Y\
154
    X_11 : in    std_logic;  -- 4B
155
    X_12 : in    std_logic;  -- 4A
156
    X_13 : out   std_logic;  -- 4Y\
157
    X_14 : inout std_logic   -- Vcc
158
);
159
end entity SN74LS02N;
160
 
161
architecture BEHAV of SN74LS02N is
162
    signal A : TTLInputs (1 to 4, 1 to 2);
163
    signal Y : TTLOutputs(1 to 4);
164
 
165
begin
166
    A <= ( (X_2, X_3), (X_5, X_6), (X_8, X_9), (X_11, X_12) );
167
 
168
    (X_1, X_4, X_10, X_13) <= Y;
169
 
170
    G: TTLgate
171
    generic map(
172
        mode   => Zor,      -- Zand, Zor, Zxor, Zbuf
173
        invert => '1',      -- '1' will invert the output
174
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
175
        tPLH   => tPLH,
176
        tPHL   => tPHL
177
    )
178
    port map(
179
        ins   => A,
180
        outs  => Y
181
    );
182
 
183
end architecture BEHAV;
184
 
185
-----------------------------------------------------------------------
186
-- SN74LS03N: Quad 2-input NAND gate (open collector)
187
--            Verified 28/05/2016
188
-----------------------------------------------------------------------
189
library ieee;
190
    use ieee.std_logic_1164.all;
191
 
192
    use work.LSTTL.all;
193
    use work.TTLPrivate.all;
194
 
195
entity SN74LS03N is
196
generic(
197
    tPLH : time := 22 ns;
198
    tPHL : time := 18 ns
199
);
200
port(
201
    X_1  : in    std_logic;  -- 1A
202
    X_2  : in    std_logic;  -- 1B
203
    X_3  : out   std_logic;  -- 1Y\
204
    X_4  : in    std_logic;  -- 2A
205
    X_5  : in    std_logic;  -- 2B
206
    X_6  : out   std_logic;  -- 2Y\
207
    X_7  : inout std_logic;  -- GND
208
    X_8  : out   std_logic;  -- 3Y\
209
    X_9  : in    std_logic;  -- 3B
210
    X_10 : in    std_logic;  -- 3A
211
    X_11 : out   std_logic;  -- 4Y\
212
    X_12 : in    std_logic;  -- 4B
213
    X_13 : in    std_logic;  -- 4A
214
    X_14 : inout std_logic   -- Vcc 
215
);
216
end entity SN74LS03N;
217
 
218
architecture BEHAV of SN74LS03N is
219
    signal A : TTLInputs (1 to 4, 1 to 2);
220
    signal Y : TTLOutputs(1 to 4);
221
 
222
begin
223
    A <= ( (X_1, X_2), (X_4, X_5), (X_9, X_10), (X_12, X_13) );
224
 
225
    (X_3, X_6, X_8, X_11) <= Y;
226
 
227
    G: TTLgate
228
    generic map(
229
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
230
        invert => '1',      -- '1' will invert the output
231
        ohigh  => 'Z',      -- '1' = normal, 'Z' = open collectors
232
        tPLH   => tPLH,
233
        tPHL   => tPHL
234
    )
235
    port map(
236
        ins   => A,
237
        outs  => Y
238
    );
239
 
240
end architecture BEHAV;
241
 
242
-----------------------------------------------------------------------
243
-- SN74LS04N: Hex inverter (Pinout A)
244
--            Verified 30/05/2016
245
-----------------------------------------------------------------------
246
library ieee;
247
    use ieee.std_logic_1164.all;
248
 
249
    use work.LSTTL.all;
250
    use work.TTLPrivate.all;
251
 
252
entity SN74LS04N is
253
generic(
254
    tPLH : time := 10 ns;
255
    tPHL : time := 10 ns
256
);
257
port(
258
    X_1  : in    std_logic;  -- 1A
259
    X_2  : out   std_logic;  -- 1Y\
260
    X_3  : in    std_logic;  -- 2A
261
    X_4  : out   std_logic;  -- 2Y\
262
    X_5  : in    std_logic;  -- 3A
263
    X_6  : out   std_logic;  -- 3Y\
264
    X_7  : inout std_logic;  -- GND
265
    X_8  : out   std_logic;  -- 4Y\
266
    X_9  : in    std_logic;  -- 4A
267
    X_10 : out   std_logic;  -- 5Y\
268
    X_11 : in    std_logic;  -- 5A
269
    X_12 : out   std_logic;  -- 6Y\
270
    X_13 : in    std_logic;  -- 6A
271
    X_14 : inout std_logic   -- Vcc
272
);
273
end entity SN74LS04N;
274
 
275
architecture BEHAV of SN74LS04N is
276
    signal A : TTLInputs (1 to 6, 1 to 1);
277
    signal Y : TTLOutputs(1 to 6);
278
 
279
begin
280
    A(1,1) <= X_1;      -- Can't use aggregates when the substring has only 1 element
281
    A(2,1) <= X_3;
282
    A(3,1) <= X_5;
283
    A(4,1) <= X_9;
284
    A(5,1) <= X_11;
285
    A(6,1) <= X_13;
286
 
287
    (X_2, X_4, X_6, X_8, X_10, X_12) <= Y;
288
 
289
    G: TTLgate
290
    generic map(
291
        mode   => Zbuf,     -- Zand, Zor, Zxor, Zbuf
292
        invert => '1',      -- '1' will invert the output
293
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
294
        tPLH   => tPLH,
295
        tPHL   => tPHL
296
    )
297
    port map(
298
        ins   => A,
299
        outs  => Y
300
    );
301
 
302
end architecture BEHAV;
303
 
304
-----------------------------------------------------------------------
305
-- SN74LS05N: Hex inverter (open collector) (Pinout A)
306
--            Verified 30/05/2016
307
-----------------------------------------------------------------------
308
library ieee;
309
    use ieee.std_logic_1164.all;
310
 
311
    use work.LSTTL.all;
312
    use work.TTLPrivate.all;
313
 
314
entity SN74LS05N is
315
generic(
316
    tPLH : time := 32 ns;
317
    tPHL : time := 28 ns
318
);
319
port(
320
    X_1  : in    std_logic;  -- 1A
321
    X_2  : out   std_logic;  -- 1Y\
322
    X_3  : in    std_logic;  -- 2A
323
    X_4  : out   std_logic;  -- 2Y\
324
    X_5  : in    std_logic;  -- 3A
325
    X_6  : out   std_logic;  -- 3Y\
326
    X_7  : inout std_logic;  -- GND
327
    X_8  : out   std_logic;  -- 4Y\
328
    X_9  : in    std_logic;  -- 4A
329
    X_10 : out   std_logic;  -- 5Y\
330
    X_11 : in    std_logic;  -- 5A
331
    X_12 : out   std_logic;  -- 6Y\
332
    X_13 : in    std_logic;  -- 6A
333
    X_14 : inout std_logic   -- Vcc
334
);
335
end entity SN74LS05N;
336
 
337
architecture BEHAV of SN74LS05N is
338
    signal A : TTLInputs (1 to 6, 1 to 1);
339
    signal Y : TTLOutputs(1 to 6);
340
 
341
begin
342
    A(1,1) <= X_1;      -- Can't use aggregates when the substring has only 1 element
343
    A(2,1) <= X_3;
344
    A(3,1) <= X_5;
345
    A(4,1) <= X_9;
346
    A(5,1) <= X_11;
347
    A(6,1) <= X_13;
348
 
349
    (X_2, X_4, X_6, X_8, X_10, X_12) <= Y;
350
 
351
    G: TTLgate
352
    generic map(
353
        mode   => Zbuf,     -- Zand, Zor, Zxor, Zbuf
354
        invert => '1',      -- '1' will invert the output
355
        ohigh  => 'Z',      -- '1' = normal, 'Z' = open collectors
356
        tPLH   => tPLH,
357
        tPHL   => tPHL
358
    )
359
    port map(
360
        ins   => A,
361
        outs  => Y
362
    );
363
 
364
end architecture BEHAV;
365
 
366
-----------------------------------------------------------------------
367
-- SN7406N: Hex inverter (high voltage open collector)
368
--          Verified 30/05/2016
369
-----------------------------------------------------------------------
370
library ieee;
371
    use ieee.std_logic_1164.all;
372
 
373
    use work.LSTTL.all;
374
    use work.TTLPrivate.all;
375
 
376
entity SN7406N is
377
generic(
378
    tPLH : time := 15 ns;
379
    tPHL : time := 23 ns
380
);
381
port(
382
    X_1  : in    std_logic;  -- 1A
383
    X_2  : out   std_logic;  -- 1Y\
384
    X_3  : in    std_logic;  -- 2A
385
    X_4  : out   std_logic;  -- 2Y\
386
    X_5  : in    std_logic;  -- 3A
387
    X_6  : out   std_logic;  -- 3Y\
388
    X_7  : inout std_logic;  -- GND
389
    X_8  : out   std_logic;  -- 4Y\
390
    X_9  : in    std_logic;  -- 4A
391
    X_10 : out   std_logic;  -- 5Y\
392
    X_11 : in    std_logic;  -- 5A
393
    X_12 : out   std_logic;  -- 6Y\
394
    X_13 : in    std_logic;  -- 6A
395
    X_14 : inout std_logic   -- Vcc
396
);
397
end entity SN7406N;
398
 
399
architecture BEHAV of SN7406N is
400
    signal A : TTLInputs (1 to 6, 1 to 1);
401
    signal Y : TTLOutputs(1 to 6);
402
 
403
begin
404
    A(1,1) <= X_1;      -- Can't use aggregates when the substring has only 1 element
405
    A(2,1) <= X_3;
406
    A(3,1) <= X_5;
407
    A(4,1) <= X_9;
408
    A(5,1) <= X_11;
409
    A(6,1) <= X_13;
410
 
411
    (X_2, X_4, X_6, X_8, X_10, X_12) <= Y;
412
 
413
    G: TTLgate
414
    generic map(
415
        mode   => Zbuf,     -- Zand, Zor, Zxor, Zbuf
416
        invert => '1',      -- '1' will invert the output
417
        ohigh  => 'Z',      -- '1' = normal, 'Z' = open collectors
418
        tPLH   => tPLH,
419
        tPHL   => tPHL
420
    )
421
    port map(
422
        ins   => A,
423
        outs  => Y
424
    );
425
 
426
end architecture BEHAV;
427
 
428
-----------------------------------------------------------------------
429
-- SN7407N: Hex buffer (high voltage open collector)
430
--          Verified 30/05/2016
431
-----------------------------------------------------------------------
432
library ieee;
433
    use ieee.std_logic_1164.all;
434
 
435
    use work.LSTTL.all;
436
    use work.TTLPrivate.all;
437
 
438
entity SN7407N is
439
generic(
440
    tPLH : time := 10 ns;
441
    tPHL : time := 30 ns
442
);
443
port(
444
    X_1  : in    std_logic;  -- 1A
445
    X_2  : out   std_logic;  -- 1Y\
446
    X_3  : in    std_logic;  -- 2A
447
    X_4  : out   std_logic;  -- 2Y\
448
    X_5  : in    std_logic;  -- 3A
449
    X_6  : out   std_logic;  -- 3Y\
450
    X_7  : inout std_logic;  -- GND
451
    X_8  : out   std_logic;  -- 4Y\
452
    X_9  : in    std_logic;  -- 4A
453
    X_10 : out   std_logic;  -- 5Y\
454
    X_11 : in    std_logic;  -- 5A
455
    X_12 : out   std_logic;  -- 6Y\
456
    X_13 : in    std_logic;  -- 6A
457
    X_14 : inout std_logic   -- Vcc
458
);
459
end entity SN7407N;
460
 
461
architecture BEHAV of SN7407N is
462
    signal A : TTLInputs (1 to 6, 1 to 1);
463
    signal Y : TTLOutputs(1 to 6);
464
 
465
begin
466
    A(1,1) <= X_1;      -- Can't use aggregates when the substring has only 1 element
467
    A(2,1) <= X_3;
468
    A(3,1) <= X_5;
469
    A(4,1) <= X_9;
470
    A(5,1) <= X_11;
471
    A(6,1) <= X_13;
472
 
473
    (X_2, X_4, X_6, X_8, X_10, X_12) <= Y;
474
 
475
    G: TTLgate
476
    generic map(
477
        mode   => Zbuf,     -- Zand, Zor, Zxor, Zbuf
478
        invert => '0',      -- '1' will invert the output
479
        ohigh  => 'Z',      -- '1' = normal, 'Z' = open collectors
480
        tPLH   => tPLH,
481
        tPHL   => tPHL
482
    )
483
    port map(
484
        ins   => A,
485
        outs  => Y
486
    );
487
 
488
end architecture BEHAV;
489
 
490
-----------------------------------------------------------------------
491
-- SN74LS08N: Quad 2-input and gate (Pinout A)
492
--            Verified 28/05/2016
493
-----------------------------------------------------------------------
494
library ieee;
495
    use ieee.std_logic_1164.all;
496
 
497
    use work.LSTTL.all;
498
    use work.TTLPrivate.all;
499
 
500
entity SN74LS08N is
501
generic(
502
    tPLH : time := 15 ns;
503
    tPHL : time := 20 ns
504
);
505
port(
506
    X_1  : in    std_logic;  -- 1A
507
    X_2  : in    std_logic;  -- 1B
508
    X_3  : out   std_logic;  -- 1Y
509
    X_4  : in    std_logic;  -- 2A
510
    X_5  : in    std_logic;  -- 2B
511
    X_6  : out   std_logic;  -- 2Y
512
    X_7  : inout std_logic;  -- GND
513
    X_8  : out   std_logic;  -- 3Y
514
    X_9  : in    std_logic;  -- 3B
515
    X_10 : in    std_logic;  -- 3A
516
    X_11 : out   std_logic;  -- 4Y
517
    X_12 : in    std_logic;  -- 4B
518
    X_13 : in    std_logic;  -- 4A
519
    X_14 : inout std_logic   -- Vcc 
520
);
521
end entity SN74LS08N;
522
 
523
architecture BEHAV of SN74LS08N is
524
    signal A : TTLInputs (1 to 4, 1 to 2);
525
    signal Y : TTLOutputs(1 to 4);
526
 
527
begin
528
    A <= ( (X_1, X_2), (X_4, X_5), (X_9, X_10), (X_12, X_13) );
529
 
530
    (X_3, X_6, X_8, X_11) <= Y;
531
 
532
    G: TTLgate
533
    generic map(
534
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
535
        invert => '0',      -- '1' will invert the output
536
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
537
        tPLH   => tPLH,
538
        tPHL   => tPHL
539
    )
540
    port map(
541
        ins   => A,
542
        outs  => Y
543
    );
544
 
545
end architecture BEHAV;
546
 
547
-----------------------------------------------------------------------
548
-- SN74LS09N: Quad 2-input and gate (open collector)
549
--            Verified 28/05/2016
550
-----------------------------------------------------------------------
551
library ieee;
552
    use ieee.std_logic_1164.all;
553
 
554
    use work.LSTTL.all;
555
    use work.TTLPrivate.all;
556
 
557
entity SN74LS09N is
558
generic(
559
    tPLH : time := 35 ns;
560
    tPHL : time := 35 ns
561
);
562
port(
563
    X_1  : in    std_logic;  -- 1A
564
    X_2  : in    std_logic;  -- 1B
565
    X_3  : out   std_logic;  -- 1Y
566
    X_4  : in    std_logic;  -- 2A
567
    X_5  : in    std_logic;  -- 2B
568
    X_6  : out   std_logic;  -- 2Y
569
    X_7  : inout std_logic;  -- GND
570
    X_8  : out   std_logic;  -- 3Y
571
    X_9  : in    std_logic;  -- 3B
572
    X_10 : in    std_logic;  -- 3A
573
    X_11 : out   std_logic;  -- 4Y
574
    X_12 : in    std_logic;  -- 4B
575
    X_13 : in    std_logic;  -- 4A
576
    X_14 : inout std_logic   -- Vcc 
577
);
578
end entity SN74LS09N;
579
 
580
architecture BEHAV of SN74LS09N is
581
    signal A : TTLInputs (1 to 4, 1 to 2);
582
    signal Y : TTLOutputs(1 to 4);
583
 
584
begin
585
    A <= ( (X_1, X_2), (X_4, X_5), (X_9, X_10), (X_12, X_13) );
586
 
587
    (X_3, X_6, X_8, X_11) <= Y;
588
 
589
    G: TTLgate
590
    generic map(
591
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
592
        invert => '0',      -- '1' will invert the output
593
        ohigh  => 'Z',      -- '1' = normal, 'Z' = open collectors
594
        tPLH   => tPLH,
595
        tPHL   => tPHL
596
    )
597
    port map(
598
        ins   => A,
599
        outs  => Y
600
    );
601
 
602
end architecture BEHAV;
603
 
604
-----------------------------------------------------------------------
605
-- SN74LS10N: Triple 3-input NAND gate (Pinout A)
606
--            Verified 30/05/2016
607
-----------------------------------------------------------------------
608
library ieee;
609
    use ieee.std_logic_1164.all;
610
 
611
    use work.LSTTL.all;
612
    use work.TTLPrivate.all;
613
 
614
entity SN74LS10N is
615
generic(
616
    tPLH : time := 15 ns;
617
    tPHL : time := 15 ns
618
);
619
port(
620
    X_1  : in    std_logic;  -- 1A
621
    X_2  : in    std_logic;  -- 1B
622
    X_3  : in    std_logic;  -- 2A
623
    X_4  : in    std_logic;  -- 2B
624
    X_5  : in    std_logic;  -- 2C
625
    X_6  : out   std_logic;  -- 2Y\
626
    X_7  : inout std_logic;  -- GND
627
    X_8  : out   std_logic;  -- 3Y\
628
    X_9  : in    std_logic;  -- 3C
629
    X_10 : in    std_logic;  -- 3B
630
    X_11 : in    std_logic;  -- 3A
631
    X_12 : out   std_logic;  -- 1Y\
632
    X_13 : in    std_logic;  -- 1C
633
    X_14 : inout std_logic   -- Vcc
634
);
635
end entity SN74LS10N;
636
 
637
architecture BEHAV of SN74LS10N is
638
    signal A : TTLInputs (1 to 3, 1 to 3);
639
    signal Y : TTLOutputs(1 to 3);
640
 
641
begin
642
    A <= ( (X_1, X_2, X_13), (X_3, X_4, X_5), (X_9, X_10, X_11) );
643
 
644
    (X_12, X_6, X_8) <= Y;
645
 
646
    G: TTLgate
647
    generic map(
648
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
649
        invert => '1',      -- '1' will invert the output
650
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
651
        tPLH   => tPLH,
652
        tPHL   => tPHL
653
    )
654
    port map(
655
        ins   => A,
656
        outs  => Y
657
    );
658
 
659
end architecture BEHAV;
660
 
661
-----------------------------------------------------------------------
662
-- SN74LS11N: Triple 3-input and gate (Pinout A)
663
--            Verified 30/05/2016
664
-----------------------------------------------------------------------
665
library ieee;
666
    use ieee.std_logic_1164.all;
667
 
668
    use work.LSTTL.all;
669
    use work.TTLPrivate.all;
670
 
671
entity SN74LS11N is
672
generic(
673
    tPLH : time := 15 ns;
674
    tPHL : time := 20 ns
675
);
676
port(
677
    X_1  : in    std_logic;  -- 1A
678
    X_2  : in    std_logic;  -- 1B
679
    X_3  : in    std_logic;  -- 2A
680
    X_4  : in    std_logic;  -- 2B
681
    X_5  : in    std_logic;  -- 2C
682
    X_6  : out   std_logic;  -- 2Y\
683
    X_7  : inout std_logic;  -- GND
684
    X_8  : out   std_logic;  -- 3Y\
685
    X_9  : in    std_logic;  -- 3C
686
    X_10 : in    std_logic;  -- 3B
687
    X_11 : in    std_logic;  -- 3A
688
    X_12 : out   std_logic;  -- 1Y\
689
    X_13 : in    std_logic;  -- 1C
690
    X_14 : inout std_logic   -- Vcc
691
);
692
end entity SN74LS11N;
693
 
694
architecture BEHAV of SN74LS11N is
695
    signal A : TTLInputs (1 to 3, 1 to 3);
696
    signal Y : TTLOutputs(1 to 3);
697
 
698
begin
699
    A <= ( (X_1, X_2, X_13), (X_3, X_4, X_5), (X_9, X_10, X_11) );
700
 
701
    (X_12, X_6, X_8) <= Y;
702
 
703
    G: TTLgate
704
    generic map(
705
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
706
        invert => '0',      -- '1' will invert the output
707
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
708
        tPLH   => tPLH,
709
        tPHL   => tPHL
710
    )
711
    port map(
712
        ins   => A,
713
        outs  => Y
714
    );
715
 
716
end architecture BEHAV;
717
 
718
-----------------------------------------------------------------------
719
-- SN74LS12N: Triple 3-input NAND gate (open collector)
720
--            Verified 30/05/2016
721
-----------------------------------------------------------------------
722
library ieee;
723
    use ieee.std_logic_1164.all;
724
 
725
    use work.LSTTL.all;
726
    use work.TTLPrivate.all;
727
 
728
entity SN74LS12N is
729
generic(
730
    tPLH : time := 32 ns;
731
    tPHL : time := 28 ns
732
);
733
port(
734
    X_1  : in    std_logic;  -- 1A
735
    X_2  : in    std_logic;  -- 1B
736
    X_3  : in    std_logic;  -- 2A
737
    X_4  : in    std_logic;  -- 2B
738
    X_5  : in    std_logic;  -- 2C
739
    X_6  : out   std_logic;  -- 2Y\
740
    X_7  : inout std_logic;  -- GND
741
    X_8  : out   std_logic;  -- 3Y\
742
    X_9  : in    std_logic;  -- 3C
743
    X_10 : in    std_logic;  -- 3B
744
    X_11 : in    std_logic;  -- 3A
745
    X_12 : out   std_logic;  -- 1Y\
746
    X_13 : in    std_logic;  -- 1C
747
    X_14 : inout std_logic   -- Vcc
748
);
749
end entity SN74LS12N;
750
 
751
architecture BEHAV of SN74LS12N is
752
    signal A : TTLInputs (1 to 3, 1 to 3);
753
    signal Y : TTLOutputs(1 to 3);
754
 
755
begin
756
    A <= ( (X_1, X_2, X_13), (X_3, X_4, X_5), (X_9, X_10, X_11) );
757
 
758
    (X_12, X_6, X_8) <= Y;
759
 
760
    G: TTLgate
761
    generic map(
762
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
763
        invert => '1',      -- '1' will invert the output
764
        ohigh  => 'Z',      -- '1' = normal, 'Z' = open collectors
765
        tPLH   => tPLH,
766
        tPHL   => tPHL
767
    )
768
    port map(
769
        ins   => A,
770
        outs  => Y
771
    );
772
 
773
end architecture BEHAV;
774
 
775
-----------------------------------------------------------------------
776
-- SN74LS13N: Dual 4-input NAND Schmitt trigger
777
--            Verified 30/05/2016
778
-----------------------------------------------------------------------
779
library ieee;
780
    use ieee.std_logic_1164.all;
781
 
782
    use work.LSTTL.all;
783
    use work.TTLPrivate.all;
784
 
785
entity SN74LS13N is
786
generic(
787
    tPLH : time := 22 ns;
788
    tPHL : time := 27 ns
789
);
790
port(
791
    X_1  : in    std_logic;  -- 1A
792
    X_2  : in    std_logic;  -- 1B
793
                             -- 
794
    X_4  : in    std_logic;  -- 1C
795
    X_5  : in    std_logic;  -- 1D
796
    X_6  : out   std_logic;  -- 1Y\
797
    X_7  : inout std_logic;  -- GND
798
    X_8  : out   std_logic;  -- 2Y\
799
    X_9  : in    std_logic;  -- 2D
800
    X_10 : in    std_logic;  -- 2C
801
                             -- 
802
    X_12 : in    std_logic;  -- 2B
803
    X_13 : in    std_logic;  -- 2A
804
    X_14 : inout std_logic   -- Vcc
805
);
806
end entity SN74LS13N;
807
 
808
architecture BEHAV of SN74LS13N is
809
    signal A : TTLInputs (1 to 2, 1 to 4);
810
    signal Y : TTLOutputs(1 to 2);
811
 
812
begin
813
    A <= ( (X_1, X_2, X_4, X_5), (X_9, X_10, X_12, X_13) );
814
 
815
    (X_6, X_8) <= Y;
816
 
817
    G: TTLgate
818
    generic map(
819
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
820
        invert => '1',      -- '1' will invert the output
821
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
822
        tPLH   => tPLH,
823
        tPHL   => tPHL
824
    )
825
    port map(
826
        ins   => A,
827
        outs  => Y
828
    );
829
 
830
end architecture BEHAV;
831
 
832
-----------------------------------------------------------------------
833
-- SN74LS14N: Hex Schmitt trigger inverter
834
--            Verified 30/05/2016
835
-----------------------------------------------------------------------
836
library ieee;
837
    use ieee.std_logic_1164.all;
838
 
839
    use work.LSTTL.all;
840
    use work.TTLPrivate.all;
841
 
842
entity SN74LS14N is
843
generic(
844
    tPLH : time := 22 ns;
845
    tPHL : time := 22 ns
846
);
847
port(
848
    X_1  : in    std_logic;  -- 1A
849
    X_2  : out   std_logic;  -- 1Y\
850
    X_3  : in    std_logic;  -- 2A
851
    X_4  : out   std_logic;  -- 2Y\
852
    X_5  : in    std_logic;  -- 3A
853
    X_6  : out   std_logic;  -- 3Y\
854
    X_7  : inout std_logic;  -- GND
855
    X_8  : out   std_logic;  -- 4Y\
856
    X_9  : in    std_logic;  -- 4A
857
    X_10 : out   std_logic;  -- 5Y\
858
    X_11 : in    std_logic;  -- 5A
859
    X_12 : out   std_logic;  -- 6Y\
860
    X_13 : in    std_logic;  -- 6A
861
    X_14 : inout std_logic   -- Vcc
862
);
863
end entity SN74LS14N;
864
 
865
architecture BEHAV of SN74LS14N is
866
    signal A : TTLInputs (1 to 6, 1 to 1);
867
    signal Y : TTLOutputs(1 to 6);
868
 
869
begin
870
    A(1,1) <= X_1;      -- Can't use aggregates when the substring has only 1 element
871
    A(2,1) <= X_3;
872
    A(3,1) <= X_5;
873
    A(4,1) <= X_9;
874
    A(5,1) <= X_11;
875
    A(6,1) <= X_13;
876
 
877
    (X_2, X_4, X_6, X_8, X_10, X_12) <= Y;
878
 
879
    G: TTLgate
880
    generic map(
881
        mode   => Zbuf,     -- Zand, Zor, Zxor, Zbuf
882
        invert => '1',      -- '1' will invert the output
883
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
884
        tPLH   => tPLH,
885
        tPHL   => tPHL
886
    )
887
    port map(
888
        ins   => A,
889
        outs  => Y
890
    );
891
 
892
end architecture BEHAV;
893
 
894
-----------------------------------------------------------------------
895
-- SN74LS15N: Triple 3-input and gate (open collector)
896
--            Verified 30/05/2016
897
-----------------------------------------------------------------------
898
library ieee;
899
    use ieee.std_logic_1164.all;
900
 
901
    use work.LSTTL.all;
902
    use work.TTLPrivate.all;
903
 
904
entity SN74LS15N is
905
generic(
906
    tPLH : time := 35 ns;
907
    tPHL : time := 35 ns
908
);
909
port(
910
    X_1  : in    std_logic;  -- 1A
911
    X_2  : in    std_logic;  -- 1B
912
    X_3  : in    std_logic;  -- 2A
913
    X_4  : in    std_logic;  -- 2B
914
    X_5  : in    std_logic;  -- 2C
915
    X_6  : out   std_logic;  -- 2Y\
916
    X_7  : inout std_logic;  -- GND
917
    X_8  : out   std_logic;  -- 3Y\
918
    X_9  : in    std_logic;  -- 3C
919
    X_10 : in    std_logic;  -- 3B
920
    X_11 : in    std_logic;  -- 3A
921
    X_12 : out   std_logic;  -- 1Y\
922
    X_13 : in    std_logic;  -- 1C
923
    X_14 : inout std_logic   -- Vcc
924
);
925
end entity SN74LS15N;
926
 
927
architecture BEHAV of SN74LS15N is
928
    signal A : TTLInputs (1 to 3, 1 to 3);
929
    signal Y : TTLOutputs(1 to 3);
930
 
931
begin
932
    A <= ( (X_1, X_2, X_13), (X_3, X_4, X_5), (X_9, X_10, X_11) );
933
 
934
    (X_12, X_6, X_8) <= Y;
935
 
936
    G: TTLgate
937
    generic map(
938
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
939
        invert => '0',      -- '1' will invert the output
940
        ohigh  => 'Z',      -- '1' = normal, 'Z' = open collectors
941
        tPLH   => tPLH,
942
        tPHL   => tPHL
943
    )
944
    port map(
945
        ins   => A,
946
        outs  => Y
947
    );
948
 
949
end architecture BEHAV;
950
 
951
-----------------------------------------------------------------------
952
-- SN7416N: Hex inverter/driver (high voltage open collector)
953
--          Verified 30/05/2016
954
-----------------------------------------------------------------------
955
library ieee;
956
    use ieee.std_logic_1164.all;
957
 
958
    use work.LSTTL.all;
959
    use work.TTLPrivate.all;
960
 
961
entity SN7416N is
962
generic(
963
    tPLH : time := 15 ns;
964
    tPHL : time := 23 ns
965
);
966
port(
967
    X_1  : in    std_logic;  -- 1A
968
    X_2  : out   std_logic;  -- 1Y\
969
    X_3  : in    std_logic;  -- 2A
970
    X_4  : out   std_logic;  -- 2Y\
971
    X_5  : in    std_logic;  -- 3A
972
    X_6  : out   std_logic;  -- 3Y\
973
    X_7  : inout std_logic;  -- GND
974
    X_8  : out   std_logic;  -- 4Y\
975
    X_9  : in    std_logic;  -- 4A
976
    X_10 : out   std_logic;  -- 5Y\
977
    X_11 : in    std_logic;  -- 5A
978
    X_12 : out   std_logic;  -- 6Y\
979
    X_13 : in    std_logic;  -- 6A
980
    X_14 : inout std_logic   -- Vcc
981
);
982
end entity SN7416N;
983
 
984
architecture BEHAV of SN7416N is
985
    signal A : TTLInputs (1 to 6, 1 to 1);
986
    signal Y : TTLOutputs(1 to 6);
987
 
988
begin
989
    A(1,1) <= X_1;      -- Can't use aggregates when the substring has only 1 element
990
    A(2,1) <= X_3;
991
    A(3,1) <= X_5;
992
    A(4,1) <= X_9;
993
    A(5,1) <= X_11;
994
    A(6,1) <= X_13;
995
 
996
    (X_2, X_4, X_6, X_8, X_10, X_12) <= Y;
997
 
998
    G: TTLgate
999
    generic map(
1000
        mode   => Zbuf,     -- Zand, Zor, Zxor, Zbuf
1001
        invert => '1',      -- '1' will invert the output
1002
        ohigh  => 'Z',      -- '1' = normal, 'Z' = open collectors
1003
        tPLH   => tPLH,
1004
        tPHL   => tPHL
1005
    )
1006
    port map(
1007
        ins   => A,
1008
        outs  => Y
1009
    );
1010
 
1011
end architecture BEHAV;
1012
 
1013
-----------------------------------------------------------------------
1014
-- SN7417N: Hex buffer/driver (high voltage open collector)
1015
--          Verified 30/05/2016
1016
-----------------------------------------------------------------------
1017
library ieee;
1018
    use ieee.std_logic_1164.all;
1019
 
1020
    use work.LSTTL.all;
1021
    use work.TTLPrivate.all;
1022
 
1023
entity SN7417N is
1024
generic(
1025
    tPLH : time := 10 ns;
1026
    tPHL : time := 30 ns
1027
);
1028
port(
1029
    X_1  : in    std_logic;  -- 1A
1030
    X_2  : out   std_logic;  -- 1Y\
1031
    X_3  : in    std_logic;  -- 2A
1032
    X_4  : out   std_logic;  -- 2Y\
1033
    X_5  : in    std_logic;  -- 3A
1034
    X_6  : out   std_logic;  -- 3Y\
1035
    X_7  : inout std_logic;  -- GND
1036
    X_8  : out   std_logic;  -- 4Y\
1037
    X_9  : in    std_logic;  -- 4A
1038
    X_10 : out   std_logic;  -- 5Y\
1039
    X_11 : in    std_logic;  -- 5A
1040
    X_12 : out   std_logic;  -- 6Y\
1041
    X_13 : in    std_logic;  -- 6A
1042
    X_14 : inout std_logic   -- Vcc
1043
);
1044
end entity SN7417N;
1045
 
1046
architecture BEHAV of SN7417N is
1047
    signal A : TTLInputs (1 to 6, 1 to 1);
1048
    signal Y : TTLOutputs(1 to 6);
1049
 
1050
begin
1051
    A(1,1) <= X_1;      -- Can't use aggregates when the substring has only 1 element
1052
    A(2,1) <= X_3;
1053
    A(3,1) <= X_5;
1054
    A(4,1) <= X_9;
1055
    A(5,1) <= X_11;
1056
    A(6,1) <= X_13;
1057
 
1058
    (X_2, X_4, X_6, X_8, X_10, X_12) <= Y;
1059
 
1060
    G: TTLgate
1061
    generic map(
1062
        mode   => Zbuf,     -- Zand, Zor, Zxor, Zbuf
1063
        invert => '0',      -- '1' will invert the output
1064
        ohigh  => 'Z',      -- '1' = normal, 'Z' = open collectors
1065
        tPLH   => tPLH,
1066
        tPHL   => tPHL
1067
    )
1068
    port map(
1069
        ins   => A,
1070
        outs  => Y
1071
    );
1072
 
1073
end architecture BEHAV;
1074
 
1075
-----------------------------------------------------------------------
1076
-- SN74LS20N: Dual 4-input NAND gate (Pinout A)
1077
--            Verified 30/05/2016
1078
-----------------------------------------------------------------------
1079
library ieee;
1080
    use ieee.std_logic_1164.all;
1081
 
1082
    use work.LSTTL.all;
1083
    use work.TTLPrivate.all;
1084
 
1085
entity SN74LS20N is
1086
generic(
1087
    tPLH : time := 15 ns;
1088
    tPHL : time := 15 ns
1089
);
1090
port(
1091
    X_1  : in    std_logic;  -- 1A
1092
    X_2  : in    std_logic;  -- 1B
1093
                             -- 
1094
    X_4  : in    std_logic;  -- 1C
1095
    X_5  : in    std_logic;  -- 1D
1096
    X_6  : out   std_logic;  -- 1Y\
1097
    X_7  : inout std_logic;  -- GND
1098
    X_8  : out   std_logic;  -- 2Y\
1099
    X_9  : in    std_logic;  -- 2D
1100
    X_10 : in    std_logic;  -- 2C
1101
                             -- 
1102
    X_12 : in    std_logic;  -- 2B
1103
    X_13 : in    std_logic;  -- 2A
1104
    X_14 : inout std_logic   -- Vcc
1105
);
1106
end entity SN74LS20N;
1107
 
1108
architecture BEHAV of SN74LS20N is
1109
    signal A : TTLInputs (1 to 2, 1 to 4);
1110
    signal Y : TTLOutputs(1 to 2);
1111
 
1112
begin
1113
    A <= ( (X_1, X_2, X_4, X_5), (X_9, X_10, X_12, X_13) );
1114
 
1115
    (X_6, X_8) <= Y;
1116
 
1117
    G: TTLgate
1118
    generic map(
1119
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
1120
        invert => '1',      -- '1' will invert the output
1121
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
1122
        tPLH   => tPLH,
1123
        tPHL   => tPHL
1124
    )
1125
    port map(
1126
        ins   => A,
1127
        outs  => Y
1128
    );
1129
 
1130
end architecture BEHAV;
1131
 
1132
-----------------------------------------------------------------------
1133
-- SN74LS21N: Dual 4-input and gate (Pinout A)
1134
--            Verified 30/05/2016
1135
-----------------------------------------------------------------------
1136
library ieee;
1137
    use ieee.std_logic_1164.all;
1138
 
1139
    use work.LSTTL.all;
1140
    use work.TTLPrivate.all;
1141
 
1142
entity SN74LS21N is
1143
generic(
1144
    tPLH : time := 15 ns;
1145
    tPHL : time := 20 ns
1146
);
1147
port(
1148
    X_1  : in    std_logic;  -- 1A
1149
    X_2  : in    std_logic;  -- 1B
1150
                             -- 
1151
    X_4  : in    std_logic;  -- 1C
1152
    X_5  : in    std_logic;  -- 1D
1153
    X_6  : out   std_logic;  -- 1Y\
1154
    X_7  : inout std_logic;  -- GND
1155
    X_8  : out   std_logic;  -- 2Y\
1156
    X_9  : in    std_logic;  -- 2D
1157
    X_10 : in    std_logic;  -- 2C
1158
                             -- 
1159
    X_12 : in    std_logic;  -- 2B
1160
    X_13 : in    std_logic;  -- 2A
1161
    X_14 : inout std_logic   -- Vcc
1162
);
1163
end entity SN74LS21N;
1164
 
1165
architecture BEHAV of SN74LS21N is
1166
    signal A : TTLInputs (1 to 2, 1 to 4);
1167
    signal Y : TTLOutputs(1 to 2);
1168
 
1169
begin
1170
    A <= ( (X_1, X_2, X_4, X_5), (X_9, X_10, X_12, X_13) );
1171
 
1172
    (X_6, X_8) <= Y;
1173
 
1174
    G: TTLgate
1175
    generic map(
1176
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
1177
        invert => '0',      -- '1' will invert the output
1178
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
1179
        tPLH   => tPLH,
1180
        tPHL   => tPHL
1181
    )
1182
    port map(
1183
        ins   => A,
1184
        outs  => Y
1185
    );
1186
 
1187
end architecture BEHAV;
1188
 
1189
-----------------------------------------------------------------------
1190
-- SN74LS22N: Dual 4-input NAND gate (open collector) (Pinout A)
1191
--            Verified 30/05/2016
1192
-----------------------------------------------------------------------
1193
library ieee;
1194
    use ieee.std_logic_1164.all;
1195
 
1196
    use work.LSTTL.all;
1197
    use work.TTLPrivate.all;
1198
 
1199
entity SN74LS22N is
1200
generic(
1201
    tPLH : time := 22 ns;
1202
    tPHL : time := 18 ns
1203
);
1204
port(
1205
    X_1  : in    std_logic;  -- 1A
1206
    X_2  : in    std_logic;  -- 1B
1207
                             -- 
1208
    X_4  : in    std_logic;  -- 1C
1209
    X_5  : in    std_logic;  -- 1D
1210
    X_6  : out   std_logic;  -- 1Y\
1211
    X_7  : inout std_logic;  -- GND
1212
    X_8  : out   std_logic;  -- 2Y\
1213
    X_9  : in    std_logic;  -- 2D
1214
    X_10 : in    std_logic;  -- 2C
1215
                             -- 
1216
    X_12 : in    std_logic;  -- 2B
1217
    X_13 : in    std_logic;  -- 2A
1218
    X_14 : inout std_logic   -- Vcc
1219
);
1220
end entity SN74LS22N;
1221
 
1222
architecture BEHAV of SN74LS22N is
1223
    signal A : TTLInputs (1 to 2, 1 to 4);
1224
    signal Y : TTLOutputs(1 to 2);
1225
 
1226
begin
1227
    A <= ( (X_1, X_2, X_4, X_5), (X_9, X_10, X_12, X_13) );
1228
 
1229
    (X_6, X_8) <= Y;
1230
 
1231
    G: TTLgate
1232
    generic map(
1233
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
1234
        invert => '1',      -- '1' will invert the output
1235
        ohigh  => 'Z',      -- '1' = normal, 'Z' = open collectors
1236
        tPLH   => tPLH,
1237
        tPHL   => tPHL
1238
    )
1239
    port map(
1240
        ins   => A,
1241
        outs  => Y
1242
    );
1243
 
1244
end architecture BEHAV;
1245
 
1246
-- SN7423N: Expandable dual 4-input NOR gate (with strobe)
1247
-- SN7425N: Dual 4-input NOR gate (with strobe)
1248
 
1249
-----------------------------------------------------------------------
1250
-- SN74LS26N: Quad 2-input NAND buffer (open collector)
1251
--            Verified 29/05/2016
1252
-----------------------------------------------------------------------
1253
library ieee;
1254
    use ieee.std_logic_1164.all;
1255
 
1256
    use work.LSTTL.all;
1257
    use work.TTLPrivate.all;
1258
 
1259
entity SN74LS26N is
1260
generic(
1261
    tPLH : time := 22 ns;
1262
    tPHL : time := 18 ns
1263
);
1264
port(
1265
    X_1  : in    std_logic;  -- 1A
1266
    X_2  : in    std_logic;  -- 1B
1267
    X_3  : out   std_logic;  -- 1Y\
1268
    X_4  : in    std_logic;  -- 2A
1269
    X_5  : in    std_logic;  -- 2B
1270
    X_6  : out   std_logic;  -- 2Y\
1271
    X_7  : inout std_logic;  -- GND
1272
    X_8  : out   std_logic;  -- 3Y\
1273
    X_9  : in    std_logic;  -- 3B
1274
    X_10 : in    std_logic;  -- 3A
1275
    X_11 : out   std_logic;  -- 4Y\
1276
    X_12 : in    std_logic;  -- 4B
1277
    X_13 : in    std_logic;  -- 4A
1278
    X_14 : inout std_logic   -- Vcc 
1279
);
1280
end entity SN74LS26N;
1281
 
1282
architecture BEHAV of SN74LS26N is
1283
    signal A : TTLInputs (1 to 4, 1 to 2);
1284
    signal Y : TTLOutputs(1 to 4);
1285
 
1286
begin
1287
    A <= ( (X_1, X_2), (X_4, X_5), (X_9, X_10), (X_12, X_13) );
1288
 
1289
    (X_3, X_6, X_8, X_11) <= Y;
1290
 
1291
    G: TTLgate
1292
    generic map(
1293
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
1294
        invert => '1',      -- '1' will invert the output
1295
        ohigh  => 'Z',      -- '1' = normal, 'Z' = open collectors
1296
        tPLH   => tPLH,
1297
        tPHL   => tPHL
1298
    )
1299
    port map(
1300
        ins   => A,
1301
        outs  => Y
1302
    );
1303
 
1304
end architecture BEHAV;
1305
 
1306
-----------------------------------------------------------------------
1307
-- SN74LS27N: Triple 3-input NOR gate
1308
--            Verified 30/05/2016
1309
-----------------------------------------------------------------------
1310
library ieee;
1311
    use ieee.std_logic_1164.all;
1312
 
1313
    use work.LSTTL.all;
1314
    use work.TTLPrivate.all;
1315
 
1316
entity SN74LS27N is
1317
generic(
1318
    tPLH : time := 13 ns;
1319
    tPHL : time := 13 ns
1320
);
1321
port(
1322
    X_1  : in    std_logic;  -- 1A
1323
    X_2  : in    std_logic;  -- 1B
1324
    X_3  : in    std_logic;  -- 2A
1325
    X_4  : in    std_logic;  -- 2B
1326
    X_5  : in    std_logic;  -- 2C
1327
    X_6  : out   std_logic;  -- 2Y\
1328
    X_7  : inout std_logic;  -- GND
1329
    X_8  : out   std_logic;  -- 3Y\
1330
    X_9  : in    std_logic;  -- 3C
1331
    X_10 : in    std_logic;  -- 3B
1332
    X_11 : in    std_logic;  -- 3A
1333
    X_12 : out   std_logic;  -- 1Y\
1334
    X_13 : in    std_logic;  -- 1C
1335
    X_14 : inout std_logic   -- Vcc
1336
);
1337
end entity SN74LS27N;
1338
 
1339
architecture BEHAV of SN74LS27N is
1340
    signal A : TTLInputs (1 to 3, 1 to 3);
1341
    signal Y : TTLOutputs(1 to 3);
1342
 
1343
begin
1344
    A <= ( (X_1, X_2, X_13), (X_3, X_4, X_5), (X_9, X_10, X_11) );
1345
 
1346
    (X_12, X_6, X_8) <= Y;
1347
 
1348
    G: TTLgate
1349
    generic map(
1350
        mode   => Zor,      -- Zand, Zor, Zxor, Zbuf
1351
        invert => '1',      -- '1' will invert the output
1352
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
1353
        tPLH   => tPLH,
1354
        tPHL   => tPHL
1355
    )
1356
    port map(
1357
        ins   => A,
1358
        outs  => Y
1359
    );
1360
 
1361
end architecture BEHAV;
1362
 
1363
-----------------------------------------------------------------------
1364
-- SN74LS28N: Quad 2-input NOR buffer
1365
--            Verified 29/05/2016
1366
-----------------------------------------------------------------------
1367
library ieee;
1368
    use ieee.std_logic_1164.all;
1369
 
1370
    use work.LSTTL.all;
1371
    use work.TTLPrivate.all;
1372
 
1373
entity SN74LS28N is
1374
generic(
1375
    tPLH : time := 20 ns;
1376
    tPHL : time := 20 ns
1377
);
1378
port(
1379
    X_1  : out   std_logic;  -- 1Y\
1380
    X_2  : in    std_logic;  -- 1A
1381
    X_3  : in    std_logic;  -- 1B
1382
    X_4  : out   std_logic;  -- 2Y\
1383
    X_5  : in    std_logic;  -- 2A
1384
    X_6  : in    std_logic;  -- 2B
1385
    X_7  : inout std_logic;  -- GND
1386
    X_8  : in    std_logic;  -- 3B
1387
    X_9  : in    std_logic;  -- 3A
1388
    X_10 : out   std_logic;  -- 3Y\
1389
    X_11 : in    std_logic;  -- 4B
1390
    X_12 : in    std_logic;  -- 4A
1391
    X_13 : out   std_logic;  -- 4Y\
1392
    X_14 : inout std_logic   -- Vcc
1393
);
1394
end entity SN74LS28N;
1395
 
1396
architecture BEHAV of SN74LS28N is
1397
    signal A : TTLInputs (1 to 4, 1 to 2);
1398
    signal Y : TTLOutputs(1 to 4);
1399
 
1400
begin
1401
    A <= ( (X_2, X_3), (X_5, X_6), (X_8, X_9), (X_11, X_12) );
1402
 
1403
    (X_1, X_4, X_10, X_13) <= Y;
1404
 
1405
    G: TTLgate
1406
    generic map(
1407
        mode   => Zor,      -- Zand, Zor, Zxor, Zbuf
1408
        invert => '1',      -- '1' will invert the output
1409
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
1410
        tPLH   => tPLH,
1411
        tPHL   => tPHL
1412
    )
1413
    port map(
1414
        ins   => A,
1415
        outs  => Y
1416
    );
1417
 
1418
end architecture BEHAV;
1419
 
1420
-----------------------------------------------------------------------
1421
-- SN74LS30N: 8-input NAND gate (Pinout A)
1422
--            Verified 30/05/2016
1423
-----------------------------------------------------------------------
1424
library ieee;
1425
    use ieee.std_logic_1164.all;
1426
 
1427
    use work.LSTTL.all;
1428
    use work.TTLPrivate.all;
1429
 
1430
entity SN74LS30N is
1431
generic(
1432
    tPLH : time := 15 ns;
1433
    tPHL : time := 20 ns
1434
);
1435
port(
1436
    X_1  : in    std_logic;  -- 1A
1437
    X_2  : in    std_logic;  -- 1B
1438
    X_3  : in    std_logic;  -- 1C
1439
    X_4  : in    std_logic;  -- 1D
1440
    X_5  : in    std_logic;  -- 1E
1441
    X_6  : in    std_logic;  -- 1F
1442
    X_7  : inout std_logic;  -- GND
1443
    X_8  : out   std_logic;  -- 1Y\
1444
                             -- 
1445
                             -- 
1446
    X_11 : in    std_logic;  -- 1G
1447
    X_12 : in    std_logic;  -- 1H
1448
                             --
1449
    X_14 : inout std_logic   -- Vcc
1450
);
1451
end entity SN74LS30N;
1452
 
1453
architecture BEHAV of SN74LS30N is
1454
    signal A : TTLInputs (1 to 1, 1 to 8);
1455
    signal Y : TTLOutputs(1 to 1);
1456
 
1457
begin
1458
    A(1,1) <= X_1;          -- Can't use aggregates with single gate
1459
    A(1,2) <= X_2;
1460
    A(1,3) <= X_3;
1461
    A(1,4) <= X_4;
1462
    A(1,5) <= X_5;
1463
    A(1,6) <= X_6;
1464
    A(1,7) <= X_11;
1465
    A(1,8) <= X_12;
1466
 
1467
    X_8 <= Y(1);
1468
 
1469
    G: TTLgate
1470
    generic map(
1471
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
1472
        invert => '1',      -- '1' will invert the output
1473
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
1474
        tPLH   => tPLH,
1475
        tPHL   => tPHL
1476
    )
1477
    port map(
1478
        ins   => A,
1479
        outs  => Y
1480
    );
1481
 
1482
end architecture BEHAV;
1483
 
1484
-----------------------------------------------------------------------
1485
-- SN74LS32N: Quad 2-input or gate
1486
--            Verified 28/05/2016
1487
-----------------------------------------------------------------------
1488
library ieee;
1489
    use ieee.std_logic_1164.all;
1490
 
1491
    use work.LSTTL.all;
1492
    use work.TTLPrivate.all;
1493
 
1494
entity SN74LS32N is
1495
generic(
1496
    tPLH : time := 15 ns;
1497
    tPHL : time := 15 ns
1498
);
1499
port(
1500
    X_1  : in    std_logic;  -- 1A
1501
    X_2  : in    std_logic;  -- 1B
1502
    X_3  : out   std_logic;  -- 1Y
1503
    X_4  : in    std_logic;  -- 2A
1504
    X_5  : in    std_logic;  -- 2B
1505
    X_6  : out   std_logic;  -- 2Y
1506
    X_7  : inout std_logic;  -- GND
1507
    X_8  : out   std_logic;  -- 3Y
1508
    X_9  : in    std_logic;  -- 3B
1509
    X_10 : in    std_logic;  -- 3A
1510
    X_11 : out   std_logic;  -- 4Y
1511
    X_12 : in    std_logic;  -- 4B
1512
    X_13 : in    std_logic;  -- 4A
1513
    X_14 : inout std_logic   -- Vcc 
1514
);
1515
end entity SN74LS32N;
1516
 
1517
architecture BEHAV of SN74LS32N is
1518
    signal A : TTLInputs (1 to 4, 1 to 2);
1519
    signal Y : TTLOutputs(1 to 4);
1520
 
1521
begin
1522
    A <= ( (X_1, X_2), (X_4, X_5), (X_9, X_10), (X_12, X_13) );
1523
 
1524
    (X_3, X_6, X_8, X_11) <= Y;
1525
 
1526
    G: TTLgate
1527
    generic map(
1528
        mode   => Zor,      -- Zand, Zor, Zxor, Zbuf
1529
        invert => '0',      -- '1' will invert the output
1530
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
1531
        tPLH   => tPLH,
1532
        tPHL   => tPHL
1533
    )
1534
    port map(
1535
        ins   => A,
1536
        outs  => Y
1537
    );
1538
 
1539
end architecture BEHAV;
1540
 
1541
-----------------------------------------------------------------------
1542
-- SN74LS33N: Quad 2-input NOR buffer (open collector)
1543
--            Verified 29/05/2016
1544
-----------------------------------------------------------------------
1545
library ieee;
1546
    use ieee.std_logic_1164.all;
1547
 
1548
    use work.LSTTL.all;
1549
    use work.TTLPrivate.all;
1550
 
1551
entity SN74LS33N is
1552
generic(
1553
    tPLH : time := 32 ns;
1554
    tPHL : time := 28 ns
1555
);
1556
port(
1557
    X_1  : out   std_logic;  -- 1Y\
1558
    X_2  : in    std_logic;  -- 1A
1559
    X_3  : in    std_logic;  -- 1B
1560
    X_4  : out   std_logic;  -- 2Y\
1561
    X_5  : in    std_logic;  -- 2A
1562
    X_6  : in    std_logic;  -- 2B
1563
    X_7  : inout std_logic;  -- GND
1564
    X_8  : in    std_logic;  -- 3B
1565
    X_9  : in    std_logic;  -- 3A
1566
    X_10 : out   std_logic;  -- 3Y\
1567
    X_11 : in    std_logic;  -- 4B
1568
    X_12 : in    std_logic;  -- 4A
1569
    X_13 : out   std_logic;  -- 4Y\
1570
    X_14 : inout std_logic   -- Vcc
1571
);
1572
end entity SN74LS33N;
1573
 
1574
architecture BEHAV of SN74LS33N is
1575
    signal A : TTLInputs (1 to 4, 1 to 2);
1576
    signal Y : TTLOutputs(1 to 4);
1577
 
1578
begin
1579
    A <= ( (X_2, X_3), (X_5, X_6), (X_8, X_9), (X_11, X_12) );
1580
 
1581
    (X_1, X_4, X_10, X_13) <= Y;
1582
 
1583
    G: TTLgate
1584
    generic map(
1585
        mode   => Zor,      -- Zand, Zor, Zxor, Zbuf
1586
        invert => '1',      -- '1' will invert the output
1587
        ohigh  => 'Z',      -- '1' = normal, 'Z' = open collectors
1588
        tPLH   => tPLH,
1589
        tPHL   => tPHL
1590
    )
1591
    port map(
1592
        ins   => A,
1593
        outs  => Y
1594
    );
1595
 
1596
end architecture BEHAV;
1597
 
1598
-----------------------------------------------------------------------
1599
-- SN74LS37N: Quad 2-input NAND buffer
1600
--            Verified 28/05/2016
1601
-----------------------------------------------------------------------
1602
library ieee;
1603
    use ieee.std_logic_1164.all;
1604
 
1605
    use work.LSTTL.all;
1606
    use work.TTLPrivate.all;
1607
 
1608
entity SN74LS37N is
1609
generic(
1610
    tPLH : time := 20 ns;
1611
    tPHL : time := 20 ns
1612
);
1613
port(
1614
    X_1  : in    std_logic;  -- 1A
1615
    X_2  : in    std_logic;  -- 1B
1616
    X_3  : out   std_logic;  -- 1Y\
1617
    X_4  : in    std_logic;  -- 2A
1618
    X_5  : in    std_logic;  -- 2B
1619
    X_6  : out   std_logic;  -- 2Y\
1620
    X_7  : inout std_logic;  -- GND
1621
    X_8  : out   std_logic;  -- 3Y\
1622
    X_9  : in    std_logic;  -- 3B
1623
    X_10 : in    std_logic;  -- 3A
1624
    X_11 : out   std_logic;  -- 4Y\
1625
    X_12 : in    std_logic;  -- 4B
1626
    X_13 : in    std_logic;  -- 4A
1627
    X_14 : inout std_logic   -- Vcc 
1628
);
1629
end entity SN74LS37N;
1630
 
1631
architecture BEHAV of SN74LS37N is
1632
    signal A : TTLInputs (1 to 4, 1 to 2);
1633
    signal Y : TTLOutputs(1 to 4);
1634
 
1635
begin
1636
    A <= ( (X_1, X_2), (X_4, X_5), (X_9, X_10), (X_12, X_13) );
1637
 
1638
    (X_3, X_6, X_8, X_11) <= Y;
1639
 
1640
    G: TTLgate
1641
    generic map(
1642
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
1643
        invert => '1',      -- '1' will invert the output
1644
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
1645
        tPLH   => tPLH,
1646
        tPHL   => tPHL
1647
    )
1648
    port map(
1649
        ins   => A,
1650
        outs  => Y
1651
    );
1652
 
1653
end architecture BEHAV;
1654
 
1655
-----------------------------------------------------------------------
1656
-- SN74LS38N: Quad 2-input NAND buffer (open collector)
1657
--            Verified 28/05/2016
1658
-----------------------------------------------------------------------
1659
library ieee;
1660
    use ieee.std_logic_1164.all;
1661
 
1662
    use work.LSTTL.all;
1663
    use work.TTLPrivate.all;
1664
 
1665
entity SN74LS38N is
1666
generic(
1667
    tPLH : time := 20 ns;
1668
    tPHL : time := 20 ns
1669
);
1670
port(
1671
    X_1  : in    std_logic;  -- 1A
1672
    X_2  : in    std_logic;  -- 1B
1673
    X_3  : out   std_logic;  -- 1Y\
1674
    X_4  : in    std_logic;  -- 2A
1675
    X_5  : in    std_logic;  -- 2B
1676
    X_6  : out   std_logic;  -- 2Y\
1677
    X_7  : inout std_logic;  -- GND
1678
    X_8  : out   std_logic;  -- 3Y\
1679
    X_9  : in    std_logic;  -- 3B
1680
    X_10 : in    std_logic;  -- 3A
1681
    X_11 : out   std_logic;  -- 4Y\
1682
    X_12 : in    std_logic;  -- 4B
1683
    X_13 : in    std_logic;  -- 4A
1684
    X_14 : inout std_logic   -- Vcc 
1685
);
1686
end entity SN74LS38N;
1687
 
1688
architecture BEHAV of SN74LS38N is
1689
    signal A : TTLInputs (1 to 4, 1 to 2);
1690
    signal Y : TTLOutputs(1 to 4);
1691
 
1692
begin
1693
    A <= ( (X_1, X_2), (X_4, X_5), (X_9, X_10), (X_12, X_13) );
1694
 
1695
    (X_3, X_6, X_8, X_11) <= Y;
1696
 
1697
    G: TTLgate
1698
    generic map(
1699
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
1700
        invert => '1',      -- '1' will invert the output
1701
        ohigh  => 'Z',      -- '1' = normal, 'Z' = open collectors
1702
        tPLH   => tPLH,
1703
        tPHL   => tPHL
1704
    )
1705
    port map(
1706
        ins   => A,
1707
        outs  => Y
1708
    );
1709
 
1710
end architecture BEHAV;
1711
 
1712
-----------------------------------------------------------------------
1713
-- SN74LS39N: Quad 2-input NAND buffer (open collector) (Pinout A)
1714
--            Verified 29/05/2016
1715
-----------------------------------------------------------------------
1716
library ieee;
1717
    use ieee.std_logic_1164.all;
1718
 
1719
    use work.LSTTL.all;
1720
    use work.TTLPrivate.all;
1721
 
1722
entity SN74LS39N is
1723
generic(
1724
    tPLH : time := 22 ns;
1725
    tPHL : time := 18 ns
1726
);
1727
port(
1728
    X_1  : out   std_logic;  -- 1Y\
1729
    X_2  : in    std_logic;  -- 1A
1730
    X_3  : in    std_logic;  -- 1B
1731
    X_4  : out   std_logic;  -- 2Y\
1732
    X_5  : in    std_logic;  -- 2A
1733
    X_6  : in    std_logic;  -- 2B
1734
    X_7  : inout std_logic;  -- GND
1735
    X_8  : in    std_logic;  -- 3B
1736
    X_9  : in    std_logic;  -- 3A
1737
    X_10 : out   std_logic;  -- 3Y\
1738
    X_11 : in    std_logic;  -- 4B
1739
    X_12 : in    std_logic;  -- 4A
1740
    X_13 : out   std_logic;  -- 4Y\
1741
    X_14 : inout std_logic   -- Vcc
1742
);
1743
end entity SN74LS39N;
1744
 
1745
architecture BEHAV of SN74LS39N is
1746
    signal A : TTLInputs (1 to 4, 1 to 2);
1747
    signal Y : TTLOutputs(1 to 4);
1748
 
1749
begin
1750
    A <= ( (X_2, X_3), (X_5, X_6), (X_8, X_9), (X_11, X_12) );
1751
 
1752
    (X_1, X_4, X_10, X_13) <= Y;
1753
 
1754
    G: TTLgate
1755
    generic map(
1756
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
1757
        invert => '1',      -- '1' will invert the output
1758
        ohigh  => 'Z',      -- '1' = normal, 'Z' = open collectors
1759
        tPLH   => tPLH,
1760
        tPHL   => tPHL
1761
    )
1762
    port map(
1763
        ins   => A,
1764
        outs  => Y
1765
    );
1766
 
1767
end architecture BEHAV;
1768
 
1769
-----------------------------------------------------------------------
1770
-- SN74LS40N: Dual 4-input NAND buffer (Pinout A)
1771
--            Verified 30/05/2016
1772
-----------------------------------------------------------------------
1773
library ieee;
1774
    use ieee.std_logic_1164.all;
1775
 
1776
    use work.LSTTL.all;
1777
    use work.TTLPrivate.all;
1778
 
1779
entity SN74LS40N is
1780
generic(
1781
    tPLH : time := 24 ns;
1782
    tPHL : time := 24 ns
1783
);
1784
port(
1785
    X_1  : in    std_logic;  -- 1A
1786
    X_2  : in    std_logic;  -- 1B
1787
                             -- 
1788
    X_4  : in    std_logic;  -- 1C
1789
    X_5  : in    std_logic;  -- 1D
1790
    X_6  : out   std_logic;  -- 1Y\
1791
    X_7  : inout std_logic;  -- GND
1792
    X_8  : out   std_logic;  -- 2Y\
1793
    X_9  : in    std_logic;  -- 2D
1794
    X_10 : in    std_logic;  -- 2C
1795
                             -- 
1796
    X_12 : in    std_logic;  -- 2B
1797
    X_13 : in    std_logic;  -- 2A
1798
    X_14 : inout std_logic   -- Vcc
1799
);
1800
end entity SN74LS40N;
1801
 
1802
architecture BEHAV of SN74LS40N is
1803
    signal A : TTLInputs (1 to 2, 1 to 4);
1804
    signal Y : TTLOutputs(1 to 2);
1805
 
1806
begin
1807
    A <= ( (X_1, X_2, X_4, X_5), (X_9, X_10, X_12, X_13) );
1808
 
1809
    (X_6, X_8) <= Y;
1810
 
1811
    G: TTLgate
1812
    generic map(
1813
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
1814
        invert => '1',      -- '1' will invert the output
1815
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
1816
        tPLH   => tPLH,
1817
        tPHL   => tPHL
1818
    )
1819
    port map(
1820
        ins   => A,
1821
        outs  => Y
1822
    );
1823
 
1824
end architecture BEHAV;
1825
 
1826
-----------------------------------------------------------------------
1827
-- SN74LS42N: 1-of-10 decoder
1828
--            Verified 30/05/2016
1829
-----------------------------------------------------------------------
1830
library ieee;
1831
    use ieee.std_logic_1164.all;
1832
    use ieee.numeric_std.all;
1833
 
1834
    use work.LSTTL.all;
1835
    use work.TTLPrivate.all;
1836
 
1837
entity SN74LS42N is
1838
generic(
1839
    tPLH : time := 20 ns;
1840
    tPHL : time := 27 ns
1841
);
1842
port(
1843
    X_1  : out   std_logic;  -- Q0\
1844
    X_2  : out   std_logic;  -- Q1\
1845
    X_3  : out   std_logic;  -- Q2\
1846
    X_4  : out   std_logic;  -- Q3\
1847
    X_5  : out   std_logic;  -- Q4\
1848
    X_6  : out   std_logic;  -- Q5\
1849
    X_7  : out   std_logic;  -- Q6\
1850
    X_8  : inout std_logic;  -- GND
1851
    X_9  : out   std_logic;  -- Q7\
1852
    X_10 : out   std_logic;  -- Q8\
1853
    X_11 : out   std_logic;  -- Q9\
1854
    X_12 : in    std_logic;  -- A3
1855
    X_13 : in    std_logic;  -- A2
1856
    X_14 : in    std_logic;  -- A1
1857
    X_15 : in    std_logic;  -- A0
1858
    X_16 : inout std_logic   -- Vcc
1859
);
1860
end entity SN74LS42N;
1861
 
1862
architecture BEHAV of SN74LS42N is
1863
    signal OP, Y : std_logic_vector(15 downto 0);
1864
begin
1865
    process(all) is
1866
    variable AT : unsigned(3 downto 0);
1867
    variable AD :  natural range(OP'range);
1868
    begin
1869
        AT := (X_12 & X_13 & X_14 & X_15);
1870
        AD := TTL_to_integer(AT);
1871
        OP <= (others => '1');
1872
        OP(AD) <= '0';
1873
    end process;
1874
 
1875
    G1: for i in OP'range generate
1876
    begin
1877
        DL: TTLdelay
1878
        generic map(
1879
            tPLH => tPLH,
1880
            tPHL => tPHL
1881
        )
1882
        port map(
1883
            A => OP(i),
1884
            B => Y(i)
1885
        );
1886
    end generate;
1887
 
1888
    ( X_11, X_10, X_9, X_7, X_6, X_5, X_4, X_3, X_2, X_1 ) <= Y(9 downto 0);
1889
 
1890
end architecture BEHAV;
1891
 
1892
-----------------------------------------------------------------------
1893
-- SN7445N: 1-of-10 decoder/driver (open collector)
1894
--          Verified 30/05/2016
1895
-----------------------------------------------------------------------
1896
library ieee;
1897
    use ieee.std_logic_1164.all;
1898
    use ieee.numeric_std.all;
1899
 
1900
    use work.LSTTL.all;
1901
    use work.TTLPrivate.all;
1902
 
1903
entity SN7445N is
1904
generic(
1905
    tPLH : time := 50 ns;
1906
    tPHL : time := 50 ns
1907
);
1908
port(
1909
    X_1  : out   std_logic;  -- Q0\
1910
    X_2  : out   std_logic;  -- Q1\
1911
    X_3  : out   std_logic;  -- Q2\
1912
    X_4  : out   std_logic;  -- Q3\
1913
    X_5  : out   std_logic;  -- Q4\
1914
    X_6  : out   std_logic;  -- Q5\
1915
    X_7  : out   std_logic;  -- Q6\
1916
    X_8  : inout std_logic;  -- GND
1917
    X_9  : out   std_logic;  -- Q7\
1918
    X_10 : out   std_logic;  -- Q8\
1919
    X_11 : out   std_logic;  -- Q9\
1920
    X_12 : in    std_logic;  -- A3
1921
    X_13 : in    std_logic;  -- A2
1922
    X_14 : in    std_logic;  -- A1
1923
    X_15 : in    std_logic;  -- A0
1924
    X_16 : inout std_logic   -- Vcc
1925
);
1926
end entity SN7445N;
1927
 
1928
architecture BEHAV of SN7445N is
1929
    signal OP, Y, Z : std_logic_vector(15 downto 0);
1930
begin
1931
    process(all) is
1932
    variable AT : unsigned(3 downto 0);
1933
    variable AD :  natural range(OP'range);
1934
    begin
1935
        AT := (X_12 & X_13 & X_14 & X_15);
1936
        AD := TTL_to_integer(AT);
1937
        OP <= (others => '1');
1938
        OP(AD) <= '0';
1939
    end process;
1940
 
1941
    G1: for i in OP'range generate
1942
    begin
1943
        DL: TTLdelay
1944
        generic map(
1945
            tPLH => tPLH,
1946
            tPHL => tPHL
1947
        )
1948
        port map(
1949
            A => OP(i),
1950
            B => Y(i)
1951
        );
1952
 
1953
        Z(i) <= '0' when Y(i) = '0' else 'Z';       -- Open collectors
1954
    end generate;
1955
 
1956
    ( X_11, X_10, X_9, X_7, X_6, X_5, X_4, X_3, X_2, X_1 ) <= Z(9 downto 0);
1957
 
1958
end architecture BEHAV;
1959
 
1960
-- SN74LS47N: BCD to 7-segment decoder/driver
1961
-- SN74LS48N: BCD to 7-segment decoder
1962
-- SN74LS49N: BCD to 7-segment decoder
1963
-- SN7450P: Expandable dual 2-wide 2-input and-or-invert gate
1964
 
1965
-----------------------------------------------------------------------
1966
-- SN74LS51N: Dual 2-wide, 2/3-input and-or-Invert gate (Pinout B)
1967
--            Verified 30/05/2016
1968
-----------------------------------------------------------------------
1969
library ieee;
1970
    use ieee.std_logic_1164.all;
1971
 
1972
    use work.LSTTL.all;
1973
    use work.TTLPrivate.all;
1974
 
1975
entity SN74LS51N is
1976
generic(
1977
    tPLH : time := 20 ns;
1978
    tPHL : time := 20 ns
1979
);
1980
port(
1981
    X_1  : in    std_logic;  -- 2A1
1982
    X_2  : in    std_logic;  -- 1A1
1983
    X_3  : in    std_logic;  -- 1A2
1984
    X_4  : in    std_logic;  -- 1B1
1985
    X_5  : in    std_logic;  -- 1B2
1986
    X_6  : out   std_logic;  -- 1Y\
1987
    X_7  : inout std_logic;  -- GND
1988
    X_8  : out   std_logic;  -- 2Y\
1989
    X_9  : in    std_logic;  -- 2B3
1990
    X_10 : in    std_logic;  -- 2B2
1991
    X_11 : in    std_logic;  -- 2B1
1992
    X_12 : in    std_logic;  -- 2A3
1993
    X_13 : in    std_logic;  -- 2A2
1994
    X_14 : inout std_logic   -- Vcc
1995
);
1996
end entity SN74LS51N;
1997
 
1998
architecture BEHAV of SN74LS51N is
1999
    signal Y : std_logic_vector(2 downto 1);
2000
begin
2001
    Y(1) <= not( (X_2 and X_3) or (X_4 and X_5));
2002
    Y(2) <= not( (X_1 and X_12 and X_13) or (X_9 and X_10 and X_11));
2003
 
2004
    G1: TTLdelay
2005
        generic map(
2006
            tPLH => tPLH,
2007
            tPHL => tPHL
2008
        )
2009
        port map(
2010
            A => Y(1),
2011
            B => X_6
2012
        );
2013
 
2014
    G2: TTLdelay
2015
        generic map(
2016
            tPLH => tPLH,
2017
            tPHL => tPHL
2018
        )
2019
        port map(
2020
            A => Y(2),
2021
            B => X_8
2022
        );
2023
 
2024
end architecture BEHAV;
2025
 
2026
-- SN74H52: Expandable 2-2-2-3-input and-or gate
2027
-- SN74H53: Expandable 2-2-2-3-input and-or-Invert gate
2028
 
2029
-----------------------------------------------------------------------
2030
-- SN74LS54N: 4-wide 2-input and-or-Invert gate (Pinout C)
2031
--            Verified 30/05/2016
2032
-----------------------------------------------------------------------
2033
library ieee;
2034
    use ieee.std_logic_1164.all;
2035
 
2036
    use work.LSTTL.all;
2037
    use work.TTLPrivate.all;
2038
 
2039
entity SN74LS54N is
2040
generic(
2041
    tPLH : time := 20 ns;
2042
    tPHL : time := 20 ns
2043
);
2044
port(
2045
    X_1  : in    std_logic;  -- 1A1
2046
    X_2  : in    std_logic;  -- 1A2
2047
    X_3  : in    std_logic;  -- 1B1
2048
    X_4  : in    std_logic;  -- 1B2
2049
    X_5  : in    std_logic;  -- 1B3
2050
    X_6  : out   std_logic;  -- 1Y\
2051
    X_7  : inout std_logic;  -- GND
2052
                             -- 
2053
    X_9  : in    std_logic;  -- 1D3
2054
    X_10 : in    std_logic;  -- 1D2
2055
    X_11 : in    std_logic;  -- 1D1
2056
    X_12 : in    std_logic;  -- 1C2
2057
    X_13 : in    std_logic;  -- 1C1
2058
    X_14 : inout std_logic   -- Vcc
2059
);
2060
end entity SN74LS54N;
2061
 
2062
architecture BEHAV of SN74LS54N is
2063
    signal Y : std_logic;
2064
begin
2065
    Y <= not( (X_1  and X_2) or
2066
              (X_3  and X_4  and X_5 ) or
2067
              (X_9  and X_10 and X_11) or
2068
              (X_12 and X_13) );
2069
 
2070
    G1: TTLdelay
2071
        generic map(
2072
            tPLH => tPLH,
2073
            tPHL => tPHL
2074
        )
2075
        port map(
2076
            A => Y,
2077
            B => X_6
2078
        );
2079
 
2080
end architecture BEHAV;
2081
 
2082
-----------------------------------------------------------------------
2083
-- SN74LS55N: 2-wide 4-input and-or-Invert gate (Pinout B)
2084
--            Verified 30/05/2016
2085
-----------------------------------------------------------------------
2086
library ieee;
2087
    use ieee.std_logic_1164.all;
2088
 
2089
    use work.LSTTL.all;
2090
    use work.TTLPrivate.all;
2091
 
2092
entity SN74LS55N is
2093
generic(
2094
    tPLH : time := 15 ns;
2095
    tPHL : time := 15 ns
2096
);
2097
port(
2098
    X_1  : in    std_logic;  -- 1A1
2099
    X_2  : in    std_logic;  -- 1A2
2100
    X_3  : in    std_logic;  -- 1A3
2101
    X_4  : in    std_logic;  -- 1A4
2102
                             -- 
2103
                             -- 
2104
    X_7  : inout std_logic;  -- GND
2105
    X_8  : out   std_logic;  -- 1Y\
2106
                             -- 
2107
    X_10 : in    std_logic;  -- 1B4
2108
    X_11 : in    std_logic;  -- 1B3
2109
    X_12 : in    std_logic;  -- 1B2
2110
    X_13 : in    std_logic;  -- 1B1
2111
    X_14 : inout std_logic   -- Vcc
2112
);
2113
end entity SN74LS55N;
2114
 
2115
architecture BEHAV of SN74LS55N is
2116
    signal Y : std_logic;
2117
begin
2118
    Y <= not( (X_1  and X_2 and X_3  and X_4) or
2119
              (X_10 and X_11 and X_12 and X_13) );
2120
 
2121
    G1: TTLdelay
2122
        generic map(
2123
            tPLH => tPLH,
2124
            tPHL => tPHL
2125
        )
2126
        port map(
2127
            A => Y,
2128
            B => X_8
2129
        );
2130
 
2131
end architecture BEHAV;
2132
 
2133
-- SN74H60: Dual 4-input expander
2134
-- SN74H61: Triple 3-input expander
2135
-- SN74H62: 3-2-2-3-input And-Or expander
2136
 
2137
-----------------------------------------------------------------------
2138
-- SN74S64N: 4-2-3-2 input and-or-Invert gate
2139
--           Verified 30/05/2016
2140
-----------------------------------------------------------------------
2141
library ieee;
2142
    use ieee.std_logic_1164.all;
2143
 
2144
    use work.LSTTL.all;
2145
    use work.TTLPrivate.all;
2146
 
2147
entity SN74S64N is
2148
generic(
2149
    tPLH : time := 5.5 ns;
2150
    tPHL : time := 5.5 ns
2151
);
2152
port(
2153
    X_1  : in    std_logic;  -- 1D1
2154
    X_2  : in    std_logic;  -- 1A1
2155
    X_3  : in    std_logic;  -- 1A2
2156
    X_4  : in    std_logic;  -- 1B1
2157
    X_5  : in    std_logic;  -- 1B2
2158
    X_6  : in    std_logic;  -- 1B3
2159
    X_7  : inout std_logic;  -- GND
2160
    X_8  : out   std_logic;  -- 1Y\
2161
    X_9  : in    std_logic;  -- 1C2
2162
    X_10 : in    std_logic;  -- 1C1
2163
    X_11 : in    std_logic;  -- 1D4
2164
    X_12 : in    std_logic;  -- 1D3
2165
    X_13 : in    std_logic;  -- 1D2
2166
    X_14 : inout std_logic   -- Vcc
2167
);
2168
end entity SN74S64N;
2169
 
2170
architecture BEHAV of SN74S64N is
2171
    signal Y : std_logic;
2172
begin
2173
    Y <= not( (X_2  and X_3) or
2174
              (X_4  and X_5 and X_6) or
2175
              (X_9  and X_10) or
2176
              (X_11 and X_12 and X_13 and X_1) );
2177
 
2178
    G1: TTLdelay
2179
        generic map(
2180
            tPLH => tPLH,
2181
            tPHL => tPHL
2182
        )
2183
        port map(
2184
            A => Y,
2185
            B => X_8
2186
        );
2187
 
2188
end architecture BEHAV;
2189
 
2190
-----------------------------------------------------------------------
2191
-- SN74S65N: 4-2-3-2 input and-or-Invert gate (open collector)
2192
--           Verified 30/05/2016
2193
-----------------------------------------------------------------------
2194
library ieee;
2195
    use ieee.std_logic_1164.all;
2196
 
2197
    use work.LSTTL.all;
2198
    use work.TTLPrivate.all;
2199
 
2200
entity SN74S65N is
2201
generic(
2202
    tPLH : time := 7.5 ns;
2203
    tPHL : time := 8.5 ns
2204
);
2205
port(
2206
    X_1  : in    std_logic;  -- 1D1
2207
    X_2  : in    std_logic;  -- 1A1
2208
    X_3  : in    std_logic;  -- 1A2
2209
    X_4  : in    std_logic;  -- 1B1
2210
    X_5  : in    std_logic;  -- 1B2
2211
    X_6  : in    std_logic;  -- 1B3
2212
    X_7  : inout std_logic;  -- GND
2213
    X_8  : out   std_logic;  -- 1Y\
2214
    X_9  : in    std_logic;  -- 1C2
2215
    X_10 : in    std_logic;  -- 1C1
2216
    X_11 : in    std_logic;  -- 1D4
2217
    X_12 : in    std_logic;  -- 1D3
2218
    X_13 : in    std_logic;  -- 1D2
2219
    X_14 : inout std_logic   -- Vcc
2220
);
2221
end entity SN74S65N;
2222
 
2223
architecture BEHAV of SN74S65N is
2224
    signal Y, Z : std_logic;
2225
begin
2226
    Y <= not( (X_2  and X_3) or
2227
              (X_4  and X_5 and X_6) or
2228
              (X_9  and X_10) or
2229
              (X_11 and X_12 and X_13 and X_1) );
2230
 
2231
    G1: TTLdelay
2232
        generic map(
2233
            tPLH => tPLH,
2234
            tPHL => tPHL
2235
        )
2236
        port map(
2237
            A => Y,
2238
            B => Z
2239
        );
2240
 
2241
        X_8 <= '0' when Z = '0' else 'Z';   -- Open collector
2242
 
2243
end architecture BEHAV;
2244
 
2245
-----------------------------------------------------------------------
2246
-- SN74LS68N: Dual 4-bit decade counter
2247
--            Verified 01/06/2016
2248
-----------------------------------------------------------------------
2249
library ieee;
2250
    use ieee.std_logic_1164.all;
2251
 
2252
    use work.LSTTL.all;
2253
    use work.TTLPrivate.all;
2254
 
2255
entity SN74LS68N is
2256
generic(
2257
    tPLH10 : time := 11 ns;
2258
    tPHL10 : time := 21 ns;
2259
    tPLH11 : time := 12 ns;     -- From CLK2
2260
    tPHL11 : time := 18 ns;
2261
    tPLH12 : time := 23 ns;
2262
    tPHL12 : time := 32 ns;     -- Worst delay = tPHL10 + tPHL12 = 53 ns
2263
    tPLH13 : time := 12 ns;
2264
    tPHL13 : time := 20 ns;
2265
 
2266
    tPLH20 : time := 11 ns;
2267
    tPHL20 : time := 21 ns;
2268
    tPLH21 : time := 24 ns;     -- From CLK1
2269
    tPHL21 : time := 29 ns;
2270
    tPLH22 : time := 35 ns;
2271
    tPHL22 : time := 40 ns;
2272
    tPLH23 : time := 24 ns;
2273
    tPHL23 : time := 29 ns
2274
);
2275
port(
2276
    X_1  : in    std_logic;  -- 1CLKA
2277
    X_2  : out   std_logic;  -- 1QB
2278
    X_3  : out   std_logic;  -- 1QD
2279
    X_4  : in    std_logic;  -- \1CLR
2280
    X_5  : out   std_logic;  -- 2QC
2281
                             -- 
2282
    X_7  : out   std_logic;  -- 2QA
2283
    X_8  : inout std_logic;  -- GND
2284
    X_9  : in    std_logic;  -- 2CLK
2285
    X_10 : out   std_logic;  -- 2QB
2286
    X_11 : in    std_logic;  -- \2CLR
2287
    X_12 : out   std_logic;  -- 2QD
2288
    X_13 : out   std_logic;  -- 1QC
2289
    X_14 : out   std_logic;  -- 1QA
2290
    X_15 : in    std_logic;  -- 1CLKB
2291
    X_16 : inout std_logic   -- Vcc
2292
);
2293
end entity SN74LS68N;
2294
 
2295
architecture BEHAV of SN74LS68N is
2296
    signal rst1, rst2 : std_logic;
2297
    signal       q02  : std_logic;
2298
begin
2299
    rst1 <= not X_4;
2300
    rst2 <= not X_11;
2301
 
2302
    C1: SN74LS90AN
2303
    generic map(
2304
        tPLH0 => tPLH10,
2305
        tPHL0 => tPHL10,
2306
        tPLH1 => tPLH11,            -- Delays not shortened: Q0 is explicit
2307
        tPHL1 => tPHL11,
2308
        tPLH2 => tPLH12,
2309
        tPHL2 => tPHL12,
2310
        tPLH3 => tPLH13,
2311
        tPHL3 => tPHL13
2312
    )
2313
    port map(
2314
        X_1  => X_15,  -- CP1\
2315
        X_2  => rst1,  -- MR1
2316
        X_3  => rst1,  -- MR2
2317
                       -- 
2318
        X_5  => open,  -- Vcc
2319
        X_6  => '0',   -- MS1
2320
        X_7  => '0',   -- MS2
2321
        X_8  => X_13,  -- Q2
2322
        X_9  => X_2,   -- Q1
2323
        X_10 => open,  -- GND
2324
        X_11 => X_3,   -- Q3
2325
        X_12 => X_14,  -- Q0
2326
                       -- 
2327
        X_14 => X_1    -- CP0\
2328
    );
2329
 
2330
    C2: SN74LS90AN
2331
    generic map(
2332
        tPLH0 => tPLH20,
2333
        tPHL0 => tPHL20,
2334
        tPLH1 => tPLH21-tPLH20,     -- Delays shortened, as they include Q0
2335
        tPHL1 => tPHL21-tPHL20,
2336
        tPLH2 => tPLH22-tPLH20,
2337
        tPHL2 => tPHL22-tPHL20,
2338
        tPLH3 => tPLH23-tPLH20,
2339
        tPHL3 => tPHL23-tPHL20
2340
    )
2341
    port map(
2342
        X_1  => q02,   -- CP1\
2343
        X_2  => rst2,  -- MR1
2344
        X_3  => rst2,  -- MR2
2345
                       -- 
2346
        X_5  => open,  -- Vcc
2347
        X_6  => '0',   -- MS1
2348
        X_7  => '0',   -- MS2
2349
        X_8  => X_5,   -- Q2
2350
        X_9  => X_10,  -- Q1
2351
        X_10 => open,  -- GND
2352
        X_11 => X_12,  -- Q3
2353
        X_12 => q02,   -- Q0
2354
                       -- 
2355
        X_14 => X_9    -- CP0\
2356
    );
2357
    X_7 <= q02;
2358
 
2359
end architecture BEHAV;
2360
 
2361
-----------------------------------------------------------------------
2362
-- SN74LS69N: Dual 4-bit binary counter
2363
--            Verified 01/06/2016
2364
-----------------------------------------------------------------------
2365
library ieee;
2366
    use ieee.std_logic_1164.all;
2367
 
2368
    use work.LSTTL.all;
2369
    use work.TTLPrivate.all;
2370
 
2371
entity SN74LS69N is
2372
generic(
2373
    tPLH10 : time := 11 ns;
2374
    tPHL10 : time := 21 ns;
2375
    tPLH11 : time := 11 ns;     -- From CLK2
2376
    tPHL11 : time := 21 ns;
2377
    tPLH12 : time := 24 ns;
2378
    tPHL12 : time := 32 ns;
2379
    tPLH13 : time := 38 ns;
2380
    tPHL13 : time := 45 ns;     -- Worst delay = tPHL10 + tPHL13 = 66 ns
2381
 
2382
    tPLH20 : time := 11 ns;
2383
    tPHL20 : time := 21 ns;
2384
    tPLH21 : time := 21 ns;     -- From CLK1
2385
    tPHL21 : time := 29 ns;
2386
    tPLH22 : time := 35 ns;
2387
    tPHL22 : time := 40 ns;
2388
    tPLH23 : time := 54 ns;
2389
    tPHL23 : time := 30 ns
2390
);
2391
port(
2392
    X_1  : in    std_logic;  -- 1CLKA
2393
    X_2  : out   std_logic;  -- 1QB
2394
    X_3  : out   std_logic;  -- 1QD
2395
    X_4  : in    std_logic;  -- \1CLR
2396
    X_5  : out   std_logic;  -- 2QC
2397
                             -- 
2398
    X_7  : out   std_logic;  -- 2QA
2399
    X_8  : inout std_logic;  -- GND
2400
    X_9  : in    std_logic;  -- 2CLK
2401
    X_10 : out   std_logic;  -- 2QB
2402
    X_11 : in    std_logic;  -- \2CLR
2403
    X_12 : out   std_logic;  -- 2QD
2404
    X_13 : out   std_logic;  -- 1QC
2405
    X_14 : out   std_logic;  -- 1QA
2406
    X_15 : in    std_logic;  -- 1CLKB
2407
    X_16 : inout std_logic   -- Vcc
2408
);
2409
end entity SN74LS69N;
2410
 
2411
architecture BEHAV of SN74LS69N is
2412
    signal rst1, rst2 : std_logic;
2413
    signal       q02  : std_logic;
2414
begin
2415
    rst1 <= not X_4;
2416
    rst2 <= not X_11;
2417
 
2418
    C1: SN74LS93N
2419
    generic map(
2420
        tPLH0 => tPLH10,
2421
        tPHL0 => tPHL10,
2422
        tPLH1 => tPLH11,
2423
        tPHL1 => tPHL11,
2424
        tPLH2 => tPLH12,
2425
        tPHL2 => tPHL12,
2426
        tPLH3 => tPLH13,
2427
        tPHL3 => tPHL13
2428
    )
2429
    port map(
2430
        X_1  => X_15,  -- CP1\
2431
        X_2  => rst1,  -- MR1
2432
        X_3  => rst1,  -- MR2
2433
                       -- 
2434
        X_5  => open,  -- Vcc
2435
                       --
2436
                       --
2437
        X_8  => X_13,  -- Q2
2438
        X_9  => X_2,   -- Q1
2439
        X_10 => open,  -- GND
2440
        X_11 => X_3,   -- Q3
2441
        X_12 => X_14,  -- Q0
2442
                       -- 
2443
        X_14 => X_1    -- CP0\
2444
    );
2445
 
2446
    C2: SN74LS93N
2447
    generic map(
2448
        tPLH0 => tPLH20,
2449
        tPHL0 => tPHL20,
2450
        tPLH1 => tPLH21-tPLH20,     -- Delays shortened, as they include Q0
2451
        tPHL1 => tPHL21-tPHL20,
2452
        tPLH2 => tPLH22-tPLH20,
2453
        tPHL2 => tPHL22-tPHL20,
2454
        tPLH3 => tPLH23-tPLH20,
2455
        tPHL3 => tPHL23-tPHL20
2456
    )
2457
    port map(
2458
        X_1  => q02,   -- CP1\
2459
        X_2  => rst2,  -- MR1
2460
        X_3  => rst2,  -- MR2
2461
                       -- 
2462
        X_5  => open,  -- Vcc
2463
                       --
2464
                       --
2465
        X_8  => X_5,   -- Q2
2466
        X_9  => X_10,  -- Q1
2467
        X_10 => open,  -- GND
2468
        X_11 => X_12,  -- Q3
2469
        X_12 => q02,   -- Q0
2470
                       -- 
2471
        X_14 => X_9    -- CP0\
2472
    );
2473
    X_7 <= q02;
2474
 
2475
end architecture BEHAV;
2476
 
2477
-----------------------------------------------------------------------
2478
-- SN74LS70N: JK edge-triggered flipflop (Pinout A)
2479
--            Verified 01/06/2016
2480
-----------------------------------------------------------------------
2481
library ieee;
2482
    use ieee.std_logic_1164.all;
2483
 
2484
    use work.LSTTL.all;
2485
    use work.TTLPrivate.all;
2486
 
2487
entity SN74LS70N is
2488
generic(
2489
    tSETUP : time := 20 ns;     -- Setup time before clock
2490
    tPLHCP : time := 50 ns;     -- Clock rising
2491
    tPHLCP : time := 50 ns;     -- Clock falling
2492
    tPLHSC : time := 50 ns;     -- S/C rising
2493
    tPHLSC : time := 50 ns      -- S/C falling
2494
);
2495
port(
2496
                             -- 
2497
    X_2  : in    std_logic;  -- CD\
2498
    X_3  : in    std_logic;  -- J1
2499
    X_4  : in    std_logic;  -- J2
2500
    X_5  : in    std_logic;  -- J3\
2501
    X_6  : out   std_logic;  -- Q\
2502
    X_7  : inout std_logic;  -- GND
2503
    X_8  : out   std_logic;  -- Q
2504
    X_9  : in    std_logic;  -- K3\
2505
    X_10 : in    std_logic;  -- K1
2506
    X_11 : in    std_logic;  -- K2
2507
    X_12 : in    std_logic;  -- CP
2508
    X_13 : in    std_logic;  -- SD\
2509
    X_14 : inout std_logic   -- Vcc
2510
);
2511
end entity SN74LS70N;
2512
 
2513
architecture BEHAV of SN74LS70N is
2514
    signal j, k, nr, ns : std_logic;
2515
begin
2516
    j  <= X_3  and X_4  and not X_5;
2517
    k  <= X_11 and X_10 and not X_9;
2518
    nr <= not X_2;
2519
    ns <= not X_13;
2520
 
2521
    FF: TTLflipflop
2522
    generic map(
2523
        tPLHCP  => tPLHCP,
2524
        tPHLCP  => tPHLCP,
2525
        tPLHSC  => tPLHSC,
2526
        tPHLSC  => tPHLSC,
2527
        tSETUP  => tSETUP,
2528
        Safeclk => false
2529
    )
2530
    port map(
2531
        J  => j,
2532
        K  => k,
2533
        C  => X_12,
2534
        S  => ns,
2535
        R  => nr,
2536
        Q  => X_8,
2537
        QB => X_6
2538
    );
2539
 
2540
end architecture BEHAV;
2541
 
2542
-----------------------------------------------------------------------
2543
-- SN74LS71N: JK master-slave flipflop (with and/or inputs)
2544
--            Verified 01/06/2016
2545
-----------------------------------------------------------------------
2546
library ieee;
2547
    use ieee.std_logic_1164.all;
2548
 
2549
    use work.LSTTL.all;
2550
    use work.TTLPrivate.all;
2551
 
2552
entity SN74LS71N is
2553
generic(
2554
    tSETUP : time :=  0 ns;     -- Setup time before clock
2555
    tPLHCP : time := 21 ns;     -- Clock rising
2556
    tPHLCP : time := 27 ns;     -- Clock falling
2557
    tPLHSC : time := 13 ns;     -- S/C rising
2558
    tPHLSC : time := 24 ns      -- S/C falling
2559
);
2560
port(
2561
    X_1  : in    std_logic;  -- J1A
2562
    X_2  : in    std_logic;  -- J1B
2563
    X_3  : in    std_logic;  -- J2A
2564
    X_4  : in    std_logic;  -- J2B
2565
    X_5  : in    std_logic;  -- SD\
2566
    X_6  : out   std_logic;  -- Q
2567
    X_7  : inout std_logic;  -- GND
2568
    X_8  : out   std_logic;  -- Q\
2569
    X_9  : in    std_logic;  -- K1A
2570
    X_10 : in    std_logic;  -- K1B
2571
    X_11 : in    std_logic;  -- K2A
2572
    X_12 : in    std_logic;  -- K2B
2573
    X_13 : in    std_logic;  -- CP
2574
    X_14 : inout std_logic   -- Vcc
2575
);
2576
end entity SN74LS71N;
2577
 
2578
architecture BEHAV of SN74LS71N is
2579
    signal j, k, ns, nc : std_logic;
2580
begin
2581
    j  <= (X_1 and X_2 ) or (X_3  and X_4 );
2582
    k  <= (X_9 and X_10) or (X_11 and X_12);
2583
    ns <= not X_5;
2584
    nc <= not X_13;
2585
 
2586
    FF: TTLflipflop
2587
    generic map(
2588
        tPLHCP  => tPLHCP,
2589
        tPHLCP  => tPHLCP,
2590
        tPLHSC  => tPLHSC,
2591
        tPHLSC  => tPHLSC,
2592
        tSETUP  => tSETUP,
2593
        Safeclk => true
2594
    )
2595
    port map(
2596
        J  => j,
2597
        K  => k,
2598
        C  => nc,
2599
        S  => ns,
2600
        R  => '0',
2601
        Q  => X_6,
2602
        QB => X_8
2603
    );
2604
 
2605
end architecture BEHAV;
2606
 
2607
-----------------------------------------------------------------------
2608
-- SN74LS72N: JK master-slave flipflop (with and inputs) (Pinout A)
2609
--            Verified 01/06/2016
2610
-----------------------------------------------------------------------
2611
library ieee;
2612
    use ieee.std_logic_1164.all;
2613
 
2614
    use work.LSTTL.all;
2615
    use work.TTLPrivate.all;
2616
 
2617
entity SN74LS72N is
2618
generic(
2619
    tSETUP : time :=  0 ns;     -- Setup time before clock
2620
    tPLHCP : time := 21 ns;     -- Clock rising
2621
    tPHLCP : time := 27 ns;     -- Clock falling
2622
    tPLHSC : time := 13 ns;     -- S/C rising
2623
    tPHLSC : time := 24 ns      -- S/C falling
2624
);
2625
port(
2626
                             -- 
2627
    X_2  : in    std_logic;  -- CD\
2628
    X_3  : in    std_logic;  -- J1
2629
    X_4  : in    std_logic;  -- J2
2630
    X_5  : in    std_logic;  -- J3
2631
    X_6  : out   std_logic;  -- Q\
2632
    X_7  : inout std_logic;  -- GND
2633
    X_8  : out   std_logic;  -- Q
2634
    X_9  : in    std_logic;  -- K1
2635
    X_10 : in    std_logic;  -- K2
2636
    X_11 : in    std_logic;  -- K3
2637
    X_12 : in    std_logic;  -- CP\
2638
    X_13 : in    std_logic;  -- SD\
2639
    X_14 : inout std_logic   -- Vcc
2640
 );
2641
end entity SN74LS72N;
2642
 
2643
architecture BEHAV of SN74LS72N is
2644
    signal j, k, ns, nr, nc : std_logic;
2645
begin
2646
    j  <= (X_3 and X_4  and X_5  );
2647
    k  <= (X_9 and X_10 and X_11 );
2648
    ns <= not X_13;
2649
    nr <= not X_2;
2650
    nc <= not X_12;
2651
 
2652
    FF: TTLflipflop
2653
    generic map(
2654
        tPLHCP  => tPLHCP,
2655
        tPHLCP  => tPHLCP,
2656
        tPLHSC  => tPLHSC,
2657
        tPHLSC  => tPHLSC,
2658
        tSETUP  => tSETUP,
2659
        Safeclk => true
2660
    )
2661
    port map(
2662
        J  => j,
2663
        K  => k,
2664
        C  => nc,
2665
        S  => ns,
2666
        R  => nr,
2667
        Q  => X_8,
2668
        QB => X_6
2669
    );
2670
 
2671
end architecture BEHAV;
2672
 
2673
-----------------------------------------------------------------------
2674
-- SN74LS73N: Dual JK flipflop
2675
--            Verified 01/06/2016
2676
-----------------------------------------------------------------------
2677
library ieee;
2678
    use ieee.std_logic_1164.all;
2679
 
2680
    use work.LSTTL.all;
2681
    use work.TTLPrivate.all;
2682
 
2683
entity SN74LS73N is
2684
generic(
2685
    tSETUP : time := 20 ns;     -- Setup time before clock
2686
    tPLHCP : time := 20 ns;     -- Clock rising
2687
    tPHLCP : time := 30 ns;     -- Clock falling
2688
    tPLHSC : time := 20 ns;     -- S/C rising
2689
    tPHLSC : time := 30 ns      -- S/C falling
2690
);
2691
port(
2692
    X_1  : in    std_logic;  -- CP1\
2693
    X_2  : in    std_logic;  -- CD1\
2694
    X_3  : in    std_logic;  -- K1
2695
    X_4  : inout std_logic;  -- Vcc
2696
    X_5  : in    std_logic;  -- CP2\
2697
    X_6  : in    std_logic;  -- CD2\
2698
    X_7  : in    std_logic;  -- J2
2699
    X_8  : out   std_logic;  -- Q2\
2700
    X_9  : out   std_logic;  -- Q2
2701
    X_10 : in    std_logic;  -- K2
2702
    X_11 : inout std_logic;  -- GND
2703
    X_12 : out   std_logic;  -- Q1
2704
    X_13 : out   std_logic;  -- Q1\
2705
    X_14 : in    std_logic   -- J1
2706
);
2707
end entity SN74LS73N;
2708
 
2709
architecture BEHAV of SN74LS73N is
2710
    subtype Pair is std_logic_vector(0 to 1);
2711
    signal C, J, K, R, Q, QB : Pair;
2712
begin
2713
    C <= (X_1,  X_5 );
2714
    R <= (X_2,  X_6 );
2715
    J <= (X_14, X_7 );
2716
    K <= (X_3,  X_10);
2717
    (X_12, X_9) <= Q;
2718
    (X_13, X_8) <= QB;
2719
 
2720
    G1: for i in Pair'range generate
2721
        signal nc, nr : std_logic;
2722
    begin
2723
        nc <= not C(i);
2724
        nr <= not R(i);
2725
 
2726
        FF: TTLflipflop
2727
        generic map(
2728
            tPLHCP  => tPLHCP,
2729
            tPHLCP  => tPHLCP,
2730
            tPLHSC  => tPLHSC,
2731
            tPHLSC  => tPHLSC,
2732
            tSETUP  => tSETUP,
2733
            Safeclk => true
2734
        )
2735
        port map(
2736
            J  => J(i),
2737
            K  => K(i),
2738
            C  => nc,
2739
            S  => '0',
2740
            R  => nr,
2741
            Q  => Q(i),
2742
            QB => QB(i)
2743
        );
2744
    end generate;
2745
end architecture BEHAV;
2746
 
2747
-----------------------------------------------------------------------
2748
-- SN74LS74N: Dual D-type +ve edge-triggered flipflop (Pinout A)
2749
--            Verified 01/06/2016
2750
-----------------------------------------------------------------------
2751
library ieee;
2752
    use ieee.std_logic_1164.all;
2753
 
2754
    use work.LSTTL.all;
2755
    use work.TTLPrivate.all;
2756
 
2757
entity SN74LS74N is
2758
generic(
2759
    tSETUP : time := 20 ns;     -- Setup time before clock
2760
    tPLHCP : time := 25 ns;     -- Clock rising
2761
    tPHLCP : time := 35 ns;     -- Clock falling
2762
    tPLHSC : time := 15 ns;     -- S/C rising
2763
    tPHLSC : time := 35 ns      -- S/C falling
2764
);
2765
port(
2766
    X_1  : in    std_logic;  -- CD1\
2767
    X_2  : in    std_logic;  -- D1
2768
    X_3  : in    std_logic;  -- CP1
2769
    X_4  : in    std_logic;  -- SD1\
2770
    X_5  : out   std_logic;  -- Q1
2771
    X_6  : out   std_logic;  -- Q1\
2772
    X_7  : inout std_logic;  -- GND
2773
    X_8  : out   std_logic;  -- Q2\
2774
    X_9  : out   std_logic;  -- Q2
2775
    X_10 : in    std_logic;  -- SD2\
2776
    X_11 : in    std_logic;  -- CP2
2777
    X_12 : in    std_logic;  -- D2
2778
    X_13 : in    std_logic;  -- CD2\
2779
    X_14 : inout std_logic   -- Vcc
2780
);
2781
end entity SN74LS74N;
2782
 
2783
architecture BEHAV of SN74LS74N is
2784
    subtype Pair is std_logic_vector(0 to 1);
2785
    signal C, D, R, S, Q, QB : Pair;
2786
begin
2787
    C <= (X_3,  X_11 );
2788
    R <= (X_1,  X_13 );
2789
    S <= (X_4,  X_10 );
2790
    D <= (X_2,  X_12 );
2791
    (X_5, X_9) <= Q;
2792
    (X_6, X_8) <= QB;
2793
 
2794
    G1: for i in Pair'range generate
2795
        signal nr, ns, nd : std_logic;
2796
    begin
2797
        nd <= not D(i);
2798
        nr <= not R(i);
2799
        ns <= not S(i);
2800
 
2801
        FF: TTLflipflop
2802
        generic map(
2803
            tPLHCP  => tPLHCP,
2804
            tPHLCP  => tPHLCP,
2805
            tPLHSC  => tPLHSC,
2806
            tPHLSC  => tPHLSC,
2807
            tSETUP  => tSETUP,
2808
            Safeclk => false
2809
        )
2810
        port map(
2811
            J  => D(i),
2812
            K  => nd,
2813
            C  => C(i),
2814
            S  => ns,
2815
            R  => nr,
2816
            Q  => Q(i),
2817
            QB => QB(i)
2818
        );
2819
    end generate;
2820
end architecture BEHAV;
2821
 
2822
-----------------------------------------------------------------------
2823
-- SN74LS75N: 4-bit bistable latch
2824
--             Verified 21/12/2016
2825
-----------------------------------------------------------------------
2826
library ieee;
2827
    use ieee.std_logic_1164.all;
2828
 
2829
    use work.LSTTL.all;
2830
    use work.TTLPrivate.all;
2831
 
2832
entity SN74LS75N is
2833
generic(
2834
    tSETUP : time := 20 ns;     -- Setup time before clock
2835
    tPLHCP : time := 40 ns;     -- Rising
2836
    tPHLCP : time := 25 ns      -- Ralling
2837
);
2838
port(
2839
    X_1  : out   std_logic;  -- Q1\
2840
    X_2  : in    std_logic;  -- D1
2841
    X_3  : in    std_logic;  -- D2
2842
    X_4  : in    std_logic;  -- E34
2843
    X_5  : inout std_logic;  -- Vcc
2844
    X_6  : in    std_logic;  -- D3
2845
    X_7  : in    std_logic;  -- D4
2846
    X_8  : out   std_logic;  -- Q4\
2847
    X_9  : out   std_logic;  -- Q4
2848
    X_10 : out   std_logic;  -- Q3\
2849
    X_11 : out   std_logic;  -- Q3
2850
    X_12 : inout std_logic;  -- GND
2851
    X_13 : in    std_logic;  -- E12
2852
    X_14 : out   std_logic;  -- Q2\
2853
    X_15 : out   std_logic;  -- Q2
2854
    X_16 : out   std_logic   -- Q1
2855
);
2856
end entity SN74LS75N;
2857
 
2858
architecture BEHAV of SN74LS75N is
2859
    signal D, E, Q, QB : std_logic_vector(4 downto 1);
2860
begin
2861
    D  <= (X_7, X_6, X_3,  X_2);
2862
    E  <= (X_4, X_4, X_13, X_13);
2863
    (X_9, X_11, X_15, X_16) <= Q;
2864
    (X_8, X_10, X_14, X_1 ) <= QB;
2865
 
2866
    G: for i in D'range generate
2867
        signal R, S : std_logic;
2868
    begin
2869
        process(D, E) is
2870
        begin
2871
            if E(i)'event and E(i) = '0' and now > tSETUP then   -- Data is registered on the falling edge
2872
                assert D(i)'stable(tSETUP)
2873
                    report "Setup time violation: (" & integer'image(i) & ") " & time'image(D(i)'last_event)
2874
                    severity failure;
2875
            end if;
2876
 
2877
            if E(i) = '1' then
2878
                R <= D(i);
2879
                S <= not D(i);
2880
            end if;
2881
        end process;
2882
 
2883
        D1: TTLdelay
2884
            generic map(
2885
                tPLH => tPLHCP,
2886
                tPHL => tPHLCP
2887
            )
2888
            port map(
2889
                A => R,
2890
                B => Q(i)
2891
            );
2892
 
2893
        D2: TTLdelay
2894
            generic map(
2895
                tPLH => tPLHCP,
2896
                tPHL => tPHLCP
2897
            )
2898
            port map(
2899
                A => S,
2900
                B => QB(i)
2901
            );
2902
    end generate;
2903
end architecture BEHAV;
2904
 
2905
-----------------------------------------------------------------------
2906
-- SN74LS76N: Dual JK flipflop
2907
--            Verified 01/06/2016
2908
-----------------------------------------------------------------------
2909
library ieee;
2910
    use ieee.std_logic_1164.all;
2911
 
2912
    use work.LSTTL.all;
2913
    use work.TTLPrivate.all;
2914
 
2915
entity SN74LS76N is
2916
generic(
2917
    tSETUP : time := 20 ns;     -- Setup time before clock
2918
    tPLHCP : time := 20 ns;     -- Clock rising
2919
    tPHLCP : time := 30 ns;     -- Clock falling
2920
    tPLHSC : time := 20 ns;     -- S/C rising
2921
    tPHLSC : time := 30 ns      -- S/C falling
2922
);
2923
port(
2924
    X_1  : in    std_logic;  -- CP1\
2925
    X_2  : in    std_logic;  -- SD1\
2926
    X_3  : in    std_logic;  -- CD1\
2927
    X_4  : in    std_logic;  -- J1
2928
    X_5  : inout std_logic;  -- Vcc
2929
    X_6  : in    std_logic;  -- CP2\
2930
    X_7  : in    std_logic;  -- SD2\
2931
    X_8  : in    std_logic;  -- CD2\
2932
    X_9  : in    std_logic;  -- J2
2933
    X_10 : out   std_logic;  -- Q2\
2934
    X_11 : out   std_logic;  -- Q2
2935
    X_12 : in    std_logic;  -- K2
2936
    X_13 : inout std_logic;  -- GND
2937
    X_14 : out   std_logic;  -- Q1\
2938
    X_15 : out   std_logic;  -- Q1
2939
    X_16 : in    std_logic   -- K1
2940
);
2941
end entity SN74LS76N;
2942
 
2943
architecture BEHAV of SN74LS76N is
2944
    subtype Pair is std_logic_vector(0 to 1);
2945
    signal C, J, K, R, S, Q, QB : Pair;
2946
begin
2947
    C <= (X_1,  X_6 );
2948
    R <= (X_3,  X_8 );
2949
    S <= (X_2,  X_7 );
2950
    J <= (X_4,  X_9 );
2951
    K <= (X_16, X_12);
2952
    (X_15, X_11) <= Q;
2953
    (X_14, X_10) <= QB;
2954
 
2955
    G1: for i in Pair'range generate
2956
        signal nc, nr, np : std_logic;
2957
    begin
2958
        nc <= not C(i);
2959
        nr <= not R(i);
2960
        np <= not S(i);
2961
 
2962
        FF: TTLflipflop
2963
        generic map(
2964
            tPLHCP  => tPLHCP,
2965
            tPHLCP  => tPHLCP,
2966
            tPLHSC  => tPLHSC,
2967
            tPHLSC  => tPHLSC,
2968
            tSETUP  => tSETUP,
2969
            Safeclk => true
2970
        )
2971
        port map(
2972
            J  => J(i),
2973
            K  => K(i),
2974
            C  => nc,
2975
            S  => np,
2976
            R  => nr,
2977
            Q  => Q(i),
2978
            QB => QB(i)
2979
        );
2980
    end generate;
2981
end architecture BEHAV;
2982
 
2983
-----------------------------------------------------------------------
2984
-- SN74LS77N: Quad D-type latch
2985
--            As 7475 without the Q\ outputs
2986
--            Verified 05/06/2016
2987
-----------------------------------------------------------------------
2988
library ieee;
2989
    use ieee.std_logic_1164.all;
2990
 
2991
    use work.LSTTL.all;
2992
    use work.TTLPrivate.all;
2993
 
2994
entity SN74LS77N is
2995
generic(
2996
    tSETUP : time := 20 ns;     -- Setup time before clock
2997
    tPLHCP : time := 40 ns;     -- Rising
2998
    tPHLCP : time := 25 ns      -- Ralling
2999
);
3000
port(
3001
    X_1  : in    std_logic;  -- D1
3002
    X_2  : in    std_logic;  -- D2
3003
    X_3  : in    std_logic;  -- E34
3004
    X_4  : inout std_logic;  -- Vcc
3005
    X_5  : in    std_logic;  -- D3
3006
    X_6  : in    std_logic;  -- D4
3007
                             -- 
3008
    X_8  : out   std_logic;  -- Q4
3009
    X_9  : out   std_logic;  -- Q3
3010
                             -- 
3011
    X_11 : inout std_logic;  -- GND
3012
    X_12 : in    std_logic;  -- E12
3013
    X_13 : out   std_logic;  -- Q2
3014
    X_14 : out   std_logic   -- Q1
3015
);
3016
end entity SN74LS77N;
3017
 
3018
architecture BEHAV of SN74LS77N is
3019
    signal D, E, Q : std_logic_vector(4 downto 1);
3020
begin
3021
    D  <= (X_6, X_5, X_2,  X_1);
3022
    E  <= (X_3, X_3, X_12, X_12);
3023
    (X_8, X_9, X_13, X_14) <= Q;
3024
 
3025
    G: for i in D'range generate
3026
        signal R, S : std_logic;
3027
    begin
3028
        process(D, E) is
3029
        begin
3030
            if E(i)'event and E(i) = '0' and now > tSETUP then   -- Data is registered on the falling edge
3031
                assert D(i)'stable(tSETUP)
3032
                    report "Setup time violation"
3033
                    severity failure;
3034
            end if;
3035
 
3036
            if E(i) = '1' then
3037
                R <= D(i);
3038
                S <= not D(i);
3039
            end if;
3040
        end process;
3041
 
3042
        D1: TTLdelay
3043
            generic map(
3044
                tPLH => tPLHCP,
3045
                tPHL => tPHLCP
3046
            )
3047
            port map(
3048
                A => R,
3049
                B => Q(i)
3050
            );
3051
    end generate;
3052
 
3053
end architecture BEHAV;
3054
 
3055
-----------------------------------------------------------------------
3056
-- SN74LS78N: Dual JK flipflop (Pinout A)
3057
--            Verified 01/06/2016
3058
-----------------------------------------------------------------------
3059
library ieee;
3060
    use ieee.std_logic_1164.all;
3061
 
3062
    use work.LSTTL.all;
3063
    use work.TTLPrivate.all;
3064
 
3065
entity SN74LS78N is
3066
generic(
3067
    tSETUP : time := 20 ns;     -- Setup time before clock
3068
    tPLHCP : time := 20 ns;     -- Clock rising
3069
    tPHLCP : time := 30 ns;     -- Clock falling
3070
    tPLHSC : time := 20 ns;     -- S/C rising
3071
    tPHLSC : time := 30 ns      -- S/C falling
3072
);
3073
port(
3074
    X_1  : in    std_logic;  -- K1
3075
    X_2  : out   std_logic;  -- Q1
3076
    X_3  : out   std_logic;  -- Q1\
3077
    X_4  : in    std_logic;  -- J1
3078
    X_5  : out   std_logic;  -- Q2\
3079
    X_6  : out   std_logic;  -- Q2
3080
    X_7  : inout std_logic;  -- GND
3081
    X_8  : in    std_logic;  -- K2
3082
    X_9  : in    std_logic;  -- CP\
3083
    X_10 : in    std_logic;  -- SD2\
3084
    X_11 : in    std_logic;  -- J2
3085
    X_12 : in    std_logic;  -- CD\
3086
    X_13 : in    std_logic;  -- SD1\
3087
    X_14 : inout std_logic   -- Vcc
3088
);
3089
end entity SN74LS78N;
3090
 
3091
architecture BEHAV of SN74LS78N is
3092
    subtype Pair is std_logic_vector(0 to 1);
3093
    signal J, K, S, Q, QB : Pair;
3094
begin
3095
    S <= (X_13,  X_10);
3096
    J <= (X_4,   X_11);
3097
    K <= (X_1,   X_8 );
3098
    (X_2, X_6) <= Q;
3099
    (X_3, X_5) <= QB;
3100
 
3101
    G1: for i in Pair'range generate
3102
        signal nc, nr, np : std_logic;
3103
    begin
3104
        nc <= not X_9;
3105
        nr <= not X_12;
3106
        np <= not S(i);
3107
 
3108
        FF: TTLflipflop
3109
        generic map(
3110
            tPLHCP  => tPLHCP,
3111
            tPHLCP  => tPHLCP,
3112
            tPLHSC  => tPLHSC,
3113
            tPHLSC  => tPHLSC,
3114
            tSETUP  => tSETUP,
3115
            Safeclk => true
3116
        )
3117
        port map(
3118
            J  => J(i),
3119
            K  => K(i),
3120
            C  => nc,
3121
            S  => np,
3122
            R  => nr,
3123
            Q  => Q(i),
3124
            QB => QB(i)
3125
        );
3126
    end generate;
3127
end architecture BEHAV;
3128
 
3129
-----------------------------------------------------------------------
3130
-- SN7480N: Gated full adder (Pinout A)
3131
--          The expansion inputs are not modelled
3132
--          Verified 05/06/2016
3133
-----------------------------------------------------------------------
3134
library ieee;
3135
    use ieee.std_logic_1164.all;
3136
 
3137
    use work.LSTTL.all;
3138
    use work.TTLPrivate.all;
3139
 
3140
entity SN7480N is
3141
generic(
3142
    tPLHCC : time := 17 ns;  -- Carry-in to carry-out
3143
    tPHLCC : time := 12 ns;
3144
    tPLHBC : time := 25 ns;  -- Data to carry-out
3145
    tPHLBC : time := 55 ns;
3146
    tPLHS  : time := 70 ns;  -- Data* to S
3147
    tPHLS  : time := 80 ns;
3148
    tPLHSB : time := 55 ns;  -- Data* to S\
3149
    tPHLSB : time := 75 ns;
3150
    tPLHX  : time := 65 ns;  -- Data to Data*
3151
    tPHLX  : time := 25 ns
3152
);
3153
port(
3154
                             -- BX
3155
    X_2  : in    std_logic;  -- BC
3156
    X_3  : in    std_logic;  -- CN
3157
    X_4  : out   std_logic;  -- CNP1\
3158
    X_5  : out   std_logic;  -- S
3159
    X_6  : out   std_logic;  -- S\
3160
    X_7  : inout std_logic;  -- GND
3161
    X_8  : in    std_logic;  -- A1
3162
    X_9  : in    std_logic;  -- A2
3163
                             -- AX
3164
    X_11 : in    std_logic;  -- AC
3165
    X_12 : in    std_logic;  -- B1
3166
    X_13 : in    std_logic;  -- B2
3167
    X_14 : inout std_logic   -- Vcc
3168
);
3169
end entity SN7480N;
3170
 
3171
architecture BEHAV of SN7480N is
3172
    signal ASI, BSI, AS, BS, C2, S, SB : std_logic;
3173
    signal tPLHC, tPHLC : time;
3174
begin
3175
    ASI <= not(X_8  and X_9 );
3176
    BSI <= not(X_12 and X_13);
3177
 
3178
    DASI: TTLdelay
3179
        generic map(
3180
            tPLH => tPLHX,
3181
            tPHL => tPHLX
3182
        )
3183
        port map(
3184
            A => ASI,
3185
            B => AS
3186
        );
3187
 
3188
    DBSI: TTLdelay
3189
        generic map(
3190
            tPLH => tPLHX,
3191
            tPHL => tPHLX
3192
        )
3193
        port map(
3194
            A => BSI,
3195
            B => BS
3196
        );
3197
 
3198
    process(all) is
3199
        variable A, B : std_logic;
3200
        variable IP   : std_logic_vector(2 downto 0);
3201
    begin
3202
        if X_3'event then
3203
            tPLHC <= tPLHCC;
3204
            tPHLC <= tPHLCC;
3205
        else
3206
            tPLHC <= tPLHBC;
3207
            tPHLC <= tPHLBC;
3208
        end if;
3209
 
3210
        A  := not(AS and X_11);
3211
        B  := not(BS and X_2 );
3212
        IP := (X_3, B, A);
3213
        case IP is
3214
            when "000"  => C2 <= '1'; SB <= '1'; S <= '0';
3215
            when "001"  => C2 <= '1'; SB <= '0'; S <= '1';
3216
            when "010"  => C2 <= '1'; SB <= '0'; S <= '1';
3217
            when "011"  => C2 <= '0'; SB <= '1'; S <= '0';
3218
            when "100"  => C2 <= '0'; SB <= '0'; S <= '1';
3219
            when "101"  => C2 <= '1'; SB <= '1'; S <= '0';
3220
            when "110"  => C2 <= '1'; SB <= '1'; S <= '0';
3221
            when "111"  => C2 <= '0'; SB <= '0'; S <= '1';
3222
            when others => null;
3223
        end case;
3224
    end process;
3225
 
3226
    process(all) is     -- Don't use TTLdelay: the delays are not constant
3227
    begin
3228
        if    rising_edge(C2) then
3229
            X_4 <= 'X', C2 after tPLHC;     -- Rising delay
3230
        elsif falling_edge(C2) then
3231
            X_4 <= 'X', C2 after tPHLC;     -- Falling delay
3232
        else
3233
            X_4 <= C2;                      -- 'Z', or bad value
3234
        end if;
3235
    end process;
3236
 
3237
    DS: TTLdelay
3238
        generic map(
3239
            tPLH => tPLHS,
3240
            tPHL => tPHLS
3241
        )
3242
        port map(
3243
            A => S,
3244
            B => X_5
3245
        );
3246
 
3247
    DSB: TTLdelay
3248
        generic map(
3249
            tPLH => tPLHSB,
3250
            tPHL => tPHLSB
3251
        )
3252
        port map(
3253
            A => SB,
3254
            B => X_6
3255
        );
3256
end architecture BEHAV;
3257
 
3258
-----------------------------------------------------------------------
3259
-- SN7482N: 2-bit full adder
3260
--          Verified 05/06/2016
3261
-----------------------------------------------------------------------
3262
library ieee;
3263
    use ieee.std_logic_1164.all;
3264
 
3265
    use work.LSTTL.all;
3266
    use work.TTLPrivate.all;
3267
 
3268
entity SN7482N is
3269
generic(
3270
    tPLHS1 : time := 34 ns;
3271
    tPHLS1 : time := 40 ns;
3272
    tPLHS2 : time := 40 ns;
3273
    tPHLS2 : time := 42 ns;
3274
    tPLHC  : time := 19 ns;
3275
    tPHLC  : time := 27 ns
3276
);
3277
port(
3278
    X_1  : out   std_logic;  -- S1
3279
    X_2  : in    std_logic;  -- A1
3280
    X_3  : in    std_logic;  -- B1
3281
    X_4  : inout std_logic;  -- Vcc
3282
    X_5  : in    std_logic;  -- CIN
3283
                             -- 
3284
                             -- 
3285
                             -- 
3286
                             -- 
3287
    X_10 : out   std_logic;  -- C2
3288
    X_11 : inout std_logic;  -- GND
3289
    X_12 : out   std_logic;  -- S2
3290
    X_13 : in    std_logic;  -- B2
3291
    X_14 : in    std_logic   -- A2
3292
);
3293
end entity SN7482N;
3294
 
3295
architecture BEHAV of SN7482N is
3296
    signal S1, S2, C2 : std_logic;
3297
begin
3298
 
3299
    process(all) is
3300
        variable IP : std_logic_vector(4 downto 0);
3301
    begin  --   Cin  A1   B1   A2    B2      
3302
        IP := ( X_5, X_2, X_3, X_14, X_13);
3303
        case IP is
3304
            when "00000" => S1 <= '0'; S2 <= '0'; C2 <= '0';
3305
            when "10000" => S1 <= '1'; S2 <= '0'; C2 <= '0';
3306
            when "01000" => S1 <= '1'; S2 <= '0'; C2 <= '0';
3307
            when "11000" => S1 <= '0'; S2 <= '1'; C2 <= '0';
3308
            when "00100" => S1 <= '1'; S2 <= '0'; C2 <= '0';
3309
            when "10100" => S1 <= '0'; S2 <= '1'; C2 <= '0';
3310
            when "01100" => S1 <= '0'; S2 <= '1'; C2 <= '0';
3311
            when "11100" => S1 <= '1'; S2 <= '1'; C2 <= '0';
3312
            when "00010" => S1 <= '0'; S2 <= '1'; C2 <= '0';
3313
            when "10010" => S1 <= '1'; S2 <= '1'; C2 <= '0';
3314
            when "01010" => S1 <= '1'; S2 <= '1'; C2 <= '0';
3315
            when "11010" => S1 <= '0'; S2 <= '0'; C2 <= '1';
3316
            when "00110" => S1 <= '1'; S2 <= '1'; C2 <= '0';
3317
            when "10110" => S1 <= '0'; S2 <= '0'; C2 <= '1';
3318
            when "01110" => S1 <= '0'; S2 <= '0'; C2 <= '1';
3319
            when "11110" => S1 <= '1'; S2 <= '0'; C2 <= '1';
3320
            when "00001" => S1 <= '0'; S2 <= '1'; C2 <= '0';
3321
            when "10001" => S1 <= '1'; S2 <= '1'; C2 <= '0';
3322
            when "01001" => S1 <= '1'; S2 <= '1'; C2 <= '0';
3323
            when "11001" => S1 <= '0'; S2 <= '0'; C2 <= '1';
3324
            when "00101" => S1 <= '1'; S2 <= '1'; C2 <= '0';
3325
            when "10101" => S1 <= '0'; S2 <= '0'; C2 <= '1';
3326
            when "01101" => S1 <= '0'; S2 <= '0'; C2 <= '1';
3327
            when "11101" => S1 <= '1'; S2 <= '0'; C2 <= '1';
3328
            when "00011" => S1 <= '0'; S2 <= '0'; C2 <= '1';
3329
            when "10011" => S1 <= '1'; S2 <= '0'; C2 <= '1';
3330
            when "01011" => S1 <= '1'; S2 <= '0'; C2 <= '1';
3331
            when "11011" => S1 <= '0'; S2 <= '1'; C2 <= '1';
3332
            when "00111" => S1 <= '1'; S2 <= '0'; C2 <= '1';
3333
            when "10111" => S1 <= '0'; S2 <= '1'; C2 <= '1';
3334
            when "01111" => S1 <= '0'; S2 <= '1'; C2 <= '1';
3335
            when "11111" => S1 <= '1'; S2 <= '1'; C2 <= '1';
3336
            when others  => S1 <= 'X'; S2 <= 'X'; C2 <= 'X';
3337
        end case;
3338
    end process;
3339
 
3340
    DS1: TTLdelay
3341
        generic map(
3342
            tPLH => tPLHS1,
3343
            tPHL => tPHLS1
3344
        )
3345
        port map(
3346
            A => S1,
3347
            B => X_1
3348
        );
3349
 
3350
    DS2: TTLdelay
3351
        generic map(
3352
            tPLH => tPLHS2,
3353
            tPHL => tPHLS2
3354
        )
3355
        port map(
3356
            A => S2,
3357
            B => X_12
3358
        );
3359
 
3360
    DC2: TTLdelay
3361
        generic map(
3362
            tPLH => tPLHC,
3363
            tPHL => tPHLC
3364
        )
3365
        port map(
3366
            A => C2,
3367
            B => X_10
3368
        );
3369
end architecture BEHAV;
3370
 
3371
-----------------------------------------------------------------------
3372
-- SN74LS83AN: 4-bit binary full adder (fast carry)
3373
--             Verified 05/06/2016
3374
-----------------------------------------------------------------------
3375
library ieee;
3376
    use ieee.std_logic_1164.all;
3377
    use ieee.numeric_std.all;
3378
 
3379
    use work.LSTTL.all;
3380
    use work.TTLPrivate.all;
3381
 
3382
entity SN74LS83AN is
3383
generic(
3384
    tPLHS  : time := 24 ns;
3385
    tPHLS  : time := 24 ns;
3386
    tPLHC  : time := 17 ns;
3387
    tPHLC  : time := 17 ns
3388
);
3389
port(
3390
    X_1  : in    std_logic;  -- A3
3391
    X_2  : out   std_logic;  -- S2
3392
    X_3  : in    std_logic;  -- A2
3393
    X_4  : in    std_logic;  -- B2
3394
    X_5  : inout std_logic;  -- Vcc
3395
    X_6  : out   std_logic;  -- S1
3396
    X_7  : in    std_logic;  -- B1
3397
    X_8  : in    std_logic;  -- A1
3398
    X_9  : out   std_logic;  -- S0
3399
    X_10 : in    std_logic;  -- A0
3400
    X_11 : in    std_logic;  -- B0
3401
    X_12 : inout std_logic;  -- GND
3402
    X_13 : in    std_logic;  -- C0
3403
    X_14 : out   std_logic;  -- C4
3404
    X_15 : out   std_logic;  -- S3
3405
    X_16 : in    std_logic   -- B3
3406
);
3407
end entity SN74LS83AN;
3408
 
3409
architecture BEHAV of SN74LS83AN is
3410
    signal A, B, S : unsigned(4 downto 0);  -- S(4) = carry-out
3411
    signal SUM     : unsigned(3 downto 0);
3412
begin
3413
    A <= ('0', X_1,  X_3, X_8, X_10);
3414
    B <= ('0', X_16, X_4, X_7, X_11);
3415
 
3416
    S <= A + B + X_13;
3417
 
3418
    G: for i in SUM'range generate
3419
    begin
3420
    DSM: TTLdelay
3421
        generic map(
3422
            tPLH => tPLHS,
3423
            tPHL => tPHLS
3424
        )
3425
        port map(
3426
            A => S(i),
3427
            B => SUM(i)
3428
        );
3429
    end generate;
3430
 
3431
    DCY: TTLdelay
3432
        generic map(
3433
            tPLH => tPLHC,
3434
            tPHL => tPHLC
3435
        )
3436
        port map(
3437
            A => S(4),
3438
            B => X_14
3439
        );
3440
 
3441
    (X_15, X_2, X_6, X_9) <= SUM;
3442
end architecture BEHAV;
3443
 
3444
-----------------------------------------------------------------------
3445
-- SN74LS85N: 4-bit magnitude comparator
3446
--            Verified 06/06/2016
3447
-----------------------------------------------------------------------
3448
library ieee;
3449
    use ieee.std_logic_1164.all;
3450
    use ieee.numeric_std.all;
3451
 
3452
    use work.LSTTL.all;
3453
    use work.TTLPrivate.all;
3454
 
3455
entity SN74LS85N is
3456
generic(
3457
    tPLH : time := 45 ns;    -- Worst-case values
3458
    tPHL : time := 45 ns
3459
);
3460
port(
3461
    X_1  : in    std_logic;  -- B3
3462
    X_2  : in    std_logic;  -- IA<B
3463
    X_3  : in    std_logic;  -- IA=B
3464
    X_4  : in    std_logic;  -- IA>B
3465
    X_5  : out   std_logic;  -- OA>B
3466
    X_6  : out   std_logic;  -- OA=B
3467
    X_7  : out   std_logic;  -- OA<B
3468
    X_8  : inout std_logic;  -- GND
3469
    X_9  : in    std_logic;  -- B0
3470
    X_10 : in    std_logic;  -- A0
3471
    X_11 : in    std_logic;  -- B1
3472
    X_12 : in    std_logic;  -- A1
3473
    X_13 : in    std_logic;  -- A2
3474
    X_14 : in    std_logic;  -- B2
3475
    X_15 : in    std_logic;  -- A3
3476
    X_16 : inout std_logic   -- Vcc
3477
);
3478
end entity SN74LS85N;
3479
 
3480
architecture BEHAV of SN74LS85N is
3481
    signal A, B       : unsigned(3 downto 0);
3482
    signal LT, EQ, GT : std_logic;
3483
 
3484
    alias inLT is X_2;
3485
    alias inEQ is X_3;
3486
    alias inGT is X_4;
3487
begin
3488
    A <= (X_15, X_13, X_12, X_10);
3489
    B <= (X_1,  X_14, X_11, X_9 );
3490
 
3491
    process(all) is
3492
        variable INCOND : std_logic_vector(2 downto 0);
3493
    begin
3494
        LT <= '0';
3495
        EQ <= '0';
3496
        GT <= '0';
3497
 
3498
        if    A < B then
3499
            LT <= '1';
3500
        elsif A > B then
3501
            GT <= '1';
3502
        else
3503
            INCOND := inGT & inLT & inEQ;
3504
            case INCOND is
3505
                when "100"  => GT <= '1';
3506
                when "010"  => LT <= '1';
3507
                when "000"  => GT <= '1'; LT <= '1';
3508
                when "110"  => null;
3509
                when others => EQ <= '1';
3510
            end case;
3511
        end if;
3512
   end process;
3513
 
3514
    DCG: TTLdelay
3515
        generic map(
3516
            tPLH => tPLH,
3517
            tPHL => tPHL
3518
        )
3519
        port map(
3520
            A => GT,
3521
            B => X_5
3522
        );
3523
 
3524
    DCL: TTLdelay
3525
        generic map(
3526
            tPLH => tPLH,
3527
            tPHL => tPHL
3528
        )
3529
        port map(
3530
            A => LT,
3531
            B => X_7
3532
        );
3533
 
3534
    DCE: TTLdelay
3535
        generic map(
3536
            tPLH => tPLH,
3537
            tPHL => tPHL
3538
        )
3539
        port map(
3540
            A => EQ,
3541
            B => X_6
3542
        );
3543
 
3544
end architecture BEHAV;
3545
 
3546
-----------------------------------------------------------------------
3547
-- SN74LS86N: Quad 2-input xor gate
3548
--            Verified 30/05/2016
3549
-----------------------------------------------------------------------
3550
library ieee;
3551
    use ieee.std_logic_1164.all;
3552
 
3553
    use work.LSTTL.all;
3554
    use work.TTLPrivate.all;
3555
 
3556
entity SN74LS86N is
3557
generic(
3558
    tPLH : time := 30 ns;
3559
    tPHL : time := 22 ns
3560
);
3561
port(
3562
    X_1  : in    std_logic;  -- 1A
3563
    X_2  : in    std_logic;  -- 1B
3564
    X_3  : out   std_logic;  -- 1Y\
3565
    X_4  : in    std_logic;  -- 2A
3566
    X_5  : in    std_logic;  -- 2B
3567
    X_6  : out   std_logic;  -- 2Y\
3568
    X_7  : inout std_logic;  -- GND
3569
    X_8  : out   std_logic;  -- 3Y\
3570
    X_9  : in    std_logic;  -- 3B
3571
    X_10 : in    std_logic;  -- 3A
3572
    X_11 : out   std_logic;  -- 4Y\
3573
    X_12 : in    std_logic;  -- 4B
3574
    X_13 : in    std_logic;  -- 4A
3575
    X_14 : inout std_logic   -- Vcc 
3576
);
3577
end entity SN74LS86N;
3578
 
3579
architecture BEHAV of SN74LS86N is
3580
    signal A : TTLInputs (1 to 4, 1 to 2);
3581
    signal Y : TTLOutputs(1 to 4);
3582
 
3583
begin
3584
    A <= ( (X_1, X_2), (X_4, X_5), (X_9, X_10), (X_12, X_13) );
3585
 
3586
    (X_3, X_6, X_8, X_11) <= Y;
3587
 
3588
    G: TTLgate
3589
    generic map(
3590
        mode   => Zxor,     -- Zand, Zor, Zxor, Zbuf
3591
        invert => '0',      -- '1' will invert the output
3592
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
3593
        tPLH   => tPLH,
3594
        tPHL   => tPHL
3595
    )
3596
    port map(
3597
        ins   => A,
3598
        outs  => Y
3599
    );
3600
 
3601
end architecture BEHAV;
3602
 
3603
-----------------------------------------------------------------------
3604
-- SN74H87N: 4-bit true/complement, zero-one element
3605
--           Verified 06/06/2016
3606
-----------------------------------------------------------------------
3607
library ieee;
3608
    use ieee.std_logic_1164.all;
3609
 
3610
    use work.LSTTL.all;
3611
    use work.TTLPrivate.all;
3612
 
3613
entity SN74H87N is
3614
generic(
3615
    tPLHI : time := 20 ns;
3616
    tPHLI : time := 19 ns;
3617
    tPLHS : time := 25 ns;
3618
    tPHLS : time := 25 ns
3619
);
3620
port(
3621
    X_1  :       std_logic;  -- S2
3622
    X_2  :       std_logic;  -- I1
3623
    X_3  : out   std_logic;  -- Q1
3624
                             -- 
3625
    X_5  :       std_logic;  -- I2
3626
    X_6  : out   std_logic;  -- Q2
3627
    X_7  : inout std_logic;  -- GND
3628
    X_8  :       std_logic;  -- S1
3629
    X_9  : out   std_logic;  -- Q3
3630
    X_10 :       std_logic;  -- I3
3631
                             --
3632
    X_12 : out   std_logic;  -- Q4
3633
    X_13 :       std_logic;  -- I4
3634
    X_14 : inout std_logic   -- Vcc
3635
);
3636
end entity SN74H87N;
3637
 
3638
architecture BEHAV of SN74H87N is
3639
    signal S1, S2, Z1 : std_logic;
3640
    signal I,  X,  O  : std_logic_vector(4 downto 1);
3641
begin
3642
    I  <= (X_13, X_10, X_5, X_2);
3643
    (X_12, X_9, X_6, X_3) <= O;
3644
    S1 <= not Z1;
3645
 
3646
    DS1: TTLdelay
3647
    generic map(
3648
        tPLH => tPLHS,
3649
        tPHL => tPHLS
3650
    )
3651
    port map(
3652
        A => X_8,
3653
        B => Z1
3654
    );
3655
 
3656
    DS2: TTLdelay
3657
    generic map(
3658
        tPLH => tPLHS,
3659
        tPHL => tPHLS
3660
    )
3661
    port map(
3662
        A => X_1,
3663
        B => S2
3664
    );
3665
 
3666
    G: for j in I'range generate
3667
    begin
3668
        DI: TTLdelay
3669
        generic map(
3670
            tPLH => tPLHI,
3671
            tPHL => tPHLI
3672
        )
3673
        port map(
3674
            A => I(j),
3675
            B => X(j)
3676
        );
3677
 
3678
        O(j) <= S2 xor (not(S1 and X(j)));
3679
 
3680
    end generate;
3681
end architecture BEHAV;
3682
 
3683
-----------------------------------------------------------------------
3684
-- SN74LS89N: 64-bit random-access memory (open collector)
3685
--            Verified 06/06/2016
3686
-----------------------------------------------------------------------
3687
library ieee;
3688
    use ieee.std_logic_1164.all;
3689
    use ieee.std_logic_misc.all;
3690
    use ieee.numeric_std.all;
3691
 
3692
    use work.LSTTL.all;
3693
    use work.TTLPrivate.all;
3694
 
3695
entity SN74LS89N is
3696
generic(
3697
    tPLC  : time     := 10 ns;
3698
    tPLA  : time     := 37 ns;
3699
    tREC  : time     := 30 ns;
3700
    tSUD  : time     := 25 ns;
3701
    tSUA  : time     := 10 ns
3702
);
3703
port(
3704
    X_1   : in    std_logic;  -- A0
3705
    X_2   : in    std_logic;  -- CS\
3706
    X_3   : in    std_logic;  -- WE\
3707
    X_4   : in    std_logic;  -- D1
3708
    X_5   : out   std_logic;  -- Q1\
3709
    X_6   : in    std_logic;  -- D2
3710
    X_7   : out   std_logic;  -- Q2\
3711
    X_8   : inout std_logic;  -- GND
3712
    X_9   : out   std_logic;  -- Q3\
3713
    X_10  : in    std_logic;  -- D3
3714
    X_11  : out   std_logic;  -- Q4\
3715
    X_12  : in    std_logic;  -- D4
3716
    X_13  : in    std_logic;  -- A3
3717
    X_14  : in    std_logic;  -- A2
3718
    X_15  : in    std_logic;  -- A1
3719
    X_16  : inout std_logic   -- Vcc
3720
);
3721
end entity SN74LS89N;
3722
 
3723
architecture BEHAV of SN74LS89N is
3724
    signal   RE, WE   : std_logic := '1';
3725
    signal   IA       : std_logic_vector(3 downto 0) := (others => '0');
3726
    signal   D, QB, Q : std_logic_vector(3 downto 0);
3727
    constant UNK      : std_logic_vector(3 downto 0) := (others => 'X');
3728
    signal   X, Y, Z  : std_logic;
3729
begin
3730
    RE   <= not(    X_3 and not X_2);
3731
    WE   <= not(not X_3 and not X_2);
3732
    IA   <=    (X_13, X_14, X_15, X_1);
3733
    D    <=    (X_12, X_10, X_6,  X_4);
3734
 
3735
    X    <= X_2 and not X_3;                -- Undefined outputs
3736
    Y    <= X after tREC;
3737
    Z    <= X or Y;                         -- Illegal during this time
3738
 
3739
    -- UNK case is explicit in the datasheet
3740
    (X_11, X_9, X_7, X_5) <= UNK when Z = '1' else Q;
3741
 
3742
    MB: TTLramblock
3743
    generic map(
3744
        Omode => OpenColl,
3745
        INVT  => '1',
3746
        tPLC  => tPLC,
3747
        tPLA  => tPLA,
3748
        tSUD  => tSUD,
3749
        tSUA  => tSUA
3750
    )
3751
    port map(
3752
        RA    => IA,
3753
        WA    => IA,
3754
        D     => D,
3755
        O     => Q,
3756
        CE    => '0',
3757
        RE    => RE,
3758
        WE    => WE
3759
    );
3760
end architecture BEHAV;
3761
 
3762
-----------------------------------------------------------------------
3763
-- SN74LS90AN: Decade counter (ripple)
3764
--             Verified 30/05/2016
3765
-----------------------------------------------------------------------
3766
library ieee;
3767
    use ieee.std_logic_1164.all;
3768
 
3769
    use work.LSTTL.all;
3770
    use work.TTLPrivate.all;
3771
 
3772
entity SN74LS90AN is
3773
generic(
3774
    tPLH0 : time := 16 ns;
3775
    tPHL0 : time := 18 ns;
3776
    tPLH1 : time := 16 ns;
3777
    tPHL1 : time := 21 ns;
3778
    tPLH2 : time := 32 ns;
3779
    tPHL2 : time := 35 ns;
3780
    tPLH3 : time := 32 ns;
3781
    tPHL3 : time := 35 ns
3782
);
3783
port(
3784
    X_1  : in    std_logic;  -- CP1\
3785
    X_2  : in    std_logic;  -- MR1
3786
    X_3  : in    std_logic;  -- MR2
3787
                             -- 
3788
    X_5  : inout std_logic;  -- Vcc
3789
    X_6  : in    std_logic;  -- MS1
3790
    X_7  : in    std_logic;  -- MS2
3791
    X_8  : out   std_logic;  -- Q2
3792
    X_9  : out   std_logic;  -- Q1
3793
    X_10 : inout std_logic;  -- GND
3794
    X_11 : out   std_logic;  -- Q3
3795
    X_12 : out   std_logic;  -- Q0
3796
                             -- 
3797
    X_14 : in    std_logic   -- CP0\
3798
);
3799
end entity SN74LS90AN;
3800
 
3801
architecture BEHAV of SN74LS90AN is
3802
    signal rst, set : std_logic;
3803
    signal val      : std_logic_vector(3 downto 0);
3804
begin
3805
    rst <= not (X_2 and X_3);
3806
    set <= not (X_6 and X_7);
3807
    (X_11, X_8, X_9, X_12) <= val;
3808
 
3809
    M1: TTLcount4
3810
    generic map(
3811
        tPLH0   => tPLH0,
3812
        tPHL0   => tPHL0,
3813
        tPLH1   => tPLH1,
3814
        tPHL1   => tPHL1,
3815
        tPLH2   => tPLH2,
3816
        tPHL2   => tPHL2,
3817
        tPLH3   => tPLH3,
3818
        tPHL3   => tPHL3,
3819
        modulus => 10
3820
    )
3821
    port map(
3822
        ld   => '1',
3823
        d    => (others => '0'),
3824
        clka => X_14,
3825
        clkb => X_1,
3826
        rst  => rst,
3827
        set  => set,
3828
        val  => val
3829
    );
3830
end architecture BEHAV;
3831
 
3832
-----------------------------------------------------------------------
3833
-- SN74LS91AN: 8-bit shift register (Pinout A)
3834
--             Verified 06/06/2016
3835
-----------------------------------------------------------------------
3836
library ieee;
3837
    use ieee.std_logic_1164.all;
3838
 
3839
    use work.LSTTL.all;
3840
    use work.TTLPrivate.all;
3841
 
3842
entity SN74LS91AN is
3843
generic(
3844
    tPLH : time := 40 ns;
3845
    tPHL : time := 40 ns;
3846
    tSU  : time := 25 ns
3847
);
3848
port(
3849
                             -- 
3850
                             -- 
3851
                             -- 
3852
                             -- 
3853
    X_5  : inout std_logic;  -- Vcc
3854
                             -- 
3855
                             -- 
3856
                             -- 
3857
    X_9  : in    std_logic;  -- CP
3858
    X_10 : inout std_logic;  -- GND
3859
    X_11 : in    std_logic;  -- B
3860
    X_12 : in    std_logic;  -- A
3861
    X_13 : out   std_logic;  -- Q
3862
    X_14 : out   std_logic   -- Q\
3863
);
3864
end entity SN74LS91AN;
3865
 
3866
architecture BEHAV of SN74LS91AN is
3867
    signal REG    : std_logic_vector(7 downto 0);
3868
    signal Q7, DI : std_logic;
3869
 
3870
    alias CP is X_9;
3871
 
3872
begin
3873
    DI <= not(X_11 and X_12);
3874
 
3875
    OPD: TTLdelay
3876
    generic map(
3877
        tPLH => tPLH,
3878
        tPHL => tPHL
3879
    )
3880
    port map(
3881
        A => REG(7),
3882
        B => Q7
3883
    );
3884
 
3885
    X_13 <= Q7;
3886
    X_14 <= not Q7;
3887
 
3888
    process(CP) is
3889
    begin
3890
        if CP'event and CP = '1' then
3891
            assert DI'stable(tSU) report "Setup violation" severity failure;
3892
            REG <= REG(6 downto 0) & DI;
3893
        end if;
3894
    end process;
3895
 
3896
end architecture BEHAV;
3897
 
3898
-----------------------------------------------------------------------
3899
-- SN74LS92N: Divide-by-12 counter (ripple)
3900
--            Verified 31/05/2016
3901
-----------------------------------------------------------------------
3902
library ieee;
3903
    use ieee.std_logic_1164.all;
3904
 
3905
    use work.LSTTL.all;
3906
    use work.TTLPrivate.all;
3907
 
3908
entity SN74LS92N is
3909
generic(
3910
    tPLH0 : time := 16 ns;
3911
    tPHL0 : time := 18 ns;
3912
    tPLH1 : time := 16 ns;
3913
    tPHL1 : time := 21 ns;
3914
    tPLH2 : time := 16 ns;
3915
    tPHL2 : time := 21 ns;
3916
    tPLH3 : time := 32 ns;
3917
    tPHL3 : time := 35 ns
3918
);
3919
port(
3920
    X_1  : in    std_logic;  -- CP1\
3921
                             --
3922
                             --
3923
                             -- 
3924
    X_5  : inout std_logic;  -- Vcc
3925
    X_6  : in    std_logic;  -- MR1
3926
    X_7  : in    std_logic;  -- MR2
3927
    X_8  : out   std_logic;  -- Q3
3928
    X_9  : out   std_logic;  -- Q2
3929
    X_10 : inout std_logic;  -- GND
3930
    X_11 : out   std_logic;  -- Q1
3931
    X_12 : out   std_logic;  -- Q0
3932
                             -- 
3933
    X_14 : in    std_logic   -- CP0\
3934
);
3935
end entity SN74LS92N;
3936
 
3937
architecture BEHAV of SN74LS92N is
3938
    signal rst : std_logic;
3939
    signal val : std_logic_vector(3 downto 0);
3940
begin
3941
    rst <= not (X_6 and X_7);
3942
    (X_8, X_9, X_11, X_12) <= val;
3943
 
3944
    M1: TTLcount4
3945
    generic map(
3946
        tPLH0   => tPLH0,
3947
        tPHL0   => tPHL0,
3948
        tPLH1   => tPLH1,
3949
        tPHL1   => tPHL1,
3950
        tPLH2   => tPLH2,
3951
        tPHL2   => tPHL2,
3952
        tPLH3   => tPLH3,
3953
        tPHL3   => tPHL3,
3954
        modulus => 12
3955
    )
3956
    port map(
3957
        ld   => '1',
3958
        d    => (others => '0'),
3959
        clka => X_14,
3960
        clkb => X_1,
3961
        rst  => rst,
3962
        set  => '1',
3963
        val  => val
3964
    );
3965
end architecture BEHAV;
3966
 
3967
-----------------------------------------------------------------------
3968
-- SN74LS93N: Divide-by-16 (binary) counter (ripple)
3969
--            Verified 31/05/2016
3970
-----------------------------------------------------------------------
3971
library ieee;
3972
    use ieee.std_logic_1164.all;
3973
 
3974
    use work.LSTTL.all;
3975
    use work.TTLPrivate.all;
3976
 
3977
entity SN74LS93N is
3978
generic(
3979
    tPLH0 : time := 16 ns;
3980
    tPHL0 : time := 18 ns;
3981
    tPLH1 : time := 16 ns;
3982
    tPHL1 : time := 21 ns;
3983
    tPLH2 : time := 32 ns;
3984
    tPHL2 : time := 35 ns;
3985
    tPLH3 : time := 51 ns;
3986
    tPHL3 : time := 51 ns
3987
);
3988
port(
3989
    X_1  : in    std_logic;  -- CP1\
3990
    X_2  : in    std_logic;  -- MR1
3991
    X_3  : in    std_logic;  -- MR2
3992
                             -- 
3993
    X_5  : inout std_logic;  -- Vcc
3994
                             -- 
3995
                             -- 
3996
    X_8  : out   std_logic;  -- Q2
3997
    X_9  : out   std_logic;  -- Q1
3998
    X_10 : inout std_logic;  -- GND
3999
    X_11 : out   std_logic;  -- Q3
4000
    X_12 : out   std_logic;  -- Q0
4001
                             -- 
4002
    X_14 : in    std_logic   -- CP0\
4003
);
4004
end entity SN74LS93N;
4005
 
4006
architecture BEHAV of SN74LS93N is
4007
    signal rst : std_logic;
4008
    signal val : std_logic_vector(3 downto 0);
4009
begin
4010
    rst <= not (X_2 and X_3);
4011
    (X_11, X_8, X_9, X_12) <= val;
4012
 
4013
    M1: TTLcount4
4014
    generic map(
4015
        tPLH0   => tPLH0,
4016
        tPHL0   => tPHL0,
4017
        tPLH1   => tPLH1,
4018
        tPHL1   => tPHL1,
4019
        tPLH2   => tPLH2,
4020
        tPHL2   => tPHL2,
4021
        tPLH3   => tPLH3,
4022
        tPHL3   => tPHL3,
4023
        modulus => 16
4024
    )
4025
    port map(
4026
        ld   => '1',
4027
        d    => (others => '0'),
4028
        clka => X_14,
4029
        clkb => X_1,
4030
        rst  => rst,
4031
        set  => '1',
4032
        val  => val
4033
    );
4034
end architecture BEHAV;
4035
 
4036
-----------------------------------------------------------------------
4037
-- SN74LS94N: 4-bit shift register
4038
--            Verified 07/06/2016
4039
-----------------------------------------------------------------------
4040
library ieee;
4041
    use ieee.std_logic_1164.all;
4042
 
4043
    use work.LSTTL.all;
4044
    use work.TTLPrivate.all;
4045
 
4046
entity SN74LS94N is
4047
generic(
4048
    tPLH : time := 40 ns;
4049
    tPHL : time := 40 ns;
4050
    tSU  : time := 35 ns
4051
);
4052
port(
4053
    X_1  : in    std_logic;  -- P1A
4054
    X_2  : in    std_logic;  -- P1B
4055
    X_3  : in    std_logic;  -- P1C
4056
    X_4  : in    std_logic;  -- P1D
4057
    X_5  : inout std_logic;  -- Vcc
4058
    X_6  : in    std_logic;  -- PL1
4059
    X_7  : in    std_logic;  -- DS
4060
    X_8  : in    std_logic;  -- CP
4061
    X_9  : out   std_logic;  -- QD
4062
    X_10 : in    std_logic;  -- CL
4063
    X_11 : in    std_logic;  -- P2D
4064
    X_12 : inout std_logic;  -- GND
4065
    X_13 : in    std_logic;  -- P2C
4066
    X_14 : in    std_logic;  -- P2B
4067
    X_15 : in    std_logic;  -- PL2
4068
    X_16 : in    std_logic   -- P2A
4069
);
4070
end entity SN74LS94N;
4071
 
4072
architecture BEHAV of SN74LS94N is
4073
    signal REG, PL1, PL2 : std_logic_vector(3 downto 0);
4074
    signal LD            : std_logic;
4075
    alias  CLK is X_8;
4076
    alias  CL  is X_10;
4077
    alias  LD1 is X_6;
4078
    alias  LD2 is X_15;
4079
    alias  DS  is X_7;
4080
begin
4081
    PL1 <= (X_4,  X_3,  X_2,  X_1 );
4082
    PL2 <= (X_11, X_13, X_14, X_16);
4083
    LD  <= LD1 or LD2;
4084
 
4085
    process(CLK, CL, LD) is
4086
    begin
4087
        if    CL = '1' then
4088
            REG <= (others => '0');
4089
        elsif LD = '1' then
4090
            for i in REG'range loop
4091
                REG(i) <= REG(i) or (PL1(i) and LD1) or (PL2(i) and LD2);
4092
            end loop;
4093
        elsif CLK'event and CLK = '1' then
4094
            assert DS'stable(tSU) report "Data setup violation" severity failure;
4095
            REG <= REG(2 downto 0) & DS;
4096
        end if;
4097
    end process;
4098
 
4099
    DO: TTLdelay
4100
    generic map(
4101
        tPLH => tPLH,
4102
        tPHL => tPHL
4103
    )
4104
    port map(
4105
        A => REG(3),
4106
        B => X_9
4107
    );
4108
 
4109
end architecture BEHAV;
4110
 
4111
-----------------------------------------------------------------------
4112
-- SN74LS95N: 4-bit right/left shift register
4113
--            Verified 07/06/2016
4114
-----------------------------------------------------------------------
4115
library ieee;
4116
    use ieee.std_logic_1164.all;
4117
 
4118
    use work.LSTTL.all;
4119
    use work.TTLPrivate.all;
4120
 
4121
entity SN74LS95N is
4122
generic(
4123
    tPLH : time := 27 ns;
4124
    tPHL : time := 27 ns;
4125
    tSU  : time := 20 ns
4126
);
4127
port(
4128
    X_1  : in    std_logic;  -- DS
4129
    X_2  : in    std_logic;  -- P0
4130
    X_3  : in    std_logic;  -- P1
4131
    X_4  : in    std_logic;  -- P2
4132
    X_5  : in    std_logic;  -- P3
4133
    X_6  : in    std_logic;  -- PE
4134
    X_7  : inout std_logic;  -- GND
4135
    X_8  : in    std_logic;  -- CP2\
4136
    X_9  : in    std_logic;  -- CP1\
4137
    X_10 : out   std_logic;  -- Q3
4138
    X_11 : out   std_logic;  -- Q2
4139
    X_12 : out   std_logic;  -- Q1
4140
    X_13 : out   std_logic;  -- Q0
4141
    X_14 : inout std_logic   -- Vcc
4142
);
4143
end entity SN74LS95N;
4144
 
4145
architecture BEHAV of SN74LS95N is
4146
    signal P, REG, Q : std_logic_vector(3 downto 0);
4147
 
4148
    alias CP1 is X_9;
4149
    alias CP2 is X_8;
4150
    alias PE  is X_6;
4151
    alias DS  is X_1;
4152
 
4153
begin
4154
    P <= (X_5, X_4, X_3, X_2);
4155
    (X_10, X_11, X_12, X_13) <= Q;
4156
 
4157
    process(CP1, CP2) is
4158
    begin
4159
        if CP2'event and CP2 = '0' and PE = '1' then
4160
            assert P'stable(tSU) report "Setup violation: parallel" severity failure;
4161
            REG <= P;
4162
        elsif CP1'event and CP1 = '0' and PE = '0' then
4163
            assert DS'stable(tSU) report "Setup violation: serial" severity failure;
4164
            REG <= REG(2 downto 0) & DS;
4165
        end if;
4166
    end process;
4167
 
4168
    DO: TTLdelays
4169
    generic map(
4170
        tPLH => tPLH,
4171
        tPHL => tPHL
4172
    )
4173
    port map(
4174
        A => REG,
4175
        B => Q
4176
    );
4177
end architecture BEHAV;
4178
 
4179
-----------------------------------------------------------------------
4180
-- SN74LS96N: 5-bit shift register
4181
--            Verified 07/06/2016
4182
-----------------------------------------------------------------------
4183
library ieee;
4184
    use ieee.std_logic_1164.all;
4185
 
4186
    use work.LSTTL.all;
4187
    use work.TTLPrivate.all;
4188
 
4189
entity SN74LS96N is
4190
generic(
4191
    tPLH : time := 40 ns;
4192
    tPHL : time := 40 ns;
4193
    tSU  : time := 30 ns
4194
);
4195
port(
4196
    X_1  : in    std_logic;  -- CP
4197
    X_2  : in    std_logic;  -- P0
4198
    X_3  : in    std_logic;  -- P1
4199
    X_4  : in    std_logic;  -- P2
4200
    X_5  : inout std_logic;  -- Vcc
4201
    X_6  : in    std_logic;  -- P3
4202
    X_7  : in    std_logic;  -- P4
4203
    X_8  : in    std_logic;  -- PL
4204
    X_9  : in    std_logic;  -- DS
4205
    X_10 : out   std_logic;  -- Q4
4206
    X_11 : out   std_logic;  -- Q3
4207
    X_12 : inout std_logic;  -- GND
4208
    X_13 : out   std_logic;  -- Q2
4209
    X_14 : out   std_logic;  -- Q1
4210
    X_15 : out   std_logic;  -- Q0
4211
    X_16 : in    std_logic   -- CL\
4212
);
4213
end entity SN74LS96N;
4214
 
4215
architecture BEHAV of SN74LS96N is
4216
    signal REG, PL, Q : std_logic_vector(4 downto 0);
4217
    alias  CLK is X_1;
4218
    alias  CL  is X_16;
4219
    alias  LD  is X_8;
4220
    alias  DS  is X_9;
4221
begin
4222
    (X_10, X_11, X_13, X_14, X_15) <= Q;
4223
    PL <= (X_7,  X_6,  X_4,  X_3, X_2 );
4224
 
4225
    process(CLK, CL, LD) is
4226
    begin
4227
        if    CL = '0' then
4228
            REG <= (others => '0');
4229
        elsif LD = '1' then
4230
            REG <= REG or PL;
4231
        elsif CLK'event and CLK = '1' then
4232
            assert DS'stable(tSU) report "Data setup violation" severity failure;
4233
            REG <= REG(3 downto 0) & DS;
4234
        end if;
4235
    end process;
4236
 
4237
    DO: TTLdelays
4238
    generic map(
4239
        tPLH => tPLH,
4240
        tPHL => tPHL
4241
    )
4242
    port map(
4243
        A => REG,
4244
        B => Q
4245
    );
4246
end architecture BEHAV;
4247
 
4248
-- SN74LS97N: Synchronous modulo-64 bit-rate multiplier
4249
 
4250
-----------------------------------------------------------------------
4251
-- SN74100N: Dual 4-bit latch
4252
--           Verified 07/06/2016
4253
-----------------------------------------------------------------------
4254
library ieee;
4255
    use ieee.std_logic_1164.all;
4256
 
4257
    use work.LSTTL.all;
4258
    use work.TTLPrivate.all;
4259
 
4260
entity SN74100N is
4261
generic(
4262
    tPLH : time := 30 ns;
4263
    tPHL : time := 25 ns
4264
);
4265
port(
4266
                             --
4267
    X_2  : in    std_logic;  -- 1D1
4268
    X_3  : in    std_logic;  -- 1D2
4269
    X_4  : out   std_logic;  -- 1Q2
4270
    X_5  : out   std_logic;  -- 1Q1
4271
                             --
4272
    X_7  : inout std_logic;  -- GND
4273
    X_8  : out   std_logic;  -- 2Q1
4274
    X_9  : out   std_logic;  -- 2Q2
4275
    X_10 : in    std_logic;  -- 2D2
4276
    X_11 : in    std_logic;  -- 2D1
4277
    X_12 : in    std_logic;  -- 2G
4278
                             -- 
4279
                             -- 
4280
    X_15 : in    std_logic;  -- 2D3
4281
    X_16 : in    std_logic;  -- 2D4
4282
    X_17 : out   std_logic;  -- 2Q4
4283
    X_18 : out   std_logic;  -- 2Q3
4284
    X_19 : out   std_logic;  -- 1Q3
4285
    X_20 : out   std_logic;  -- 1Q4
4286
    X_21 : in    std_logic;  -- 1D4
4287
    X_22 : in    std_logic;  -- 1D3
4288
    X_23 : in    std_logic;  -- 1G
4289
    X_24 : inout std_logic   -- Vcc
4290
);
4291
end entity SN74100N;
4292
 
4293
architecture BEHAV of SN74100N is
4294
    subtype quad is std_logic_vector(4 downto 1);
4295
    type  biquad is array(2 downto 1) of quad;
4296
 
4297
    signal D, R, Q : biquad;
4298
    signal G       : std_logic_vector(2 downto 1);
4299
 
4300
begin
4301
    G <= (X_12, X_23);
4302
    D <= ((X_16, X_15, X_10, X_11), (X_21, X_22, X_3, X_2));
4303
    (X_17, X_18, X_9, X_8) <= Q(2);
4304
    (X_20, X_19, X_4, X_5) <= Q(1);
4305
 
4306
    G1: for i in G'range generate
4307
    begin
4308
        process(G(i), D(i)) is
4309
        begin
4310
            if G(i) = '1' then
4311
                R(i) <= D(i);
4312
            end if;
4313
        end process;
4314
 
4315
        DO: TTLdelays
4316
        generic map(
4317
            tPLH => tPLH,
4318
            tPHL => tPHL
4319
        )
4320
        port map(
4321
            A => R(i),
4322
            B => Q(i)
4323
        );
4324
    end generate;
4325
 
4326
end architecture BEHAV;
4327
 
4328
-----------------------------------------------------------------------
4329
-- SN74H101N: JK edge-triggered flipflop (with and-or inputs) (Pinout A)
4330
--            Verified 01/06/2016
4331
-----------------------------------------------------------------------
4332
library ieee;
4333
    use ieee.std_logic_1164.all;
4334
 
4335
    use work.LSTTL.all;
4336
    use work.TTLPrivate.all;
4337
 
4338
entity SN74H101N is
4339
generic(
4340
    tSETUP : time := 13 ns;     -- Setup time before clock
4341
    tPLHCP : time := 15 ns;     -- Clock rising
4342
    tPHLCP : time := 20 ns;     -- Clock falling
4343
    tPLHSC : time := 12 ns;     -- S/C rising
4344
    tPHLSC : time := 20 ns      -- S/C falling
4345
);
4346
port(
4347
    X_1  : in    std_logic;  -- J1A
4348
    X_2  : in    std_logic;  -- J1B
4349
    X_3  : in    std_logic;  -- J2A
4350
    X_4  : in    std_logic;  -- J2B
4351
    X_5  : in    std_logic;  -- SD\
4352
    X_6  : out   std_logic;  -- Q
4353
    X_7  : inout std_logic;  -- GND
4354
    X_8  : out   std_logic;  -- Q\
4355
    X_9  : in    std_logic;  -- K1A
4356
    X_10 : in    std_logic;  -- K1B
4357
    X_11 : in    std_logic;  -- K2A
4358
    X_12 : in    std_logic;  -- K2B
4359
    X_13 : in    std_logic;  -- CP
4360
    X_14 : inout std_logic   -- Vcc
4361
);
4362
end entity SN74H101N;
4363
 
4364
architecture BEHAV of SN74H101N is
4365
    signal j, k, ns, nc : std_logic;
4366
begin
4367
    j  <= (X_1 and X_2 ) or (X_3  and X_4 );
4368
    k  <= (X_9 and X_10) or (X_11 and X_12);
4369
    ns <= not X_5;
4370
    nc <= not X_13;
4371
 
4372
    FF: TTLflipflop
4373
    generic map(
4374
        tPLHCP  => tPLHCP,
4375
        tPHLCP  => tPHLCP,
4376
        tPLHSC  => tPLHSC,
4377
        tPHLSC  => tPHLSC,
4378
        tSETUP  => tSETUP,
4379
        Safeclk => false
4380
    )
4381
    port map(
4382
        J  => j,
4383
        K  => k,
4384
        C  => nc,
4385
        S  => ns,
4386
        R  => '0',
4387
        Q  => X_6,
4388
        QB => X_8
4389
    );
4390
end architecture BEHAV;
4391
 
4392
-----------------------------------------------------------------------
4393
-- SN74H102N: JK edge-triggered flipflop (with and inputs) (Pinout A)
4394
--            Verified 02/06/2016
4395
-----------------------------------------------------------------------
4396
library ieee;
4397
    use ieee.std_logic_1164.all;
4398
 
4399
    use work.LSTTL.all;
4400
    use work.TTLPrivate.all;
4401
 
4402
entity SN74H102N is
4403
generic(
4404
    tSETUP : time := 13 ns;     -- Setup time before clock
4405
    tPLHCP : time := 15 ns;     -- Clock rising
4406
    tPHLCP : time := 20 ns;     -- Clock falling
4407
    tPLHSC : time := 12 ns;     -- S/C rising
4408
    tPHLSC : time := 20 ns      -- S/C falling
4409
);
4410
port(
4411
                             -- 
4412
    X_2  : in    std_logic;  -- CD\
4413
    X_3  : in    std_logic;  -- J1
4414
    X_4  : in    std_logic;  -- J2
4415
    X_5  : in    std_logic;  -- J3
4416
    X_6  : out   std_logic;  -- Q\
4417
    X_7  : inout std_logic;  -- GND
4418
    X_8  : out   std_logic;  -- Q
4419
    X_9  : in    std_logic;  -- K1
4420
    X_10 : in    std_logic;  -- K2
4421
    X_11 : in    std_logic;  -- K3
4422
    X_12 : in    std_logic;  -- CP\
4423
    X_13 : in    std_logic;  -- SD\
4424
    X_14 : inout std_logic   -- Vcc
4425
);
4426
end entity SN74H102N;
4427
 
4428
architecture BEHAV of SN74H102N is
4429
    signal j, k, nr, ns, nc : std_logic;
4430
begin
4431
    j  <= X_3 and X_4  and X_5 ;
4432
    k  <= X_9 and X_10 and X_11;
4433
    nr <= not X_2;
4434
    ns <= not X_13;
4435
    nc <= not X_12;
4436
 
4437
    FF: TTLflipflop
4438
    generic map(
4439
        tPLHCP  => tPLHCP,
4440
        tPHLCP  => tPHLCP,
4441
        tPLHSC  => tPLHSC,
4442
        tPHLSC  => tPHLSC,
4443
        tSETUP  => tSETUP,
4444
        Safeclk => false
4445
    )
4446
    port map(
4447
        J  => j,
4448
        K  => k,
4449
        C  => nc,
4450
        S  => ns,
4451
        R  => nr,
4452
        Q  => X_8,
4453
        QB => X_6
4454
    );
4455
end architecture BEHAV;
4456
 
4457
-----------------------------------------------------------------------
4458
-- SN74H103N: Dual JK edge-triggered flipflop
4459
--            Verified 02/06/2016
4460
-----------------------------------------------------------------------
4461
library ieee;
4462
    use ieee.std_logic_1164.all;
4463
 
4464
    use work.LSTTL.all;
4465
    use work.TTLPrivate.all;
4466
 
4467
entity SN74H103N is
4468
generic(
4469
    tSETUP : time := 13 ns;     -- Setup time before clock
4470
    tPLHCP : time := 15 ns;     -- Clock rising
4471
    tPHLCP : time := 20 ns;     -- Clock falling
4472
    tPLHSC : time := 12 ns;     -- S/C rising
4473
    tPHLSC : time := 35 ns      -- S/C falling
4474
);
4475
port(
4476
    X_1  : in    std_logic;  -- CP1\
4477
    X_2  : in    std_logic;  -- CD1\
4478
    X_3  : in    std_logic;  -- K1
4479
    X_4  : inout std_logic;  -- Vcc
4480
    X_5  : in    std_logic;  -- CP2\
4481
    X_6  : in    std_logic;  -- CD2\
4482
    X_7  : in    std_logic;  -- J2
4483
    X_8  : out   std_logic;  -- Q2\
4484
    X_9  : out   std_logic;  -- Q2
4485
    X_10 : in    std_logic;  -- K2
4486
    X_11 : inout std_logic;  -- GND
4487
    X_12 : out   std_logic;  -- Q1
4488
    X_13 : out   std_logic;  -- Q1\
4489
    X_14 : in    std_logic   -- J1
4490
);
4491
end entity SN74H103N;
4492
 
4493
architecture BEHAV of SN74H103N is
4494
    subtype Pair is std_logic_vector(0 to 1);
4495
    signal C, J, K, R, Q, QB : Pair;
4496
begin
4497
    C <= (X_1,  X_5 );
4498
    R <= (X_2,  X_6 );
4499
    J <= (X_14, X_7 );
4500
    K <= (X_3,  X_10);
4501
    (X_12, X_9) <= Q;
4502
    (X_13, X_8) <= QB;
4503
 
4504
    G1: for i in Pair'range generate
4505
        signal nc, nr : std_logic;
4506
    begin
4507
        nc <= not C(i);
4508
        nr <= not R(i);
4509
 
4510
        FF: TTLflipflop
4511
        generic map(
4512
            tPLHCP  => tPLHCP,
4513
            tPHLCP  => tPHLCP,
4514
            tPLHSC  => tPLHSC,
4515
            tPHLSC  => tPHLSC,
4516
            tSETUP  => tSETUP,
4517
            Safeclk => false
4518
        )
4519
        port map(
4520
            J  => J(i),
4521
            K  => K(i),
4522
            C  => nc,
4523
            S  => '0',
4524
            R  => nr,
4525
            Q  => Q(i),
4526
            QB => QB(i)
4527
        );
4528
    end generate;
4529
end architecture BEHAV;
4530
 
4531
-- SN74105N: JK flipflop with extra gating
4532
 
4533
-----------------------------------------------------------------------
4534
-- SN74H106N: Dual JK edge-triggered flipflop
4535
--            Verified 02/06/2016
4536
-----------------------------------------------------------------------
4537
library ieee;
4538
    use ieee.std_logic_1164.all;
4539
 
4540
    use work.LSTTL.all;
4541
    use work.TTLPrivate.all;
4542
 
4543
entity SN74H106N is
4544
generic(
4545
    tSETUP : time := 13 ns;     -- Setup time before clock
4546
    tPLHCP : time := 15 ns;     -- Clock rising
4547
    tPHLCP : time := 20 ns;     -- Clock falling
4548
    tPLHSC : time := 12 ns;     -- S/C rising
4549
    tPHLSC : time := 35 ns      -- S/C falling
4550
);
4551
port(
4552
    X_1  : in    std_logic;  -- CP1\
4553
    X_2  : in    std_logic;  -- SD1\
4554
    X_3  : in    std_logic;  -- CD1\
4555
    X_4  : in    std_logic;  -- J1
4556
    X_5  : inout std_logic;  -- Vcc
4557
    X_6  : in    std_logic;  -- CP2\
4558
    X_7  : in    std_logic;  -- SD2\
4559
    X_8  : in    std_logic;  -- CD2\
4560
    X_9  : in    std_logic;  -- J2
4561
    X_10 : out   std_logic;  -- Q2\
4562
    X_11 : out   std_logic;  -- Q2
4563
    X_12 : in    std_logic;  -- K2
4564
    X_13 : inout std_logic;  -- GND
4565
    X_14 : out   std_logic;  -- Q1\
4566
    X_15 : out   std_logic;  -- Q1
4567
    X_16 : in    std_logic   -- K1
4568
);
4569
end entity SN74H106N;
4570
 
4571
architecture BEHAV of SN74H106N is
4572
    subtype Pair is std_logic_vector(0 to 1);
4573
    signal C, J, K, R, S, Q, QB : Pair;
4574
begin
4575
    C <= (X_1,  X_6 );
4576
    R <= (X_3,  X_8 );
4577
    S <= (X_2,  X_7 );
4578
    J <= (X_4,  X_9 );
4579
    K <= (X_16, X_12);
4580
    (X_15, X_11) <= Q;
4581
    (X_14, X_10) <= QB;
4582
 
4583
    G1: for i in Pair'range generate
4584
        signal nc, ns, nr : std_logic;
4585
    begin
4586
        nc <= not C(i);
4587
        nr <= not R(i);
4588
        ns <= not S(i);
4589
 
4590
        FF: TTLflipflop
4591
        generic map(
4592
            tPLHCP  => tPLHCP,
4593
            tPHLCP  => tPHLCP,
4594
            tPLHSC  => tPLHSC,
4595
            tPHLSC  => tPHLSC,
4596
            tSETUP  => tSETUP,
4597
            Safeclk => false
4598
        )
4599
        port map(
4600
            J  => J(i),
4601
            K  => K(i),
4602
            C  => nc,
4603
            S  => ns,
4604
            R  => nr,
4605
            Q  => Q(i),
4606
            QB => QB(i)
4607
        );
4608
    end generate;
4609
end architecture BEHAV;
4610
 
4611
-----------------------------------------------------------------------
4612
-- SN74LS107N: Dual JK flipflop
4613
--             Verified 02/06/2016
4614
-----------------------------------------------------------------------
4615
library ieee;
4616
    use ieee.std_logic_1164.all;
4617
 
4618
    use work.LSTTL.all;
4619
    use work.TTLPrivate.all;
4620
 
4621
entity SN74LS107N is
4622
generic(
4623
    tSETUP : time := 20 ns;     -- Setup time before clock
4624
    tPLHCP : time := 20 ns;     -- Clock rising
4625
    tPHLCP : time := 30 ns;     -- Clock falling
4626
    tPLHSC : time := 20 ns;     -- S/C rising
4627
    tPHLSC : time := 30 ns      -- S/C falling
4628
);
4629
port(
4630
    X_1  : in    std_logic;  -- J1
4631
    X_2  : out   std_logic;  -- Q1\
4632
    X_3  : out   std_logic;  -- Q1
4633
    X_4  : in    std_logic;  -- K1
4634
    X_5  : out   std_logic;  -- Q2
4635
    X_6  : out   std_logic;  -- Q2\
4636
    X_7  : inout std_logic;  -- GND
4637
    X_8  : in    std_logic;  -- J2
4638
    X_9  : in    std_logic;  -- CP2\
4639
    X_10 : in    std_logic;  -- CD2\
4640
    X_11 : in    std_logic;  -- K2
4641
    X_12 : in    std_logic;  -- CP1\
4642
    X_13 : in    std_logic;  -- CD2\
4643
    X_14 : inout std_logic   -- Vcc
4644
);
4645
end entity SN74LS107N;
4646
 
4647
architecture BEHAV of SN74LS107N is
4648
    subtype Pair is std_logic_vector(0 to 1);
4649
    signal C, J, K, R, Q, QB : Pair;
4650
begin
4651
    C <= (X_12, X_9 );
4652
    R <= (X_13, X_10);
4653
    J <= (X_1,  X_8 );
4654
    K <= (X_4,  X_11);
4655
    (X_3, X_5) <= Q;
4656
    (X_2, X_6) <= QB;
4657
 
4658
    G1: for i in Pair'range generate
4659
        signal nc, nr : std_logic;
4660
    begin
4661
        nc <= not C(i);
4662
        nr <= not R(i);
4663
 
4664
        FF: TTLflipflop
4665
        generic map(
4666
            tPLHCP  => tPLHCP,
4667
            tPHLCP  => tPHLCP,
4668
            tPLHSC  => tPLHSC,
4669
            tPHLSC  => tPHLSC,
4670
            tSETUP  => tSETUP,
4671
            Safeclk => false
4672
        )
4673
        port map(
4674
            J  => J(i),
4675
            K  => K(i),
4676
            C  => nc,
4677
            S  => '0',
4678
            R  => nr,
4679
            Q  => Q(i),
4680
            QB => QB(i)
4681
        );
4682
    end generate;
4683
end architecture BEHAV;
4684
 
4685
-----------------------------------------------------------------------
4686
-- SN74H108N: Dual JK edge-triggered flipflop
4687
--            Verified 02/06/2016
4688
-----------------------------------------------------------------------
4689
library ieee;
4690
    use ieee.std_logic_1164.all;
4691
 
4692
    use work.LSTTL.all;
4693
    use work.TTLPrivate.all;
4694
 
4695
entity SN74H108N is
4696
generic(
4697
    tSETUP : time := 13 ns;     -- Setup time before clock
4698
    tPLHCP : time := 15 ns;     -- Clock rising
4699
    tPHLCP : time := 20 ns;     -- Clock falling
4700
    tPLHSC : time := 12 ns;     -- S/C rising
4701
    tPHLSC : time := 35 ns      -- S/C falling
4702
);
4703
port(
4704
    X_1  : in    std_logic;  -- K1
4705
    X_2  : out   std_logic;  -- Q1
4706
    X_3  : out   std_logic;  -- Q1\
4707
    X_4  : in    std_logic;  -- J1
4708
    X_5  : out   std_logic;  -- Q2\
4709
    X_6  : out   std_logic;  -- Q2
4710
    X_7  : inout std_logic;  -- GND
4711
    X_8  : in    std_logic;  -- K2
4712
    X_9  : in    std_logic;  -- CP\
4713
    X_10 : in    std_logic;  -- SD2\
4714
    X_11 : in    std_logic;  -- J2
4715
    X_12 : in    std_logic;  -- CD\
4716
    X_13 : in    std_logic;  -- SD1\
4717
    X_14 : inout std_logic   -- Vcc
4718
);
4719
end entity SN74H108N;
4720
 
4721
architecture BEHAV of SN74H108N is
4722
    subtype Pair is std_logic_vector(0 to 1);
4723
    signal J, K, S, Q, QB : Pair;
4724
begin
4725
    S <= (X_13, X_10);
4726
    J <= (X_4,  X_11);
4727
    K <= (X_1,  X_8 );
4728
    (X_2, X_6) <= Q;
4729
    (X_3, X_5) <= QB;
4730
 
4731
    G1: for i in Pair'range generate
4732
        signal nc, nr, ns : std_logic;
4733
    begin
4734
        nc <= not X_9;
4735
        nr <= not X_12;
4736
        ns <= not S(i);
4737
 
4738
        FF: TTLflipflop
4739
        generic map(
4740
            tPLHCP  => tPLHCP,
4741
            tPHLCP  => tPHLCP,
4742
            tPLHSC  => tPLHSC,
4743
            tPHLSC  => tPHLSC,
4744
            tSETUP  => tSETUP,
4745
            Safeclk => false
4746
        )
4747
        port map(
4748
            J  => J(i),
4749
            K  => K(i),
4750
            C  => nc,
4751
            S  => ns,
4752
            R  => nr,
4753
            Q  => Q(i),
4754
            QB => QB(i)
4755
        );
4756
    end generate;
4757
end architecture BEHAV;
4758
 
4759
-----------------------------------------------------------------------
4760
-- SN74LS109N: Dual JK +ve edge-triggered flipflop
4761
--             Verified 04/06/2016
4762
-----------------------------------------------------------------------
4763
library ieee;
4764
    use ieee.std_logic_1164.all;
4765
 
4766
    use work.LSTTL.all;
4767
    use work.TTLPrivate.all;
4768
 
4769
entity SN74LS109N is
4770
generic(
4771
    tSETUP : time := 18 ns;     -- Setup time before clock
4772
    tPLHCP : time := 25 ns;     -- Clock rising
4773
    tPHLCP : time := 35 ns;     -- Clock falling
4774
    tPLHSC : time := 15 ns;     -- S/C rising
4775
    tPHLSC : time := 24 ns      -- S/C falling
4776
);
4777
port(
4778
    X_1  : in    std_logic;  -- CD1\
4779
    X_2  : in    std_logic;  -- J1
4780
    X_3  : in    std_logic;  -- K1\
4781
    X_4  : in    std_logic;  -- CP1
4782
    X_5  : in    std_logic;  -- SD1\
4783
    X_6  : out   std_logic;  -- Q1
4784
    X_7  : out   std_logic;  -- Q1\
4785
    X_8  : inout std_logic;  -- GND
4786
    X_9  : out   std_logic;  -- Q2\
4787
    X_10 : out   std_logic;  -- Q2
4788
    X_11 : in    std_logic;  -- SD2\
4789
    X_12 : in    std_logic;  -- CP2
4790
    X_13 : in    std_logic;  -- K2\
4791
    X_14 : in    std_logic;  -- J2
4792
    X_15 : in    std_logic;  -- CD2\
4793
    X_16 : inout std_logic   -- Vcc
4794
);
4795
end entity SN74LS109N;
4796
 
4797
architecture BEHAV of SN74LS109N is
4798
    subtype Pair is std_logic_vector(0 to 1);
4799
    signal C, J, K, R, S, Q, QB : Pair;
4800
begin
4801
    C <= (X_4,  X_12);
4802
    R <= (X_1,  X_15);
4803
    S <= (X_5,  X_11);
4804
    J <= (X_2,  X_14);
4805
    K <= (X_3,  X_13);
4806
    (X_6, X_10) <= Q;
4807
    (X_7, X_9 ) <= QB;
4808
 
4809
    G1: for i in Pair'range generate
4810
        signal kb, nr, ns : std_logic;
4811
    begin
4812
        nr <= not R(i);
4813
        ns <= not S(i);
4814
        kb <= not K(i);
4815
 
4816
        FF: TTLflipflop
4817
        generic map(
4818
            tPLHCP  => tPLHCP,
4819
            tPHLCP  => tPHLCP,
4820
            tPLHSC  => tPLHSC,
4821
            tPHLSC  => tPHLSC,
4822
            tSETUP  => tSETUP,
4823
            Safeclk => false
4824
        )
4825
        port map(
4826
            J  => J(i),
4827
            K  => kb,
4828
            C  => C(i),
4829
            S  => ns,
4830
            R  => nr,
4831
            Q  => Q(i),
4832
            QB => QB(i)
4833
        );
4834
    end generate;
4835
end architecture BEHAV;
4836
 
4837
-----------------------------------------------------------------------
4838
-- SN74LS112N: Dual JK -ve edge-triggered flipflop
4839
--             Verified 04/06/2016
4840
-----------------------------------------------------------------------
4841
library ieee;
4842
    use ieee.std_logic_1164.all;
4843
 
4844
    use work.LSTTL.all;
4845
    use work.TTLPrivate.all;
4846
 
4847
entity SN74LS112N is
4848
generic(
4849
    tSETUP : time := 20 ns;     -- Setup time before clock
4850
    tPLHCP : time := 16 ns;     -- Clock rising
4851
    tPHLCP : time := 24 ns;     -- Clock falling
4852
    tPLHSC : time := 16 ns;     -- S/C rising
4853
    tPHLSC : time := 24 ns      -- S/C falling
4854
);
4855
port(
4856
    X_1  : in    std_logic;  -- CP1\
4857
    X_2  : in    std_logic;  -- K1
4858
    X_3  : in    std_logic;  -- J1
4859
    X_4  : in    std_logic;  -- SD1\
4860
    X_5  : out   std_logic;  -- Q1
4861
    X_6  : out   std_logic;  -- Q1\
4862
    X_7  : out   std_logic;  -- Q2\
4863
    X_8  : inout std_logic;  -- GND
4864
    X_9  : out   std_logic;  -- Q2
4865
    X_10 : in    std_logic;  -- SD2\
4866
    X_11 : in    std_logic;  -- J2
4867
    X_12 : in    std_logic;  -- K2
4868
    X_13 : in    std_logic;  -- CP2\
4869
    X_14 : in    std_logic;  -- CD2\
4870
    X_15 : in    std_logic;  -- CD1\
4871
    X_16 : inout std_logic   -- Vcc
4872
);
4873
end entity SN74LS112N;
4874
 
4875
architecture BEHAV of SN74LS112N is
4876
    subtype Pair is std_logic_vector(0 to 1);
4877
    signal C, J, K, R, S, Q, QB : Pair;
4878
begin
4879
    C <= (X_1,  X_13);
4880
    R <= (X_15, X_14);
4881
    S <= (X_4,  X_10);
4882
    J <= (X_3,  X_11);
4883
    K <= (X_2,  X_12);
4884
    (X_5, X_9) <= Q;
4885
    (X_6, X_7) <= QB;
4886
 
4887
    G1: for i in Pair'range generate
4888
        signal nc, nr, ns : std_logic;
4889
    begin
4890
        nc <= not C(i);
4891
        nr <= not R(i);
4892
        ns <= not S(i);
4893
 
4894
        FF: TTLflipflop
4895
        generic map(
4896
            tPLHCP  => tPLHCP,
4897
            tPHLCP  => tPHLCP,
4898
            tPLHSC  => tPLHSC,
4899
            tPHLSC  => tPHLSC,
4900
            tSETUP  => tSETUP,
4901
            Safeclk => false
4902
        )
4903
        port map(
4904
            J  => J(i),
4905
            K  => K(i),
4906
            C  => nc,
4907
            S  => ns,
4908
            R  => nr,
4909
            Q  => Q(i),
4910
            QB => QB(i)
4911
        );
4912
    end generate;
4913
end architecture BEHAV;
4914
 
4915
-----------------------------------------------------------------------
4916
-- SN74LS113N: Dual JK edge-triggered flipflop
4917
--             Verified 04/06/2016
4918
-----------------------------------------------------------------------
4919
library ieee;
4920
    use ieee.std_logic_1164.all;
4921
 
4922
    use work.LSTTL.all;
4923
    use work.TTLPrivate.all;
4924
 
4925
entity SN74LS113N is
4926
generic(
4927
    tSETUP : time := 20 ns;     -- Setup time before clock
4928
    tPLHCP : time := 16 ns;     -- Clock rising
4929
    tPHLCP : time := 24 ns;     -- Clock falling
4930
    tPLHSC : time := 16 ns;     -- S/C rising
4931
    tPHLSC : time := 24 ns      -- S/C falling
4932
);
4933
port(
4934
    X_1  : in    std_logic;  -- CP1\
4935
    X_2  : in    std_logic;  -- K1
4936
    X_3  : in    std_logic;  -- J1
4937
    X_4  : in    std_logic;  -- SD1\
4938
    X_5  : out   std_logic;  -- Q1
4939
    X_6  : out   std_logic;  -- Q1\
4940
    X_7  : inout std_logic;  -- GND
4941
    X_8  : out   std_logic;  -- Q2\
4942
    X_9  : out   std_logic;  -- Q2
4943
    X_10 : in    std_logic;  -- SD2\
4944
    X_11 : in    std_logic;  -- J2
4945
    X_12 : in    std_logic;  -- K2
4946
    X_13 : in    std_logic;  -- CP2\
4947
    X_14 : inout std_logic   -- Vcc
4948
);
4949
end entity SN74LS113N;
4950
 
4951
architecture BEHAV of SN74LS113N is
4952
    subtype Pair is std_logic_vector(0 to 1);
4953
    signal C, J, K, S, Q, QB : Pair;
4954
begin
4955
    C <= (X_1,  X_13);
4956
    S <= (X_4,  X_10);
4957
    J <= (X_3,  X_11);
4958
    K <= (X_2,  X_12);
4959
    (X_5, X_9) <= Q;
4960
    (X_6, X_8) <= QB;
4961
 
4962
    G1: for i in Pair'range generate
4963
        signal nc, ns : std_logic;
4964
    begin
4965
        nc <= not C(i);
4966
        ns <= not S(i);
4967
 
4968
        FF: TTLflipflop
4969
        generic map(
4970
            tPLHCP  => tPLHCP,
4971
            tPHLCP  => tPHLCP,
4972
            tPLHSC  => tPLHSC,
4973
            tPHLSC  => tPHLSC,
4974
            tSETUP  => tSETUP,
4975
            Safeclk => false
4976
        )
4977
        port map(
4978
            J  => J(i),
4979
            K  => K(i),
4980
            C  => nc,
4981
            S  => ns,
4982
            R  => '0',
4983
            Q  => Q(i),
4984
            QB => QB(i)
4985
        );
4986
    end generate;
4987
end architecture BEHAV;
4988
 
4989
-----------------------------------------------------------------------
4990
-- SN74LS114N: Dual JK -ve edge-triggered flipflop
4991
--             Verified 04/06/2016
4992
-----------------------------------------------------------------------
4993
library ieee;
4994
    use ieee.std_logic_1164.all;
4995
 
4996
    use work.LSTTL.all;
4997
    use work.TTLPrivate.all;
4998
 
4999
entity SN74LS114N is
5000
generic(
5001
    tSETUP : time := 20 ns;     -- Setup time before clock
5002
    tPLHCP : time := 16 ns;     -- Clock rising
5003
    tPHLCP : time := 24 ns;     -- Clock falling
5004
    tPLHSC : time := 16 ns;     -- S/C rising
5005
    tPHLSC : time := 24 ns      -- S/C falling
5006
);
5007
port(
5008
    X_1  : in    std_logic;  -- CD\
5009
    X_2  : in    std_logic;  -- K1
5010
    X_3  : in    std_logic;  -- J1
5011
    X_4  : in    std_logic;  -- SD1\
5012
    X_5  : out   std_logic;  -- Q1
5013
    X_6  : out   std_logic;  -- Q1\
5014
    X_7  : inout std_logic;  -- GND
5015
    X_8  : out   std_logic;  -- Q2\
5016
    X_9  : out   std_logic;  -- Q2
5017
    X_10 : in    std_logic;  -- SD2\
5018
    X_11 : in    std_logic;  -- J2
5019
    X_12 : in    std_logic;  -- K2
5020
    X_13 : in    std_logic;  -- CP\
5021
    X_14 : inout std_logic   -- Vcc
5022
);
5023
end entity SN74LS114N;
5024
 
5025
architecture BEHAV of SN74LS114N is
5026
    subtype Pair is std_logic_vector(0 to 1);
5027
    signal J, K, S, Q, QB : Pair;
5028
begin
5029
    S <= (X_4,  X_10);
5030
    J <= (X_3,  X_11);
5031
    K <= (X_2,  X_12);
5032
    (X_5, X_9) <= Q;
5033
    (X_6, X_8) <= QB;
5034
 
5035
    G1: for i in Pair'range generate
5036
        signal nc, nr, ns : std_logic;
5037
    begin
5038
        nc <= not X_13;
5039
        ns <= not S(i);
5040
        nr <= not X_1;
5041
 
5042
        FF: TTLflipflop
5043
        generic map(
5044
            tPLHCP  => tPLHCP,
5045
            tPHLCP  => tPHLCP,
5046
            tPLHSC  => tPLHSC,
5047
            tPHLSC  => tPHLSC,
5048
            tSETUP  => tSETUP,
5049
            Safeclk => false
5050
        )
5051
        port map(
5052
            J  => J(i),
5053
            K  => K(i),
5054
            C  => nc,
5055
            S  => ns,
5056
            R  => nr,
5057
            Q  => Q(i),
5058
            QB => QB(i)
5059
        );
5060
    end generate;
5061
end architecture BEHAV;
5062
 
5063
-----------------------------------------------------------------------
5064
-- SN74121N: Monostable multivibrator
5065
--           Tw = 0.69 * R * C
5066
--           Verified 04/06/2016
5067
-----------------------------------------------------------------------
5068
library ieee;
5069
    use ieee.std_logic_1164.all;
5070
    use ieee.std_logic_misc.all;
5071
 
5072
    use work.LSTTL.all;
5073
    use work.TTLPrivate.all;
5074
 
5075
entity SN74121N is
5076
generic(
5077
    W    : time := 100 us    -- Pulse width
5078
);
5079
port(
5080
    X_1  : out   std_logic;  -- Q\
5081
                             -- 
5082
    X_3  : in    std_logic;  -- A1\
5083
    X_4  : in    std_logic;  -- A2\
5084
    X_5  : in    std_logic;  -- B
5085
    X_6  : out   std_logic;  -- Q
5086
    X_7  : inout std_logic;  -- GND
5087
                             -- 
5088
    X_9  : inout std_logic;  -- Rint (open for simulation)
5089
    X_10 : inout std_logic;  -- Cx
5090
    X_11 : inout std_logic;  -- RxCx
5091
                             -- 
5092
                             -- 
5093
    X_14 : inout std_logic   -- Vcc
5094
);
5095
end entity SN74121N;
5096
 
5097
architecture BEHAV of SN74121N is
5098
    constant tD : time :=  80 ns;   -- Trigger delay from input
5099
    constant mt : time :=  50 ns;   -- Minimum trigger width
5100
 
5101
    signal trig, Q : std_logic;
5102
begin
5103
    trig <= X_5 and nand_reduce(X_3 & X_4) after tD;
5104
 
5105
    MS: TTLmonostable
5106
    generic map(
5107
        pwidth        => W,   -- Triggered pulse width
5108
        mintrig       => mt,  -- Minimum trigger width
5109
        retriggerable => false
5110
    )
5111
    port map(
5112
        trig  => trig,
5113
        reset => '0',
5114
        Q     => Q
5115
    );
5116
 
5117
    X_6 <= Q;
5118
    X_1 <= not Q;
5119
 
5120
end architecture BEHAV;
5121
 
5122
-----------------------------------------------------------------------
5123
-- SN74122N: Retriggerable resettable monostable multivibrator
5124
--           Tw = 0.32 * R * X * (1.0 + 0.7/R)
5125
--           Verified 04/06/2016
5126
-----------------------------------------------------------------------
5127
library ieee;
5128
    use ieee.std_logic_1164.all;
5129
    use ieee.std_logic_misc.all;
5130
 
5131
    use work.LSTTL.all;
5132
    use work.TTLPrivate.all;
5133
 
5134
entity SN74122N is
5135
generic(
5136
    W    : time := 100 us    -- Pulse width
5137
);
5138
port(
5139
    X_1  : in    std_logic;  -- A1\
5140
    X_2  : in    std_logic;  -- A2\
5141
    X_3  : in    std_logic;  -- B1
5142
    X_4  : in    std_logic;  -- B2
5143
    X_5  : in    std_logic;  -- CD\
5144
    X_6  : out   std_logic;  -- Q\
5145
    X_7  : inout std_logic;  -- GND
5146
    X_8  : out   std_logic;  -- Q
5147
    X_9  : inout std_logic;  -- Rint
5148
                             -- 
5149
    X_11 : inout std_logic;  -- Cx
5150
                             -- 
5151
    X_13 : inout std_logic;  -- RxCx
5152
    X_14 : inout std_logic   -- Vcc
5153
);
5154
end entity SN74122N;
5155
 
5156
architecture BEHAV of SN74122N is
5157
    constant tD : time :=  40 ns;   -- Trigger delay from input
5158
    constant mt : time :=  40 ns;   -- Minimum trigger width
5159
 
5160
    signal trig, NR, Q : std_logic;
5161
begin
5162
    trig <= and_reduce(X_3 & X_4 & X_5 & nand_reduce(X_1 & X_2)) after tD;
5163
    NR   <= not X_5;
5164
 
5165
    MS: TTLmonostable
5166
    generic map(
5167
    pwidth        =>  W,  -- Triggered pulse width
5168
    mintrig       => mt,  -- Minimum trigger width
5169
    retriggerable => true
5170
    )
5171
    port map(
5172
        trig  => trig,
5173
        reset => NR,
5174
        Q     => Q
5175
    );
5176
 
5177
    X_8 <= Q;
5178
    X_6 <= not Q;
5179
 
5180
end architecture BEHAV;
5181
 
5182
-----------------------------------------------------------------------
5183
-- SN74123N: Dual retriggerable resettable monostable multivibrator
5184
--           Tw = 0.28 * R * C * (1.0 + 0.7/R)
5185
--           Verified 04/06/2016
5186
-----------------------------------------------------------------------
5187
library ieee;
5188
    use ieee.std_logic_1164.all;
5189
    use ieee.std_logic_misc.all;
5190
 
5191
    use work.LSTTL.all;
5192
    use work.TTLPrivate.all;
5193
 
5194
entity SN74123N is
5195
generic(
5196
    W1   : time := 100 us;   -- Pulse widths
5197
    W2   : time := 100 us
5198
);
5199
port(
5200
    X_1  : in    std_logic;  -- A1\
5201
    X_2  : in    std_logic;  -- B1
5202
    X_3  : in    std_logic;  -- CD1\
5203
    X_4  : out   std_logic;  -- Q1\
5204
    X_5  : out   std_logic;  -- Q2
5205
    X_6  : inout std_logic;  -- Cx2
5206
    X_7  : inout std_logic;  -- Rx2Cx2
5207
    X_8  : inout std_logic;  -- GND
5208
    X_9  : in    std_logic;  -- A2\
5209
    X_10 : in    std_logic;  -- B2
5210
    X_11 : in    std_logic;  -- CD2\
5211
    X_12 : out   std_logic;  -- Q2\
5212
    X_13 : out   std_logic;  -- Q1
5213
    X_14 : inout std_logic;  -- Cx1
5214
    X_15 : inout std_logic;  -- Rx1Cx1
5215
    X_16 : inout std_logic   -- Vcc
5216
);
5217
end entity SN74123N;
5218
 
5219
architecture BEHAV of SN74123N is
5220
    constant tD : time :=  40 ns;   -- Trigger delay from input
5221
    constant mt : time :=  40 ns;   -- Minimum trigger width
5222
 
5223
    signal trig, NR, Q : std_logic_vector(2 downto 1);
5224
 
5225
    type Widths is array(2 downto 1) of time;
5226
    constant pw : Widths := (W1, W2);
5227
begin
5228
    NR(1)   <= not X_3;
5229
    trig(1) <= and_reduce(X_3  & X_2  & (not X_1)) after tD;
5230
    NR(2)   <= not X_11;
5231
    trig(2) <= and_reduce(X_11 & X_10 & (not X_9)) after tD;
5232
 
5233
    GN: for i in trig'range generate
5234
    begin
5235
        MS: TTLmonostable
5236
        generic map(
5237
            pwidth        => pw(i),  -- Triggered pulse width
5238
            mintrig       =>    mt,  -- Minimum trigger width
5239
            retriggerable => true
5240
        )
5241
        port map(
5242
            trig  => trig(i),
5243
            reset => NR(i),
5244
            Q     => Q(i)
5245
        );
5246
    end generate;
5247
 
5248
    X_13 <= Q(1);
5249
    X_4  <= not Q(1);
5250
    X_5  <= Q(2);
5251
    X_12 <= not Q(2);
5252
 
5253
end architecture BEHAV;
5254
 
5255
-----------------------------------------------------------------------
5256
-- SN74LS125N: Quad bus buffer (3-state outputs)
5257
--             Verified 07/06/2016
5258
-----------------------------------------------------------------------
5259
library ieee;
5260
    use ieee.std_logic_1164.all;
5261
 
5262
    use work.LSTTL.all;
5263
    use work.TTLPrivate.all;
5264
 
5265
entity SN74LS125N is
5266
generic(
5267
    tPLH : time := 15 ns;
5268
    tPHL : time := 18 ns;
5269
    tPHZ : time := 25 ns;
5270
    tPLZ : time := 25 ns;
5271
    tPHE : time := 16 ns;
5272
    tPLE : time := 25 ns
5273
);
5274
port(
5275
    X_1  : in    std_logic;  -- E1\
5276
    X_2  : in    std_logic;  -- D1
5277
    X_3  : out   std_logic;  -- Q1
5278
    X_4  : in    std_logic;  -- E2\
5279
    X_5  : in    std_logic;  -- D2
5280
    X_6  : out   std_logic;  -- Q2
5281
    X_7  : inout std_logic;  -- GND
5282
    X_8  : out   std_logic;  -- Q3
5283
    X_9  : in    std_logic;  -- D3
5284
    X_10 : in    std_logic;  -- E3\
5285
    X_11 : out   std_logic;  -- Q4
5286
    X_12 : in    std_logic;  -- D4
5287
    X_13 : in    std_logic;  -- E4\
5288
    X_14 : inout std_logic   -- Vcc
5289
);
5290
end entity SN74LS125N;
5291
 
5292
architecture BEHAV of SN74LS125N is
5293
    subtype quad is std_logic_vector(3 downto 0);
5294
    signal  D, E, Q, X : quad;
5295
begin
5296
    D <= (X_12, X_9,  X_5, X_2);
5297
    E <= (X_13, X_10, X_4, X_1);
5298
    (X_11, X_8, X_6, X_3) <= Q;
5299
 
5300
    G1: for i in D'range generate
5301
    begin
5302
        X(i) <= D(i) when E(i) = '0' else 'Z';
5303
 
5304
        process(X(i)) is
5305
            variable Z : std_logic_vector(1 downto 0);
5306
        begin
5307
            if X(i)'event then
5308
                Z(1) := X(i)'last_value;
5309
                Z(0) := X(i);
5310
                case Z is
5311
                    when "01"   => Q(i) <= 'X', X(i) after tPLH;
5312
                    when "10"   => Q(i) <= 'X', X(i) after tPHL;
5313
                    when "0Z"   => Q(i) <= 'X', X(i) after tPLZ;
5314
                    when "1Z"   => Q(i) <= 'X', X(i) after tPHZ;
5315
                    when "Z0"   => Q(i) <= 'X', X(i) after tPLE;
5316
                    when "Z1"   => Q(i) <= 'X', X(i) after tPHE;
5317
                    when others => Q(i) <= 'X', X(i) after tPHL;
5318
                end case;
5319
            end if;
5320
        end process;
5321
    end generate;
5322
 
5323
end architecture BEHAV;
5324
 
5325
-----------------------------------------------------------------------
5326
-- SN74LS126N: Quad bus buffer (3-state outputs)
5327
--             Verified 07/06/2016
5328
-----------------------------------------------------------------------
5329
library ieee;
5330
    use ieee.std_logic_1164.all;
5331
 
5332
    use work.LSTTL.all;
5333
    use work.TTLPrivate.all;
5334
 
5335
entity SN74LS126N is
5336
generic(
5337
    tPLH : time := 15 ns;
5338
    tPHL : time := 18 ns;
5339
    tPHZ : time := 30 ns;
5340
    tPLZ : time := 30 ns;
5341
    tPHE : time := 20 ns;
5342
    tPLE : time := 30 ns
5343
);
5344
port(
5345
    X_1  : in    std_logic;  -- E1
5346
    X_2  : in    std_logic;  -- D1
5347
    X_3  : out   std_logic;  -- Q1
5348
    X_4  : in    std_logic;  -- E2
5349
    X_5  : in    std_logic;  -- D2
5350
    X_6  : out   std_logic;  -- Q2
5351
    X_7  : inout std_logic;  -- GND
5352
    X_8  : out   std_logic;  -- Q3
5353
    X_9  : in    std_logic;  -- D3
5354
    X_10 : in    std_logic;  -- E3
5355
    X_11 : out   std_logic;  -- Q4
5356
    X_12 : in    std_logic;  -- D4
5357
    X_13 : in    std_logic;  -- E4
5358
    X_14 : inout std_logic   -- Vcc
5359
);
5360
end entity SN74LS126N;
5361
 
5362
architecture BEHAV of SN74LS126N is
5363
    subtype quad is std_logic_vector(3 downto 0);
5364
    signal  D, E, Q, X : quad;
5365
begin
5366
    D <= (X_12, X_9,  X_5, X_2);
5367
    E <= (X_13, X_10, X_4, X_1);
5368
    (X_11, X_8, X_6, X_3) <= Q;
5369
 
5370
    G1: for i in D'range generate
5371
    begin
5372
        X(i) <= D(i) when E(i) = '1' else 'Z';
5373
 
5374
        process(X(i)) is
5375
            variable Z : std_logic_vector(1 downto 0);
5376
        begin
5377
            if X(i)'event then
5378
                Z(1) := X(i)'last_value;
5379
                Z(0) := X(i);
5380
                case Z is
5381
                    when "01"   => Q(i) <= 'X', X(i) after tPLH;
5382
                    when "10"   => Q(i) <= 'X', X(i) after tPHL;
5383
                    when "0Z"   => Q(i) <= 'X', X(i) after tPLZ;
5384
                    when "1Z"   => Q(i) <= 'X', X(i) after tPHZ;
5385
                    when "Z0"   => Q(i) <= 'X', X(i) after tPLE;
5386
                    when "Z1"   => Q(i) <= 'X', X(i) after tPHE;
5387
                    when others => Q(i) <= 'X', X(i) after tPHL;
5388
                end case;
5389
            end if;
5390
        end process;
5391
    end generate;
5392
end architecture BEHAV;
5393
 
5394
-----------------------------------------------------------------------
5395
-- SN74LS132N: Quad 2-input Schmitt trigger NAND gate
5396
--             Verified 30/05/2016
5397
-----------------------------------------------------------------------
5398
library ieee;
5399
    use ieee.std_logic_1164.all;
5400
 
5401
    use work.LSTTL.all;
5402
    use work.TTLPrivate.all;
5403
 
5404
entity SN74LS132N is
5405
generic(
5406
    tPLH : time := 20 ns;
5407
    tPHL : time := 20 ns
5408
);
5409
port(
5410
    X_1  : in    std_logic;  -- 1A
5411
    X_2  : in    std_logic;  -- 1B
5412
    X_3  : out   std_logic;  -- 1Y\
5413
    X_4  : in    std_logic;  -- 2A
5414
    X_5  : in    std_logic;  -- 2B
5415
    X_6  : out   std_logic;  -- 2Y\
5416
    X_7  : inout std_logic;  -- GND
5417
    X_8  : out   std_logic;  -- 3Y\
5418
    X_9  : in    std_logic;  -- 3B
5419
    X_10 : in    std_logic;  -- 3A
5420
    X_11 : out   std_logic;  -- 4Y\
5421
    X_12 : in    std_logic;  -- 4B
5422
    X_13 : in    std_logic;  -- 4A
5423
    X_14 : inout std_logic   -- Vcc 
5424
);
5425
end entity SN74LS132N;
5426
 
5427
architecture BEHAV of SN74LS132N is
5428
    signal A : TTLInputs (1 to 4, 1 to 2);
5429
    signal Y : TTLOutputs(1 to 4);
5430
 
5431
begin
5432
    A <= ( (X_1, X_2), (X_4, X_5), (X_9, X_10), (X_12, X_13) );
5433
 
5434
    (X_3, X_6, X_8, X_11) <= Y;
5435
 
5436
    G: TTLgate
5437
    generic map(
5438
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
5439
        invert => '1',      -- '1' will invert the output
5440
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
5441
        tPLH   => tPLH,
5442
        tPHL   => tPHL
5443
    )
5444
    port map(
5445
        ins   => A,
5446
        outs  => Y
5447
    );
5448
 
5449
end architecture BEHAV;
5450
 
5451
-----------------------------------------------------------------------
5452
-- SN74LS133N: 13-input NAND gate
5453
--             Verified 05/06/2016
5454
-----------------------------------------------------------------------
5455
library ieee;
5456
    use ieee.std_logic_1164.all;
5457
 
5458
    use work.LSTTL.all;
5459
    use work.TTLPrivate.all;
5460
 
5461
entity SN74LS133N is
5462
generic(
5463
    tPLH : time := 15 ns;
5464
    tPHL : time := 38 ns
5465
);
5466
port(
5467
    X_1  : in    std_logic;  -- 1A
5468
    X_2  : in    std_logic;  -- 1B
5469
    X_3  : in    std_logic;  -- 1C
5470
    X_4  : in    std_logic;  -- 1D
5471
    X_5  : in    std_logic;  -- 1E
5472
    X_6  : in    std_logic;  -- 1F
5473
    X_7  : in    std_logic;  -- 1G
5474
    X_8  : inout std_logic;  -- GND
5475
    X_9  : out   std_logic;  -- 1Y\
5476
    X_10 : in    std_logic;  -- 1H
5477
    X_11 : in    std_logic;  -- 1J
5478
    X_12 : in    std_logic;  -- 1K
5479
    X_13 : in    std_logic;  -- 1L
5480
    X_14 : in    std_logic;  -- 1M
5481
    X_15 : in    std_logic;  -- 1N
5482
    X_16 : inout std_logic   -- Vcc
5483
);
5484
end entity SN74LS133N;
5485
 
5486
architecture BEHAV of SN74LS133N is
5487
    signal A : TTLInputs (1 to 1, 1 to 13);
5488
    signal Y : TTLOutputs(1 to 1);
5489
 
5490
begin
5491
    A(1,1)  <= X_1;         -- Can't use aggregates with single gate
5492
    A(1,2)  <= X_2;
5493
    A(1,3)  <= X_3;
5494
    A(1,4)  <= X_4;
5495
    A(1,5)  <= X_5;
5496
    A(1,6)  <= X_6;
5497
    A(1,7)  <= X_7;
5498
    A(1,8)  <= X_10;
5499
    A(1,9)  <= X_11;
5500
    A(1,10) <= X_12;
5501
    A(1,11) <= X_13;
5502
    A(1,12) <= X_14;
5503
    A(1,13) <= X_15;
5504
 
5505
    X_9 <= Y(1);            -- Output
5506
 
5507
    G: TTLgate
5508
    generic map(
5509
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
5510
        invert => '1',      -- '1' will invert the output
5511
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
5512
        tPLH   => tPLH,
5513
        tPHL   => tPHL
5514
    )
5515
    port map(
5516
        ins   => A,
5517
        outs  => Y
5518
    );
5519
 
5520
end architecture BEHAV;
5521
 
5522
-----------------------------------------------------------------------
5523
-- SN74S134N: 12-input NAND gate (3-state output)
5524
--            Verified 05/06/2016
5525
-----------------------------------------------------------------------
5526
library ieee;
5527
    use ieee.std_logic_1164.all;
5528
    use ieee.std_logic_misc.all;
5529
 
5530
    use work.LSTTL.all;
5531
    use work.TTLPrivate.all;
5532
 
5533
entity SN74S134N is
5534
generic(
5535
    tPLH : time :=  6.0 ns;
5536
    tPHL : time :=  7.5 ns;
5537
    tPZH : time := 19.5 ns;
5538
    tPZL : time := 21.0 ns;
5539
    tPHZ : time :=  8.5 ns;
5540
    tPLZ : time := 14.0 ns
5541
);
5542
port(
5543
    X_1  : in    std_logic;  -- 1A
5544
    X_2  : in    std_logic;  -- 1B
5545
    X_3  : in    std_logic;  -- 1C
5546
    X_4  : in    std_logic;  -- 1D
5547
    X_5  : in    std_logic;  -- 1E
5548
    X_6  : in    std_logic;  -- 1F
5549
    X_7  : in    std_logic;  -- 1G
5550
    X_8  : inout std_logic;  -- GND
5551
    X_9  : out   std_logic;  -- 1Y\
5552
    X_10 : in    std_logic;  -- 1H
5553
    X_11 : in    std_logic;  -- 1J
5554
    X_12 : in    std_logic;  -- 1K
5555
    X_13 : in    std_logic;  -- 1L
5556
    X_14 : in    std_logic;  -- 1M
5557
    X_15 : in    std_logic;  -- EB
5558
    X_16 : inout std_logic   -- Vcc
5559
);
5560
end entity SN74S134N;
5561
 
5562
architecture BEHAV of SN74S134N is
5563
    signal X, Y, EB : std_logic;
5564
begin
5565
    X  <= nand_reduce( X_1  & X_2  & X_3  & X_4  & X_5  & X_6  &
5566
                       X_7  & X_10 & X_11 & X_12 & X_13 & X_14 );
5567
    EB <= not X_15;
5568
 
5569
    B1: TTL3State
5570
    generic map(
5571
        tPLH => tPLH,
5572
        tPHL => tPHL,
5573
        tPZH => tPZH,
5574
        tPZL => tPZL,
5575
        tPHZ => tPHZ,
5576
        tPLZ => tPLZ
5577
    )
5578
    port map(
5579
        A  => X,
5580
        E  => EB,
5581
        Y  => X_9
5582
    );
5583
 
5584
end architecture BEHAV;
5585
 
5586
-----------------------------------------------------------------------
5587
-- SN74S135N: Quad XOR/NOR gate
5588
--            Verified 05/06/2016
5589
-----------------------------------------------------------------------
5590
library ieee;
5591
    use ieee.std_logic_1164.all;
5592
 
5593
    use work.LSTTL.all;
5594
    use work.TTLPrivate.all;
5595
 
5596
entity SN74S135N is
5597
generic(
5598
    tPXX : time := 13 ns
5599
);
5600
port(
5601
    X_1  : in    std_logic;  -- A1
5602
    X_2  : in    std_logic;  -- B1
5603
    X_3  : out   std_logic;  -- Y1
5604
    X_4  : in    std_logic;  -- C12
5605
    X_5  : in    std_logic;  -- A2
5606
    X_6  : in    std_logic;  -- B2
5607
    X_7  : out   std_logic;  -- Y2
5608
    X_8  : inout std_logic;  -- GND
5609
    X_9  : out   std_logic;  -- Y3
5610
    X_10 : in    std_logic;  -- B3
5611
    X_11 : in    std_logic;  -- A3
5612
    X_12 : in    std_logic;  -- C34
5613
    X_13 : out   std_logic;  -- Y4
5614
    X_14 : in    std_logic;  -- B4
5615
    X_15 : in    std_logic;  -- A4
5616
    X_16 : inout std_logic   -- Vcc
5617
);
5618
end entity SN74S135N;
5619
 
5620
architecture BEHAV of SN74S135N is
5621
begin
5622
    X_3  <= X_4  xor (X_1  xor X_2 ) after tPXX;
5623
    X_7  <= X_4  xor (X_5  xor X_6 ) after tPXX;
5624
    X_9  <= X_12 xor (X_10 xor X_11) after tPXX;
5625
    X_13 <= X_12 xor (X_14 xor X_15) after tPXX;
5626
end architecture BEHAV;
5627
 
5628
-----------------------------------------------------------------------
5629
-- SN74LS136N: Quad 2-input xor gate (open collector)
5630
--             Verified 30/05/2016
5631
-----------------------------------------------------------------------
5632
library ieee;
5633
    use ieee.std_logic_1164.all;
5634
 
5635
    use work.LSTTL.all;
5636
    use work.TTLPrivate.all;
5637
 
5638
entity SN74LS136N is
5639
generic(
5640
    tPLH : time := 30 ns;
5641
    tPHL : time := 30 ns
5642
);
5643
port(
5644
    X_1  : in    std_logic;  -- 1A
5645
    X_2  : in    std_logic;  -- 1B
5646
    X_3  : out   std_logic;  -- 1Y\
5647
    X_4  : in    std_logic;  -- 2A
5648
    X_5  : in    std_logic;  -- 2B
5649
    X_6  : out   std_logic;  -- 2Y\
5650
    X_7  : inout std_logic;  -- GND
5651
    X_8  : out   std_logic;  -- 3Y\
5652
    X_9  : in    std_logic;  -- 3B
5653
    X_10 : in    std_logic;  -- 3A
5654
    X_11 : out   std_logic;  -- 4Y\
5655
    X_12 : in    std_logic;  -- 4B
5656
    X_13 : in    std_logic;  -- 4A
5657
    X_14 : inout std_logic   -- Vcc 
5658
);
5659
end entity SN74LS136N;
5660
 
5661
architecture BEHAV of SN74LS136N is
5662
    signal A : TTLInputs (1 to 4, 1 to 2);
5663
    signal Y : TTLOutputs(1 to 4);
5664
 
5665
begin
5666
    A <= ( (X_1, X_2), (X_4, X_5), (X_9, X_10), (X_12, X_13) );
5667
 
5668
    (X_3, X_6, X_8, X_11) <= Y;
5669
 
5670
    G: TTLgate
5671
    generic map(
5672
        mode   => Zxor,     -- Zand, Zor, Zxor, Zbuf
5673
        invert => '0',      -- '1' will invert the output
5674
        ohigh  => 'Z',      -- '1' = normal, 'Z' = open collectors
5675
        tPLH   => tPLH,
5676
        tPHL   => tPHL
5677
    )
5678
    port map(
5679
        ins   => A,
5680
        outs  => Y
5681
    );
5682
 
5683
end architecture BEHAV;
5684
 
5685
-----------------------------------------------------------------------
5686
-- SN74LS137N: 1-of-8 decoder/demultiplexer (input latches)
5687
--             Verified 08/06/2016
5688
-----------------------------------------------------------------------
5689
library ieee;
5690
    use ieee.std_logic_1164.all;
5691
    use ieee.std_logic_misc.all;
5692
    use ieee.numeric_std.all;
5693
 
5694
    use work.LSTTL.all;
5695
    use work.TTLPrivate.all;
5696
 
5697
entity SN74LS137N is
5698
generic(
5699
    tPLH : time := 12 ns;
5700
    tPHL : time := 20 ns
5701
);
5702
port(
5703
    X_1  : in    std_logic;  -- A0
5704
    X_2  : in    std_logic;  -- A1
5705
    X_3  : in    std_logic;  -- A2
5706
    X_4  : in    std_logic;  -- LE\
5707
    X_5  : in    std_logic;  -- E1\
5708
    X_6  : in    std_logic;  -- E2
5709
    X_7  : out   std_logic;  -- O7\
5710
    X_8  : inout std_logic;  -- GND
5711
    X_9  : out   std_logic;  -- O6\
5712
    X_10 : out   std_logic;  -- O5\
5713
    X_11 : out   std_logic;  -- O4\
5714
    X_12 : out   std_logic;  -- O3\
5715
    X_13 : out   std_logic;  -- O2\
5716
    X_14 : out   std_logic;  -- O1\
5717
    X_15 : out   std_logic;  -- O0\
5718
    X_16 : inout std_logic   -- Vcc
5719
);
5720
end entity SN74LS137N;
5721
 
5722
architecture BEHAV of SN74LS137N is
5723
    signal chn  : natural range 7 downto 0;
5724
    signal Q, O : std_logic_vector(7 downto 0);
5725
    signal A    : unsigned(2 downto 0);
5726
    signal EN   : std_logic;
5727
 
5728
    alias LE is X_4;
5729
 
5730
begin
5731
    A  <= (X_3, X_2, X_1);
5732
    EN <= X_6 and not X_5;
5733
    (X_7, X_9, X_10, X_11, X_12, X_13, X_14, X_15) <= O;
5734
 
5735
    process(A, LE) is
5736
    begin
5737
        if LE = '0' then
5738
            chn <= TTL_to_integer(A);
5739
        end if;
5740
    end process;
5741
 
5742
    process(chn, EN) is
5743
    begin
5744
        Q <= (others => '1');
5745
        Q(chn) <= not EN;
5746
    end process;
5747
 
5748
    OD: TTLdelays
5749
    generic map(
5750
        tPLH => tPLH,
5751
        tPHL => tPHL
5752
    )
5753
    port map(
5754
        A => Q,
5755
        B => O
5756
    );
5757
 
5758
end architecture BEHAV;
5759
 
5760
-----------------------------------------------------------------------
5761
-- SN74LS138N: 1-of-8 decoder/demultiplexer
5762
--             Verified 08/06/2016
5763
-----------------------------------------------------------------------
5764
library ieee;
5765
    use ieee.std_logic_1164.all;
5766
    use ieee.std_logic_misc.all;
5767
    use ieee.numeric_std.all;
5768
 
5769
    use work.LSTTL.all;
5770
    use work.TTLPrivate.all;
5771
 
5772
entity SN74LS138N is
5773
generic(
5774
    tPLH : time := 18 ns;
5775
    tPHL : time := 28 ns
5776
);
5777
port(
5778
    X_1  : in    std_logic;  -- A0
5779
    X_2  : in    std_logic;  -- A1
5780
    X_3  : in    std_logic;  -- A2
5781
    X_4  : in    std_logic;  -- E1\
5782
    X_5  : in    std_logic;  -- E2\
5783
    X_6  : in    std_logic;  -- E3
5784
    X_7  : out   std_logic;  -- O7\
5785
    X_8  : inout std_logic;  -- GND
5786
    X_9  : out   std_logic;  -- O6\
5787
    X_10 : out   std_logic;  -- O5\
5788
    X_11 : out   std_logic;  -- O4\
5789
    X_12 : out   std_logic;  -- O3\
5790
    X_13 : out   std_logic;  -- O2\
5791
    X_14 : out   std_logic;  -- O1\
5792
    X_15 : out   std_logic;  -- O0\
5793
    X_16 : inout std_logic   -- Vcc
5794
);
5795
end entity SN74LS138N;
5796
 
5797
architecture BEHAV of SN74LS138N is
5798
    signal Q, O : std_logic_vector(7 downto 0);
5799
    signal A    : unsigned(2 downto 0);
5800
    signal EN   : std_logic;
5801
 
5802
begin
5803
    A  <= (X_3, X_2, X_1);
5804
    EN <= X_6 and (not X_5) and not (X_4);
5805
    (X_7, X_9, X_10, X_11, X_12, X_13, X_14, X_15) <= O;
5806
 
5807
    process(A, EN) is
5808
        variable chn : natural range 7 downto 0;
5809
    begin
5810
        Q <= (others => '1');
5811
        if EN = '1' then
5812
            chn    := TTL_to_integer(A);
5813
            Q(chn) <= '0';
5814
        end if;
5815
    end process;
5816
 
5817
    OD: TTLdelays
5818
    generic map(
5819
        tPLH => tPLH,
5820
        tPHL => tPHL
5821
    )
5822
    port map(
5823
        A => Q,
5824
        B => O
5825
    );
5826
 
5827
end architecture BEHAV;
5828
 
5829
-----------------------------------------------------------------------
5830
-- SN74LS139N: Dual 1-of-4 decoder
5831
--             Verified 09/06/2016
5832
-----------------------------------------------------------------------
5833
library ieee;
5834
    use ieee.std_logic_1164.all;
5835
    use ieee.std_logic_misc.all;
5836
    use ieee.numeric_std.all;
5837
 
5838
    use work.LSTTL.all;
5839
    use work.TTLPrivate.all;
5840
 
5841
entity SN74LS139N is
5842
generic(
5843
    tPLH : time := 18 ns;
5844
    tPHL : time := 28 ns
5845
);
5846
port(
5847
    X_1  : in    std_logic;  -- EA\
5848
    X_2  : in    std_logic;  -- A0A
5849
    X_3  : in    std_logic;  -- A1A
5850
    X_4  : out   std_logic;  -- O0A\
5851
    X_5  : out   std_logic;  -- O1A\
5852
    X_6  : out   std_logic;  -- O2A\
5853
    X_7  : out   std_logic;  -- O3A\
5854
    X_8  : inout std_logic;  -- GND
5855
    X_9  : out   std_logic;  -- O3B\
5856
    X_10 : out   std_logic;  -- O2B\
5857
    X_11 : out   std_logic;  -- O1B\
5858
    X_12 : out   std_logic;  -- O0B\
5859
    X_13 : in    std_logic;  -- A1B
5860
    X_14 : in    std_logic;  -- A0B
5861
    X_15 : in    std_logic;  -- EB\
5862
    X_16 : inout std_logic   -- Vcc
5863
);
5864
end entity SN74LS139N;
5865
 
5866
architecture BEHAV of SN74LS139N is
5867
    signal A    : std_logic_vector(3 downto 0);
5868
    signal E    : std_logic_vector(1 downto 0);
5869
    signal Q, Z : std_logic_vector(7 downto 0);
5870
 
5871
begin
5872
    A <= (X_13, X_14, X_3, X_2);
5873
    E <= (X_15, X_1);
5874
    (X_9, X_10, X_11, X_12, X_7, X_6,  X_5,  X_4) <= Q;
5875
 
5876
    process(A, E) is
5877
        variable AA : unsigned(1 downto 0);
5878
        variable N  : natural range 3 downto 0;
5879
        variable QQ : std_logic_vector(3 downto 0);
5880
    begin
5881
        for i in E'range loop
5882
            QQ    := (others => '1');
5883
            if E(i) = '0' then
5884
                AA    := unsigned(A((2*i)+1 downto (2*i)));
5885
                N     := TTL_to_integer(AA);
5886
                QQ(N) := '0';
5887
            end if;
5888
            Z((4*i)+3 downto (4*i)) <= QQ;
5889
        end loop;
5890
    end process;
5891
 
5892
    GD: for i in Q'range generate
5893
    begin
5894
        OD: TTLdelays
5895
        generic map(
5896
            tPLH => tPLH,
5897
            tPHL => tPHL
5898
        )
5899
        port map(
5900
            A => Z,
5901
            B => Q
5902
        );
5903
    end generate;
5904
end architecture BEHAV;
5905
 
5906
-----------------------------------------------------------------------
5907
-- SN74S140N: Dual 4-input NAND line driver
5908
--            Verified 09/06/2016
5909
-----------------------------------------------------------------------
5910
library ieee;
5911
    use ieee.std_logic_1164.all;
5912
 
5913
    use work.LSTTL.all;
5914
    use work.TTLPrivate.all;
5915
 
5916
entity SN74S140N is
5917
generic(
5918
    tPLH : time := 6.5 ns;
5919
    tPHL : time := 6.5 ns
5920
);
5921
port(
5922
    X_1  : in    std_logic;  -- 1A
5923
    X_2  : in    std_logic;  -- 1B
5924
                             -- 
5925
    X_4  : in    std_logic;  -- 1C
5926
    X_5  : in    std_logic;  -- 1D
5927
    X_6  : out   std_logic;  -- 1Y\
5928
    X_7  : inout std_logic;  -- GND
5929
    X_8  : out   std_logic;  -- 2Y\
5930
    X_9  : in    std_logic;  -- 2D
5931
    X_10 : in    std_logic;  -- 2C
5932
                             -- 
5933
    X_12 : in    std_logic;  -- 2B
5934
    X_13 : in    std_logic;  -- 2A
5935
    X_14 : inout std_logic   -- Vcc
5936
);
5937
end entity SN74S140N;
5938
 
5939
architecture BEHAV of SN74S140N is
5940
    signal A : TTLInputs (1 to 2, 1 to 4);
5941
    signal Y : TTLOutputs(1 to 2);
5942
 
5943
begin
5944
    A <= ( (X_1, X_2, X_4, X_5), (X_9, X_10, X_12, X_13) );
5945
 
5946
    (X_6, X_8) <= Y;
5947
 
5948
    G: TTLgate
5949
    generic map(
5950
        mode   => Zand,     -- Zand, Zor, Zxor, Zbuf
5951
        invert => '1',      -- '1' will invert the output
5952
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
5953
        tPLH   => tPLH,
5954
        tPHL   => tPHL
5955
    )
5956
    port map(
5957
        ins   => A,
5958
        outs  => Y
5959
    );
5960
end architecture BEHAV;
5961
 
5962
-- SN74LS141N: 1-of-10 Nixie decoder/driver (open collector)
5963
 
5964
-----------------------------------------------------------------------
5965
-- SN74145N: 1-of-10 decoder/driver (open collector)
5966
--           Verified 09/06/2016
5967
-----------------------------------------------------------------------
5968
library ieee;
5969
    use ieee.std_logic_1164.all;
5970
    use ieee.std_logic_misc.all;
5971
    use ieee.numeric_std.all;
5972
 
5973
    use work.LSTTL.all;
5974
    use work.TTLPrivate.all;
5975
 
5976
entity SN74145N is
5977
generic(
5978
    tPLH : time := 50 ns;
5979
    tPHL : time := 50 ns
5980
);
5981
port(
5982
    X_1  : out   std_logic;  -- Q0\
5983
    X_2  : out   std_logic;  -- Q1\
5984
    X_3  : out   std_logic;  -- Q2\
5985
    X_4  : out   std_logic;  -- Q3\
5986
    X_5  : out   std_logic;  -- Q4\
5987
    X_6  : out   std_logic;  -- Q5\
5988
    X_7  : out   std_logic;  -- Q6\
5989
    X_8  : inout std_logic;  -- GND
5990
    X_9  : out   std_logic;  -- Q7\
5991
    X_10 : out   std_logic;  -- Q8\
5992
    X_11 : out   std_logic;  -- Q9\
5993
    X_12 : in    std_logic;  -- A3
5994
    X_13 : in    std_logic;  -- A2
5995
    X_14 : in    std_logic;  -- A1
5996
    X_15 : in    std_logic;  -- A0
5997
    X_16 : inout std_logic   -- Vcc
5998
);
5999
end entity SN74145N;
6000
 
6001
architecture BEHAV of SN74145N is
6002
    signal OP, Y, Z : std_logic_vector(15 downto 0);
6003
begin
6004
    process(all) is
6005
    variable AT : unsigned(3 downto 0);
6006
    variable AD :  natural range(OP'range);
6007
    begin
6008
        AT := (X_12 & X_13 & X_14 & X_15);
6009
        AD := TTL_to_integer(AT);
6010
        OP <= (others => '1');
6011
        OP(AD) <= '0';
6012
    end process;
6013
 
6014
    G1: for i in OP'range generate
6015
    begin
6016
        DL: TTLdelay
6017
        generic map(
6018
            tPLH => tPLH,
6019
            tPHL => tPHL
6020
        )
6021
        port map(
6022
            A => OP(i),
6023
            B => Y(i)
6024
        );
6025
 
6026
        Z(i) <= '0' when Y(i) = '0' else 'Z';       -- Open collectors
6027
    end generate;
6028
 
6029
    ( X_11, X_10, X_9, X_7, X_6, X_5, X_4, X_3, X_2, X_1 ) <= Z(9 downto 0);
6030
 
6031
end architecture BEHAV;
6032
 
6033
-----------------------------------------------------------------------
6034
-- SN74150N: 16-input multiplexer
6035
--           Verified 09/06/2016
6036
-----------------------------------------------------------------------
6037
library ieee;
6038
    use ieee.std_logic_1164.all;
6039
    use ieee.std_logic_misc.all;
6040
    use ieee.numeric_std.all;
6041
 
6042
    use work.LSTTL.all;
6043
    use work.TTLPrivate.all;
6044
 
6045
entity SN74150N is
6046
generic(
6047
    tPLH : time := 35 ns;
6048
    tPHL : time := 33 ns
6049
);
6050
port(
6051
    X_1  : in    std_logic;  -- I7
6052
    X_2  : in    std_logic;  -- I6
6053
    X_3  : in    std_logic;  -- I5
6054
    X_4  : in    std_logic;  -- I4
6055
    X_5  : in    std_logic;  -- I3
6056
    X_6  : in    std_logic;  -- I2
6057
    X_7  : in    std_logic;  -- I1
6058
    X_8  : in    std_logic;  -- I0
6059
    X_9  : in    std_logic;  -- E\
6060
    X_10 : out   std_logic;  -- Z\
6061
    X_11 : in    std_logic;  -- S3
6062
    X_12 : inout std_logic;  -- GND
6063
    X_13 : in    std_logic;  -- S2
6064
    X_14 : in    std_logic;  -- S1
6065
    X_15 : in    std_logic;  -- S0
6066
    X_16 : in    std_logic;  -- I15
6067
    X_17 : in    std_logic;  -- I14
6068
    X_18 : in    std_logic;  -- I13
6069
    X_19 : in    std_logic;  -- I12
6070
    X_20 : in    std_logic;  -- I11
6071
    X_21 : in    std_logic;  -- I10
6072
    X_22 : in    std_logic;  -- I9
6073
    X_23 : in    std_logic;  -- I8
6074
    X_24 : inout std_logic   -- Vcc
6075
);
6076
end entity SN74150N;
6077
 
6078
architecture BEHAV of SN74150N is
6079
    signal D : std_logic_vector(15 downto 0);
6080
    signal A : unsigned(3 downto 0);
6081
    signal Q : std_logic;
6082
 
6083
begin
6084
    A <= (X_11, X_13, X_14, X_15);
6085
    D <= (X_16, X_17, X_18, X_19, X_20, X_21, X_22, X_23,
6086
          X_1,  X_2,  X_3,  X_4,  X_5,  X_6,  X_7,  X_8 );
6087
 
6088
    Q <= D(TTL_to_integer(A)) or X_9;
6089
 
6090
    OD: TTLdelay
6091
    generic map(
6092
        tPLH => tPLH,
6093
        tPHL => tPHL
6094
    )
6095
    port map(
6096
        A => Q,
6097
        B => X_10
6098
    );
6099
end architecture BEHAV;
6100
 
6101
-----------------------------------------------------------------------
6102
-- SN74LS151N: 8-input multiplexer
6103
--             Verified 09/06/2016
6104
-----------------------------------------------------------------------
6105
library ieee;
6106
    use ieee.std_logic_1164.all;
6107
    use ieee.std_logic_misc.all;
6108
    use ieee.numeric_std.all;
6109
 
6110
    use work.LSTTL.all;
6111
    use work.TTLPrivate.all;
6112
 
6113
entity SN74LS151N is
6114
generic(
6115
    tPLHZ  : time := 48 ns;
6116
    tPHLZ  : time := 32 ns;
6117
    tPLHZB : time := 24 ns;
6118
    tPHLZB : time := 34 ns
6119
);
6120
port(
6121
    X_1  : in    std_logic;  -- I3
6122
    X_2  : in    std_logic;  -- I2
6123
    X_3  : in    std_logic;  -- I1
6124
    X_4  : in    std_logic;  -- I0
6125
    X_5  : out   std_logic;  -- Z
6126
    X_6  : out   std_logic;  -- Z\
6127
    X_7  : in    std_logic;  -- E\
6128
    X_8  : inout std_logic;  -- GND
6129
    X_9  : in    std_logic;  -- S2
6130
    X_10 : in    std_logic;  -- S1
6131
    X_11 : in    std_logic;  -- S0
6132
    X_12 : in    std_logic;  -- I7
6133
    X_13 : in    std_logic;  -- I6
6134
    X_14 : in    std_logic;  -- I5
6135
    X_15 : in    std_logic;  -- I4
6136
    X_16 : inout std_logic   -- Vcc
6137
);
6138
end entity SN74LS151N;
6139
 
6140
architecture BEHAV of SN74LS151N is
6141
    signal D     : std_logic_vector(7 downto 0);
6142
    signal A     : unsigned(2 downto 0);
6143
    signal Q, QB : std_logic;
6144
 
6145
begin
6146
    A <= (X_9, X_10, X_11);
6147
    D <= (X_12,  X_13,  X_14,  X_15,  X_1,  X_2,  X_3,  X_4 );
6148
 
6149
    QB <= X_7 or not D(TTL_to_integer(A));
6150
    Q  <= not QB;
6151
 
6152
    OQ: TTLdelay
6153
    generic map(
6154
        tPLH => tPLHZ,
6155
        tPHL => tPHLZ
6156
    )
6157
    port map(
6158
        A => Q,
6159
        B => X_5
6160
    );
6161
 
6162
    OQB: TTLdelay
6163
    generic map(
6164
        tPLH => tPLHZB,
6165
        tPHL => tPHLZB
6166
    )
6167
    port map(
6168
        A => QB,
6169
        B => X_6
6170
    );
6171
end architecture BEHAV;
6172
 
6173
-- SN74LS152N: 8-input multiplexer (flatpack only, no DIP)
6174
 
6175
-----------------------------------------------------------------------
6176
-- SN74LS153N: Dual 4-input multiplexer (common selects)
6177
--             Verified 09/06/2016
6178
-----------------------------------------------------------------------
6179
library ieee;
6180
    use ieee.std_logic_1164.all;
6181
    use ieee.std_logic_misc.all;
6182
    use ieee.numeric_std.all;
6183
 
6184
    use work.LSTTL.all;
6185
    use work.TTLPrivate.all;
6186
 
6187
entity SN74LS153N is
6188
generic(
6189
    tPLH : time := 29 ns;
6190
    tPHL : time := 32 ns
6191
);
6192
port(
6193
    X_1  : in    std_logic;  -- EA\
6194
    X_2  : in    std_logic;  -- S1
6195
    X_3  : in    std_logic;  -- I3A
6196
    X_4  : in    std_logic;  -- I2A
6197
    X_5  : in    std_logic;  -- I1A
6198
    X_6  : in    std_logic;  -- I0A
6199
    X_7  : out   std_logic;  -- ZA
6200
    X_8  : inout std_logic;  -- GND
6201
    X_9  : out   std_logic;  -- ZB
6202
    X_10 : in    std_logic;  -- I0B
6203
    X_11 : in    std_logic;  -- I1B
6204
    X_12 : in    std_logic;  -- I2B
6205
    X_13 : in    std_logic;  -- I3B
6206
    X_14 : in    std_logic;  -- S0
6207
    X_15 : in    std_logic;  -- EB\
6208
    X_16 : inout std_logic   -- Vcc
6209
);
6210
end entity SN74LS153N;
6211
 
6212
architecture BEHAV of SN74LS153N is
6213
    signal D : TTLInputs(2 downto 1, 4 downto 1);
6214
    signal A : unsigned(2 downto 1);
6215
    signal E : std_logic_vector(2 downto 1);        -- Enables: B:A channels
6216
    signal Q : std_logic_vector(2 downto 1);
6217
    signal C : natural range 4 downto 1;
6218
 
6219
begin
6220
    A <= (X_2,  X_14);
6221
    C <= 1+TTL_to_integer(A);
6222
    E <= (X_15, X_1 );
6223
    D <= ((X_13,  X_12,  X_11,  X_10), (X_3,  X_4,  X_5,  X_6));
6224
    (X_9, X_7) <= Q;
6225
 
6226
    G: for i in E'range generate
6227
        signal Z : std_logic;
6228
    begin
6229
        Z <= (not E(i)) and D(i,C);
6230
 
6231
        OQ: TTLdelay
6232
        generic map(
6233
            tPLH => tPLH,
6234
            tPHL => tPHL
6235
        )
6236
        port map(
6237
            A => Z,
6238
            B => Q(i)
6239
        );
6240
    end generate;
6241
end architecture BEHAV;
6242
 
6243
-----------------------------------------------------------------------
6244
-- SN74154N: 1-of-16 decoder/demultiplexer
6245
--           Verified 09/06/2016
6246
-----------------------------------------------------------------------
6247
library ieee;
6248
    use ieee.std_logic_1164.all;
6249
    use ieee.std_logic_misc.all;
6250
    use ieee.numeric_std.all;
6251
 
6252
    use work.LSTTL.all;
6253
    use work.TTLPrivate.all;
6254
 
6255
entity SN74154N is
6256
generic(
6257
    tPLH : time := 31 ns;
6258
    tPHL : time := 28 ns
6259
);
6260
port(
6261
    X_1  : out   std_logic;  -- O0\
6262
    X_2  : out   std_logic;  -- O1\
6263
    X_3  : out   std_logic;  -- O2\
6264
    X_4  : out   std_logic;  -- O3\
6265
    X_5  : out   std_logic;  -- O4\
6266
    X_6  : out   std_logic;  -- O5\
6267
    X_7  : out   std_logic;  -- O6\
6268
    X_8  : out   std_logic;  -- O7\
6269
    X_9  : out   std_logic;  -- O8\
6270
    X_10 : out   std_logic;  -- O9\
6271
    X_11 : out   std_logic;  -- O10\
6272
    X_12 : inout std_logic;  -- GND
6273
    X_13 : out   std_logic;  -- O11\
6274
    X_14 : out   std_logic;  -- O12\
6275
    X_15 : out   std_logic;  -- O13\
6276
    X_16 : out   std_logic;  -- O14\
6277
    X_17 : out   std_logic;  -- O15\
6278
    X_18 : in    std_logic;  -- E0\
6279
    X_19 : in    std_logic;  -- E1\
6280
    X_20 : in    std_logic;  -- A3
6281
    X_21 : in    std_logic;  -- A2
6282
    X_22 : in    std_logic;  -- A1
6283
    X_23 : in    std_logic;  -- A0
6284
    X_24 : inout std_logic   -- Vcc
6285
);
6286
end entity SN74154N;
6287
 
6288
architecture BEHAV of SN74154N is
6289
    signal Q, Z : std_logic_vector(15 downto 0);
6290
    signal A    : unsigned(3 downto 0);
6291
    signal E    : std_logic;
6292
 
6293
begin
6294
    A <= (X_20, X_21, X_22, X_23);
6295
    E <= X_18 or X_19;
6296
    (X_17, X_16, X_15, X_14, X_13, X_11, X_10, X_9,
6297
     X_8,  X_7,  X_6,  X_5,  X_4,  X_3,  X_2,  X_1) <= Q;
6298
 
6299
    process(A, E) is
6300
    begin
6301
        Z <= (others => '1');
6302
        Z(TTL_to_integer(A)) <= E;
6303
    end process;
6304
 
6305
    OQ: TTLdelays
6306
    generic map(
6307
        tPLH => tPLH,
6308
        tPHL => tPHL
6309
    )
6310
    port map(
6311
        A => Z,
6312
        B => Q
6313
    );
6314
end architecture BEHAV;
6315
 
6316
-----------------------------------------------------------------------
6317
-- SN74LS155N: Dual 1-of-4 decoder/demultiplexer
6318
--             Verified 10/06/2016
6319
-----------------------------------------------------------------------
6320
library ieee;
6321
    use ieee.std_logic_1164.all;
6322
    use ieee.std_logic_misc.all;
6323
    use ieee.numeric_std.all;
6324
 
6325
    use work.LSTTL.all;
6326
    use work.TTLPrivate.all;
6327
 
6328
entity SN74LS155N is
6329
generic(
6330
    tPLH : time := 18 ns;
6331
    tPHL : time := 27 ns
6332
);
6333
port(
6334
    X_1  : in    std_logic;  -- EA
6335
    X_2  : in    std_logic;  -- EA\
6336
    X_3  : in    std_logic;  -- A1
6337
    X_4  : out   std_logic;  -- O3A\
6338
    X_5  : out   std_logic;  -- O2A\
6339
    X_6  : out   std_logic;  -- O1A\
6340
    X_7  : out   std_logic;  -- O0A\
6341
    X_8  : inout std_logic;  -- GND
6342
    X_9  : out   std_logic;  -- O0B\
6343
    X_10 : out   std_logic;  -- O1B\
6344
    X_11 : out   std_logic;  -- O2B\
6345
    X_12 : out   std_logic;  -- O3B\
6346
    X_13 : in    std_logic;  -- A0
6347
    X_14 : in    std_logic;  -- EB2\
6348
    X_15 : in    std_logic;  -- EB1\
6349
    X_16 : inout std_logic   -- Vcc
6350
);
6351
end entity SN74LS155N;
6352
 
6353
architecture BEHAV of SN74LS155N is
6354
    signal A    : unsigned(1 downto 0);
6355
    signal E    : std_logic_vector(1 downto 0);
6356
    signal Q, Z : std_logic_vector(7 downto 0);
6357
    signal N    : natural range 3 downto 0;
6358
 
6359
begin
6360
    A <= (X_3, X_13);
6361
    N <= TTL_to_integer(A);
6362
    E <= (not(X_14 or X_15), X_1 and not X_2);
6363
    (X_12, X_11, X_10, X_9, X_4, X_5, X_6, X_7) <= Q;
6364
 
6365
    process(N, E) is
6366
    begin
6367
        Z <= (others => '1');
6368
        Z(4+N) <= not E(1);
6369
        Z(N)   <= not E(0);
6370
    end process;
6371
 
6372
    OD: TTLdelays
6373
    generic map(
6374
        tPLH => tPLH,
6375
        tPHL => tPHL
6376
    )
6377
    port map(
6378
        A => Z,
6379
        B => Q
6380
    );
6381
end architecture BEHAV;
6382
 
6383
-----------------------------------------------------------------------
6384
-- SN74LS156N: Dual 1-of-4 decoder/demultiplexer (open collector)
6385
--             Verified 10/06/2016
6386
-----------------------------------------------------------------------
6387
library ieee;
6388
    use ieee.std_logic_1164.all;
6389
    use ieee.std_logic_misc.all;
6390
    use ieee.numeric_std.all;
6391
 
6392
    use work.LSTTL.all;
6393
    use work.TTLPrivate.all;
6394
 
6395
entity SN74LS156N is
6396
generic(
6397
    tPLH : time := 34 ns;
6398
    tPHL : time := 34 ns
6399
);
6400
port(
6401
    X_1  : in    std_logic;  -- EA
6402
    X_2  : in    std_logic;  -- EA\
6403
    X_3  : in    std_logic;  -- A1
6404
    X_4  : out   std_logic;  -- O3A\
6405
    X_5  : out   std_logic;  -- O2A\
6406
    X_6  : out   std_logic;  -- O1A\
6407
    X_7  : out   std_logic;  -- O0A\
6408
    X_8  : inout std_logic;  -- GND
6409
    X_9  : out   std_logic;  -- O0B\
6410
    X_10 : out   std_logic;  -- O1B\
6411
    X_11 : out   std_logic;  -- O2B\
6412
    X_12 : out   std_logic;  -- O3B\
6413
    X_13 : in    std_logic;  -- A0
6414
    X_14 : in    std_logic;  -- EB2\
6415
    X_15 : in    std_logic;  -- EB1\
6416
    X_16 : inout std_logic   -- Vcc
6417
);
6418
end entity SN74LS156N;
6419
 
6420
architecture BEHAV of SN74LS156N is
6421
    signal A    : unsigned(1 downto 0);
6422
    signal E    : std_logic_vector(1 downto 0);
6423
    signal Q, Z : std_logic_vector(7 downto 0);
6424
    signal N    : natural range 3 downto 0;
6425
 
6426
begin
6427
    A <= (X_3, X_13);
6428
    N <= TTL_to_integer(A);
6429
    E <= (not(X_14 or X_15), X_1 and not X_2);
6430
    (X_12, X_11, X_10, X_9, X_4, X_5, X_6, X_7) <= Q;
6431
 
6432
    process(N, E) is
6433
    begin
6434
        Z <= (others => 'Z');
6435
        if E(1) = '1' then Z(4+N) <= '0'; end if;
6436
        if E(0) = '1' then Z(N)   <= '0'; end if;
6437
    end process;
6438
 
6439
    OD: TTLdelays
6440
    generic map(
6441
        tPLH => tPLH,
6442
        tPHL => tPHL
6443
    )
6444
    port map(
6445
        A => Z,
6446
        B => Q
6447
    );
6448
end architecture BEHAV;
6449
 
6450
-----------------------------------------------------------------------
6451
-- SN74LS157N: Quad 2-input multiplexer (common select)
6452
--             Verified 10/06/2016
6453
-----------------------------------------------------------------------
6454
library ieee;
6455
    use ieee.std_logic_1164.all;
6456
    use ieee.std_logic_misc.all;
6457
    use ieee.numeric_std.all;
6458
 
6459
    use work.LSTTL.all;
6460
    use work.TTLPrivate.all;
6461
 
6462
entity SN74LS157N is
6463
generic(
6464
    tPLH : time := 26 ns;
6465
    tPHL : time := 24 ns
6466
);
6467
port(
6468
    X_1  : in    std_logic;  -- S
6469
    X_2  : in    std_logic;  -- I0A
6470
    X_3  : in    std_logic;  -- I1A
6471
    X_4  : out   std_logic;  -- ZA
6472
    X_5  : in    std_logic;  -- I0B
6473
    X_6  : in    std_logic;  -- I1B
6474
    X_7  : out   std_logic;  -- ZB
6475
    X_8  : inout std_logic;  -- GND
6476
    X_9  : out   std_logic;  -- ZD
6477
    X_10 : in    std_logic;  -- I1D
6478
    X_11 : in    std_logic;  -- I0D
6479
    X_12 : out   std_logic;  -- ZC
6480
    X_13 : in    std_logic;  -- I1C
6481
    X_14 : in    std_logic;  -- I0C
6482
    X_15 : in    std_logic;  -- E\
6483
    X_16 : inout std_logic   -- Vcc
6484
);
6485
end entity SN74LS157N;
6486
 
6487
architecture BEHAV of SN74LS157N is
6488
    signal D : TTLInputs(4 downto 1, 2 downto 1);
6489
    signal Q : std_logic_vector(4 downto 1);
6490
    signal C : natural range 2 downto 1;
6491
 
6492
begin
6493
    C <= 2 when To_bit(X_1) = '1' else 1;
6494
    D <= ((X_10,  X_11), (X_13,  X_14), (X_6,  X_5), (X_3,  X_2));
6495
    (X_9, X_12, X_7, X_4) <= Q;
6496
 
6497
    G: for i in Q'range generate
6498
        signal Z : std_logic;
6499
    begin
6500
        Z <= D(i,C) and not X_15;
6501
 
6502
        OQ: TTLdelay
6503
        generic map(
6504
            tPLH => tPLH,
6505
            tPHL => tPHL
6506
        )
6507
        port map(
6508
            A => Z,
6509
            B => Q(i)
6510
        );
6511
    end generate;
6512
end architecture BEHAV;
6513
 
6514
-----------------------------------------------------------------------
6515
-- SN74LS158N: Quad 2-input multiplexer (common select: inverting)
6516
--             Verified 10/06/2016
6517
-----------------------------------------------------------------------
6518
library ieee;
6519
    use ieee.std_logic_1164.all;
6520
    use ieee.std_logic_misc.all;
6521
    use ieee.numeric_std.all;
6522
 
6523
    use work.LSTTL.all;
6524
    use work.TTLPrivate.all;
6525
 
6526
entity SN74LS158N is
6527
generic(
6528
    tPLH : time := 20 ns;
6529
    tPHL : time := 24 ns
6530
);
6531
port(
6532
    X_1  : in    std_logic;  -- S
6533
    X_2  : in    std_logic;  -- I0A
6534
    X_3  : in    std_logic;  -- I1A
6535
    X_4  : out   std_logic;  -- ZA\
6536
    X_5  : in    std_logic;  -- I0B
6537
    X_6  : in    std_logic;  -- I1B
6538
    X_7  : out   std_logic;  -- ZB\
6539
    X_8  : inout std_logic;  -- GND
6540
    X_9  : out   std_logic;  -- ZD\
6541
    X_10 : in    std_logic;  -- I1D
6542
    X_11 : in    std_logic;  -- I0D
6543
    X_12 : out   std_logic;  -- ZC\
6544
    X_13 : in    std_logic;  -- I1C
6545
    X_14 : in    std_logic;  -- I0C
6546
    X_15 : in    std_logic;  -- E\
6547
    X_16 : inout std_logic   -- Vcc
6548
);
6549
end entity SN74LS158N;
6550
 
6551
architecture BEHAV of SN74LS158N is
6552
    signal D : TTLInputs(4 downto 1, 2 downto 1);
6553
    signal Q : std_logic_vector(4 downto 1);
6554
    signal C : natural range 2 downto 1;
6555
 
6556
begin
6557
    C <= 2 when To_bit(X_1) = '1' else 1;
6558
    D <= ((X_10,  X_11), (X_13,  X_14), (X_6,  X_5), (X_3,  X_2));
6559
    (X_9, X_12, X_7, X_4) <= Q;
6560
 
6561
    G: for i in Q'range generate
6562
        signal Z : std_logic;
6563
    begin
6564
        Z <= not(D(i,C) and not X_15);
6565
 
6566
        OQ: TTLdelay
6567
        generic map(
6568
            tPLH => tPLH,
6569
            tPHL => tPHL
6570
        )
6571
        port map(
6572
            A => Z,
6573
            B => Q(i)
6574
        );
6575
    end generate;
6576
end architecture BEHAV;
6577
 
6578
-----------------------------------------------------------------------
6579
-- SN74LS160N: Synchronous presettable BCD decade counter
6580
--             Verified 10/06/2016
6581
-----------------------------------------------------------------------
6582
library ieee;
6583
    use ieee.std_logic_1164.all;
6584
    use ieee.std_logic_misc.all;
6585
    use ieee.numeric_std.all;
6586
 
6587
    use work.LSTTL.all;
6588
    use work.TTLPrivate.all;
6589
 
6590
entity SN74LS160N is
6591
generic(
6592
    tPLHT : time := 25 ns;
6593
    tPHLT : time := 23 ns;
6594
    tPLHQ : time := 24 ns;
6595
    tPHLQ : time := 27 ns
6596
);
6597
port(
6598
    X_1  : in    std_logic;  -- R\
6599
    X_2  : in    std_logic;  -- CP
6600
    X_3  : in    std_logic;  -- P0
6601
    X_4  : in    std_logic;  -- P1
6602
    X_5  : in    std_logic;  -- P2
6603
    X_6  : in    std_logic;  -- P3
6604
    X_7  : in    std_logic;  -- CEP
6605
    X_8  : inout std_logic;  -- GND
6606
    X_9  : in    std_logic;  -- PE\
6607
    X_10 : in    std_logic;  -- CET
6608
    X_11 : out   std_logic;  -- Q3
6609
    X_12 : out   std_logic;  -- Q2
6610
    X_13 : out   std_logic;  -- Q1
6611
    X_14 : out   std_logic;  -- Q0
6612
    X_15 : out   std_logic;  -- TC
6613
    X_16 : inout std_logic   -- Vcc
6614
);
6615
end entity SN74LS160N;
6616
 
6617
architecture BEHAV of SN74LS160N is
6618
    signal Q : std_logic_vector(3 downto 0);
6619
begin
6620
    (X_11, X_12, X_13, X_14) <= Q;
6621
 
6622
    CT: TTLsynccount
6623
    generic map(
6624
        asyncreset => true,
6625
        modulus    => 10,
6626
        tPLHT      => tPLHT,
6627
        tPHLT      => tPHLT,
6628
        tPLHQ      => tPLHQ,
6629
        tPHLQ      => tPHLQ
6630
    )
6631
    port map(
6632
        PE  => X_9,
6633
        CP  => X_2,
6634
        CEP => X_7,
6635
        CET => X_10,
6636
        RST => X_1,
6637
        TC  => X_15,
6638
        P   => (X_6, X_5, X_4, X_3),
6639
        Q   => Q
6640
    );
6641
end architecture BEHAV;
6642
 
6643
-----------------------------------------------------------------------
6644
-- SN74LS161N: Synchronous presettable 4-bit binary counter
6645
--             Verified 10/06/2016
6646
-----------------------------------------------------------------------
6647
library ieee;
6648
    use ieee.std_logic_1164.all;
6649
    use ieee.std_logic_misc.all;
6650
    use ieee.numeric_std.all;
6651
 
6652
    use work.LSTTL.all;
6653
    use work.TTLPrivate.all;
6654
 
6655
entity SN74LS161N is
6656
generic(
6657
    tPLHT : time := 25 ns;
6658
    tPHLT : time := 23 ns;
6659
    tPLHQ : time := 24 ns;
6660
    tPHLQ : time := 27 ns
6661
);
6662
port(
6663
    X_1  : in    std_logic;  -- R\
6664
    X_2  : in    std_logic;  -- CP
6665
    X_3  : in    std_logic;  -- P0
6666
    X_4  : in    std_logic;  -- P1
6667
    X_5  : in    std_logic;  -- P2
6668
    X_6  : in    std_logic;  -- P3
6669
    X_7  : in    std_logic;  -- CEP
6670
    X_8  : inout std_logic;  -- GND
6671
    X_9  : in    std_logic;  -- PE\
6672
    X_10 : in    std_logic;  -- CET
6673
    X_11 : out   std_logic;  -- Q3
6674
    X_12 : out   std_logic;  -- Q2
6675
    X_13 : out   std_logic;  -- Q1
6676
    X_14 : out   std_logic;  -- Q0
6677
    X_15 : out   std_logic;  -- TC
6678
    X_16 : inout std_logic   -- Vcc
6679
);
6680
end entity SN74LS161N;
6681
 
6682
architecture BEHAV of SN74LS161N is
6683
    signal Q : std_logic_vector(3 downto 0);
6684
begin
6685
    (X_11, X_12, X_13, X_14) <= Q;
6686
 
6687
    CT: TTLsynccount
6688
    generic map(
6689
        asyncreset => true,
6690
        modulus    => 16,
6691
        tPLHT      => tPLHT,
6692
        tPHLT      => tPHLT,
6693
        tPLHQ      => tPLHQ,
6694
        tPHLQ      => tPHLQ
6695
    )
6696
    port map(
6697
        PE  => X_9,
6698
        CP  => X_2,
6699
        CEP => X_7,
6700
        CET => X_10,
6701
        RST => X_1,
6702
        TC  => X_15,
6703
        P   => (X_6, X_5, X_4, X_3),
6704
        Q   => Q
6705
    );
6706
end architecture BEHAV;
6707
 
6708
-----------------------------------------------------------------------
6709
-- SN74LS162N: Synchronous presettable BCD decade counter
6710
--             Verified 10/06/2016
6711
-----------------------------------------------------------------------
6712
library ieee;
6713
    use ieee.std_logic_1164.all;
6714
    use ieee.std_logic_misc.all;
6715
    use ieee.numeric_std.all;
6716
 
6717
    use work.LSTTL.all;
6718
    use work.TTLPrivate.all;
6719
 
6720
entity SN74LS162N is
6721
generic(
6722
    tPLHT : time := 25 ns;
6723
    tPHLT : time := 23 ns;
6724
    tPLHQ : time := 24 ns;
6725
    tPHLQ : time := 27 ns
6726
);
6727
port(
6728
    X_1  : in    std_logic;  -- R\
6729
    X_2  : in    std_logic;  -- CP
6730
    X_3  : in    std_logic;  -- P0
6731
    X_4  : in    std_logic;  -- P1
6732
    X_5  : in    std_logic;  -- P2
6733
    X_6  : in    std_logic;  -- P3
6734
    X_7  : in    std_logic;  -- CEP
6735
    X_8  : inout std_logic;  -- GND
6736
    X_9  : in    std_logic;  -- PE\
6737
    X_10 : in    std_logic;  -- CET
6738
    X_11 : out   std_logic;  -- Q3
6739
    X_12 : out   std_logic;  -- Q2
6740
    X_13 : out   std_logic;  -- Q1
6741
    X_14 : out   std_logic;  -- Q0
6742
    X_15 : out   std_logic;  -- TC
6743
    X_16 : inout std_logic   -- Vcc
6744
);
6745
end entity SN74LS162N;
6746
 
6747
architecture BEHAV of SN74LS162N is
6748
    signal Q : std_logic_vector(3 downto 0);
6749
begin
6750
    (X_11, X_12, X_13, X_14) <= Q;
6751
 
6752
    CT: TTLsynccount
6753
    generic map(
6754
        asyncreset => false,
6755
        modulus    => 10,
6756
        tPLHT      => tPLHT,
6757
        tPHLT      => tPHLT,
6758
        tPLHQ      => tPLHQ,
6759
        tPHLQ      => tPHLQ
6760
    )
6761
    port map(
6762
        PE  => X_9,
6763
        CP  => X_2,
6764
        CEP => X_7,
6765
        CET => X_10,
6766
        RST => X_1,
6767
        TC  => X_15,
6768
        P   => (X_6, X_5, X_4, X_3),
6769
        Q   => Q
6770
    );
6771
end architecture BEHAV;
6772
 
6773
-----------------------------------------------------------------------
6774
-- SN74LS163N: Synchronous presettable 4-bit binary counter
6775
--             Verified 10/06/2016
6776
-----------------------------------------------------------------------
6777
library ieee;
6778
    use ieee.std_logic_1164.all;
6779
    use ieee.std_logic_misc.all;
6780
    use ieee.numeric_std.all;
6781
 
6782
    use work.LSTTL.all;
6783
    use work.TTLPrivate.all;
6784
 
6785
entity SN74LS163N is
6786
generic(
6787
    tPLHT : time := 25 ns;
6788
    tPHLT : time := 23 ns;
6789
    tPLHQ : time := 24 ns;
6790
    tPHLQ : time := 27 ns
6791
);
6792
port(
6793
    X_1  : in    std_logic;  -- R\
6794
    X_2  : in    std_logic;  -- CP
6795
    X_3  : in    std_logic;  -- P0
6796
    X_4  : in    std_logic;  -- P1
6797
    X_5  : in    std_logic;  -- P2
6798
    X_6  : in    std_logic;  -- P3
6799
    X_7  : in    std_logic;  -- CEP
6800
    X_8  : inout std_logic;  -- GND
6801
    X_9  : in    std_logic;  -- PE\
6802
    X_10 : in    std_logic;  -- CET
6803
    X_11 : out   std_logic;  -- Q3
6804
    X_12 : out   std_logic;  -- Q2
6805
    X_13 : out   std_logic;  -- Q1
6806
    X_14 : out   std_logic;  -- Q0
6807
    X_15 : out   std_logic;  -- TC
6808
    X_16 : inout std_logic   -- Vcc
6809
);
6810
end entity SN74LS163N;
6811
 
6812
architecture BEHAV of SN74LS163N is
6813
    signal Q : std_logic_vector(3 downto 0);
6814
begin
6815
    (X_11, X_12, X_13, X_14) <= Q;
6816
 
6817
    CT: TTLsynccount
6818
    generic map(
6819
        asyncreset => false,
6820
        modulus    => 16,
6821
        tPLHT      => tPLHT,
6822
        tPHLT      => tPHLT,
6823
        tPLHQ      => tPLHQ,
6824
        tPHLQ      => tPHLQ
6825
    )
6826
    port map(
6827
        PE  => X_9,
6828
        CP  => X_2,
6829
        CEP => X_7,
6830
        CET => X_10,
6831
        RST => X_1,
6832
        TC  => X_15,
6833
        P   => (X_6, X_5, X_4, X_3),
6834
        Q   => Q
6835
    );
6836
end architecture BEHAV;
6837
 
6838
-----------------------------------------------------------------------
6839
-- SN74LS164N: SIPO shift register
6840
--             Verified 10/06/2016
6841
-----------------------------------------------------------------------
6842
library ieee;
6843
    use ieee.std_logic_1164.all;
6844
 
6845
    use work.LSTTL.all;
6846
    use work.TTLPrivate.all;
6847
 
6848
entity SN74LS164N is
6849
generic(
6850
    tPLH : time := 27 ns;
6851
    tPHL : time := 32 ns
6852
);
6853
port(
6854
    X_1  : in    std_logic;  -- A
6855
    X_2  : in    std_logic;  -- B
6856
    X_3  : out   std_logic;  -- Q0
6857
    X_4  : out   std_logic;  -- Q1
6858
    X_5  : out   std_logic;  -- Q2
6859
    X_6  : out   std_logic;  -- Q3
6860
    X_7  : inout std_logic;  -- GND
6861
    X_8  : in    std_logic;  -- CP
6862
    X_9  : in    std_logic;  -- MR\
6863
    X_10 : out   std_logic;  -- Q4
6864
    X_11 : out   std_logic;  -- Q5
6865
    X_12 : out   std_logic;  -- Q6
6866
    X_13 : out   std_logic;  -- Q7
6867
    X_14 : inout std_logic   -- Vcc
6868
);
6869
end entity SN74LS164N;
6870
 
6871
architecture BEHAV of SN74LS164N is
6872
    signal R, Q : std_logic_vector(7 downto 0);
6873
    signal D    : std_logic;
6874
 
6875
    alias RST : std_logic is X_9;
6876
    alias CLK : std_logic is X_8;
6877
 
6878
begin
6879
    (X_13, X_12, X_11, X_10, X_6, X_5, X_4, X_3) <= Q;
6880
    D <= X_1 and X_2;
6881
 
6882
    process(CLK, RST) is
6883
    begin
6884
        if RST = '0' then
6885
            R <= (others => '0');
6886
        elsif CLK'event and CLK = '1' then
6887
            R <= R(6 downto 0) & D;
6888
        end if;
6889
    end process;
6890
 
6891
    OQ: TTLdelays
6892
    generic map(
6893
        tPLH => tPLH,
6894
        tPHL => tPHL
6895
    )
6896
    port map(
6897
        A => R,
6898
        B => Q
6899
    );
6900
 
6901
end architecture BEHAV;
6902
 
6903
-----------------------------------------------------------------------
6904
-- SN74LS165N: 8-bit parallel-to-serial converter
6905
--             Verified 11/06/2016
6906
-----------------------------------------------------------------------
6907
library ieee;
6908
    use ieee.std_logic_1164.all;
6909
 
6910
    use work.LSTTL.all;
6911
    use work.TTLPrivate.all;
6912
 
6913
entity SN74LS165N is
6914
generic(
6915
    tPLH : time := 30 ns;
6916
    tPHL : time := 30 ns
6917
);
6918
port(
6919
    X_1  : in    std_logic;  -- PL\
6920
    X_2  : in    std_logic;  -- CP1
6921
    X_3  : in    std_logic;  -- P4
6922
    X_4  : in    std_logic;  -- P5
6923
    X_5  : in    std_logic;  -- P6
6924
    X_6  : in    std_logic;  -- P7
6925
    X_7  : out   std_logic;  -- Q7\
6926
    X_8  : inout std_logic;  -- GND
6927
    X_9  : out   std_logic;  -- Q7
6928
    X_10 : in    std_logic;  -- DS
6929
    X_11 : in    std_logic;  -- P0
6930
    X_12 : in    std_logic;  -- P1
6931
    X_13 : in    std_logic;  -- P2
6932
    X_14 : in    std_logic;  -- P3
6933
    X_15 : in    std_logic;  -- CP2
6934
    X_16 : inout std_logic   -- Vcc
6935
);
6936
end entity SN74LS165N;
6937
 
6938
architecture BEHAV of SN74LS165N is
6939
    signal R       : std_logic_vector(7 downto 0);
6940
    signal CLK, N7 : std_logic;
6941
 
6942
    alias CP1 : std_logic is X_2;
6943
    alias CP2 : std_logic is X_15;
6944
    alias DS  : std_logic is X_10;
6945
    alias PL  : std_logic is X_1;
6946
 
6947
begin
6948
    N7  <= not R(7);
6949
    CLK <= not((CP1 and PL) or (CP2 and PL));
6950
 
6951
    process(CLK, PL) is
6952
    begin
6953
        if PL = '0' then
6954
            R <= (X_6, X_5, X_4, X_3, X_14, X_13, X_12, X_11);
6955
        elsif CLK'event and CLK = '0' then
6956
            R <= R(6 downto 0) & DS;
6957
        end if;
6958
    end process;
6959
 
6960
    OQ: TTLdelay
6961
    generic map(
6962
        tPLH => tPLH,
6963
        tPHL => tPHL
6964
    )
6965
    port map(
6966
        A => R(7),
6967
        B => X_9
6968
    );
6969
    OQB: TTLdelay
6970
    generic map(
6971
        tPLH => tPLH,
6972
        tPHL => tPHL
6973
    )
6974
    port map(
6975
        A => N7,
6976
        B => X_7
6977
    );
6978
 
6979
end architecture BEHAV;
6980
 
6981
-----------------------------------------------------------------------
6982
-- SN74LS166N: 8-bit PISO shift register
6983
--             Verified 11/06/2016
6984
-----------------------------------------------------------------------
6985
library ieee;
6986
    use ieee.std_logic_1164.all;
6987
 
6988
    use work.LSTTL.all;
6989
    use work.TTLPrivate.all;
6990
 
6991
entity SN74LS166N is
6992
generic(
6993
    tPLH : time := 18 ns;
6994
    tPHL : time := 27 ns;
6995
    tSU  : time := 20 ns
6996
);
6997
port(
6998
    X_1  : in    std_logic;  -- DS
6999
    X_2  : in    std_logic;  -- P0
7000
    X_3  : in    std_logic;  -- P1
7001
    X_4  : in    std_logic;  -- P2
7002
    X_5  : in    std_logic;  -- P3
7003
    X_6  : in    std_logic;  -- CP2
7004
    X_7  : in    std_logic;  -- CP1
7005
    X_8  : inout std_logic;  -- GND
7006
    X_9  : in    std_logic;  -- MR\
7007
    X_10 : in    std_logic;  -- P4
7008
    X_11 : in    std_logic;  -- P5
7009
    X_12 : in    std_logic;  -- P6
7010
    X_13 : out   std_logic;  -- Q7
7011
    X_14 : in    std_logic;  -- P7
7012
    X_15 : in    std_logic;  -- PE\
7013
    X_16 : inout std_logic   -- Vcc
7014
);
7015
end entity SN74LS166N;
7016
 
7017
architecture BEHAV of SN74LS166N is
7018
    signal CP : std_logic;
7019
    signal R  : std_logic_vector(7 downto 0);
7020
    signal D  : std_logic_vector(7 downto 0);
7021
 
7022
    alias MR  : std_logic is X_9;
7023
    alias PE  : std_logic is X_15;
7024
    alias DS  : std_logic is X_1;
7025
 
7026
begin
7027
    CP <= X_6 or X_7;
7028
    D  <= (X_14, X_12, X_11, X_10, X_5, X_4, X_3, X_2);
7029
 
7030
    process(CP, MR) is
7031
    begin
7032
        if MR = '0' then
7033
            R <= (others => '0');
7034
        elsif CP'event and CP = '1' then
7035
            if PE = '0' then
7036
                assert D'stable(tSU) report "Setup violation" severity failure;
7037
                R <= D;
7038
            else
7039
                R <= R(6 downto 0) & DS;
7040
            end if;
7041
        end if;
7042
    end process;
7043
 
7044
    OQ: TTLdelay
7045
    generic map(
7046
        tPLH => tPLH,
7047
        tPHL => tPHL
7048
    )
7049
    port map(
7050
        A => R(7),
7051
        B => X_13
7052
    );
7053
end architecture BEHAV;
7054
 
7055
-- SN74167N: Synchronous decade rate multiplier
7056
 
7057
-----------------------------------------------------------------------
7058
-- SN74LS168N: Synchronous bidirectional BCD decade counter
7059
--             Verified 11/06/2016
7060
-----------------------------------------------------------------------
7061
library ieee;
7062
    use ieee.std_logic_1164.all;
7063
 
7064
    use work.LSTTL.all;
7065
    use work.TTLPrivate.all;
7066
 
7067
entity SN74LS168N is
7068
generic(
7069
    tPLHQ : time := 20 ns;
7070
    tPHLQ : time := 20 ns;
7071
    tPLHT : time := 30 ns;
7072
    tPHLT : time := 30 ns;
7073
    tSU   : time := 15 ns;
7074
    tSUPE : time := 20 ns
7075
);
7076
port(
7077
    X_1  : in    std_logic;  -- U_D\
7078
    X_2  : in    std_logic;  -- CP
7079
    X_3  : in    std_logic;  -- P0
7080
    X_4  : in    std_logic;  -- P1
7081
    X_5  : in    std_logic;  -- P2
7082
    X_6  : in    std_logic;  -- P3
7083
    X_7  : in    std_logic;  -- CEP\
7084
    X_8  : inout std_logic;  -- GND
7085
    X_9  : in    std_logic;  -- PE\
7086
    X_10 : in    std_logic;  -- CET\
7087
    X_11 : out   std_logic;  -- Q3
7088
    X_12 : out   std_logic;  -- Q2
7089
    X_13 : out   std_logic;  -- Q1
7090
    X_14 : out   std_logic;  -- Q0
7091
    X_15 : out   std_logic;  -- TC\
7092
    X_16 : inout std_logic   -- Vcc
7093
);
7094
end entity SN74LS168N;
7095
 
7096
architecture BEHAV of SN74LS168N is
7097
    signal Z : std_logic_vector(3 downto 0);
7098
begin
7099
    (X_11, X_12, X_13, X_14) <= Z;
7100
 
7101
    CT: TTLbiCount
7102
    generic map(
7103
        decade => true,
7104
        tPLHQ  => tPLHQ,
7105
        tPHLQ  => tPHLQ,
7106
        tPLHT  => tPLHT,
7107
        tPHLT  => tPHLT,
7108
        tSU    => tSU,
7109
        tSUPE  => tSUPE
7110
    )
7111
    port map(
7112
        PE  => X_9,
7113
        CP  => X_2,
7114
        CEP => X_7,
7115
        CET => X_10,
7116
        U_D => X_1,
7117
        P   => (X_6, X_5, X_4, X_3),
7118
        Q   => Z,
7119
        TC  => X_15
7120
    );
7121
end architecture BEHAV;
7122
 
7123
-----------------------------------------------------------------------
7124
-- SN74LS169N: Synchronous bidirectional 4-bit binary counter
7125
--             Verified 11/06/2016
7126
-----------------------------------------------------------------------
7127
library ieee;
7128
    use ieee.std_logic_1164.all;
7129
 
7130
    use work.LSTTL.all;
7131
    use work.TTLPrivate.all;
7132
 
7133
entity SN74LS169N is
7134
generic(
7135
    tPLHQ : time := 20 ns;
7136
    tPHLQ : time := 20 ns;
7137
    tPLHT : time := 30 ns;
7138
    tPHLT : time := 30 ns;
7139
    tSU   : time := 15 ns;
7140
    tSUPE : time := 20 ns
7141
);
7142
port(
7143
    X_1  : in    std_logic;  -- U_D\
7144
    X_2  : in    std_logic;  -- CP
7145
    X_3  : in    std_logic;  -- P0
7146
    X_4  : in    std_logic;  -- P1
7147
    X_5  : in    std_logic;  -- P2
7148
    X_6  : in    std_logic;  -- P3
7149
    X_7  : in    std_logic;  -- CEP\
7150
    X_8  : inout std_logic;  -- GND
7151
    X_9  : in    std_logic;  -- PE\
7152
    X_10 : in    std_logic;  -- CET\
7153
    X_11 : out   std_logic;  -- Q3
7154
    X_12 : out   std_logic;  -- Q2
7155
    X_13 : out   std_logic;  -- Q1
7156
    X_14 : out   std_logic;  -- Q0
7157
    X_15 : out   std_logic;  -- TC\
7158
    X_16 : inout std_logic   -- Vcc
7159
);
7160
end entity SN74LS169N;
7161
 
7162
architecture BEHAV of SN74LS169N is
7163
    signal Z : std_logic_vector(3 downto 0);
7164
begin
7165
    (X_11, X_12, X_13, X_14) <= Z;
7166
 
7167
    CT: TTLbiCount
7168
    generic map(
7169
        decade => false,
7170
        tPLHQ  => tPLHQ,
7171
        tPHLQ  => tPHLQ,
7172
        tPLHT  => tPLHT,
7173
        tPHLT  => tPHLT,
7174
        tSU    => tSU,
7175
        tSUPE  => tSUPE
7176
    )
7177
    port map(
7178
        PE  => X_9,
7179
        CP  => X_2,
7180
        CEP => X_7,
7181
        CET => X_10,
7182
        U_D => X_1,
7183
        P   => (X_6, X_5, X_4, X_3),
7184
        Q   => Z,
7185
        TC  => X_15
7186
    );
7187
end architecture BEHAV;
7188
 
7189
-----------------------------------------------------------------------
7190
-- SN74LS170N: 4 X 4 register file (open collector)
7191
--             Verified 17/07/2016
7192
-----------------------------------------------------------------------
7193
library ieee;
7194
    use ieee.std_logic_1164.all;
7195
    use ieee.std_logic_misc.all;
7196
    use ieee.numeric_std.all;
7197
 
7198
    use work.LSTTL.all;
7199
    use work.TTLPrivate.all;
7200
 
7201
entity SN74LS170N is
7202
generic(
7203
    tPLC : time    := 35 ns;
7204
    tPLA : time    := 35 ns;
7205
    tSUD : time    := 10 ns;
7206
    tSUA : time    := 10 ns
7207
);
7208
port(
7209
    X_1  : in    std_logic;  -- D2
7210
    X_2  : in    std_logic;  -- D3
7211
    X_3  : in    std_logic;  -- D4
7212
    X_4  : in    std_logic;  -- RA1
7213
    X_5  : in    std_logic;  -- RA0
7214
    X_6  : out   std_logic;  -- Q4
7215
    X_7  : out   std_logic;  -- Q3
7216
    X_8  : inout std_logic;  -- GND
7217
    X_9  : out   std_logic;  -- Q2
7218
    X_10 : out   std_logic;  -- Q1
7219
    X_11 : in    std_logic;  -- RE\
7220
    X_12 : in    std_logic;  -- WE\
7221
    X_13 : in    std_logic;  -- WA1
7222
    X_14 : in    std_logic;  -- WA0
7223
    X_15 : in    std_logic;  -- D1
7224
    X_16 : inout std_logic   -- Vcc
7225
);
7226
end entity SN74LS170N;
7227
 
7228
architecture BEHAV of SN74LS170N is
7229
    signal  RE, WE   : std_logic := '1';
7230
    signal  RA, WA   : std_logic_vector(1 downto 0) := (others => '0');
7231
    signal  D,  Q    : std_logic_vector(3 downto 0);
7232
begin
7233
    RE <= X_11;
7234
    WE <= X_12;
7235
    RA <= (X_4, X_5);
7236
    WA <= (X_13, X_14);
7237
    D  <= (X_3, X_2, X_1, X_15);
7238
    (X_6, X_7, X_9, X_10) <= Q;
7239
 
7240
    MB: TTLramblock
7241
    generic map(
7242
        Omode => OpenColl,
7243
        INVT  => '0',
7244
        tPLC  => tPLC,
7245
        tPLA  => tPLA,
7246
        tSUD  => tSUD,
7247
        tSUA  => tSUA
7248
    )
7249
    port map(
7250
        RA    => RA,
7251
        WA    => WA,
7252
        D     => D,
7253
        O     => Q,
7254
        CE    => '0',
7255
        RE    => RE,
7256
        WE    => WE
7257
    );
7258
end architecture BEHAV;
7259
 
7260
-----------------------------------------------------------------------
7261
-- SN74LS173N: 4-bit D-type register (3-state outputs)
7262
--             Verified 17/07/2016
7263
-----------------------------------------------------------------------
7264
library ieee;
7265
    use ieee.std_logic_1164.all;
7266
 
7267
    use work.LSTTL.all;
7268
    use work.TTLPrivate.all;
7269
 
7270
entity SN74LS173N is
7271
generic(
7272
    tSD  : time  := 10 ns;  -- Setup, D to CLK
7273
    tSE  : time  := 17 ns;  -- Setup, IE to CLK
7274
    tPQ  : time  := 40 ns;  -- Delay, CLK to Q
7275
    tQZ  : time  := 20 ns   -- Delay, OE to Z
7276
);
7277
port(
7278
    X_1  : in    std_logic;  -- OE1\
7279
    X_2  : in    std_logic;  -- OE2\
7280
    X_3  : out   std_logic;  -- Q0
7281
    X_4  : out   std_logic;  -- Q1
7282
    X_5  : out   std_logic;  -- Q2
7283
    X_6  : out   std_logic;  -- Q3
7284
    X_7  : in    std_logic;  -- CP
7285
    X_8  : inout std_logic;  -- GND
7286
    X_9  : in    std_logic;  -- IE1\
7287
    X_10 : in    std_logic;  -- IE2\
7288
    X_11 : in    std_logic;  -- D3
7289
    X_12 : in    std_logic;  -- D2
7290
    X_13 : in    std_logic;  -- D1
7291
    X_14 : in    std_logic;  -- D0
7292
    X_15 : in    std_logic;  -- MR
7293
    X_16 : inout std_logic   -- Vcc
7294
);
7295
end entity SN74LS173N;
7296
 
7297
architecture BEHAV of SN74LS173N is
7298
    signal D,  REG : std_logic_vector(3 downto 0);
7299
    signal IE, OE  : std_logic;
7300
 
7301
    alias CLK is X_7;
7302
    alias MR  is X_15;
7303
 
7304
begin
7305
    IE <= X_9 or X_10;
7306
    OE <= X_1 or X_2 after tQZ;
7307
    (X_6, X_5, X_4, X_3) <= REG when OE = '0' else (others => 'Z');
7308
 
7309
    D <= (X_11, X_12, X_13, X_14);
7310
 
7311
    RG: process(CLK, MR) is
7312
    begin
7313
        if MR = '1' then
7314
            REG <= (others => '0');
7315
        elsif rising_edge(CLK) then
7316
            assert D'stable(tSD)  report "D setup violation"  severity failure;
7317
            assert IE'stable(tSE) report "IE setup violation" severity failure;
7318
 
7319
            if IE = '0' then
7320
                REG <= D after tSD;
7321
            end if;
7322
        end if;
7323
    end process;
7324
 
7325
end architecture BEHAV;
7326
 
7327
-----------------------------------------------------------------------
7328
-- SN74LS174N: Hex D-flipflop
7329
--             Verified 17/07/2016
7330
-----------------------------------------------------------------------
7331
library ieee;
7332
    use ieee.std_logic_1164.all;
7333
 
7334
    use work.LSTTL.all;
7335
    use work.TTLPrivate.all;
7336
 
7337
entity SN74LS174N is
7338
generic(
7339
    tSU  : time := 10 ns;
7340
    tPD  : time := 25 ns
7341
);
7342
port(
7343
    X_1  : in    std_logic;  -- MR\
7344
    X_2  : out   std_logic;  -- Q0
7345
    X_3  : in    std_logic;  -- D0
7346
    X_4  : in    std_logic;  -- D1
7347
    X_5  : out   std_logic;  -- Q1
7348
    X_6  : in    std_logic;  -- D2
7349
    X_7  : out   std_logic;  -- Q2
7350
    X_8  : inout std_logic;  -- GND
7351
    X_9  : in    std_logic;  -- CP
7352
    X_10 : out   std_logic;  -- Q3
7353
    X_11 : in    std_logic;  -- D3
7354
    X_12 : out   std_logic;  -- Q4
7355
    X_13 : in    std_logic;  -- D4
7356
    X_14 : in    std_logic;  -- D5
7357
    X_15 : out   std_logic;  -- Q5
7358
    X_16 : inout std_logic   -- Vcc
7359
);
7360
end entity SN74LS174N;
7361
 
7362
architecture BEHAV of SN74LS174N is
7363
    signal D, Q : std_logic_vector(5 downto 0);
7364
    alias  CLK is X_9;
7365
    alias  MR  is X_1;
7366
 
7367
begin
7368
    D <= (X_14, X_13, X_11, X_6, X_4, X_3);
7369
    (X_15, X_12, X_10, X_7, X_5, X_2) <= Q;
7370
 
7371
    RG: process(CLK, MR) is
7372
    begin
7373
        if MR = '0' then
7374
            Q <= (others => '0');
7375
        elsif rising_edge(CLK) then
7376
            assert D'stable(tSU) report "tSU failure" severity failure;
7377
            Q <= D after tPD;
7378
        end if;
7379
    end process;
7380
 
7381
end architecture BEHAV;
7382
 
7383
-----------------------------------------------------------------------
7384
-- SN74LS175N: Quad D-flipflop
7385
--             Verified 17/07/2016
7386
-----------------------------------------------------------------------
7387
library ieee;
7388
    use ieee.std_logic_1164.all;
7389
 
7390
    use work.LSTTL.all;
7391
    use work.TTLPrivate.all;
7392
 
7393
entity SN74LS175N is
7394
generic(
7395
    tSU  : time := 10 ns;
7396
    tPD  : time := 25 ns
7397
);
7398
port(
7399
    X_1  : in    std_logic;  -- MR\
7400
    X_2  : out   std_logic;  -- Q0
7401
    X_3  : out   std_logic;  -- Q0\
7402
    X_4  : in    std_logic;  -- D0
7403
    X_5  : in    std_logic;  -- D1
7404
    X_6  : out   std_logic;  -- Q1\
7405
    X_7  : out   std_logic;  -- Q1
7406
    X_8  : inout std_logic;  -- GND
7407
    X_9  : in    std_logic;  -- CP
7408
    X_10 : out   std_logic;  -- Q2
7409
    X_11 : out   std_logic;  -- Q2\
7410
    X_12 : in    std_logic;  -- D2
7411
    X_13 : in    std_logic;  -- D3
7412
    X_14 : out   std_logic;  -- Q3\
7413
    X_15 : out   std_logic;  -- Q3
7414
    X_16 : inout std_logic   -- Vcc
7415
);
7416
end entity SN74LS175N;
7417
 
7418
architecture BEHAV of SN74LS175N is
7419
    signal D, Q, QB : std_logic_vector(3 downto 0);
7420
    alias  CLK is X_9;
7421
    alias  MR  is X_1;
7422
 
7423
begin
7424
    D <= (X_13, X_12, X_5, X_4);
7425
    (X_15, X_10, X_7, X_2) <= Q;
7426
    (X_14, X_11, X_6, X_3) <= QB;
7427
    QB <= not Q;
7428
 
7429
    RG: process(CLK, MR) is
7430
    begin
7431
        if MR = '0' then
7432
            Q <= (others => '0');
7433
        elsif rising_edge(CLK) then
7434
            assert D'stable(tSU) report "tSU failure" severity failure;
7435
            Q <= D after tPD;
7436
        end if;
7437
    end process;
7438
end architecture BEHAV;
7439
 
7440
-----------------------------------------------------------------------
7441
-- SN74176N: Presettable decade counter
7442
--           Verified 19/07/2016
7443
-----------------------------------------------------------------------
7444
library ieee;
7445
    use ieee.std_logic_1164.all;
7446
 
7447
    use work.LSTTL.all;
7448
    use work.TTLPrivate.all;
7449
 
7450
entity SN74176N is
7451
generic(
7452
    tPLH0 : time := 13 ns;
7453
    tPHL0 : time := 17 ns;
7454
    tPLH1 : time := 17 ns;
7455
    tPHL1 : time := 26 ns;
7456
    tPLH2 : time := 41 ns;
7457
    tPHL2 : time := 51 ns;
7458
    tPLH3 : time := 20 ns;
7459
    tPHL3 : time := 26 ns
7460
);
7461
port(
7462
    X_1  : in    std_logic;  -- PL\
7463
    X_2  : out   std_logic;  -- Q2
7464
    X_3  : in    std_logic;  -- P2
7465
    X_4  : in    std_logic;  -- P0
7466
    X_5  : out   std_logic;  -- Q0
7467
    X_6  : in    std_logic;  -- CP1\
7468
    X_7  : inout std_logic;  -- GND
7469
    X_8  : in    std_logic;  -- CP0\
7470
    X_9  : out   std_logic;  -- Q1
7471
    X_10 : in    std_logic;  -- P1
7472
    X_11 : in    std_logic;  -- P3
7473
    X_12 : out   std_logic;  -- Q3
7474
    X_13 : in    std_logic;  -- MR\
7475
    X_14 : inout std_logic   -- Vcc
7476
);
7477
end entity SN74176N;
7478
 
7479
architecture BEHAV of SN74176N is
7480
    signal p, q : std_logic_vector(3 downto 0);
7481
 
7482
begin
7483
    p <= (X_11, X_3, X_10, X_4);
7484
    (X_12, X_2, X_9, X_5) <= q;
7485
 
7486
    M1: TTLcount4
7487
    generic map(
7488
        tPLH0   => tPLH0,
7489
        tPHL0   => tPHL0,
7490
        tPLH1   => tPLH1,
7491
        tPHL1   => tPHL1,
7492
        tPLH2   => tPLH2,
7493
        tPHL2   => tPHL2,
7494
        tPLH3   => tPLH3,
7495
        tPHL3   => tPHL3,
7496
        modulus => 10
7497
    )
7498
    port map(
7499
        ld   => X_1,
7500
        d    => p,
7501
        clka => X_8,
7502
        clkb => X_6,
7503
        rst  => X_13,
7504
        set  => '1',
7505
        val  => q
7506
    );
7507
end architecture BEHAV;
7508
 
7509
-----------------------------------------------------------------------
7510
-- SN74177N: Presettable binary counter
7511
--           Verified 19/07/2016
7512
-----------------------------------------------------------------------
7513
library ieee;
7514
    use ieee.std_logic_1164.all;
7515
 
7516
    use work.LSTTL.all;
7517
    use work.TTLPrivate.all;
7518
 
7519
entity SN74177N is
7520
generic(
7521
    tPLH0 : time := 13 ns;
7522
    tPHL0 : time := 17 ns;
7523
    tPLH1 : time := 17 ns;
7524
    tPHL1 : time := 26 ns;
7525
    tPLH2 : time := 41 ns;
7526
    tPHL2 : time := 51 ns;
7527
    tPLH3 : time := 66 ns;
7528
    tPHL3 : time := 75 ns
7529
);
7530
port(
7531
    X_1  : in    std_logic;  -- PL\
7532
    X_2  : out   std_logic;  -- Q2
7533
    X_3  : in    std_logic;  -- P2
7534
    X_4  : in    std_logic;  -- P0
7535
    X_5  : out   std_logic;  -- Q0
7536
    X_6  : in    std_logic;  -- CP1\
7537
    X_7  : inout std_logic;  -- GND
7538
    X_8  : in    std_logic;  -- CP0\
7539
    X_9  : out   std_logic;  -- Q1
7540
    X_10 : in    std_logic;  -- P1
7541
    X_11 : in    std_logic;  -- P3
7542
    X_12 : out   std_logic;  -- Q3
7543
    X_13 : in    std_logic;  -- MR\
7544
    X_14 : inout std_logic   -- Vcc
7545
);
7546
end entity SN74177N;
7547
 
7548
architecture BEHAV of SN74177N is
7549
    signal p, q : std_logic_vector(3 downto 0);
7550
 
7551
begin
7552
    p <= (X_11, X_3, X_10, X_4);
7553
    (X_12, X_2, X_9, X_5) <= q;
7554
 
7555
    M1: TTLcount4
7556
    generic map(
7557
        tPLH0   => tPLH0,
7558
        tPHL0   => tPHL0,
7559
        tPLH1   => tPLH1,
7560
        tPHL1   => tPHL1,
7561
        tPLH2   => tPLH2,
7562
        tPHL2   => tPHL2,
7563
        tPLH3   => tPLH3,
7564
        tPHL3   => tPHL3,
7565
        modulus => 16
7566
    )
7567
    port map(
7568
        ld   => X_1,
7569
        d    => p,
7570
        clka => X_8,
7571
        clkb => X_6,
7572
        rst  => X_13,
7573
        set  => '1',
7574
        val  => q
7575
    );
7576
end architecture BEHAV;
7577
 
7578
-----------------------------------------------------------------------
7579
-- SN74178N: 4-bit shift register
7580
--           Verified 20/07/2016
7581
-----------------------------------------------------------------------
7582
library ieee;
7583
    use ieee.std_logic_1164.all;
7584
 
7585
    use work.LSTTL.all;
7586
    use work.TTLPrivate.all;
7587
 
7588
entity SN74178N is
7589
generic(
7590
    tDL  : time := 36 ns;
7591
    tSU  : time := 35 ns
7592
);
7593
port(
7594
    X_1  : in    std_logic;  -- P1
7595
    X_2  : in    std_logic;  -- P0
7596
    X_3  : in    std_logic;  -- DS
7597
    X_4  : out   std_logic;  -- Q0
7598
    X_5  : in    std_logic;  -- CP\
7599
    X_6  : out   std_logic;  -- Q1
7600
    X_7  : inout std_logic;  -- GND
7601
    X_8  : out   std_logic;  -- Q2
7602
    X_9  : in    std_logic;  -- PE
7603
    X_10 : out   std_logic;  -- Q3
7604
    X_11 : in    std_logic;  -- SE
7605
    X_12 : in    std_logic;  -- P3
7606
    X_13 : in    std_logic;  -- P2
7607
    X_14 : inout std_logic   -- Vcc
7608
);
7609
end entity SN74178N;
7610
 
7611
architecture BEHAV of SN74178N is
7612
begin
7613
    C: SN74179N             -- 74178 is 74179, with MR\ & Q3\ deleted
7614
    generic map(
7615
        tDL  => tDL,
7616
        tSU  => tSU
7617
    )
7618
    port map(
7619
        X_1  => '1',  -- MR\
7620
        X_2  => X_1,  -- P1
7621
        X_3  => X_2,  -- P0
7622
        X_4  => X_3,  -- DS
7623
        X_5  => X_4,  -- Q0
7624
        X_6  => X_5,  -- CP\
7625
        X_7  => X_6,  -- Q1
7626
        X_8  => open, -- GND
7627
        X_9  => X_8,  -- Q2
7628
        X_10 => X_9,  -- PE
7629
        X_11 => X_10, -- Q3
7630
        X_12 => open, -- Q3\
7631
        X_13 => X_11, -- SE
7632
        X_14 => X_12, -- P3
7633
        X_15 => X_13, -- P2
7634
        X_16 => open  -- Vcc
7635
    );
7636
end architecture BEHAV;
7637
 
7638
-----------------------------------------------------------------------
7639
-- SN74179N: 4-bit shift register
7640
--           Verified 20/07/2016
7641
-----------------------------------------------------------------------
7642
library ieee;
7643
    use ieee.std_logic_1164.all;
7644
 
7645
    use work.LSTTL.all;
7646
    use work.TTLPrivate.all;
7647
 
7648
entity SN74179N is
7649
generic(
7650
    tDL  : time := 36 ns;
7651
    tSU  : time := 35 ns
7652
);
7653
port(
7654
    X_1  : in    std_logic;  -- MR\
7655
    X_2  : in    std_logic;  -- P1
7656
    X_3  : in    std_logic;  -- P0
7657
    X_4  : in    std_logic;  -- DS
7658
    X_5  : out   std_logic;  -- Q0
7659
    X_6  : in    std_logic;  -- CP\ (falling)
7660
    X_7  : out   std_logic;  -- Q1
7661
    X_8  : inout std_logic;  -- GND
7662
    X_9  : out   std_logic;  -- Q2
7663
    X_10 : in    std_logic;  -- PE
7664
    X_11 : out   std_logic;  -- Q3
7665
    X_12 : out   std_logic;  -- Q3\
7666
    X_13 : in    std_logic;  -- SE
7667
    X_14 : in    std_logic;  -- P3
7668
    X_15 : in    std_logic;  -- P2
7669
    X_16 : inout std_logic   -- Vcc
7670
);
7671
end entity SN74179N;
7672
 
7673
architecture BEHAV of SN74179N is
7674
    signal D, REG, Q : std_logic_vector(3 downto 0);
7675
 
7676
    alias  CLK is X_6;
7677
    alias  MR  is X_1;
7678
    alias  DS  is X_4;
7679
    alias  PE  is X_10;
7680
    alias  SE  is X_13;
7681
 
7682
begin
7683
    D <= (X_14, X_15, X_2, X_3);
7684
    (X_11, X_9, X_7, X_5) <= Q;
7685
    X_12 <= not Q(3);
7686
 
7687
    process(MR, CLK) is
7688
    begin
7689
        if MR = '0' then
7690
            REG <= (others => '0');
7691
        elsif falling_edge(CLK) then
7692
            assert SE'stable(tSU) report "SE violation" severity failure;
7693
            assert PE'stable(tSU) report "PE violation" severity failure;
7694
            assert D'stable(tSU)  report "Data violation" severity failure;
7695
            assert DS'stable(tSU) report "DS violation" severity failure;
7696
            if SE = '1' then
7697
                REG <= REG(2 downto 0) & DS;
7698
            elsif PE = '1' then
7699
                REG <= D;
7700
            end if;
7701
        end if;
7702
    end process;
7703
 
7704
    Q <= REG after tDL;
7705
 
7706
end architecture BEHAV;
7707
 
7708
-----------------------------------------------------------------------
7709
-- SN74180N: 8-bit parity generator/checker
7710
--           Verified 20/07/2016
7711
-----------------------------------------------------------------------
7712
library ieee;
7713
    use ieee.std_logic_1164.all;
7714
    use ieee.std_logic_misc.all;
7715
 
7716
    use work.LSTTL.all;
7717
    use work.TTLPrivate.all;
7718
 
7719
entity SN74180N is
7720
generic(
7721
    tPI  : time  := 68 ns;
7722
    tPE  : time  := 20 ns
7723
);
7724
port(
7725
    X_1  : in    std_logic;  -- I6
7726
    X_2  : in    std_logic;  -- I7
7727
    X_3  : in    std_logic;  -- EI
7728
    X_4  : in    std_logic;  -- OI
7729
    X_5  : out   std_logic;  -- SE
7730
    X_6  : out   std_logic;  -- SO
7731
    X_7  : inout std_logic;  -- GND
7732
    X_8  : in    std_logic;  -- I0
7733
    X_9  : in    std_logic;  -- I1
7734
    X_10 : in    std_logic;  -- I2
7735
    X_11 : in    std_logic;  -- I3
7736
    X_12 : in    std_logic;  -- I4
7737
    X_13 : in    std_logic;  -- I5
7738
    X_14 : inout std_logic   -- Vcc
7739
);
7740
end entity SN74180N;
7741
 
7742
architecture BEHAV of SN74180N is
7743
    signal IP, OI, EI : std_logic;
7744
    signal I  : std_logic_vector(7 downto 0);
7745
begin
7746
    I   <= (X_8, X_9, X_10, X_11, X_12, X_13, X_1, X_2);
7747
    IP  <= xnor_reduce(I) after tPI;
7748
    OI  <= X_4 after tPE;
7749
    EI  <= X_3 after tPE;
7750
    X_5 <= not ((IP and OI) or (EI and not IP));
7751
    X_6 <= not ((IP and EI) or (OI and not IP));
7752
end architecture BEHAV;
7753
 
7754
-----------------------------------------------------------------------
7755
-- SN74LS181N: 4-bit arithmetic/logic unit
7756
--             Verified 31/07/2016
7757
-----------------------------------------------------------------------
7758
library ieee;
7759
    use ieee.std_logic_1164.all;
7760
    use ieee.std_logic_misc.all;
7761
    use ieee.numeric_std.all;
7762
 
7763
    use work.LSTTL.all;
7764
    use work.TTLPrivate.all;
7765
 
7766
entity SN74LS181N is
7767
generic(
7768
    T1   : time :=  7 ns;
7769
    T2   : time := 19 ns;
7770
    T3   : time := 16 ns;
7771
    T4   : time := 25 ns;
7772
    T5   : time := 29 ns
7773
);
7774
port(
7775
    X_1  : in    std_logic;  -- B0\
7776
    X_2  : in    std_logic;  -- A0\
7777
    X_3  : in    std_logic;  -- S3
7778
    X_4  : in    std_logic;  -- S2
7779
    X_5  : in    std_logic;  -- S1
7780
    X_6  : in    std_logic;  -- S0
7781
    X_7  : in    std_logic;  -- Cn
7782
    X_8  : in    std_logic;  -- M
7783
    X_9  : out   std_logic;  -- F0\
7784
    X_10 : out   std_logic;  -- F1\
7785
    X_11 : out   std_logic;  -- F2\
7786
    X_12 : inout std_logic;  -- GND
7787
    X_13 : out   std_logic;  -- F3\
7788
    X_14 : out   std_logic;  -- A=B
7789
    X_15 : out   std_logic;  -- P\
7790
    X_16 : out   std_logic;  -- Cn+4
7791
    X_17 : out   std_logic;  -- G\
7792
    X_18 : in    std_logic;  -- B3\
7793
    X_19 : in    std_logic;  -- A3\
7794
    X_20 : in    std_logic;  -- B2\
7795
    X_21 : in    std_logic;  -- A2\
7796
    X_22 : in    std_logic;  -- B1\
7797
    X_23 : in    std_logic;  -- A1\
7798
    X_24 : inout std_logic   -- Vcc
7799
);
7800
end entity SN74LS181N;
7801
 
7802
architecture BEHAV of SN74LS181N is
7803
    alias CN   is X_7;
7804
    alias M    is X_8;
7805
    alias EQB  is X_14;
7806
    alias CO   is X_16;
7807
    alias G    is X_17;
7808
    alias P    is X_15;
7809
 
7810
    signal A, B, F, BN, X, Y, N, L, Z, QI : unsigned(3 downto 0);
7811
 
7812
    signal S   : std_logic_vector(3 downto 0);
7813
 
7814
    signal MN  : std_logic;
7815
    signal L1 : std_logic;
7816
    signal L2 : std_logic;
7817
    signal L3 : std_logic;
7818
    signal L4 : std_logic;
7819
    signal L5 : std_logic;
7820
    signal L6 : std_logic;
7821
    signal L7 : std_logic;
7822
    signal L8 : std_logic;
7823
    signal L9 : std_logic;
7824
    signal LA : std_logic;
7825
    signal LB  : std_logic;
7826
    signal LC : std_logic;
7827
 
7828
begin
7829
    A  <= (X_19, X_21, X_23, X_2);
7830
    B  <= (X_18, X_20, X_22, X_1);
7831
    S  <= (X_3, X_4, X_5, X_6);
7832
    BN <= not B;
7833
    MN <= not ( M );
7834
 
7835
    G1: for i in A'range generate
7836
        Y(i) <= not ( (  B(i) and S(3) and A(i) ) or ( A(i) and S(2) and BN(i) ) );
7837
        X(i) <= not ( ( BN(i) and S(1) )          or ( S(0) and B(i) ) or A(i) );
7838
        N(i) <= ( Y(i) and not X(i) ) after T5;
7839
    end generate;
7840
 
7841
    Z(3)  <= ( X(3) ) after T1;
7842
    Z(2)  <= ( Y(3) and X(2) ) after T1;
7843
    Z(1)  <= ( Y(3) and Y(2) and X(1) ) after T1;
7844
    Z(0)  <= ( Y(3) and Y(2) and Y(1) and X(0) ) after T1;
7845
    L1    <= not ( Y(3) and Y(2) and Y(1) and Y(0) and CN );
7846
    L2    <= ( CN and Y(0) and Y(1) and Y(2) and MN );
7847
    L3    <= ( Y(1) and Y(2) and X(0) and MN );
7848
    L4    <= ( Y(2) and X(1) and MN );
7849
    L5    <= ( X(2) and MN );
7850
    L6    <= ( CN and Y(0) and Y(1) and MN );
7851
    L7    <= ( Y(1) and X(0) and MN );
7852
    L8    <= ( X(1) and MN );
7853
    L9    <= ( CN and Y(0) and MN );
7854
    LA    <= ( X(0) and MN );
7855
    L(0)  <= not ( CN and MN );
7856
    L(3)  <= not ( L2 or L3 or L4 or L5 );
7857
    L(2)  <= not ( L6 or L7 or L8 );
7858
    L(1)  <= not ( L9 or LA );
7859
    LC    <= nor_reduce(std_logic_vector(Z)) after T2;
7860
    G     <= LC;
7861
    LB    <= ( LC ) after T1;
7862
    CO    <= not ( LB and L1 ) after T2;
7863
    P     <= nand_reduce(std_logic_vector(Y)) after T4;
7864
    F     <= ( N xor L ) after T2;
7865
 
7866
    G2: for i in 3 downto 1 generate
7867
        QI(i) <= ( F(i) ) after T5;
7868
    end generate;
7869
 
7870
    QI(0) <= F(0);     -- NB no delay
7871
    EQB   <= and_reduce(std_logic_vector(QI)) after T3;
7872
    (X_13, X_11, X_10, X_9) <= F;
7873
 
7874
end architecture BEHAV;
7875
 
7876
-----------------------------------------------------------------------
7877
-- SN74LS182N: Fast carry unit for 4 x LS181
7878
--             Verified 31/07/2016
7879
-----------------------------------------------------------------------
7880
library ieee;
7881
    use ieee.std_logic_1164.all;
7882
    use ieee.std_logic_misc.all;
7883
 
7884
    use work.LSTTL.all;
7885
    use work.TTLPrivate.all;
7886
 
7887
entity SN74LS182N is
7888
generic(
7889
    tCLH : time := 10   ns;
7890
    tCHL : time := 11.5 ns;
7891
    tGLH : time :=  7.5 ns;
7892
    tGHL : time := 10.5 ns;
7893
    tPLH : time :=  6.5 ns;
7894
    tPHL : time := 10   ns
7895
);
7896
port(
7897
    X_1  : in    std_logic;  -- G1
7898
    X_2  : in    std_logic;  -- P1
7899
    X_3  : in    std_logic;  -- G0
7900
    X_4  : in    std_logic;  -- P0
7901
    X_5  : in    std_logic;  -- G3
7902
    X_6  : in    std_logic;  -- P3
7903
    X_7  : out   std_logic;  -- P
7904
    X_8  : inout std_logic;  -- GND
7905
    X_9  : out   std_logic;  -- Cnz
7906
    X_10 : out   std_logic;  -- G
7907
    X_11 : out   std_logic;  -- Cny
7908
    X_12 : out   std_logic;  -- Cnx
7909
    X_13 : in    std_logic;  -- Cn
7910
    X_14 : in    std_logic;  -- G2
7911
    X_15 : in    std_logic;  -- P2
7912
    X_16 : inout std_logic   -- Vcc
7913
);
7914
end entity SN74LS182N;
7915
 
7916
architecture BEHAV of SN74LS182N is
7917
    alias  G1   is X_1;
7918
    alias  P1   is X_2;
7919
    alias  G0   is X_3;
7920
    alias  P0   is X_4;
7921
    alias  G3   is X_5;
7922
    alias  P3   is X_6;
7923
    alias  Cn   is X_13;
7924
    alias  G2   is X_14;
7925
    alias  P2   is X_15;
7926
 
7927
    signal NC   : std_logic;
7928
    signal Cnx, Cny, Cnz, PI, GI  : std_logic;
7929
 
7930
begin
7931
    NC  <= not Cn;
7932
    PI  <= or_reduce(P3 & P2 & P1 & P0);
7933
    GI  <= and_reduce(G3 & G2 & G1 & G0) or
7934
               and_reduce(G3 & G2 & G1 & P1) or
7935
               and_reduce(G3 & G2 & P2) or (G3 and P3);
7936
    Cnz <= not(and_reduce(G2 & G1 & G0 & NC) or
7937
               and_reduce(G2 & G1 & G0 & P0) or
7938
               and_reduce(G2 & G1 & P1) or (G2 and P2));
7939
    Cny <= not(and_reduce(G1 & G0 & NC) or
7940
               and_reduce(G1 & G0 & P0) or (G1 and P1));
7941
    Cnx <= not((G0 and NC) or (G0 and P0));
7942
 
7943
    T1: TTLdelay
7944
        generic map(
7945
            tPLH => tCLH,
7946
            tPHL => tCHL
7947
        )
7948
        port map(
7949
            A => Cnx,
7950
            B => X_12
7951
        );
7952
 
7953
    T2: TTLdelay
7954
        generic map(
7955
            tPLH => tCLH,
7956
            tPHL => tCHL
7957
        )
7958
        port map(
7959
            A => Cny,
7960
            B => X_11
7961
        );
7962
 
7963
    T3: TTLdelay
7964
        generic map(
7965
            tPLH => tCLH,
7966
            tPHL => tCHL
7967
        )
7968
        port map(
7969
            A => Cnz,
7970
            B => X_9
7971
        );
7972
 
7973
    T4: TTLdelay
7974
        generic map(
7975
            tPLH => tPLH,
7976
            tPHL => tPHL
7977
        )
7978
        port map(
7979
            A => PI,
7980
            B => X_7
7981
        );
7982
 
7983
    T5: TTLdelay
7984
        generic map(
7985
            tPLH => tGLH,
7986
            tPHL => tGHL
7987
        )
7988
        port map(
7989
            A => GI,
7990
            B => X_10
7991
        );
7992
 
7993
end architecture BEHAV;
7994
 
7995
-----------------------------------------------------------------------
7996
-- SN74H183N: Dual high-speed adder
7997
--            Verified 31/07/2016
7998
-----------------------------------------------------------------------
7999
library ieee;
8000
    use ieee.std_logic_1164.all;
8001
    use ieee.std_logic_misc.all;
8002
    use ieee.numeric_std.all;
8003
 
8004
    use work.LSTTL.all;
8005
    use work.TTLPrivate.all;
8006
 
8007
entity SN74H183N is
8008
generic(
8009
    tPLH : time := 15 ns;
8010
    tPHL : time := 18 ns
8011
);
8012
port(
8013
    X_1  : in    std_logic;  -- Aa
8014
                             -- 
8015
    X_3  : in    std_logic;  -- Ba
8016
    X_4  : in    std_logic;  -- CIa
8017
    X_5  : out   std_logic;  -- COa
8018
    X_6  : out   std_logic;  -- Sa
8019
    X_7  : inout std_logic;  -- GND
8020
    X_8  : out   std_logic;  -- Sb
8021
                             -- 
8022
    X_10 : out   std_logic;  -- COb
8023
    X_11 : in    std_logic;  -- CIb
8024
    X_12 : in    std_logic;  -- Bb
8025
    X_13 : in    std_logic;  -- Ab
8026
    X_14 : inout std_logic   -- Vcc
8027
);
8028
end entity SN74H183N;
8029
 
8030
architecture BEHAV of SN74H183N is
8031
    signal CI, A, B, S, CO : std_logic_vector(1 downto 0);  -- Order b, a
8032
begin
8033
    CI <= (X_11, X_4);
8034
    A  <= (X_13, X_1);
8035
    B  <= (X_12, X_3);
8036
 
8037
    ( X_8, X_6) <= S;
8038
    (X_10, X_5) <= CO;
8039
 
8040
    G: for i in A'range generate
8041
        signal AA, BB, R : unsigned(1 downto 0);
8042
        signal Y,  Z     : std_logic_vector(1 downto 0);
8043
    begin
8044
        AA <= ('0', A(i));
8045
        BB <= ('0', B(i));
8046
        R  <= AA + BB + CI(i);
8047
        Y  <= std_logic_vector(R);
8048
 
8049
        T1: TTLdelays
8050
        generic map(
8051
            tPLH => tPLH,
8052
            tPHL => tPHL
8053
        )
8054
        port map(
8055
            A => Y,
8056
            B => Z
8057
        );
8058
 
8059
        S(i)  <= Z(0);
8060
        CO(i) <= Z(1);
8061
    end generate;
8062
 
8063
end architecture BEHAV;
8064
 
8065
-----------------------------------------------------------------------
8066
-- SN74LS189N: 64-bit random-access memory (3-state outputs)
8067
--             Verified 18/07/2016
8068
-----------------------------------------------------------------------
8069
library ieee;
8070
    use ieee.std_logic_1164.all;
8071
    use ieee.std_logic_misc.all;
8072
    use ieee.numeric_std.all;
8073
 
8074
    use work.LSTTL.all;
8075
    use work.TTLPrivate.all;
8076
 
8077
entity SN74LS189N is
8078
generic(
8079
    tPLC : time    := 10 ns;
8080
    tPLA : time    := 37 ns;
8081
    tSUD : time    := 25 ns;
8082
    tSUA : time    := 10 ns
8083
);
8084
port(
8085
    X_1  : in    std_logic;  -- A0
8086
    X_2  : in    std_logic;  -- CS\
8087
    X_3  : in    std_logic;  -- WE\
8088
    X_4  : in    std_logic;  -- D1
8089
    X_5  : out   std_logic;  -- Q1\
8090
    X_6  : in    std_logic;  -- D2
8091
    X_7  : out   std_logic;  -- Q2\
8092
    X_8  : inout std_logic;  -- GND
8093
    X_9  : out   std_logic;  -- Q3\
8094
    X_10 : in    std_logic;  -- D3
8095
    X_11 : out   std_logic;  -- Q4\
8096
    X_12 : in    std_logic;  -- D4
8097
    X_13 : in    std_logic;  -- A3
8098
    X_14 : in    std_logic;  -- A2
8099
    X_15 : in    std_logic;  -- A1
8100
    X_16 : inout std_logic   -- Vcc
8101
);
8102
end entity SN74LS189N;
8103
 
8104
architecture BEHAV of SN74LS189N is
8105
    signal  RE, WE      : std_logic := '1';
8106
    signal  IA          : std_logic_vector(3 downto 0) := (others => '0');
8107
    signal  D, QB, Q    : std_logic_vector(3 downto 0);
8108
begin
8109
    RE <= not(    X_3 and not X_2);
8110
    WE <= not(not X_3 and not X_2);
8111
    IA <=    (X_13, X_14, X_15, X_1);
8112
    D  <=    (X_12, X_10, X_6, X_4);
8113
    (X_11, X_9, X_7, X_5) <= Q;
8114
 
8115
    MB: TTLramblock
8116
    generic map(
8117
        Omode => TriState,
8118
        INVT  => '1',
8119
        tPLC  => tPLC,
8120
        tPLA  => tPLA,
8121
        tSUD  => tSUD,
8122
        tSUA  => tSUA
8123
    )
8124
    port map(
8125
        RA    => IA,
8126
        WA    => IA,
8127
        D     => D,
8128
        O     => Q,
8129
        CE    => '0',
8130
        RE    => RE,
8131
        WE    => WE
8132
    );
8133
end architecture BEHAV;
8134
 
8135
-----------------------------------------------------------------------
8136
-- SN74LS190N: Up/down decade counter
8137
--             Verified 01/08/2016
8138
-----------------------------------------------------------------------
8139
library ieee;
8140
    use ieee.std_logic_1164.all;
8141
    use ieee.std_logic_misc.all;
8142
    use ieee.numeric_std.all;
8143
 
8144
    use work.LSTTL.all;
8145
    use work.TTLPrivate.all;
8146
 
8147
entity SN74LS190N is
8148
generic(
8149
    MODULUS : positive := 10;
8150
    tQLH    : time     := 24 ns;
8151
    tQHL    : time     := 36 ns;
8152
    tTLH    : time     := 42 ns;
8153
    tTHL    : time     := 52 ns;
8154
    tRLH    : time     := 20 ns;
8155
    tRHL    : time     := 24 ns
8156
);
8157
port(
8158
    X_1  : in    std_logic;  -- P1
8159
    X_2  : out   std_logic;  -- Q1
8160
    X_3  : out   std_logic;  -- Q0
8161
    X_4  : in    std_logic;  -- CE\
8162
    X_5  : in    std_logic;  -- U\/D
8163
    X_6  : out   std_logic;  -- Q2
8164
    X_7  : out   std_logic;  -- Q3
8165
    X_8  : inout std_logic;  -- GND
8166
    X_9  : in    std_logic;  -- P3
8167
    X_10 : in    std_logic;  -- P2
8168
    X_11 : in    std_logic;  -- PL\
8169
    X_12 : out   std_logic;  -- TC
8170
    X_13 : out   std_logic;  -- RC\
8171
    X_14 : in    std_logic;  -- CP
8172
    X_15 : in    std_logic;  -- P0
8173
    X_16 : inout std_logic   -- Vcc
8174
);
8175
end entity SN74LS190N;
8176
 
8177
architecture BEHAV of SN74LS190N is
8178
    subtype CVAL is natural range 15 downto 0;
8179
    type VTAB is array(0 to 15) of CVAL;
8180
 
8181
    constant T10U : VTAB := ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 0,11, 6,13, 4,15, 2);
8182
    constant T10D : VTAB := ( 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14);
8183
    constant T16U : VTAB := ( 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 0);
8184
    constant T16D : VTAB := (15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14);
8185
 
8186
    signal P,  Q  : unsigned(3 downto 0);
8187
    signal QI, QO : std_logic_vector(Q'range);
8188
    signal CTR    : CVAL;
8189
    signal RC, TC : std_logic;
8190
 
8191
    alias CP  is X_14;
8192
    alias DWN is X_5;
8193
    alias CE  is X_4;
8194
    alias PL  is X_11;
8195
 
8196
begin
8197
    assert (MODULUS = 10) or (MODULUS = 16) report "Incorrect modulus" severity failure;
8198
 
8199
    P <= (X_9, X_10, X_1, X_15);
8200
    (X_7, X_6, X_2, X_3) <= QO;
8201
 
8202
    process(CP, PL, P) is
8203
    begin
8204
        if PL = '0' then
8205
            CTR <= to_integer(P);
8206
        elsif rising_edge(CP) and (CE = '0') then
8207
            if MODULUS = 10 then
8208
                if DWN = '0' then
8209
                    CTR <= T10U(CTR);
8210
                else
8211
                    CTR <= T10D(CTR);
8212
                end if;
8213
            else
8214
                if DWN = '0' then
8215
                    CTR <= T16U(CTR);
8216
                else
8217
                    CTR <= T16D(CTR);
8218
                end if;
8219
            end if;
8220
        end if;
8221
    end process;
8222
 
8223
    process(all) is
8224
        variable B : std_logic;
8225
    begin
8226
        B  := '1' when MODULUS = 10 else '0';
8227
        TC <= '0';                  -- Default
8228
        case CTR is
8229
            when  0           => TC <=           DWN;
8230
            when  9 | 11 | 13 => TC <= B and not DWN;
8231
            when 15           => TC <=       not DWN;
8232
            when others       => null;
8233
        end case;
8234
    end process;
8235
 
8236
    RC <= not(TC and (not CE) and (not CP));
8237
 
8238
    Q  <= to_unsigned(CTR, Q'length);
8239
    QI <= std_logic_vector(Q);
8240
 
8241
    TQ: TTLdelays
8242
    generic map(
8243
        tPLH => tQLH,
8244
        tPHL => tQHL
8245
    )
8246
    port map(
8247
        A => QI,
8248
        B => QO
8249
    );
8250
 
8251
    TRC: TTLdelay
8252
    generic map(
8253
        tPLH => tRLH,
8254
        tPHL => tRHL
8255
    )
8256
    port map(
8257
        A => RC,
8258
        B => X_13
8259
    );
8260
 
8261
    TTC: TTLdelay
8262
    generic map(
8263
        tPLH => tTLH,
8264
        tPHL => tTHL
8265
    )
8266
    port map(
8267
        A => TC,
8268
        B => X_12
8269
    );
8270
 
8271
end architecture BEHAV;
8272
 
8273
-----------------------------------------------------------------------
8274
-- SN74LS191N: Up/down binary counter
8275
--             Verified 01/08/2016
8276
-----------------------------------------------------------------------
8277
library ieee;
8278
    use ieee.std_logic_1164.all;
8279
 
8280
    use work.LSTTL.all;
8281
    use work.TTLPrivate.all;
8282
 
8283
entity SN74LS191N is
8284
generic(
8285
    MODULUS : positive := 16;
8286
    tQLH    : time     := 24 ns;
8287
    tQHL    : time     := 36 ns;
8288
    tTLH    : time     := 42 ns;
8289
    tTHL    : time     := 52 ns;
8290
    tRLH    : time     := 20 ns;
8291
    tRHL    : time     := 24 ns
8292
);
8293
port(
8294
    X_1  : in    std_logic;  -- P1
8295
    X_2  : out   std_logic;  -- Q1
8296
    X_3  : out   std_logic;  -- Q0
8297
    X_4  : in    std_logic;  -- CE\
8298
    X_5  : in    std_logic;  -- U\/D
8299
    X_6  : out   std_logic;  -- Q2
8300
    X_7  : out   std_logic;  -- Q3
8301
    X_8  : inout std_logic;  -- GND
8302
    X_9  : in    std_logic;  -- P3
8303
    X_10 : in    std_logic;  -- P2
8304
    X_11 : in    std_logic;  -- PL\
8305
    X_12 : out   std_logic;  -- TC
8306
    X_13 : out   std_logic;  -- RC\
8307
    X_14 : in    std_logic;  -- CP
8308
    X_15 : in    std_logic;  -- P0
8309
    X_16 : inout std_logic   -- Vcc
8310
);
8311
end entity SN74LS191N;
8312
 
8313
architecture BEHAV of SN74LS191N is
8314
begin
8315
    Q: SN74LS190N       -- Use the generic device, set for modulus 16
8316
    generic map(
8317
        MODULUS => MODULUS,
8318
        tQLH    => tQLH,
8319
        tQHL    => tQHL,
8320
        tTLH    => tTLH,
8321
        tTHL    => tTHL,
8322
        tRLH    => tRLH,
8323
        tRHL    => tRHL
8324
    )
8325
    port map(
8326
        X_1  => X_1,
8327
        X_2  => X_2,
8328
        X_3  => X_3,
8329
        X_4  => X_4,
8330
        X_5  => X_5,
8331
        X_6  => X_6,
8332
        X_7  => X_7,
8333
        X_8  => X_8,
8334
        X_9  => X_9,
8335
        X_10 => X_10,
8336
        X_11 => X_11,
8337
        X_12 => X_12,
8338
        X_13 => X_13,
8339
        X_14 => X_14,
8340
        X_15 => X_15,
8341
        X_16 => X_16
8342
    );
8343
end architecture BEHAV;
8344
 
8345
-----------------------------------------------------------------------
8346
-- SN74LS192N: Up/down decade counter
8347
--             Verified 02/08/2016
8348
-----------------------------------------------------------------------
8349
library ieee;
8350
    use ieee.std_logic_1164.all;
8351
    use ieee.std_logic_misc.all;
8352
    use ieee.numeric_std.all;
8353
 
8354
    use work.LSTTL.all;
8355
    use work.TTLPrivate.all;
8356
 
8357
entity SN74LS192N is
8358
generic(
8359
    MODULUS : positive := 10;
8360
    tQLH    : time     := 32 ns;
8361
    tQHL    : time     := 30 ns;
8362
    tTCULH  : time     := 16 ns;
8363
    tTCUHL  : time     := 21 ns;
8364
    tTCDLH  : time     := 16 ns;
8365
    tTCDHL  : time     := 24 ns
8366
);
8367
port(
8368
    X_1  : in    std_logic;  -- P1
8369
    X_2  : out   std_logic;  -- Q1
8370
    X_3  : out   std_logic;  -- Q0
8371
    X_4  : in    std_logic;  -- CPD
8372
    X_5  : in    std_logic;  -- CPU
8373
    X_6  : out   std_logic;  -- Q2
8374
    X_7  : out   std_logic;  -- Q3
8375
    X_8  : inout std_logic;  -- GND
8376
    X_9  : in    std_logic;  -- P3
8377
    X_10 : in    std_logic;  -- P2
8378
    X_11 : in    std_logic;  -- PL\
8379
    X_12 : out   std_logic;  -- TCU\
8380
    X_13 : out   std_logic;  -- TCD\
8381
    X_14 : in    std_logic;  -- MR
8382
    X_15 : in    std_logic;  -- P0
8383
    X_16 : inout std_logic   -- Vcc
8384
);
8385
end entity SN74LS192N;
8386
 
8387
architecture BEHAV of SN74LS192N is
8388
    subtype CVAL is natural range 15 downto 0;
8389
    type VTAB is array(0 to 15) of CVAL;
8390
 
8391
    constant T10U : VTAB := ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 0,11, 6,13, 4,15, 2);
8392
    constant T10D : VTAB := ( 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14);
8393
    constant T16U : VTAB := ( 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 0);
8394
    constant T16D : VTAB := (15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14);
8395
 
8396
    signal P,  Q,   QB : unsigned(3 downto 0);
8397
    signal QI, QO      : std_logic_vector(Q'range);
8398
    signal CTR         : CVAL;
8399
    signal TCU, TCD    : std_logic;
8400
 
8401
    alias  PL  is X_11;
8402
    alias  MR  is X_14;
8403
    alias  CPD is X_4;
8404
    alias  CPU is X_5;
8405
 
8406
begin
8407
    assert (MODULUS = 10) or (MODULUS = 16) report "Incorrect modulus" severity failure;
8408
 
8409
    P <= (X_9, X_10, X_1, X_15);
8410
    (X_7, X_6, X_2, X_3) <= QO;
8411
 
8412
    Q  <= to_unsigned(CTR, Q'length);
8413
    QI <= std_logic_vector(Q);
8414
    QB <= not Q;
8415
 
8416
    process(CPU, CPD, PL, MR, P) is
8417
    begin
8418
        if MR = '1' then
8419
            CTR <= 0;
8420
        elsif PL = '0' then
8421
            CTR <= to_integer(P);
8422
        elsif rising_edge(CPU) then
8423
            if MODULUS = 10 then
8424
                CTR <= T10U(CTR);
8425
            else
8426
                CTR <= T16U(CTR);
8427
            end if;
8428
        elsif rising_edge(CPD) then
8429
            if MODULUS = 10 then
8430
                CTR <= T10D(CTR);
8431
            else
8432
                CTR <= T16D(CTR);
8433
            end if;
8434
        end if;
8435
    end process;
8436
 
8437
    process(all) is
8438
    begin
8439
        if MODULUS = 10 then
8440
            TCU <= not((not CPU) and Q(0) and Q(3));
8441
        else
8442
            TCU <= not((not CPD) and Q(0) and Q(1) and Q(2) and Q(3));
8443
        end if;
8444
        TCD <= not((not CPD) and QB(0) and QB(1) and QB(2) and QB(3));
8445
    end process;
8446
 
8447
    TQ: TTLdelays
8448
    generic map(
8449
        tPLH => tQLH,
8450
        tPHL => tQHL
8451
    )
8452
    port map(
8453
        A => QI,
8454
        B => QO
8455
    );
8456
 
8457
    TRC: TTLdelay
8458
    generic map(
8459
        tPLH => tTCULH,
8460
        tPHL => tTCUHL
8461
    )
8462
    port map(
8463
        A => TCU,
8464
        B => X_12
8465
    );
8466
 
8467
    TTC: TTLdelay
8468
    generic map(
8469
        tPLH => tTCDLH,
8470
        tPHL => tTCDHL
8471
    )
8472
    port map(
8473
        A => TCD,
8474
        B => X_13
8475
    );
8476
 
8477
end architecture BEHAV;
8478
 
8479
-----------------------------------------------------------------------
8480
-- SN74LS193N: Up/down binary counter
8481
--             Verified 02/08/2016
8482
-----------------------------------------------------------------------
8483
library ieee;
8484
    use ieee.std_logic_1164.all;
8485
 
8486
    use work.LSTTL.all;
8487
    use work.TTLPrivate.all;
8488
 
8489
entity SN74LS193N is
8490
generic(
8491
    MODULUS : positive := 16;
8492
    tQLH    : time     := 32 ns;
8493
    tQHL    : time     := 30 ns;
8494
    tTCULH  : time     := 16 ns;
8495
    tTCUHL  : time     := 21 ns;
8496
    tTCDLH  : time     := 16 ns;
8497
    tTCDHL  : time     := 24 ns
8498
);
8499
port(
8500
    X_1  : in    std_logic;  -- P1
8501
    X_2  : out   std_logic;  -- Q1
8502
    X_3  : out   std_logic;  -- Q0
8503
    X_4  : in    std_logic;  -- CPD
8504
    X_5  : in    std_logic;  -- CPU
8505
    X_6  : out   std_logic;  -- Q2
8506
    X_7  : out   std_logic;  -- Q3
8507
    X_8  : inout std_logic;  -- GND
8508
    X_9  : in    std_logic;  -- P3
8509
    X_10 : in    std_logic;  -- P2
8510
    X_11 : in    std_logic;  -- PL\
8511
    X_12 : out   std_logic;  -- TCU\
8512
    X_13 : out   std_logic;  -- TCD\
8513
    X_14 : in    std_logic;  -- MR
8514
    X_15 : in    std_logic;  -- P0
8515
    X_16 : inout std_logic   -- Vcc
8516
);
8517
end entity SN74LS193N;
8518
 
8519
architecture BEHAV of SN74LS193N is
8520
begin
8521
    G: SN74LS192N       -- Use the generic device, set for modulus 16
8522
    generic map(
8523
        MODULUS => MODULUS,
8524
        tQLH    => tQLH,
8525
        tQHL    => tQHL,
8526
        tTCULH  => tTCULH,
8527
        tTCUHL  => tTCUHL,
8528
        tTCDLH  => tTCDLH,
8529
        tTCDHL  => tTCDHL
8530
    )
8531
    port map(
8532
        X_1  => X_1,
8533
        X_2  => X_2,
8534
        X_3  => X_3,
8535
        X_4  => X_4,
8536
        X_5  => X_5,
8537
        X_6  => X_6,
8538
        X_7  => X_7,
8539
        X_8  => X_8,
8540
        X_9  => X_9,
8541
        X_10 => X_10,
8542
        X_11 => X_11,
8543
        X_12 => X_12,
8544
        X_13 => X_13,
8545
        X_14 => X_14,
8546
        X_15 => X_15,
8547
        X_16 => X_16
8548
    );
8549
end architecture BEHAV;
8550
 
8551
-----------------------------------------------------------------------
8552
-- SN74LS194N: 4-bit bidirectional shift register
8553
--             Verified 03/08/2016
8554
-----------------------------------------------------------------------
8555
library ieee;
8556
    use ieee.std_logic_1164.all;
8557
 
8558
    use work.LSTTL.all;
8559
    use work.TTLPrivate.all;
8560
 
8561
entity SN74LS194N is
8562
generic(
8563
    tPLH : time := 21 ns;
8564
    tPHL : time := 24 ns
8565
);
8566
port(
8567
    X_1  : in    std_logic;  -- MR\
8568
    X_2  : in    std_logic;  -- DSR
8569
    X_3  : in    std_logic;  -- P0
8570
    X_4  : in    std_logic;  -- P1
8571
    X_5  : in    std_logic;  -- P2
8572
    X_6  : in    std_logic;  -- P3
8573
    X_7  : in    std_logic;  -- DSL
8574
    X_8  : inout std_logic;  -- GND
8575
    X_9  : in    std_logic;  -- S0
8576
    X_10 : in    std_logic;  -- S1
8577
    X_11 : in    std_logic;  -- CP
8578
    X_12 : out   std_logic;  -- Q3
8579
    X_13 : out   std_logic;  -- Q2
8580
    X_14 : out   std_logic;  -- Q1
8581
    X_15 : out   std_logic;  -- Q0
8582
    X_16 : inout std_logic   -- Vcc
8583
);
8584
end entity SN74LS194N;
8585
 
8586
architecture BEHAV of SN74LS194N is
8587
    signal S       : std_logic_vector(1 downto 0);
8588
 
8589
    -- NB Q3 is considered the rightmost bit (see data sheet)
8590
    signal P, Q, Z : std_logic_vector(0 to 3);
8591
 
8592
    alias CP is X_11;
8593
    alias MR is X_1;
8594
    alias DR is X_2;
8595
    alias DL is X_7;
8596
 
8597
begin
8598
    S <= (X_10, X_9);
8599
    P <= (X_6, X_5, X_4, X_3);
8600
    (X_12, X_13, X_14, X_15) <= Z;
8601
 
8602
    process(CP, MR) is
8603
    begin
8604
        if MR = '0' then
8605
            Q <= (others => '0');
8606
        elsif rising_edge(CP) then
8607
            case S is
8608
                when "01"   => Q <= DR & Q(0 to 2); -- Shift right
8609
                when "10"   => Q <= Q(1 to 3) & DL; -- Shift left
8610
                when "11"   => Q <= P;              -- Parallel load
8611
                when others => null;                -- Hold
8612
            end case;
8613
        end if;
8614
    end process;
8615
 
8616
    TQ: TTLdelays
8617
    generic map(
8618
        tPLH => tPLH,
8619
        tPHL => tPHL
8620
    )
8621
    port map(
8622
        A => Q,
8623
        B => Z
8624
    );
8625
 
8626
end architecture BEHAV;
8627
 
8628
-----------------------------------------------------------------------
8629
-- SN74LS195N: Universal 4-bit shift register
8630
--             Verified 03/08/2016
8631
-----------------------------------------------------------------------
8632
library ieee;
8633
    use ieee.std_logic_1164.all;
8634
 
8635
    use work.LSTTL.all;
8636
    use work.TTLPrivate.all;
8637
 
8638
entity SN74LS195N is
8639
generic(
8640
    tPLH : time := 21 ns;
8641
    tPHL : time := 24 ns
8642
);
8643
port(
8644
    X_1  : in    std_logic;  -- MR\
8645
    X_2  : in    std_logic;  -- J
8646
    X_3  : in    std_logic;  -- K\
8647
    X_4  : in    std_logic;  -- P0
8648
    X_5  : in    std_logic;  -- P1
8649
    X_6  : in    std_logic;  -- P2
8650
    X_7  : in    std_logic;  -- P3
8651
    X_8  : inout std_logic;  -- GND
8652
    X_9  : in    std_logic;  -- PE\
8653
    X_10 : in    std_logic;  -- CP
8654
    X_11 : out   std_logic;  -- Q3\
8655
    X_12 : out   std_logic;  -- Q3
8656
    X_13 : out   std_logic;  -- Q2
8657
    X_14 : out   std_logic;  -- Q1
8658
    X_15 : out   std_logic;  -- Q0
8659
    X_16 : inout std_logic   -- Vcc
8660
);
8661
end entity SN74LS195N;
8662
 
8663
architecture BEHAV of SN74LS195N is
8664
    signal P, Q, Z : std_logic_vector(3 downto 0);
8665
    signal JK      : std_logic_vector(1 downto 0);
8666
    signal D       : std_logic;
8667
 
8668
    alias CP is X_10;
8669
    alias MR is X_1;
8670
    alias PE is X_9;
8671
 
8672
begin
8673
    JK <= (X_2, X_3);
8674
    P  <= (X_7, X_6, X_5, X_4);
8675
    (X_12, X_13, X_14, X_15) <= Z;
8676
    X_11 <= not Z(3);
8677
 
8678
    with JK select D <=
8679
        '0'      when "00",
8680
        '1'      when "11",
8681
        not Q(0) when "10",
8682
        Q(0)     when others;
8683
 
8684
    process(CP, MR)
8685
    begin
8686
        if MR = '0' then
8687
            Q <= (others => '0');
8688
        elsif rising_edge(CP) then
8689
            if PE = '0' then
8690
                Q <= P;
8691
            else
8692
                Q <= Q(2 downto 0) & D;
8693
            end if;
8694
        end if;
8695
    end process;
8696
 
8697
    TQ: TTLdelays
8698
    generic map(
8699
        tPLH => tPLH,
8700
        tPHL => tPHL
8701
    )
8702
    port map(
8703
        A => Q,
8704
        B => Z
8705
    );
8706
end architecture BEHAV;
8707
 
8708
-----------------------------------------------------------------------
8709
-- SN74LS196N: Presettable decade counter
8710
--             Verified 03/08/2016
8711
-----------------------------------------------------------------------
8712
library ieee;
8713
    use ieee.std_logic_1164.all;
8714
 
8715
    use work.LSTTL.all;
8716
    use work.TTLPrivate.all;
8717
 
8718
entity SN74LS196N is
8719
generic(
8720
    tPLH0 : time := 12 ns;
8721
    tPHL0 : time := 12 ns;
8722
    tPLH1 : time := 14 ns;
8723
    tPHL1 : time := 14 ns;
8724
    tPLH2 : time := 34 ns;
8725
    tPHL2 : time := 32 ns;
8726
    tPLH3 : time := 18 ns;
8727
    tPHL3 : time := 18 ns
8728
);
8729
port(
8730
    X_1  : in    std_logic;  -- PL\
8731
    X_2  : out   std_logic;  -- Q2
8732
    X_3  : in    std_logic;  -- P2
8733
    X_4  : in    std_logic;  -- P0
8734
    X_5  : out   std_logic;  -- Q0
8735
    X_6  : in    std_logic;  -- CP1\
8736
    X_7  : inout std_logic;  -- GND
8737
    X_8  : in    std_logic;  -- CP0\
8738
    X_9  : out   std_logic;  -- Q1
8739
    X_10 : in    std_logic;  -- P1
8740
    X_11 : in    std_logic;  -- P3
8741
    X_12 : out   std_logic;  -- Q3
8742
    X_13 : in    std_logic;  -- MR\
8743
    X_14 : inout std_logic   -- Vcc
8744
);
8745
end entity SN74LS196N;
8746
 
8747
architecture BEHAV of SN74LS196N is
8748
begin
8749
CT: SN74176N      -- Same device, just faster
8750
generic map(
8751
    tPLH0 => tPLH0,
8752
    tPHL0 => tPHL0,
8753
    tPLH1 => tPLH1,
8754
    tPHL1 => tPHL1,
8755
    tPLH2 => tPLH2,
8756
    tPHL2 => tPHL2,
8757
    tPLH3 => tPLH3,
8758
    tPHL3 => tPHL3
8759
)
8760
port map(
8761
    X_1  => X_1,   -- PL\
8762
    X_2  => X_2,   -- Q2
8763
    X_3  => X_3,   -- P2
8764
    X_4  => X_4,   -- P0
8765
    X_5  => X_5,   -- Q0
8766
    X_6  => X_6,   -- CP1\
8767
    X_7  => X_7,   -- GND
8768
    X_8  => X_8,   -- CP0\
8769
    X_9  => X_9,   -- Q1
8770
    X_10 => X_10,  -- P1
8771
    X_11 => X_11,  -- P3
8772
    X_12 => X_12,  -- Q3
8773
    X_13 => X_13,  -- MR\
8774
    X_14 => X_14   -- Vcc
8775
);
8776
end architecture BEHAV;
8777
 
8778
-----------------------------------------------------------------------
8779
-- SN74LS197N: Presettable binary counter
8780
--             Verified 03/08/2016
8781
-----------------------------------------------------------------------
8782
library ieee;
8783
    use ieee.std_logic_1164.all;
8784
 
8785
    use work.LSTTL.all;
8786
    use work.TTLPrivate.all;
8787
 
8788
entity SN74LS197N is
8789
generic(
8790
    tPLH0 : time := 12 ns;
8791
    tPHL0 : time := 12 ns;
8792
    tPLH1 : time := 14 ns;
8793
    tPHL1 : time := 14 ns;
8794
    tPLH2 : time := 36 ns;
8795
    tPHL2 : time := 34 ns;
8796
    tPLH3 : time := 50 ns;
8797
    tPHL3 : time := 55 ns
8798
);
8799
port(
8800
    X_1  : in    std_logic;  -- PL\
8801
    X_2  : out   std_logic;  -- Q2
8802
    X_3  : in    std_logic;  -- P2
8803
    X_4  : in    std_logic;  -- P0
8804
    X_5  : out   std_logic;  -- Q0
8805
    X_6  : in    std_logic;  -- CP1\
8806
    X_7  : inout std_logic;  -- GND
8807
    X_8  : in    std_logic;  -- CP0\
8808
    X_9  : out   std_logic;  -- Q1
8809
    X_10 : in    std_logic;  -- P1
8810
    X_11 : in    std_logic;  -- P3
8811
    X_12 : out   std_logic;  -- Q3
8812
    X_13 : in    std_logic;  -- MR\
8813
    X_14 : inout std_logic   -- Vcc
8814
);
8815
end entity SN74LS197N;
8816
 
8817
architecture BEHAV of SN74LS197N is
8818
begin
8819
CT: SN74177N      -- Same device, just faster
8820
generic map(
8821
    tPLH0 => tPLH0,
8822
    tPHL0 => tPHL0,
8823
    tPLH1 => tPLH1,
8824
    tPHL1 => tPHL1,
8825
    tPLH2 => tPLH2,
8826
    tPHL2 => tPHL2,
8827
    tPLH3 => tPLH3,
8828
    tPHL3 => tPHL3
8829
)
8830
port map(
8831
    X_1  => X_1,   -- PL\
8832
    X_2  => X_2,   -- Q2
8833
    X_3  => X_3,   -- P2
8834
    X_4  => X_4,   -- P0
8835
    X_5  => X_5,   -- Q0
8836
    X_6  => X_6,   -- CP1\
8837
    X_7  => X_7,   -- GND
8838
    X_8  => X_8,   -- CP0\
8839
    X_9  => X_9,   -- Q1
8840
    X_10 => X_10,  -- P1
8841
    X_11 => X_11,  -- P3
8842
    X_12 => X_12,  -- Q3
8843
    X_13 => X_13,  -- MR\
8844
    X_14 => X_14   -- Vcc
8845
);
8846
end architecture BEHAV;
8847
 
8848
-----------------------------------------------------------------------
8849
-- SN74LS198N: 8-bit right/left shift register
8850
--             Verified 06/08/2016
8851
-----------------------------------------------------------------------
8852
-- NB Fairchild databook has S0, S1 interchanged. See Signetics book.
8853
library ieee;
8854
    use ieee.std_logic_1164.all;
8855
 
8856
    use work.LSTTL.all;
8857
    use work.TTLPrivate.all;
8858
 
8859
entity SN74LS198N is
8860
generic(
8861
    tPLH : time := 26 ns;
8862
    tPHL : time := 30 ns
8863
);
8864
port(
8865
    X_1  : in    std_logic;  -- S0
8866
    X_2  : in    std_logic;  -- DSR
8867
    X_3  : in    std_logic;  -- P0
8868
    X_4  : out   std_logic;  -- Q0
8869
    X_5  : in    std_logic;  -- P1
8870
    X_6  : out   std_logic;  -- Q1
8871
    X_7  : in    std_logic;  -- P2
8872
    X_8  : out   std_logic;  -- Q2
8873
    X_9  : in    std_logic;  -- P3
8874
    X_10 : out   std_logic;  -- Q3
8875
    X_11 : in    std_logic;  -- CP
8876
    X_12 : inout std_logic;  -- GND
8877
    X_13 : in    std_logic;  -- MR\
8878
    X_14 : out   std_logic;  -- Q4
8879
    X_15 : in    std_logic;  -- P4
8880
    X_16 : out   std_logic;  -- Q5
8881
    X_17 : in    std_logic;  -- P5
8882
    X_18 : out   std_logic;  -- Q6
8883
    X_19 : in    std_logic;  -- P6
8884
    X_20 : out   std_logic;  -- Q7
8885
    X_21 : in    std_logic;  -- P7
8886
    X_22 : in    std_logic;  -- DSL
8887
    X_23 : in    std_logic;  -- S1
8888
    X_24 : inout std_logic   -- Vcc
8889
);
8890
end entity SN74LS198N;
8891
 
8892
architecture BEHAV of SN74LS198N is
8893
    signal P, D, Q, Z : std_logic_vector(0 to 7);
8894
    signal S          : std_logic_vector(1 downto 0);
8895
 
8896
    alias DSL is X_22;
8897
    alias DSR is X_2;
8898
    alias CP  is X_11;
8899
    alias MR  is X_13;
8900
 
8901
begin
8902
    S <= (X_23, X_1);
8903
    P <= (X_3, X_5, X_7, X_9, X_15, X_17, X_19, X_21);
8904
    (X_4, X_6, X_8, X_10, X_14, X_16, X_18, X_20) <= Z;
8905
 
8906
    process(S) is
8907
    begin
8908
        assert (CP = '1') or (now < 6 ns) report "Change S only when CP = 1" severity error;
8909
    end process;
8910
 
8911
    with S select D <=
8912
        P               when "11",      -- Load
8913
        Q(1 to 7) & DSL when "10",      -- Left
8914
        DSR & Q(0 to 6) when "01",      -- Right
8915
        Q               when others;    -- Hold
8916
 
8917
    process(CP, MR) is
8918
    begin
8919
        if MR = '0' then
8920
            Q <= (others => '0');
8921
        elsif rising_edge(CP) then
8922
            Q <= D;
8923
        end if;
8924
    end process;
8925
 
8926
    TQ: TTLdelays
8927
    generic map(
8928
        tPLH => tPLH,
8929
        tPHL => tPHL
8930
    )
8931
    port map(
8932
        A => Q,
8933
        B => Z
8934
    );
8935
end architecture BEHAV;
8936
 
8937
-----------------------------------------------------------------------
8938
-- SN74LS199N: 8-bit parallel IO shift register
8939
-----------------------------------------------------------------------
8940
library ieee;
8941
    use ieee.std_logic_1164.all;
8942
 
8943
    use work.LSTTL.all;
8944
    use work.TTLPrivate.all;
8945
 
8946
entity SN74LS199N is
8947
generic(
8948
    tPLH : time := 26 ns;
8949
    tPHL : time := 30 ns
8950
);
8951
port(
8952
    X_1  : in    std_logic;  -- K\
8953
    X_2  : in    std_logic;  -- J
8954
    X_3  : in    std_logic;  -- P0
8955
    X_4  : out   std_logic;  -- Q0
8956
    X_5  : in    std_logic;  -- P1
8957
    X_6  : out   std_logic;  -- Q1
8958
    X_7  : in    std_logic;  -- P2
8959
    X_8  : out   std_logic;  -- Q2
8960
    X_9  : in    std_logic;  -- P3
8961
    X_10 : out   std_logic;  -- Q3
8962
    X_11 : in    std_logic;  -- CP1
8963
    X_12 : inout std_logic;  -- GND
8964
    X_13 : in    std_logic;  -- CP2
8965
    X_14 : in    std_logic;  -- MR\
8966
    X_15 : out   std_logic;  -- Q4
8967
    X_16 : in    std_logic;  -- P4
8968
    X_17 : out   std_logic;  -- Q5
8969
    X_18 : in    std_logic;  -- P5
8970
    X_19 : out   std_logic;  -- Q6
8971
    X_20 : in    std_logic;  -- P6
8972
    X_21 : out   std_logic;  -- Q7
8973
    X_22 : in    std_logic;  -- P7
8974
    X_23 : in    std_logic;  -- PE\
8975
    X_24 : inout std_logic   -- Vcc
8976
);
8977
end entity SN74LS199N;
8978
 
8979
architecture BEHAV of SN74LS199N is
8980
    signal CLK, I, P0, CP     : std_logic;
8981
    signal P, Q, Z            : std_logic_vector(0 to 7);
8982
    signal L1, L2, L3, L4, L5 : std_logic;
8983
 
8984
    alias MR  is X_14;
8985
    alias PE  is X_23;
8986
    alias CP1 is X_11;
8987
    alias CP2 is X_13;
8988
    alias J   is X_2;
8989
    alias KB  is X_1;
8990
 
8991
begin
8992
    P <= (X_3, X_5, X_7, X_9, X_16, X_18, X_20, X_22);
8993
    L1 <= not PE;
8994
    L2 <= not Q(0);
8995
    CP <= CP1 or CP2;
8996
 
8997
    L3 <= J and PE and L2;
8998
    L4 <= L1 and P(0);
8999
    L5 <= KB and PE and Q(0);
9000
    P0 <= L3 or L4 or L5;
9001
    FFC1 : TTL_FF
9002
    port map(
9003
        q   => Q(0),
9004
        d   => P0,
9005
        clk => CP,
9006
        cl  => MR
9007
    );
9008
 
9009
    G: for i in 1 to 7 generate
9010
        signal Z : std_logic;
9011
    begin
9012
        Z <= (Q(i-1) and PE ) or ( L1 and P(i));
9013
        FFC2 : TTL_FF
9014
        port map(
9015
            q   => Q(i),
9016
            d   => Z,
9017
            clk => CP,
9018
            cl  => MR
9019
        );
9020
    end generate;
9021
 
9022
    TQ: TTLdelays
9023
    generic map(
9024
        tPLH => tPLH,
9025
        tPHL => tPHL
9026
    )
9027
    port map(
9028
        A => Q,
9029
        B => Z
9030
    );
9031
 
9032
    (X_4, X_6, X_8, X_10, X_15, X_17, X_19, X_21) <= Z;
9033
end architecture BEHAV;
9034
 
9035
-----------------------------------------------------------------------
9036
-- SN74LS221N: Dual monostable multivibrator
9037
--             Verified 06/08/2016
9038
-----------------------------------------------------------------------
9039
library ieee;
9040
    use ieee.std_logic_1164.all;
9041
    use ieee.std_logic_misc.all;
9042
 
9043
    use work.LSTTL.all;
9044
    use work.TTLPrivate.all;
9045
 
9046
entity SN74LS221N is
9047
generic(
9048
    W1   : time := 100 us;   -- Pulse widths
9049
    W2   : time := 100 us
9050
);
9051
port(
9052
    X_1  : in    std_logic;  -- A1\
9053
    X_2  : in    std_logic;  -- B1
9054
    X_3  : in    std_logic;  -- CD1\
9055
    X_4  : out   std_logic;  -- Q1\
9056
    X_5  : out   std_logic;  -- Q2
9057
    X_6  : inout std_logic;  -- Cx2
9058
    X_7  : inout std_logic;  -- Rx2Cx2
9059
    X_8  : inout std_logic;  -- GND
9060
    X_9  : in    std_logic;  -- A2\
9061
    X_10 : in    std_logic;  -- B2
9062
    X_11 : in    std_logic;  -- CD2\
9063
    X_12 : out   std_logic;  -- Q2\
9064
    X_13 : out   std_logic;  -- Q1
9065
    X_14 : inout std_logic;  -- Cx1
9066
    X_15 : inout std_logic;  -- Rx1Cx1
9067
    X_16 : inout std_logic   -- Vcc
9068
);
9069
end entity SN74LS221N;
9070
 
9071
architecture BEHAV of SN74LS221N is
9072
    constant tD : time :=  40 ns;   -- Trigger delay from input
9073
    constant mt : time :=  40 ns;   -- Minimum trigger width
9074
 
9075
    signal trig, NR, Q : std_logic_vector(2 downto 1);
9076
 
9077
    type Widths is array(2 downto 1) of time;
9078
    constant pw : Widths := (W1, W2);
9079
begin
9080
    NR(1)   <= not X_3;
9081
    trig(1) <= and_reduce(X_3  & X_2  & (not X_1)) after tD;
9082
    NR(2)   <= not X_11;
9083
    trig(2) <= and_reduce(X_11 & X_10 & (not X_9)) after tD;
9084
 
9085
    GN: for i in trig'range generate
9086
    begin
9087
        MS: TTLmonostable
9088
        generic map(
9089
            pwidth        => pw(i),  -- Triggered pulse width
9090
            mintrig       =>    mt,  -- Minimum trigger width
9091
            retriggerable => true
9092
        )
9093
        port map(
9094
            trig  => trig(i),
9095
            reset => NR(i),
9096
            Q     => Q(i)
9097
        );
9098
    end generate;
9099
 
9100
    X_13 <= Q(1);
9101
    X_4  <= not Q(1);
9102
    X_5  <= Q(2);
9103
    X_12 <= not Q(2);
9104
 
9105
end architecture BEHAV;
9106
 
9107
-----------------------------------------------------------------------
9108
-- SN74LS240N: Octal buffer/line driver (3-state outputs)
9109
--             Verified 06/08/2016
9110
-----------------------------------------------------------------------
9111
library ieee;
9112
    use ieee.std_logic_1164.all;
9113
 
9114
    use work.LSTTL.all;
9115
    use work.TTLPrivate.all;
9116
 
9117
entity SN74LS240N is
9118
generic(
9119
    tPLH : time := 14 ns;
9120
    tPHL : time := 18 ns;
9121
    tPZH : time := 23 ns;
9122
    tPZL : time := 30 ns;
9123
    tPHZ : time := 25 ns;
9124
    tPLZ : time := 18 ns
9125
);
9126
port(
9127
    X_1  : in    std_logic;  -- OEA\
9128
    X_2  : in    std_logic;  -- IA0
9129
    X_3  : out   std_logic;  -- YB0\
9130
    X_4  : in    std_logic;  -- IA1
9131
    X_5  : out   std_logic;  -- YB1\
9132
    X_6  : in    std_logic;  -- IA2
9133
    X_7  : out   std_logic;  -- YB2\
9134
    X_8  : in    std_logic;  -- IA3
9135
    X_9  : out   std_logic;  -- YB3\
9136
    X_10 : inout std_logic;  -- GND
9137
    X_11 : in    std_logic;  -- IB3
9138
    X_12 : out   std_logic;  -- YA3\
9139
    X_13 : in    std_logic;  -- IB2
9140
    X_14 : out   std_logic;  -- YA2\
9141
    X_15 : in    std_logic;  -- IB1
9142
    X_16 : out   std_logic;  -- YA1\
9143
    X_17 : in    std_logic;  -- IB0
9144
    X_18 : out   std_logic;  -- YA0\
9145
    X_19 : in    std_logic;  -- OEB\
9146
    X_20 : inout std_logic   -- Vcc
9147
);
9148
end entity SN74LS240N;
9149
 
9150
architecture BEHAV of SN74LS240N is
9151
    signal IA, IB, YA, YB, IAN, IBN : std_logic_vector(0 to 3);
9152
    signal OEA, OEB : std_logic;
9153
 
9154
begin
9155
    OEA <= not X_1;         -- Enable, both active low
9156
    OEB <= not X_19;
9157
 
9158
    IA <= (X_2,  X_4,  X_6,  X_8 );
9159
    IB <= (X_17, X_15, X_13, X_11);
9160
    IAN <= not IA;          -- '240 inverts data
9161
    IBN <= not IB;
9162
 
9163
    G1: for i in IA'range generate
9164
    begin
9165
        B1: TTL3State
9166
        generic map(
9167
            tPLH => tPLH,
9168
            tPHL => tPHL,
9169
            tPZH => tPZH,
9170
            tPZL => tPZL,
9171
            tPHZ => tPHZ,
9172
            tPLZ => tPLZ
9173
        )
9174
        port map(
9175
            A  => IAN(i),
9176
            E  => OEA,
9177
            Y  => YA(i)
9178
        );
9179
 
9180
        B2: TTL3State
9181
        generic map(
9182
            tPLH => tPLH,
9183
            tPHL => tPHL,
9184
            tPZH => tPZH,
9185
            tPZL => tPZL,
9186
            tPHZ => tPHZ,
9187
            tPLZ => tPLZ
9188
        )
9189
        port map(
9190
            A  => IBN(i),
9191
            E  => OEB,
9192
            Y  => YB(i)
9193
        );
9194
    end generate;
9195
 
9196
    (X_18, X_16, X_14, X_12) <= YA;
9197
    (X_3,  X_5,  X_7,  X_9 ) <= YB;
9198
end architecture BEHAV;
9199
 
9200
-----------------------------------------------------------------------
9201
-- SN74LS241N: Octal buffer/line driver (3-state outputs)
9202
--             Verified 14/08/2016
9203
-----------------------------------------------------------------------
9204
library ieee;
9205
    use ieee.std_logic_1164.all;
9206
 
9207
    use work.LSTTL.all;
9208
    use work.TTLPrivate.all;
9209
 
9210
entity SN74LS241N is
9211
generic(
9212
    tPLH : time := 18 ns;
9213
    tPHL : time := 18 ns;
9214
    tPZH : time := 23 ns;
9215
    tPZL : time := 30 ns;
9216
    tPHZ : time := 25 ns;
9217
    tPLZ : time := 18 ns
9218
);
9219
port(
9220
    X_1  : in    std_logic;  -- OEA\
9221
    X_2  : in    std_logic;  -- IA0
9222
    X_3  : out   std_logic;  -- YB0
9223
    X_4  : in    std_logic;  -- IA1
9224
    X_5  : out   std_logic;  -- YB1
9225
    X_6  : in    std_logic;  -- IA2
9226
    X_7  : out   std_logic;  -- YB2
9227
    X_8  : in    std_logic;  -- IA3
9228
    X_9  : out   std_logic;  -- YB3
9229
    X_10 : inout std_logic;  -- GND
9230
    X_11 : in    std_logic;  -- IB3
9231
    X_12 : out   std_logic;  -- YA3
9232
    X_13 : in    std_logic;  -- IB2
9233
    X_14 : out   std_logic;  -- YA2
9234
    X_15 : in    std_logic;  -- IB1
9235
    X_16 : out   std_logic;  -- YA1
9236
    X_17 : in    std_logic;  -- IB0
9237
    X_18 : out   std_logic;  -- YA0
9238
    X_19 : in    std_logic;  -- OEB
9239
    X_20 : inout std_logic   -- Vcc
9240
);
9241
end entity SN74LS241N;
9242
 
9243
architecture BEHAV of SN74LS241N is
9244
    signal IA, IB, YA, YB : std_logic_vector(0 to 3);
9245
    signal OEA, OEB : std_logic;
9246
 
9247
begin
9248
    OEA <= not X_1;             -- Enable, active low
9249
    OEB <= X_19;                -- Enable, active high
9250
 
9251
    IA <= (X_2,  X_4,  X_6,  X_8 );
9252
    IB <= (X_17, X_15, X_13, X_11);
9253
 
9254
    G1: for i in IA'range generate
9255
    begin
9256
        B1: TTL3State
9257
        generic map(
9258
            tPLH => tPLH,
9259
            tPHL => tPHL,
9260
            tPZH => tPZH,
9261
            tPZL => tPZL,
9262
            tPHZ => tPHZ,
9263
            tPLZ => tPLZ
9264
        )
9265
        port map(
9266
            A  => IA(i),
9267
            E  => OEA,
9268
            Y  => YA(i)
9269
        );
9270
 
9271
        B2: TTL3State
9272
        generic map(
9273
            tPLH => tPLH,
9274
            tPHL => tPHL,
9275
            tPZH => tPZH,
9276
            tPZL => tPZL,
9277
            tPHZ => tPHZ,
9278
            tPLZ => tPLZ
9279
        )
9280
        port map(
9281
            A  => IB(i),
9282
            E  => OEB,
9283
            Y  => YB(i)
9284
        );
9285
    end generate;
9286
 
9287
    (X_18, X_16, X_14, X_12) <= YA;
9288
    (X_3,  X_5,  X_7,  X_9 ) <= YB;
9289
end architecture BEHAV;
9290
 
9291
-----------------------------------------------------------------------
9292
-- SN74LS242N: Quad bus transceiver (inverting 3-state outputs)
9293
--             Verified 14/08/2016
9294
-----------------------------------------------------------------------
9295
library ieee;
9296
    use ieee.std_logic_1164.all;
9297
 
9298
    use work.LSTTL.all;
9299
    use work.TTLPrivate.all;
9300
 
9301
entity SN74LS242N is
9302
generic(
9303
    tPLH : time := 14 ns;
9304
    tPHL : time := 18 ns;
9305
    tPZH : time := 23 ns;
9306
    tPZL : time := 30 ns;
9307
    tPHZ : time := 25 ns;
9308
    tPLZ : time := 18 ns
9309
);
9310
port(
9311
    X_1  : in    std_logic;  -- A2B\
9312
                             -- 
9313
    X_3  : inout std_logic;  -- A1
9314
    X_4  : inout std_logic;  -- A2
9315
    X_5  : inout std_logic;  -- A3
9316
    X_6  : inout std_logic;  -- A4
9317
    X_7  : inout std_logic;  -- GND
9318
    X_8  : inout std_logic;  -- B4\
9319
    X_9  : inout std_logic;  -- B3\
9320
    X_10 : inout std_logic;  -- B2\
9321
    X_11 : inout std_logic;  -- B1\
9322
                             -- 
9323
    X_13 : in    std_logic;  -- B2A
9324
    X_14 : inout std_logic   -- Vcc
9325
);
9326
end entity SN74LS242N;
9327
 
9328
architecture BEHAV of SN74LS242N is
9329
    signal A2B, B2A             : std_logic;
9330
    signal AIN, AOUT, BIN, BOUT : std_logic_vector(1 to 4);
9331
 
9332
begin
9333
    A2B <= not X_1;             -- Enable, active low
9334
    B2A <= X_13;                -- Enable, active high
9335
 
9336
    AIN <= (X_3,  X_4,  X_5, X_6);
9337
    BIN <= (X_11, X_10, X_9, X_8);
9338
    (X_3,  X_4,  X_5, X_6) <= AOUT;
9339
    (X_11, X_10, X_9, X_8) <= BOUT;
9340
 
9341
    G: for i in AIN'range generate
9342
        signal AX, BX : std_logic;
9343
    begin
9344
        AX <= not AIN(i);
9345
        G1A: TTL3State
9346
        generic map(
9347
            tPLH => tPLH,
9348
            tPHL => tPHL,
9349
            tPZH => tPZH,
9350
            tPZL => tPZL,
9351
            tPHZ => tPHZ,
9352
            tPLZ => tPLZ
9353
        )
9354
        port map(
9355
            A  => AX,
9356
            E  => A2B,
9357
            Y  => BOUT(i)
9358
        );
9359
        BX <= not BIN(i);
9360
        G1B: TTL3State
9361
        generic map(
9362
            tPLH => tPLH,
9363
            tPHL => tPHL,
9364
            tPZH => tPZH,
9365
            tPZL => tPZL,
9366
            tPHZ => tPHZ,
9367
            tPLZ => tPLZ
9368
        )
9369
        port map(
9370
            A  => BX,
9371
            E  => B2A,
9372
            Y  => AOUT(i)
9373
        );
9374
    end generate;
9375
 
9376
end architecture BEHAV;
9377
 
9378
-----------------------------------------------------------------------
9379
-- SN74LS243N: Quad bus transceiver (3-state outputs)
9380
--             Verified 14/08/2016
9381
-----------------------------------------------------------------------
9382
library ieee;
9383
    use ieee.std_logic_1164.all;
9384
 
9385
    use work.LSTTL.all;
9386
    use work.TTLPrivate.all;
9387
 
9388
entity SN74LS243N is
9389
generic(
9390
    tPLH : time := 18 ns;
9391
    tPHL : time := 18 ns;
9392
    tPZH : time := 23 ns;
9393
    tPZL : time := 30 ns;
9394
    tPHZ : time := 25 ns;
9395
    tPLZ : time := 18 ns
9396
);
9397
port(
9398
    X_1  : in    std_logic;  -- A2B\
9399
                             -- 
9400
    X_3  : inout std_logic;  -- A1
9401
    X_4  : inout std_logic;  -- A2
9402
    X_5  : inout std_logic;  -- A3
9403
    X_6  : inout std_logic;  -- A4
9404
    X_7  : inout std_logic;  -- GND
9405
    X_8  : inout std_logic;  -- B4
9406
    X_9  : inout std_logic;  -- B3
9407
    X_10 : inout std_logic;  -- B2
9408
    X_11 : inout std_logic;  -- B1
9409
                             -- 
9410
    X_13 : in    std_logic;  -- B2A
9411
    X_14 : inout std_logic   -- Vcc
9412
);
9413
end entity SN74LS243N;
9414
 
9415
architecture BEHAV of SN74LS243N is
9416
    signal A2B, B2A             : std_logic;
9417
    signal AIN, AOUT, BIN, BOUT : std_logic_vector(1 to 4);
9418
 
9419
begin
9420
    A2B <= not X_1;             -- Enable, active low
9421
    B2A <= X_13;                -- Enable, active high
9422
 
9423
    AIN <= (X_3,  X_4,  X_5, X_6);
9424
    BIN <= (X_11, X_10, X_9, X_8);
9425
    (X_3,  X_4,  X_5, X_6) <= AOUT;
9426
    (X_11, X_10, X_9, X_8) <= BOUT;
9427
 
9428
    G: for i in AIN'range generate
9429
    begin
9430
        G1A: TTL3State
9431
        generic map(
9432
            tPLH => tPLH,
9433
            tPHL => tPHL,
9434
            tPZH => tPZH,
9435
            tPZL => tPZL,
9436
            tPHZ => tPHZ,
9437
            tPLZ => tPLZ
9438
        )
9439
        port map(
9440
            A  => AIN(i),
9441
            E  => A2B,
9442
            Y  => BOUT(i)
9443
        );
9444
        G1B: TTL3State
9445
        generic map(
9446
            tPLH => tPLH,
9447
            tPHL => tPHL,
9448
            tPZH => tPZH,
9449
            tPZL => tPZL,
9450
            tPHZ => tPHZ,
9451
            tPLZ => tPLZ
9452
        )
9453
        port map(
9454
            A  => BIN(i),
9455
            E  => B2A,
9456
            Y  => AOUT(i)
9457
        );
9458
    end generate;
9459
 
9460
end architecture BEHAV;
9461
 
9462
-----------------------------------------------------------------------
9463
-- SN74LS244N: Octal buffer/line driver (3-state outputs)
9464
--             Verified 14/08/2016
9465
-----------------------------------------------------------------------
9466
library ieee;
9467
    use ieee.std_logic_1164.all;
9468
 
9469
    use work.LSTTL.all;
9470
    use work.TTLPrivate.all;
9471
 
9472
entity SN74LS244N is
9473
generic(
9474
    tPLH : time := 18 ns;
9475
    tPHL : time := 18 ns;
9476
    tPZH : time := 23 ns;
9477
    tPZL : time := 30 ns;
9478
    tPHZ : time := 25 ns;
9479
    tPLZ : time := 18 ns
9480
);
9481
port(
9482
    X_1  : in    std_logic;  -- OEA\
9483
    X_2  : in    std_logic;  -- IA0
9484
    X_3  : out   std_logic;  -- YB0
9485
    X_4  : in    std_logic;  -- IA1
9486
    X_5  : out   std_logic;  -- YB1
9487
    X_6  : in    std_logic;  -- IA2
9488
    X_7  : out   std_logic;  -- YB2
9489
    X_8  : in    std_logic;  -- IA3
9490
    X_9  : out   std_logic;  -- YB3
9491
    X_10 : inout std_logic;  -- GND
9492
    X_11 : in    std_logic;  -- IB3
9493
    X_12 : out   std_logic;  -- YA3
9494
    X_13 : in    std_logic;  -- IB2
9495
    X_14 : out   std_logic;  -- YA2
9496
    X_15 : in    std_logic;  -- IB1
9497
    X_16 : out   std_logic;  -- YA1
9498
    X_17 : in    std_logic;  -- IB0
9499
    X_18 : out   std_logic;  -- YA0
9500
    X_19 : in    std_logic;  -- OEB\
9501
    X_20 : inout std_logic   -- Vcc
9502
);
9503
end entity SN74LS244N;
9504
 
9505
architecture BEHAV of SN74LS244N is
9506
    signal IA, IB, YA, YB : std_logic_vector(0 to 3);
9507
    signal OEA, OEB : std_logic;
9508
 
9509
begin
9510
    OEA <= not X_1;         -- Enable, both active low
9511
    OEB <= not X_19;
9512
 
9513
    IA <= (X_2,  X_4,  X_6,  X_8 );
9514
    IB <= (X_17, X_15, X_13, X_11);
9515
 
9516
    G1: for i in IA'range generate
9517
    begin
9518
        B1: TTL3State
9519
        generic map(
9520
            tPLH => tPLH,
9521
            tPHL => tPHL,
9522
            tPZH => tPZH,
9523
            tPZL => tPZL,
9524
            tPHZ => tPHZ,
9525
            tPLZ => tPLZ
9526
        )
9527
        port map(
9528
            A  => IA(i),
9529
            E  => OEA,
9530
            Y  => YA(i)
9531
        );
9532
 
9533
        B2: TTL3State
9534
        generic map(
9535
            tPLH => tPLH,
9536
            tPHL => tPHL,
9537
            tPZH => tPZH,
9538
            tPZL => tPZL,
9539
            tPHZ => tPHZ,
9540
            tPLZ => tPLZ
9541
        )
9542
        port map(
9543
            A  => IB(i),
9544
            E  => OEB,
9545
            Y  => YB(i)
9546
        );
9547
    end generate;
9548
 
9549
    (X_18, X_16, X_14, X_12) <= YA;
9550
    (X_3,  X_5,  X_7,  X_9 ) <= YB;
9551
end architecture BEHAV;
9552
 
9553
-----------------------------------------------------------------------
9554
-- SN74LS245N: Octal bus transceiver (3-state outputs)
9555
--             Verified 15/12/2016
9556
-----------------------------------------------------------------------
9557
library ieee;
9558
    use ieee.std_logic_1164.all;
9559
 
9560
    use work.LSTTL.all;
9561
    use work.TTLPrivate.all;
9562
 
9563
entity SN74LS245N is
9564
generic(
9565
    tPLH : time := 18 ns;
9566
    tPHL : time := 18 ns;
9567
    tPZH : time := 23 ns;
9568
    tPZL : time := 30 ns;
9569
    tPHZ : time := 25 ns;
9570
    tPLZ : time := 18 ns
9571
);
9572
port(
9573
    X_1  : in    std_logic;  -- A2B
9574
    X_2  : inout std_logic;  -- A0
9575
    X_3  : inout std_logic;  -- A1
9576
    X_4  : inout std_logic;  -- A2
9577
    X_5  : inout std_logic;  -- A3
9578
    X_6  : inout std_logic;  -- A4
9579
    X_7  : inout std_logic;  -- A5
9580
    X_8  : inout std_logic;  -- A6
9581
    X_9  : inout std_logic;  -- A7
9582
    X_10 : inout std_logic;  -- GND
9583
    X_11 : inout std_logic;  -- B7
9584
    X_12 : inout std_logic;  -- B6
9585
    X_13 : inout std_logic;  -- B5
9586
    X_14 : inout std_logic;  -- B4
9587
    X_15 : inout std_logic;  -- B3
9588
    X_16 : inout std_logic;  -- B2
9589
    X_17 : inout std_logic;  -- B1
9590
    X_18 : inout std_logic;  -- B0
9591
    X_19 : in    std_logic;  -- E\
9592
    X_20 : inout std_logic   -- Vcc
9593
);
9594
end entity SN74LS245N;
9595
 
9596
architecture BEHAV of SN74LS245N is
9597
    signal A2B, B2A             : std_logic;
9598
    signal AIN, AOUT, BIN, BOUT : std_logic_vector(0 to 7);
9599
 
9600
begin
9601
    A2B <= X_1 and not X_19;
9602
    B2A <= X_1 nor X_19;
9603
 
9604
    AIN <= (X_2,  X_3,  X_4,  X_5,  X_6,  X_7,  X_8,  X_9 );
9605
    BIN <= (X_18, X_17, X_16, X_15, X_14, X_13, X_12, X_11);
9606
    (X_2,  X_3,  X_4,  X_5,  X_6,  X_7,  X_8,  X_9 ) <= AOUT;
9607
    (X_18, X_17, X_16, X_15, X_14, X_13, X_12, X_11) <= BOUT;
9608
 
9609
    G: for i in AIN'range generate
9610
    begin
9611
        G1A: TTL3State
9612
        generic map(
9613
            tPLH => tPLH,
9614
            tPHL => tPHL,
9615
            tPZH => tPZH,
9616
            tPZL => tPZL,
9617
            tPHZ => tPHZ,
9618
            tPLZ => tPLZ
9619
        )
9620
        port map(
9621
            A  => AIN(i),
9622
            E  => A2B,
9623
            Y  => BOUT(i)
9624
        );
9625
        G1B: TTL3State
9626
        generic map(
9627
            tPLH => tPLH,
9628
            tPHL => tPHL,
9629
            tPZH => tPZH,
9630
            tPZL => tPZL,
9631
            tPHZ => tPHZ,
9632
            tPLZ => tPLZ
9633
        )
9634
        port map(
9635
            A  => BIN(i),
9636
            E  => B2A,
9637
            Y  => AOUT(i)
9638
        );
9639
    end generate;
9640
end architecture BEHAV;
9641
 
9642
-- SN74LS247N: BCD to 7-segment decoder/driver (open collector)
9643
-- SN74LS248N: BCD to 7-segment decoder/driver (2kR pullups)
9644
-- SN74LS249N: BCD to 7-segment decoder (open collector)
9645
 
9646
-----------------------------------------------------------------------
9647
-- SN74LS251N: 8-input multiplexer (3-state outputs)
9648
--             Verified 15/12/2016
9649
-----------------------------------------------------------------------
9650
library ieee;
9651
    use ieee.std_logic_1164.all;
9652
    use ieee.numeric_std.all;
9653
 
9654
    use work.LSTTL.all;
9655
    use work.TTLPrivate.all;
9656
 
9657
entity SN74LS251N is
9658
generic(
9659
    tQBLH  : time :=  18 ns;    -- Synthetic values, QB - Q delay
9660
    tQBHL  : time :=  12 ns;
9661
    tPS    : time :=  33 ns;
9662
    tPI    : time :=  15 ns;
9663
    tPZH   : time :=  20 ns;
9664
    tPZL   : time :=  25 ns;
9665
    tPHZ   : time :=  25 ns;
9666
    tPLZ   : time :=  20 ns
9667
);
9668
port(
9669
    X_1  : in    std_logic;  -- I3
9670
    X_2  : in    std_logic;  -- I2
9671
    X_3  : in    std_logic;  -- I1
9672
    X_4  : in    std_logic;  -- I0
9673
    X_5  : out   std_logic;  -- Z
9674
    X_6  : out   std_logic;  -- Z\
9675
    X_7  : in    std_logic;  -- OE\
9676
    X_8  : inout std_logic;  -- GND
9677
    X_9  : in    std_logic;  -- S2
9678
    X_10 : in    std_logic;  -- S1
9679
    X_11 : in    std_logic;  -- S0
9680
    X_12 : in    std_logic;  -- I7
9681
    X_13 : in    std_logic;  -- I6
9682
    X_14 : in    std_logic;  -- I5
9683
    X_15 : in    std_logic;  -- I4
9684
    X_16 : inout std_logic   -- Vcc
9685
);
9686
end entity SN74LS251N;
9687
 
9688
architecture BEHAV of SN74LS251N is
9689
    signal D     : std_logic_vector(7 downto 0);
9690
    signal A     : unsigned(2 downto 0);
9691
    signal Q, QB : std_logic;
9692
    signal EN    : std_logic;
9693
 
9694
begin
9695
    A <= (X_9, X_10, X_11) after tPS;
9696
    D <= (X_12,  X_13,  X_14,  X_15,  X_1,  X_2,  X_3,  X_4 ) after tPI;
9697
 
9698
    QB <= not D(TTL_to_integer(A));
9699
    Q  <= not QB;
9700
    EN <= not X_7;          -- Active-high enable
9701
 
9702
    OZ: TTL3State
9703
    generic map(
9704
        tPLH => tQBLH,
9705
        tPHL => tQBHL,
9706
        tPZH => tPZH,
9707
        tPZL => tPZL,
9708
        tPHZ => tPHZ,
9709
        tPLZ => tPLZ
9710
    )
9711
    port map(
9712
        A => Q,
9713
        E => EN,
9714
        Y => X_5
9715
    );
9716
 
9717
    OZB: TTL3State
9718
    generic map(
9719
        tPLH => 1 ns,
9720
        tPHL => 1 ns,
9721
        tPZH => tPZH,
9722
        tPZL => tPZL,
9723
        tPHZ => tPHZ,
9724
        tPLZ => tPLZ
9725
    )
9726
    port map(
9727
        A => QB,
9728
        E => EN,
9729
        Y => X_6
9730
    );
9731
 
9732
end architecture BEHAV;
9733
 
9734
-----------------------------------------------------------------------
9735
-- SN74LS253N: Dual 4-input multiplexer (3-state outputs)
9736
--             Verified 16/12/2016
9737
-----------------------------------------------------------------------
9738
library ieee;
9739
    use ieee.std_logic_1164.all;
9740
    use ieee.std_logic_misc.all;
9741
    use ieee.numeric_std.all;
9742
 
9743
    use work.LSTTL.all;
9744
    use work.TTLPrivate.all;
9745
 
9746
entity SN74LS253N is
9747
generic(
9748
    tPLH  : time := 29 ns;
9749
    tPHL  : time := 24 ns;
9750
    tPZX  : time := 22 ns;
9751
    tPXZ  : time := 32 ns
9752
);
9753
port(
9754
    X_1  : in    std_logic;  -- OEA\
9755
    X_2  : in    std_logic;  -- S1
9756
    X_3  : in    std_logic;  -- I3A
9757
    X_4  : in    std_logic;  -- I2A
9758
    X_5  : in    std_logic;  -- I1A
9759
    X_6  : in    std_logic;  -- I0A
9760
    X_7  : out   std_logic;  -- ZA
9761
    X_8  : inout std_logic;  -- GND
9762
    X_9  : out   std_logic;  -- ZB
9763
    X_10 : in    std_logic;  -- I0B
9764
    X_11 : in    std_logic;  -- I1B
9765
    X_12 : in    std_logic;  -- I2B
9766
    X_13 : in    std_logic;  -- I3B
9767
    X_14 : in    std_logic;  -- S0
9768
    X_15 : in    std_logic;  -- OEB\
9769
    X_16 : inout std_logic   -- Vcc
9770
);
9771
end entity SN74LS253N;
9772
 
9773
architecture BEHAV of SN74LS253N is
9774
    signal D : TTLInputs(2 downto 1, 4 downto 1);
9775
    signal A : unsigned(2 downto 1);
9776
    signal E : std_logic_vector(2 downto 1);        -- Enables: B:A channels
9777
    signal Q : std_logic_vector(2 downto 1);
9778
    signal C : natural range 4 downto 1;
9779
 
9780
begin
9781
    A <= (X_2,  X_14);
9782
    C <= 1+TTL_to_integer(A);
9783
    E <= (not X_15, not X_1 );                      -- Active high internally
9784
    D <= ((X_13, X_12, X_11, X_10), (X_3, X_4, X_5, X_6));
9785
    (X_9, X_7) <= Q;
9786
 
9787
    G: for i in E'range generate
9788
    begin
9789
        OQ: TTL3State
9790
        generic map(
9791
            tPLH => tPLH,
9792
            tPHL => tPHL,
9793
            tPZH => tPZX,
9794
            tPZL => tPZX,
9795
            tPHZ => tPXZ,
9796
            tPLZ => tPXZ
9797
        )
9798
        port map(
9799
            A => D(i,C),
9800
            E => E(i),
9801
            Y => Q(i)
9802
        );
9803
    end generate;
9804
end architecture BEHAV;
9805
 
9806
-----------------------------------------------------------------------
9807
-- SN74LS256N: Dual 4-bit addressable latch
9808
--             Verified 18/12/2016
9809
-----------------------------------------------------------------------
9810
library ieee;
9811
    use ieee.std_logic_1164.all;
9812
    use ieee.std_logic_misc.all;
9813
    use ieee.numeric_std.all;
9814
 
9815
    use work.LSTTL.all;
9816
    use work.TTLPrivate.all;
9817
 
9818
entity SN74LS256N is
9819
generic(
9820
    tPXDA : time := 30 ns;
9821
    tPHLC : time := 18 ns
9822
);
9823
port(
9824
    X_1  : in    std_logic;  -- A0
9825
    X_2  : in    std_logic;  -- A1
9826
    X_3  : in    std_logic;  -- DA
9827
    X_4  : out   std_logic;  -- O0A
9828
    X_5  : out   std_logic;  -- O1A
9829
    X_6  : out   std_logic;  -- O2A
9830
    X_7  : out   std_logic;  -- O3A
9831
    X_8  : inout std_logic;  -- GND
9832
    X_9  : out   std_logic;  -- O0B
9833
    X_10 : out   std_logic;  -- O1B
9834
    X_11 : out   std_logic;  -- O2B
9835
    X_12 : out   std_logic;  -- O3B
9836
    X_13 : in    std_logic;  -- DB
9837
    X_14 : in    std_logic;  -- E\
9838
    X_15 : in    std_logic;  -- CL\
9839
    X_16 : inout std_logic   -- Vcc
9840
);
9841
end entity SN74LS256N;
9842
 
9843
architecture BEHAV of SN74LS256N is
9844
    signal AD : unsigned(1 downto 0);
9845
    signal A, B : std_logic_vector(3 downto 0);
9846
begin
9847
    AD <= (X_2, X_1);
9848
    (X_7,  X_6,  X_5,  X_4) <= A;
9849
    (X_12, X_11, X_10, X_9) <= B;
9850
 
9851
    L1: TTLadLatch
9852
    generic map(
9853
        ABits => 2,
9854
        tPXDA => tPXDA,
9855
        tPHLC => tPHLC
9856
    )
9857
    port map(
9858
        D     => X_3,
9859
        En    => X_14,
9860
        Cn    => X_15,
9861
        A     => AD,
9862
        Z     => A
9863
    );
9864
 
9865
    L2: TTLadLatch
9866
    generic map(
9867
        ABits => 2,
9868
        tPXDA => tPXDA,
9869
        tPHLC => tPHLC
9870
    )
9871
    port map(
9872
        D     => X_13,
9873
        En    => X_14,
9874
        Cn    => X_15,
9875
        A     => AD,
9876
        Z     => B
9877
    );
9878
end architecture BEHAV;
9879
 
9880
-----------------------------------------------------------------------
9881
-- SN74LS257N: Quad 2-input multiplexer (3-state outputs)
9882
--             Verified 18/12/2016
9883
-----------------------------------------------------------------------
9884
library ieee;
9885
    use ieee.std_logic_1164.all;
9886
    use ieee.std_logic_misc.all;
9887
    use ieee.numeric_std.all;
9888
 
9889
    use work.LSTTL.all;
9890
    use work.TTLPrivate.all;
9891
 
9892
entity SN74LS257N is
9893
generic(
9894
    tPI  : time := 18 ns;
9895
    tPS  : time := 21 ns;
9896
    tPE  : time := 30 ns
9897
);
9898
port(
9899
    X_1  : in    std_logic;  -- S
9900
    X_2  : in    std_logic;  -- I0A
9901
    X_3  : in    std_logic;  -- I1A
9902
    X_4  : out   std_logic;  -- ZA
9903
    X_5  : in    std_logic;  -- I0B
9904
    X_6  : in    std_logic;  -- I1B
9905
    X_7  : out   std_logic;  -- ZB
9906
    X_8  : inout std_logic;  -- GND
9907
    X_9  : out   std_logic;  -- ZD
9908
    X_10 : in    std_logic;  -- I1D
9909
    X_11 : in    std_logic;  -- I0D
9910
    X_12 : out   std_logic;  -- ZC
9911
    X_13 : in    std_logic;  -- I1C
9912
    X_14 : in    std_logic;  -- I0C
9913
    X_15 : in    std_logic;  -- OE\
9914
    X_16 : inout std_logic   -- Vcc
9915
);
9916
end entity SN74LS257N;
9917
 
9918
architecture BEHAV of SN74LS257N is
9919
    signal D    : std_logic_vector(7 downto 0);     -- Raw data, vectorized
9920
    signal Y, Z : std_logic_vector(3 downto 0);     -- Output data, ditto
9921
    signal E    : std_logic;                        -- Output enable, active high
9922
    signal N    : unsigned(1 downto 0);             -- Input select, as unsigned
9923
    signal A    : natural;                          -- Ditto, numeric
9924
begin
9925
    N <= '0' & X_1;
9926
    A <= to_integer(N) after tPS - tPI;
9927
    D <= (X_10, X_11, X_13, X_14, X_6, X_5, X_3, X_2);
9928
    E <= not X_15;
9929
    (X_9, X_12, X_7, X_4) <= Z;
9930
 
9931
    GE: for i in Y'range generate
9932
    begin
9933
        ZB: TTL3State
9934
        generic map(
9935
            tPLH => tPI,
9936
            tPHL => tPI,
9937
            tPZH => tPE,
9938
            tPZL => tPE,
9939
            tPHZ => tPE,
9940
            tPLZ => tPE
9941
        )
9942
        port map(
9943
            A    => Y(i),
9944
            E    => E,
9945
            Y    => Z(i)
9946
        );
9947
    end generate;
9948
 
9949
    MUX: process(all) is
9950
    begin
9951
        for i in Y'range loop
9952
            Y(i) <= D((2*i)+A);
9953
        end loop;
9954
    end process;
9955
end architecture BEHAV;
9956
 
9957
-----------------------------------------------------------------------
9958
-- SN74LS258N: Quad 2-input multiplexer (inverting 3-state outputs)
9959
-----------------------------------------------------------------------
9960
library ieee;
9961
    use ieee.std_logic_1164.all;
9962
    use ieee.std_logic_misc.all;
9963
    use ieee.numeric_std.all;
9964
 
9965
    use work.LSTTL.all;
9966
    use work.TTLPrivate.all;
9967
 
9968
entity SN74LS258N is
9969
generic(
9970
    tPI  : time := 18 ns;
9971
    tPS  : time := 21 ns;
9972
    tPE  : time := 30 ns
9973
);
9974
port(
9975
    X_1  : in    std_logic;  -- S
9976
    X_2  : in    std_logic;  -- I0A
9977
    X_3  : in    std_logic;  -- I1A
9978
    X_4  : out   std_logic;  -- ZA\
9979
    X_5  : in    std_logic;  -- I0B
9980
    X_6  : in    std_logic;  -- I1B
9981
    X_7  : out   std_logic;  -- ZB\
9982
    X_8  : inout std_logic;  -- GND
9983
    X_9  : out   std_logic;  -- ZD\
9984
    X_10 : in    std_logic;  -- I1D
9985
    X_11 : in    std_logic;  -- I0D
9986
    X_12 : out   std_logic;  -- ZC\
9987
    X_13 : in    std_logic;  -- I1C
9988
    X_14 : in    std_logic;  -- I0C
9989
    X_15 : in    std_logic;  -- OE\
9990
    X_16 : inout std_logic   -- Vcc
9991
);
9992
end entity SN74LS258N;
9993
 
9994
architecture BEHAV of SN74LS258N is
9995
    signal D    : std_logic_vector(7 downto 0);     -- Raw data, vectorized
9996
    signal Y, Z : std_logic_vector(3 downto 0);     -- Output data, ditto
9997
    signal E    : std_logic;                        -- Output enable, active high
9998
    signal N    : unsigned(1 downto 0);             -- Input select, as unsigned
9999
    signal A    : natural;                          -- Ditto, numeric
10000
begin
10001
    N <= '0' & X_1;
10002
    A <= to_integer(N) after tPS - tPI;
10003
    D <= (X_10, X_11, X_13, X_14, X_6, X_5, X_3, X_2);
10004
    E <= not X_15;
10005
    (X_9, X_12, X_7, X_4) <= Z;
10006
 
10007
    GE: for i in Y'range generate
10008
    begin
10009
        ZB: TTL3State
10010
        generic map(
10011
            tPLH => tPI,
10012
            tPHL => tPI,
10013
            tPZH => tPE,
10014
            tPZL => tPE,
10015
            tPHZ => tPE,
10016
            tPLZ => tPE
10017
        )
10018
        port map(
10019
            A    => Y(i),
10020
            E    => E,
10021
            Y    => Z(i)
10022
        );
10023
    end generate;
10024
 
10025
    MUX: process(all) is
10026
    begin
10027
        for i in Y'range loop
10028
            Y(i) <= not D((2*i)+A);
10029
        end loop;
10030
    end process;
10031
end architecture BEHAV;
10032
 
10033
-----------------------------------------------------------------------
10034
-- SN74LS259N: 8-bit addressable latch
10035
-----------------------------------------------------------------------
10036
library ieee;
10037
    use ieee.std_logic_1164.all;
10038
    use ieee.std_logic_misc.all;
10039
    use ieee.numeric_std.all;
10040
 
10041
    use work.LSTTL.all;
10042
    use work.TTLPrivate.all;
10043
 
10044
entity SN74LS259N is
10045
generic(
10046
    tPXDA : time := 30 ns;
10047
    tPHLC : time := 18 ns
10048
);
10049
port(
10050
    X_1  : in    std_logic;  -- A0
10051
    X_2  : in    std_logic;  -- A1
10052
    X_3  : in    std_logic;  -- A2
10053
    X_4  : out   std_logic;  -- Q0
10054
    X_5  : out   std_logic;  -- Q1
10055
    X_6  : out   std_logic;  -- Q2
10056
    X_7  : out   std_logic;  -- Q3
10057
    X_8  : inout std_logic;  -- GND
10058
    X_9  : out   std_logic;  -- Q4
10059
    X_10 : out   std_logic;  -- Q5
10060
    X_11 : out   std_logic;  -- Q6
10061
    X_12 : out   std_logic;  -- Q7
10062
    X_13 : in    std_logic;  -- D
10063
    X_14 : in    std_logic;  -- E\
10064
    X_15 : in    std_logic;  -- CL\
10065
    X_16 : inout std_logic   -- Vcc
10066
);
10067
end entity SN74LS259N;
10068
 
10069
architecture BEHAV of SN74LS259N is
10070
    signal AD : unsigned(2 downto 0);
10071
    signal A  : std_logic_vector(7 downto 0);
10072
begin
10073
    AD <= (X_3, X_2, X_1);
10074
    (X_12, X_11, X_10, X_9, X_7, X_6, X_5, X_4) <= A;
10075
 
10076
    L1: TTLadLatch
10077
    generic map(
10078
        ABits => 3,
10079
        tPXDA => tPXDA,
10080
        tPHLC => tPHLC
10081
    )
10082
    port map(
10083
        D     => X_13,
10084
        En    => X_14,
10085
        Cn    => X_15,
10086
        A     => AD,
10087
        Z     => A
10088
    );
10089
end architecture BEHAV;
10090
 
10091
-----------------------------------------------------------------------
10092
-- SN74LS260N: Dual 5-input NOR gate
10093
--             Verified 30/05/2016
10094
-----------------------------------------------------------------------
10095
library ieee;
10096
    use ieee.std_logic_1164.all;
10097
 
10098
    use work.LSTTL.all;
10099
    use work.TTLPrivate.all;
10100
 
10101
entity SN74LS260N is
10102
generic(
10103
    tPLH : time := 10 ns;
10104
    tPHL : time := 12 ns
10105
);
10106
port(
10107
    X_1  : in    std_logic;  -- I1A
10108
    X_2  : in    std_logic;  -- I2A
10109
    X_3  : in    std_logic;  -- I3A
10110
    X_4  : in    std_logic;  -- I1B
10111
    X_5  : out   std_logic;  -- ZA\
10112
    X_6  : out   std_logic;  -- ZB\
10113
    X_7  : inout std_logic;  -- GND
10114
    X_8  : in    std_logic;  -- I2B
10115
    X_9  : in    std_logic;  -- I3B
10116
    X_10 : in    std_logic;  -- I4B
10117
    X_11 : in    std_logic;  -- I5B
10118
    X_12 : in    std_logic;  -- I4A
10119
    X_13 : in    std_logic;  -- I5A
10120
    X_14 : inout std_logic   -- Vcc
10121
);
10122
end entity SN74LS260N;
10123
 
10124
architecture BEHAV of SN74LS260N is
10125
    signal A : TTLInputs (1 to 2, 1 to 5);
10126
    signal Y : TTLOutputs(1 to 2);
10127
 
10128
begin
10129
    A <= ( (X_1, X_2, X_3, X_12, X_13), (X_4, X_8, X_9, X_10, X_11) );
10130
 
10131
    (X_5, X_6) <= Y;
10132
 
10133
    G: TTLgate
10134
    generic map(
10135
        mode   => Zor,      -- Zand, Zor, Zxor, Zbuf
10136
        invert => '1',      -- '1' will invert the output
10137
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
10138
        tPLH   => tPLH,
10139
        tPHL   => tPHL
10140
    )
10141
    port map(
10142
        ins   => A,
10143
        outs  => Y
10144
    );
10145
end architecture BEHAV;
10146
 
10147
-----------------------------------------------------------------------
10148
-- SN74LS266N: Quad 2-input XNOR gate (open collector)
10149
--             Verified 30/05/2016
10150
-----------------------------------------------------------------------
10151
library ieee;
10152
    use ieee.std_logic_1164.all;
10153
 
10154
    use work.LSTTL.all;
10155
    use work.TTLPrivate.all;
10156
 
10157
entity SN74LS266N is
10158
generic(
10159
    tPLH : time := 30 ns;
10160
    tPHL : time := 30 ns
10161
);
10162
port(
10163
    X_1  : in    std_logic;  -- 1A
10164
    X_2  : in    std_logic;  -- 1B
10165
    X_3  : out   std_logic;  -- 1Y\
10166
    X_4  : out   std_logic;  -- 2Y\
10167
    X_5  : in    std_logic;  -- 2A
10168
    X_6  : in    std_logic;  -- 2B
10169
    X_7  : inout std_logic;  -- GND
10170
    X_8  : in    std_logic;  -- 3B
10171
    X_9  : in    std_logic;  -- 3A
10172
    X_10 : out   std_logic;  -- 3Y\
10173
    X_11 : out   std_logic;  -- 4Y\
10174
    X_12 : in    std_logic;  -- 4B
10175
    X_13 : in    std_logic;  -- 4A
10176
    X_14 : inout std_logic   -- Vcc 
10177
);
10178
end entity SN74LS266N;
10179
 
10180
architecture BEHAV of SN74LS266N is
10181
    signal A : TTLInputs (1 to 4, 1 to 2);
10182
    signal Y : TTLOutputs(1 to 4);
10183
 
10184
begin
10185
    A <= ( (X_1, X_2), (X_5, X_6), (X_8, X_9), (X_12, X_13) );
10186
 
10187
    (X_3, X_4, X_10, X_11) <= Y;
10188
 
10189
    G: TTLgate
10190
    generic map(
10191
        mode   => Zxor,     -- Zand, Zor, Zxor, Zbuf
10192
        invert => '1',      -- '1' will invert the output
10193
        ohigh  => 'Z',      -- '1' = normal, 'Z' = open collectors
10194
        tPLH   => tPLH,
10195
        tPHL   => tPHL
10196
    )
10197
    port map(
10198
        ins   => A,
10199
        outs  => Y
10200
    );
10201
 
10202
end architecture BEHAV;
10203
 
10204
-----------------------------------------------------------------------
10205
-- SN74LS273N: 8-bit register, with Clear
10206
--             Verified 18/12/2016
10207
-----------------------------------------------------------------------
10208
library ieee;
10209
    use ieee.std_logic_1164.all;
10210
 
10211
    use work.LSTTL.all;
10212
    use work.TTLPrivate.all;
10213
 
10214
entity SN74LS273N is
10215
generic(
10216
    tPX  : time := 24 ns
10217
);
10218
port(
10219
    X_1  : in    std_logic;  -- MR\
10220
    X_2  : out   std_logic;  -- Q0
10221
    X_3  : in    std_logic;  -- D0
10222
    X_4  : in    std_logic;  -- D1
10223
    X_5  : out   std_logic;  -- Q1
10224
    X_6  : out   std_logic;  -- Q2
10225
    X_7  : in    std_logic;  -- D2
10226
    X_8  : in    std_logic;  -- D3
10227
    X_9  : out   std_logic;  -- Q3
10228
    X_10 : inout std_logic;  -- GND
10229
    X_11 : in    std_logic;  -- CP
10230
    X_12 : out   std_logic;  -- Q4
10231
    X_13 : in    std_logic;  -- D4
10232
    X_14 : in    std_logic;  -- D5
10233
    X_15 : out   std_logic;  -- Q5
10234
    X_16 : out   std_logic;  -- Q6
10235
    X_17 : in    std_logic;  -- D6
10236
    X_18 : in    std_logic;  -- D7
10237
    X_19 : out   std_logic;  -- Q7
10238
    X_20 : inout std_logic   -- Vcc
10239
);
10240
end entity SN74LS273N;
10241
 
10242
architecture BEHAV of SN74LS273N is
10243
    signal A, Y : std_logic_vector(7 downto 0);
10244
begin
10245
    A <= (X_18, X_17, X_14, X_13, X_8, X_7, X_4, X_3);
10246
    (X_19, X_16, X_15, X_12, X_9, X_6, X_5, X_2) <= Y after tPX;
10247
 
10248
    process(all) is
10249
    begin
10250
        if X_1 = '0' then
10251
            Y <= (others => '0');
10252
        elsif rising_edge(X_11) then
10253
            Y <= A;
10254
        end if;
10255
    end process;
10256
end architecture BEHAV;
10257
 
10258
-----------------------------------------------------------------------
10259
-- SN74LS279N: Quad set/reset latch
10260
--             Verified 18/12/2016
10261
-----------------------------------------------------------------------
10262
library ieee;
10263
    use ieee.std_logic_1164.all;
10264
 
10265
    use work.LSTTL.all;
10266
    use work.TTLPrivate.all;
10267
 
10268
entity SN74LS279N is
10269
generic(
10270
    tPX  : time := 27 ns
10271
);
10272
port(
10273
    X_1  : in    std_logic;  -- 1R\
10274
    X_2  : in    std_logic;  -- 1S1\
10275
    X_3  : in    std_logic;  -- 1S2\
10276
    X_4  : out   std_logic;  -- 1Q
10277
    X_5  : in    std_logic;  -- 2R\
10278
    X_6  : in    std_logic;  -- 2S\
10279
    X_7  : out   std_logic;  -- 2Q
10280
    X_8  : inout std_logic;  -- GND
10281
    X_9  : out   std_logic;  -- 3Q
10282
    X_10 : in    std_logic;  -- 3S\
10283
    X_11 : in    std_logic;  -- 3R1\
10284
    X_12 : in    std_logic;  -- 3R2\
10285
    X_13 : out   std_logic;  -- 4Q
10286
    X_14 : in    std_logic;  -- 4S\
10287
    X_15 : in    std_logic;  -- 4R\
10288
    X_16 : inout std_logic   -- Vcc
10289
);
10290
end entity SN74LS279N;
10291
 
10292
architecture BEHAV of SN74LS279N is
10293
    signal R, S, Q : std_logic_vector(3 downto 0);
10294
begin
10295
    R  <= (X_15, X_12 and X_11, X_5, X_1);
10296
    S  <= (X_14, X_10, X_6, X_3 and  X_2);
10297
    (X_13, X_9, X_7, X_4) <= Q after tPX;
10298
 
10299
    process(all) is
10300
        variable Z : std_logic_vector(1 downto 0);
10301
    begin
10302
        for i in Q'range loop
10303
            Z := S(i) & R(i);
10304
            case Z is
10305
                when "11"   => null;
10306
                when "01"   => Q(i) <= '1';
10307
                when "10"   => Q(i) <= '0';
10308
                when others => Q(i) <= 'X';
10309
            end case;
10310
        end loop;
10311
    end process;
10312
end architecture BEHAV;
10313
 
10314
-----------------------------------------------------------------------
10315
-- SN74LS280N: 9-bit parity generator/checker
10316
--             Verified 18/12/2016
10317
-----------------------------------------------------------------------
10318
library ieee;
10319
    use ieee.std_logic_1164.all;
10320
    use ieee.std_logic_misc.all;
10321
 
10322
    use work.LSTTL.all;
10323
    use work.TTLPrivate.all;
10324
 
10325
entity SN74LS280N is
10326
generic(
10327
    tPLH : time := 21 ns;
10328
    tPHL : time := 18 ns
10329
);
10330
port(
10331
    X_1  : in    std_logic;  -- I6
10332
    X_2  : in    std_logic;  -- I7
10333
                             -- 
10334
    X_4  : in    std_logic;  -- I8
10335
    X_5  : out   std_logic;  -- SE
10336
    X_6  : out   std_logic;  -- SO
10337
    X_7  : inout std_logic;  -- GND
10338
    X_8  : in    std_logic;  -- I0
10339
    X_9  : in    std_logic;  -- I1
10340
    X_10 : in    std_logic;  -- I2
10341
    X_11 : in    std_logic;  -- I3
10342
    X_12 : in    std_logic;  -- I4
10343
    X_13 : in    std_logic;  -- I5
10344
    X_14 : inout std_logic   -- Vcc
10345
);
10346
end entity SN74LS280N;
10347
 
10348
architecture BEHAV of SN74LS280N is
10349
    signal A    : std_logic_vector(8 downto 0);
10350
    signal Y, Z : std_logic;
10351
begin
10352
    A <= (X_4, X_2, X_1, X_13, X_12, X_11, X_10, X_9, X_8);
10353
    Y <= xor_reduce(A);
10354
 
10355
    OD: TTLdelay
10356
    generic map(
10357
        tPLH => tPLH,
10358
        tPHL => tPHL
10359
    )
10360
    port map(
10361
        A => Y,
10362
        B => Z
10363
    );
10364
 
10365
    X_6 <= Z;
10366
    X_5 <= not Z;
10367
end architecture BEHAV;
10368
 
10369
-----------------------------------------------------------------------
10370
-- SN74LS283N: 4-bit binary full adder (with fast carry)
10371
--             Verified 06/06/2016
10372
-----------------------------------------------------------------------
10373
library ieee;
10374
    use ieee.std_logic_1164.all;
10375
    use ieee.numeric_std.all;
10376
 
10377
    use work.LSTTL.all;
10378
    use work.TTLPrivate.all;
10379
 
10380
entity SN74LS283N is
10381
generic(
10382
    tPLHS  : time := 24 ns;
10383
    tPHLS  : time := 24 ns;
10384
    tPLHC  : time := 17 ns;
10385
    tPHLC  : time := 17 ns
10386
);
10387
port(
10388
    X_1  : out   std_logic;  -- S1
10389
    X_2  : in    std_logic;  -- B1
10390
    X_3  : in    std_logic;  -- A1
10391
    X_4  : out   std_logic;  -- S0
10392
    X_5  : in    std_logic;  -- A0
10393
    X_6  : in    std_logic;  -- B0
10394
    X_7  : in    std_logic;  -- C0
10395
    X_8  : inout std_logic;  -- GND
10396
    X_9  : out   std_logic;  -- C4
10397
    X_10 : out   std_logic;  -- S3
10398
    X_11 : in    std_logic;  -- B3
10399
    X_12 : in    std_logic;  -- A3
10400
    X_13 : out   std_logic;  -- S2
10401
    X_14 : in    std_logic;  -- A2
10402
    X_15 : in    std_logic;  -- B2
10403
    X_16 : inout std_logic   -- Vcc
10404
);
10405
end entity SN74LS283N;
10406
 
10407
architecture BEHAV of SN74LS283N is
10408
    signal A, B, S : unsigned(4 downto 0);  -- S(4) = carry-out
10409
    signal SUM     : unsigned(3 downto 0);
10410
begin
10411
    A <= ('0', X_12, X_14, X_3, X_5);
10412
    B <= ('0', X_11, X_15, X_2, X_6);
10413
 
10414
    S <= A + B + X_7;
10415
 
10416
    G: for i in SUM'range generate
10417
    begin
10418
    DSM: TTLdelay
10419
        generic map(
10420
            tPLH => tPLHS,
10421
            tPHL => tPHLS
10422
        )
10423
        port map(
10424
            A => S(i),
10425
            B => SUM(i)
10426
        );
10427
    end generate;
10428
 
10429
    DCY: TTLdelay
10430
        generic map(
10431
            tPLH => tPLHC,
10432
            tPHL => tPHLC
10433
        )
10434
        port map(
10435
            A => S(4),
10436
            B => X_9
10437
        );
10438
 
10439
    (X_10, X_13, X_1, X_4) <= SUM;
10440
end architecture BEHAV;
10441
 
10442
-----------------------------------------------------------------------
10443
-- SN74LS289N: 64-bit random access memory (open collector)
10444
--             Verified 06/06/2016
10445
-----------------------------------------------------------------------
10446
library ieee;
10447
    use ieee.std_logic_1164.all;
10448
    use ieee.std_logic_misc.all;
10449
    use ieee.numeric_std.all;
10450
 
10451
    use work.LSTTL.all;
10452
    use work.TTLPrivate.all;
10453
 
10454
entity SN74LS289N is
10455
generic(
10456
    tPLC : time    := 10 ns;
10457
    tPLA : time    := 37 ns;
10458
    tSUD : time    := 25 ns;
10459
    tSUA : time    := 10 ns
10460
);
10461
port(
10462
    X_1  : in    std_logic;  -- A0
10463
    X_2  : in    std_logic;  -- CS\
10464
    X_3  : in    std_logic;  -- WE\
10465
    X_4  : in    std_logic;  -- D1
10466
    X_5  : out   std_logic;  -- Q1\
10467
    X_6  : in    std_logic;  -- D2
10468
    X_7  : out   std_logic;  -- Q2\
10469
    X_8  : inout std_logic;  -- GND
10470
    X_9  : out   std_logic;  -- Q3\
10471
    X_10 : in    std_logic;  -- D3
10472
    X_11 : out   std_logic;  -- Q4\
10473
    X_12 : in    std_logic;  -- D4
10474
    X_13 : in    std_logic;  -- A3
10475
    X_14 : in    std_logic;  -- A2
10476
    X_15 : in    std_logic;  -- A1
10477
    X_16 : inout std_logic   -- Vcc
10478
);
10479
end entity SN74LS289N;
10480
 
10481
architecture BEHAV of SN74LS289N is
10482
    signal  RE, WE   : std_logic := '1';
10483
    signal  ia       : std_logic_vector(3 downto 0) := (others => '0');
10484
    signal  D, QB, Q : std_logic_vector(3 downto 0);
10485
begin
10486
    RE <= not(    X_3 and not X_2);
10487
    WE <= not(not X_3 and not X_2);
10488
    ia <=    (X_13, X_14, X_15, X_1);
10489
    D  <=    (X_12, X_10, X_6, X_4);
10490
    (X_11, X_9, X_7, X_5) <= Q;
10491
 
10492
    MB: TTLramblock
10493
    generic map(
10494
        Omode => OpenColl,
10495
        INVT  => '1',
10496
        tPLC  => tPLC,
10497
        tPLA  => tPLA,
10498
        tSUD  => tSUD,
10499
        tSUA  => tSUA
10500
    )
10501
    port map(
10502
        RA    => ia,
10503
        WA    => ia,
10504
        D     => D,
10505
        O     => Q,
10506
        CE    => '0',
10507
        RE    => RE,
10508
        WE    => WE
10509
    );
10510
end architecture BEHAV;
10511
 
10512
-----------------------------------------------------------------------
10513
-- SN74LS290N: BCD decade counter
10514
--             Verified 31/05/2016
10515
-----------------------------------------------------------------------
10516
library ieee;
10517
    use ieee.std_logic_1164.all;
10518
 
10519
    use work.LSTTL.all;
10520
    use work.TTLPrivate.all;
10521
 
10522
entity SN74LS290N is
10523
generic(
10524
    tPLH0 : time := 16 ns;
10525
    tPHL0 : time := 18 ns;
10526
    tPLH1 : time := 16 ns;
10527
    tPHL1 : time := 21 ns;
10528
    tPLH2 : time := 32 ns;
10529
    tPHL2 : time := 35 ns;
10530
    tPLH3 : time := 32 ns;
10531
    tPHL3 : time := 35 ns
10532
);
10533
port(
10534
    X_1  : in    std_logic;  -- MS1
10535
                             -- 
10536
    X_3  : in    std_logic;  -- MS2
10537
    X_4  : out   std_logic;  -- Q2
10538
    X_5  : out   std_logic;  -- Q1
10539
                             -- 
10540
    X_7  : inout std_logic;  -- GND
10541
    X_8  : out   std_logic;  -- Q3
10542
    X_9  : out   std_logic;  -- Q0
10543
    X_10 : in    std_logic;  -- CP0\
10544
    X_11 : in    std_logic;  -- CP1\
10545
    X_12 : in    std_logic;  -- MR1
10546
    X_13 : in    std_logic;  -- MR2
10547
    X_14 : inout std_logic   -- Vcc
10548
);
10549
end entity SN74LS290N;
10550
 
10551
architecture BEHAV of SN74LS290N is
10552
    signal rst, set : std_logic;
10553
    signal val      : std_logic_vector(3 downto 0);
10554
begin
10555
    rst <= not (X_12 and X_13);
10556
    set <= not (X_1  and X_3 );
10557
    (X_8, X_4, X_5, X_9) <= val;
10558
 
10559
    M1: TTLcount4
10560
    generic map(
10561
        tPLH0   => tPLH0,
10562
        tPHL0   => tPHL0,
10563
        tPLH1   => tPLH1,
10564
        tPHL1   => tPHL1,
10565
        tPLH2   => tPLH2,
10566
        tPHL2   => tPHL2,
10567
        tPLH3   => tPLH3,
10568
        tPHL3   => tPHL3,
10569
        modulus => 10
10570
    )
10571
    port map(
10572
        ld   => '1',
10573
        d    => (others => '0'),
10574
        clka => X_10,
10575
        clkb => X_11,
10576
        rst  => rst,
10577
        set  => set,
10578
        val  => val
10579
    );
10580
end architecture BEHAV;
10581
 
10582
-----------------------------------------------------------------------
10583
-- SN74LS293N: 4-bit binary counter
10584
--             Verified 31/05/2016
10585
-----------------------------------------------------------------------
10586
library ieee;
10587
    use ieee.std_logic_1164.all;
10588
 
10589
    use work.LSTTL.all;
10590
    use work.TTLPrivate.all;
10591
 
10592
entity SN74LS293N is
10593
generic(
10594
    tPLH0 : time := 16 ns;
10595
    tPHL0 : time := 18 ns;
10596
    tPLH1 : time := 16 ns;
10597
    tPHL1 : time := 21 ns;
10598
    tPLH2 : time := 32 ns;
10599
    tPHL2 : time := 35 ns;
10600
    tPLH3 : time := 32 ns;
10601
    tPHL3 : time := 35 ns
10602
);
10603
port(
10604
                             -- 
10605
                             -- 
10606
                             -- 
10607
    X_4  : out   std_logic;  -- Q2
10608
    X_5  : out   std_logic;  -- Q1
10609
                             -- 
10610
    X_7  : inout std_logic;  -- GND
10611
    X_8  : out   std_logic;  -- Q3
10612
    X_9  : out   std_logic;  -- Q0
10613
    X_10 : in    std_logic;  -- CP0\
10614
    X_11 : in    std_logic;  -- CP1\
10615
    X_12 : in    std_logic;  -- MR1
10616
    X_13 : in    std_logic;  -- MR2
10617
    X_14 : inout std_logic   -- Vcc
10618
);
10619
end entity SN74LS293N;
10620
 
10621
architecture BEHAV of SN74LS293N is
10622
    signal rst : std_logic;
10623
    signal val : std_logic_vector(3 downto 0);
10624
begin
10625
    rst <= not (X_12 and X_13);
10626
    (X_8, X_4, X_5, X_9) <= val;
10627
 
10628
    M1: TTLcount4
10629
    generic map(
10630
        tPLH0   => tPLH0,
10631
        tPHL0   => tPHL0,
10632
        tPLH1   => tPLH1,
10633
        tPHL1   => tPHL1,
10634
        tPLH2   => tPLH2,
10635
        tPHL2   => tPHL2,
10636
        tPLH3   => tPLH3,
10637
        tPHL3   => tPHL3,
10638
        modulus => 16
10639
    )
10640
    port map(
10641
        ld   => '1',
10642
        d    => (others => '0'),
10643
        clka => X_10,
10644
        clkb => X_11,
10645
        rst  => rst,
10646
        set  => '1',
10647
        val  => val
10648
    );
10649
end architecture BEHAV;
10650
 
10651
-----------------------------------------------------------------------
10652
-- SN74LS295AN: 4-bit shift register (3-state outputs)
10653
--              Verified 18/12/2016
10654
-----------------------------------------------------------------------
10655
library ieee;
10656
    use ieee.std_logic_1164.all;
10657
 
10658
    use work.LSTTL.all;
10659
    use work.TTLPrivate.all;
10660
 
10661
entity SN74LS295AN is
10662
generic(
10663
    tPLH : time := 30 ns;
10664
    tPHL : time := 26 ns;
10665
    tPZH : time := 18 ns;
10666
    tPZL : time := 20 ns;
10667
    tPHZ : time := 24 ns;
10668
    tPLZ : time := 20 ns
10669
);
10670
port(
10671
    X_1  : in    std_logic;  -- DS
10672
    X_2  : in    std_logic;  -- P0
10673
    X_3  : in    std_logic;  -- P1
10674
    X_4  : in    std_logic;  -- P2
10675
    X_5  : in    std_logic;  -- P3
10676
    X_6  : in    std_logic;  -- PE
10677
    X_7  : inout std_logic;  -- GND
10678
    X_8  : in    std_logic;  -- OE
10679
    X_9  : in    std_logic;  -- CP\
10680
    X_10 : out   std_logic;  -- Q3
10681
    X_11 : out   std_logic;  -- Q2
10682
    X_12 : out   std_logic;  -- Q1
10683
    X_13 : out   std_logic;  -- Q0
10684
    X_14 : inout std_logic   -- Vcc
10685
);
10686
end entity SN74LS295AN;
10687
 
10688
architecture BEHAV of SN74LS295AN is
10689
    signal P, REG, Q : std_logic_vector(3 downto 0);
10690
 
10691
    alias CP  is X_9;
10692
    alias PE  is X_6;
10693
    alias DS  is X_1;
10694
    alias OE  is X_8;
10695
 
10696
begin
10697
    P <= (X_5, X_4, X_3, X_2);
10698
    (X_10, X_11, X_12, X_13) <= Q;
10699
 
10700
    process(CP) is
10701
    begin
10702
        if falling_edge(CP) then
10703
            if PE = '1' then            -- Load
10704
                REG <= P;
10705
            else
10706
                REG <= REG(2 downto 0) & DS;
10707
            end if;
10708
        end if;
10709
    end process;
10710
 
10711
    G: for i in REG'range generate
10712
    begin
10713
        OB: TTL3State
10714
        generic map(
10715
            tPLH => tPLH,
10716
            tPHL => tPHL,
10717
            tPZH => tPZH,
10718
            tPZL => tPZL,
10719
            tPHZ => tPHZ,
10720
            tPLZ => tPLZ
10721
        )
10722
        port map(
10723
            A    => REG(i),
10724
            E    => OE,
10725
            Y    => Q(i)
10726
        );
10727
    end generate;
10728
 
10729
    DO: TTLdelays
10730
    generic map(
10731
        tPLH => tPLH,
10732
        tPHL => tPHL
10733
    )
10734
    port map(
10735
        A => REG,
10736
        B => Q
10737
    );
10738
end architecture BEHAV;
10739
 
10740
-----------------------------------------------------------------------
10741
-- SN74LS298N: Quad 2-port register (multiplexer with storage)
10742
--             Verified 19/12/2016
10743
-----------------------------------------------------------------------
10744
library ieee;
10745
    use ieee.std_logic_1164.all;
10746
 
10747
    use work.LSTTL.all;
10748
    use work.TTLPrivate.all;
10749
 
10750
entity SN74LS298N is
10751
generic(
10752
    tPLH : time := 25 ns;
10753
    tPHL : time := 25 ns
10754
);
10755
port(
10756
    X_1  : in    std_logic;  -- I1B
10757
    X_2  : in    std_logic;  -- I1A
10758
    X_3  : in    std_logic;  -- I0A
10759
    X_4  : in    std_logic;  -- I0B
10760
    X_5  : in    std_logic;  -- I1C
10761
    X_6  : in    std_logic;  -- I1D
10762
    X_7  : in    std_logic;  -- I0D
10763
    X_8  : inout std_logic;  -- GND
10764
    X_9  : in    std_logic;  -- I0C
10765
    X_10 : in    std_logic;  -- S
10766
    X_11 : in    std_logic;  -- CP\
10767
    X_12 : out   std_logic;  -- QD
10768
    X_13 : out   std_logic;  -- QC
10769
    X_14 : out   std_logic;  -- QB
10770
    X_15 : out   std_logic;  -- QA
10771
    X_16 : inout std_logic   -- Vcc
10772
);
10773
end entity SN74LS298N;
10774
 
10775
architecture BEHAV of SN74LS298N is
10776
    signal D    : TTLInputs(4 downto 1, 2 downto 1);
10777
    signal R, Q : std_logic_vector(4 downto 1);
10778
    signal C    : natural range 2 downto 1;
10779
 
10780
    alias CP is X_11;
10781
    alias S  is X_10;
10782
 
10783
begin
10784
    C <= 2 when To_bit(S) = '1' else 1;
10785
    D <= ((X_6,  X_7), (X_5,  X_9), (X_1,  X_4), (X_2,  X_3));
10786
    (X_12, X_13, X_14, X_15) <= Q;
10787
 
10788
    process(CP) is              -- Output register
10789
    begin
10790
        if falling_edge(CP) then
10791
            for i in R'range loop
10792
                R(i) <= D(i,C);
10793
            end loop;
10794
        end if;
10795
    end process;
10796
 
10797
    OQ: TTLdelays
10798
    generic map(
10799
        tPLH => tPLH,
10800
        tPHL => tPHL
10801
    )
10802
    port map(
10803
        A => R,
10804
        B => Q
10805
    );
10806
end architecture BEHAV;
10807
 
10808
-----------------------------------------------------------------------
10809
-- SN74LS299N: 8-bit universal shift/storage register
10810
--             Verified 20/12/2016
10811
-----------------------------------------------------------------------
10812
library ieee;
10813
    use ieee.std_logic_1164.all;
10814
    use ieee.numeric_std.all;
10815
 
10816
    use work.LSTTL.all;
10817
    use work.TTLPrivate.all;
10818
 
10819
entity SN74LS299N is
10820
generic(
10821
    tPLH : time := 25 ns;
10822
    tPHL : time := 29 ns;
10823
    tPZH : time := 18 ns;
10824
    tPZL : time := 23 ns;
10825
    tPHZ : time := 15 ns;
10826
    tPLZ : time := 15 ns;
10827
    tRSD : time :=  3 ns     -- Extra delay after reset
10828
);
10829
port(
10830
    X_1  : in    std_logic;  -- S0
10831
    X_2  : in    std_logic;  -- OE1\
10832
    X_3  : in    std_logic;  -- OE2\
10833
    X_4  : inout std_logic;  -- IO6
10834
    X_5  : inout std_logic;  -- IO4
10835
    X_6  : inout std_logic;  -- IO2
10836
    X_7  : inout std_logic;  -- IO0
10837
    X_8  : out   std_logic;  -- Q0
10838
    X_9  : in    std_logic;  -- MR\
10839
    X_10 : inout std_logic;  -- GND
10840
    X_11 : in    std_logic;  -- DS0
10841
    X_12 : in    std_logic;  -- CP
10842
    X_13 : inout std_logic;  -- IO1
10843
    X_14 : inout std_logic;  -- IO3
10844
    X_15 : inout std_logic;  -- IO5
10845
    X_16 : inout std_logic;  -- IO7
10846
    X_17 : out   std_logic;  -- Q7
10847
    X_18 : in    std_logic;  -- DS7
10848
    X_19 : in    std_logic;  -- S1
10849
    X_20 : inout std_logic   -- Vcc
10850
);
10851
end entity SN74LS299N;
10852
 
10853
architecture BEHAV of SN74LS299N is
10854
    signal D, Q, Z : std_logic_vector(0 to 7);  -- Internal register (NB direction)
10855
    signal S   : unsigned(1 downto 0);
10856
    signal OE  : std_logic;
10857
 
10858
    alias  MR  is X_9;
10859
    alias  CP  is X_12;
10860
    alias  DS0 is X_11;
10861
    alias  DS7 is X_18;
10862
 
10863
begin
10864
    S    <= (X_19, X_1);
10865
    OE   <= not(X_2) and not(X_3) and not(X_1 and X_19);
10866
    D    <= (X_7, X_13, X_6, X_14, X_5, X_15, X_4, X_16);   -- Parallel load
10867
    X_8  <= Q(0);
10868
    X_17 <= Q(7);
10869
    (X_7, X_13, X_6, X_14, X_5, X_15, X_4, X_16) <= Z;      -- When driven
10870
 
10871
    G: for i in Q'range generate
10872
    begin
10873
        OB: TTL3State
10874
        generic map(
10875
            tPLH => tPLH,
10876
            tPHL => tPHL,
10877
            tPZH => tPZH,
10878
            tPZL => tPZL,
10879
            tPHZ => tPHZ,
10880
            tPLZ => tPLZ
10881
        )
10882
        port map(
10883
            A    => Q(i),
10884
            E    => OE,
10885
            Y    => Z(i)
10886
        );
10887
    end generate;
10888
 
10889
    process(MR, CP) is                                  -- Main register
10890
    begin
10891
        if MR = '0' then
10892
            Q <= (others => '0') after tRSD;            -- MR is slightly late
10893
        elsif rising_edge(CP) then
10894
            case S is
10895
                when "01"   => Q <= DS0 & Q(0 to 6);    -- Shift right
10896
                when "10"   => Q <= Q(1 to 7) & DS7;    -- Shift left
10897
                when "11"   => Q <= D;                  -- Parallel load
10898
                when others => null;                    -- "00" hold
10899
            end case;
10900
        end if;
10901
    end process;
10902
end architecture BEHAV;
10903
 
10904
-----------------------------------------------------------------------
10905
-- SN74LS322N: 8-bit SIPO register (with sign extend)
10906
--             Verified 21/12/2016
10907
-----------------------------------------------------------------------
10908
library ieee;
10909
    use ieee.std_logic_1164.all;
10910
    use ieee.numeric_std.all;
10911
 
10912
    use work.LSTTL.all;
10913
    use work.TTLPrivate.all;
10914
 
10915
entity SN74LS322N is
10916
generic(
10917
    tPLH : time := 25 ns;
10918
    tPHL : time := 30 ns;
10919
    tPZH : time := 25 ns;
10920
    tPZL : time := 30 ns;
10921
    tPHZ : time := 23 ns;
10922
    tPLZ : time := 23 ns;
10923
    tRSD : time :=  3 ns     -- Extra delay after reset
10924
);
10925
port(
10926
    X_1  : in    std_logic;  -- RE\
10927
    X_2  : in    std_logic;  -- S/P\
10928
    X_3  : in    std_logic;  -- D0
10929
    X_4  : inout std_logic;  -- IO7
10930
    X_5  : inout std_logic;  -- IO5
10931
    X_6  : inout std_logic;  -- IO3
10932
    X_7  : inout std_logic;  -- IO1
10933
    X_8  : in    std_logic;  -- OE\
10934
    X_9  : in    std_logic;  -- MR\
10935
    X_10 : inout std_logic;  -- GND
10936
    X_11 : in    std_logic;  -- CP
10937
    X_12 : out   std_logic;  -- Q0
10938
    X_13 : inout std_logic;  -- IO0
10939
    X_14 : inout std_logic;  -- IO2
10940
    X_15 : inout std_logic;  -- IO4
10941
    X_16 : inout std_logic;  -- IO6
10942
    X_17 : in    std_logic;  -- D1
10943
    X_18 : in    std_logic;  -- SE\
10944
    X_19 : in    std_logic;  -- S
10945
    X_20 : inout std_logic   -- Vcc
10946
);
10947
end entity SN74LS322N;
10948
 
10949
architecture BEHAV of SN74LS322N is
10950
    signal D,   Q,  Z : std_logic_vector(7 downto 0);  -- Internal register (NB direction)
10951
    signal OEI, DI    : std_logic;
10952
 
10953
    alias  MR  is X_9;
10954
    alias  CP  is X_11;
10955
    alias  D0  is X_3;
10956
    alias  D1  is X_17;
10957
    alias  S   is X_19;
10958
    alias  RE  is X_1;
10959
    alias  SP  is X_2;
10960
    alias  SE  is X_18;
10961
    alias  OE  is X_8;
10962
    alias  Q0  is Q(0);
10963
 
10964
begin
10965
    OEI  <= (SP or RE) and not(OE);
10966
    DI   <= D0 when S = '0' else D1;
10967
    D    <= (X_4, X_16, X_5, X_15, X_6, X_14, X_7, X_13);   -- Parallel load
10968
    X_12 <= Q0;
10969
    (X_4, X_16, X_5, X_15, X_6, X_14, X_7, X_13) <= Z;      -- When driven
10970
 
10971
    G: for i in Q'range generate
10972
    begin
10973
        OB: TTL3State
10974
        generic map(
10975
            tPLH => tPLH,
10976
            tPHL => tPHL,
10977
            tPZH => tPZH,
10978
            tPZL => tPZL,
10979
            tPHZ => tPHZ,
10980
            tPLZ => tPLZ
10981
        )
10982
        port map(
10983
            A    => Q(i),
10984
            E    => OEI,
10985
            Y    => Z(i)
10986
        );
10987
    end generate;
10988
 
10989
    process(MR, CP) is                                  -- Main register
10990
        variable SEL : unsigned(2 downto 0);
10991
    begin
10992
        if MR = '0' then
10993
            Q <= (others => '0') after tRSD;            -- MR is slightly late
10994
        elsif rising_edge(CP) then
10995
            SEL := RE & SP & SE;
10996
            case SEL is
10997
                when "011"  => Q <= DI   & Q(7 downto 1);   -- Shift right
10998
                when "010"  => Q <= Q(7) & Q(7 downto 1);   -- Sign extend
10999
                when "00-"  => Q <= D;                      -- Parallel load
11000
                when others => null;                        -- Hold
11001
            end case;
11002
        end if;
11003
    end process;
11004
 
11005
end architecture BEHAV;
11006
 
11007
-----------------------------------------------------------------------
11008
-- SN74LS323N: 8-bit universal shift/storage register
11009
--             Verified 21/12/2016
11010
-----------------------------------------------------------------------
11011
library ieee;
11012
    use ieee.std_logic_1164.all;
11013
    use ieee.numeric_std.all;
11014
 
11015
    use work.LSTTL.all;
11016
    use work.TTLPrivate.all;
11017
 
11018
entity SN74LS323N is
11019
generic(
11020
    tPLH : time := 25 ns;
11021
    tPHL : time := 29 ns;
11022
    tPZH : time := 18 ns;
11023
    tPZL : time := 23 ns;
11024
    tPHZ : time := 15 ns;
11025
    tPLZ : time := 15 ns
11026
);
11027
port(
11028
    X_1  : in    std_logic;  -- S0
11029
    X_2  : in    std_logic;  -- OE1\
11030
    X_3  : in    std_logic;  -- OE2\
11031
    X_4  : inout std_logic;  -- IO6
11032
    X_5  : inout std_logic;  -- IO4
11033
    X_6  : inout std_logic;  -- IO2
11034
    X_7  : inout std_logic;  -- IO0
11035
    X_8  : out   std_logic;  -- Q0
11036
    X_9  : in    std_logic;  -- SR\
11037
    X_10 : inout std_logic;  -- GND
11038
    X_11 : in    std_logic;  -- DSO
11039
    X_12 : in    std_logic;  -- CP
11040
    X_13 : inout std_logic;  -- IO1
11041
    X_14 : inout std_logic;  -- IO3
11042
    X_15 : inout std_logic;  -- IO5
11043
    X_16 : inout std_logic;  -- IO7
11044
    X_17 : out   std_logic;  -- Q7
11045
    X_18 : in    std_logic;  -- DS7
11046
    X_19 : in    std_logic;  -- S1
11047
    X_20 : inout std_logic   -- Vcc
11048
);
11049
end entity SN74LS323N;
11050
 
11051
architecture BEHAV of SN74LS323N is
11052
    signal D, Q, Z : std_logic_vector(0 to 7);  -- Internal register (NB direction)
11053
    signal OE  : std_logic;
11054
 
11055
    alias  SR  is X_9;
11056
    alias  CP  is X_12;
11057
    alias  DS0 is X_11;
11058
    alias  DS7 is X_18;
11059
 
11060
begin
11061
    OE   <= not(X_2) and not(X_3) and not(X_1 and X_19);
11062
    D    <= (X_7, X_13, X_6, X_14, X_5, X_15, X_4, X_16);   -- Parallel load
11063
    X_8  <= Q(0);
11064
    X_17 <= Q(7);
11065
    (X_7, X_13, X_6, X_14, X_5, X_15, X_4, X_16) <= Z;      -- When driven
11066
 
11067
    G: for i in Q'range generate
11068
    begin
11069
        OB: TTL3State
11070
        generic map(
11071
            tPLH => tPLH,
11072
            tPHL => tPHL,
11073
            tPZH => tPZH,
11074
            tPZL => tPZL,
11075
            tPHZ => tPHZ,
11076
            tPLZ => tPLZ
11077
        )
11078
        port map(
11079
            A    => Q(i),
11080
            E    => OE,
11081
            Y    => Z(i)
11082
        );
11083
    end generate;
11084
 
11085
    process(CP) is                                          -- Main register
11086
        variable S : unsigned(2 downto 0);
11087
    begin
11088
        if rising_edge(CP) then
11089
            S := (SR, X_19, X_1);
11090
            case S is
11091
                when "0--"  => Q <= (others => '0');    -- Sync. reset
11092
                when "101"  => Q <= DS0 & Q(0 to 6);    -- Shift right
11093
                when "110"  => Q <= Q(1 to 7) & DS7;    -- Shift left
11094
                when "111"  => Q <= D;                  -- Parallel load
11095
                when others => null;                    -- Hold
11096
            end case;
11097
        end if;
11098
    end process;
11099
end architecture BEHAV;
11100
 
11101
-----------------------------------------------------------------------
11102
-- SN74LS352N: Dual 4-input multiplexer
11103
--             Verified 21/12/2016
11104
-----------------------------------------------------------------------
11105
library ieee;
11106
    use ieee.std_logic_1164.all;
11107
    use ieee.std_logic_misc.all;
11108
    use ieee.numeric_std.all;
11109
 
11110
    use work.LSTTL.all;
11111
    use work.TTLPrivate.all;
11112
 
11113
entity SN74LS352N is
11114
generic(
11115
    tPLH : time := 22 ns;
11116
    tPHL : time := 38 ns
11117
);
11118
port(
11119
    X_1  : in    std_logic;  -- EA\
11120
    X_2  : in    std_logic;  -- S1
11121
    X_3  : in    std_logic;  -- I3A
11122
    X_4  : in    std_logic;  -- I2A
11123
    X_5  : in    std_logic;  -- I1A
11124
    X_6  : in    std_logic;  -- I0A
11125
    X_7  : out   std_logic;  -- ZA
11126
    X_8  : inout std_logic;  -- GND
11127
    X_9  : out   std_logic;  -- ZB
11128
    X_10 : in    std_logic;  -- I0B
11129
    X_11 : in    std_logic;  -- I1B
11130
    X_12 : in    std_logic;  -- I2B
11131
    X_13 : in    std_logic;  -- I3B
11132
    X_14 : in    std_logic;  -- S0
11133
    X_15 : in    std_logic;  -- EB\
11134
    X_16 : inout std_logic   -- Vcc
11135
);
11136
end entity SN74LS352N;
11137
 
11138
architecture BEHAV of SN74LS352N is
11139
    signal D : TTLInputs(2 downto 1, 4 downto 1);
11140
    signal A : unsigned(2 downto 1);
11141
    signal E : std_logic_vector(2 downto 1);        -- Enables: B:A channels
11142
    signal Q : std_logic_vector(2 downto 1);
11143
    signal C : natural range 4 downto 1;
11144
 
11145
begin
11146
    A <= (X_2,  X_14);
11147
    C <= 1+TTL_to_integer(A);
11148
    E <= (X_15, X_1 );
11149
    D <= ((X_13,  X_12,  X_11,  X_10), (X_3,  X_4,  X_5,  X_6));
11150
    (X_9, X_7) <= Q;
11151
 
11152
    G: for i in E'range generate
11153
        signal Z : std_logic;
11154
    begin
11155
        Z <= not((not E(i)) and D(i,C));
11156
 
11157
        OQ: TTLdelay
11158
        generic map(
11159
            tPLH => tPLH,
11160
            tPHL => tPHL
11161
        )
11162
        port map(
11163
            A => Z,
11164
            B => Q(i)
11165
        );
11166
    end generate;
11167
end architecture BEHAV;
11168
 
11169
-----------------------------------------------------------------------
11170
-- SN74LS353N: Dual 4-input multiplexer (3-state outputs)
11171
--             Verified 21/12/2016
11172
-----------------------------------------------------------------------
11173
library ieee;
11174
    use ieee.std_logic_1164.all;
11175
    use ieee.std_logic_misc.all;
11176
    use ieee.numeric_std.all;
11177
 
11178
    use work.LSTTL.all;
11179
    use work.TTLPrivate.all;
11180
 
11181
entity SN74LS353N is
11182
generic(
11183
    tPLH  : time := 24 ns;
11184
    tPHL  : time := 32 ns;
11185
    tPZX  : time := 18 ns;
11186
    tPXZ  : time := 18 ns
11187
);
11188
port(
11189
    X_1  : in    std_logic;  -- OEA\
11190
    X_2  : in    std_logic;  -- S1
11191
    X_3  : in    std_logic;  -- I3A
11192
    X_4  : in    std_logic;  -- I2A
11193
    X_5  : in    std_logic;  -- I1A
11194
    X_6  : in    std_logic;  -- I0A
11195
    X_7  : out   std_logic;  -- ZA\
11196
    X_8  : inout std_logic;  -- GND
11197
    X_9  : out   std_logic;  -- ZB\
11198
    X_10 : in    std_logic;  -- I0B
11199
    X_11 : in    std_logic;  -- I1B
11200
    X_12 : in    std_logic;  -- I2B
11201
    X_13 : in    std_logic;  -- I3B
11202
    X_14 : in    std_logic;  -- S0
11203
    X_15 : in    std_logic;  -- OEB\
11204
    X_16 : inout std_logic   -- Vcc
11205
);
11206
end entity SN74LS353N;
11207
 
11208
architecture BEHAV of SN74LS353N is
11209
    signal D : TTLInputs(2 downto 1, 4 downto 1);
11210
    signal A : unsigned(2 downto 1);
11211
    signal E : std_logic_vector(2 downto 1);        -- Enables: B:A channels
11212
    signal Q : std_logic_vector(2 downto 1);
11213
    signal C : natural range 4 downto 1;
11214
 
11215
begin
11216
    A <= (X_2,  X_14);
11217
    C <= 1+TTL_to_integer(A);
11218
    E <= (not X_15, not X_1 );                      -- Active high internally
11219
    D <= ((X_13, X_12, X_11, X_10), (X_3, X_4, X_5, X_6));
11220
    (X_9, X_7) <= Q;
11221
 
11222
    G: for i in E'range generate
11223
        signal Z : std_logic;
11224
    begin
11225
        Z <= not D(i,C);
11226
        OQ: TTL3State
11227
        generic map(
11228
            tPLH => tPLH,
11229
            tPHL => tPHL,
11230
            tPZH => tPZX,
11231
            tPZL => tPZX,
11232
            tPHZ => tPXZ,
11233
            tPLZ => tPXZ
11234
        )
11235
        port map(
11236
            A => Z,
11237
            E => E(i),
11238
            Y => Q(i)
11239
        );
11240
    end generate;
11241
end architecture BEHAV;
11242
 
11243
-----------------------------------------------------------------------
11244
-- SN74LS365AN: Hex 3-state buffer
11245
--             Verified 21/12/2016
11246
-----------------------------------------------------------------------
11247
library ieee;
11248
    use ieee.std_logic_1164.all;
11249
    use ieee.numeric_std.all;
11250
 
11251
    use work.LSTTL.all;
11252
    use work.TTLPrivate.all;
11253
 
11254
entity SN74LS365AN is
11255
generic(
11256
    tPLH : time := 16 ns;
11257
    tPHL : time := 22 ns;
11258
    tPZH : time := 24 ns;
11259
    tPZL : time := 30 ns;
11260
    tPHZ : time := 20 ns;
11261
    tPLZ : time := 25 ns
11262
);
11263
port(
11264
    X_1  : in    std_logic;  -- E1\
11265
    X_2  : in    std_logic;  -- A1
11266
    X_3  : out   std_logic;  -- Y1
11267
    X_4  : in    std_logic;  -- A2
11268
    X_5  : out   std_logic;  -- Y2
11269
    X_6  : in    std_logic;  -- A3
11270
    X_7  : out   std_logic;  -- Y3
11271
    X_8  : inout std_logic;  -- GND
11272
    X_9  : out   std_logic;  -- Y4
11273
    X_10 : in    std_logic;  -- A4
11274
    X_11 : out   std_logic;  -- Y5
11275
    X_12 : in    std_logic;  -- A5
11276
    X_13 : out   std_logic;  -- Y6
11277
    X_14 : in    std_logic;  -- A6
11278
    X_15 : in    std_logic;  -- E2\
11279
    X_16 : inout std_logic   -- Vcc
11280
);
11281
end entity SN74LS365AN;
11282
 
11283
architecture BEHAV of SN74LS365AN is
11284
    signal A, Z : std_logic_vector(5 downto 0);
11285
    signal E    : std_logic;
11286
begin
11287
    E <= not(X_1 or X_15);
11288
    A <= (X_14, X_12, X_10, X_6, X_4, X_2);
11289
    (X_13, X_11, X_9, X_7, X_5, X_3) <= Z;
11290
 
11291
    G: for i in A'range generate
11292
        signal B : std_logic;
11293
    begin
11294
        B <= A(i);
11295
        TB: TTL3State
11296
        generic map(
11297
            tPLH => tPLH,
11298
            tPHL => tPHL,
11299
            tPZH => tPZH,
11300
            tPZL => tPZL,
11301
            tPHZ => tPHZ,
11302
            tPLZ => tPLZ
11303
        )
11304
        port map(
11305
            A    => B,
11306
            E    => E,
11307
            Y    => Z(i)
11308
        );
11309
    end generate;
11310
end architecture BEHAV;
11311
 
11312
-----------------------------------------------------------------------
11313
-- SN74LS366AN: Hex 3-state inverter buffer
11314
--             Verified 21/12/2016
11315
-----------------------------------------------------------------------
11316
library ieee;
11317
    use ieee.std_logic_1164.all;
11318
    use ieee.numeric_std.all;
11319
 
11320
    use work.LSTTL.all;
11321
    use work.TTLPrivate.all;
11322
 
11323
entity SN74LS366AN is
11324
generic(
11325
    tPLH : time := 16 ns;
11326
    tPHL : time := 22 ns;
11327
    tPZH : time := 24 ns;
11328
    tPZL : time := 30 ns;
11329
    tPHZ : time := 20 ns;
11330
    tPLZ : time := 25 ns
11331
);
11332
port(
11333
    X_1  : in    std_logic;  -- E1\
11334
    X_2  : in    std_logic;  -- A1
11335
    X_3  : out   std_logic;  -- Y1\
11336
    X_4  : in    std_logic;  -- A2
11337
    X_5  : out   std_logic;  -- Y2\
11338
    X_6  : in    std_logic;  -- A3
11339
    X_7  : out   std_logic;  -- Y3\
11340
    X_8  : inout std_logic;  -- GND
11341
    X_9  : out   std_logic;  -- Y4\
11342
    X_10 : in    std_logic;  -- A4
11343
    X_11 : out   std_logic;  -- Y5\
11344
    X_12 : in    std_logic;  -- A5
11345
    X_13 : out   std_logic;  -- Y6\
11346
    X_14 : in    std_logic;  -- A6
11347
    X_15 : in    std_logic;  -- E2\
11348
    X_16 : inout std_logic   -- Vcc
11349
);
11350
end entity SN74LS366AN;
11351
 
11352
architecture BEHAV of SN74LS366AN is
11353
    signal A, Z : std_logic_vector(5 downto 0);
11354
    signal E    : std_logic;
11355
begin
11356
    E <= not(X_1 or X_15);
11357
    A <= (X_14, X_12, X_10, X_6, X_4, X_2);
11358
    (X_13, X_11, X_9, X_7, X_5, X_3) <= Z;
11359
 
11360
    G: for i in A'range generate
11361
        signal B : std_logic;
11362
    begin
11363
        B <= not A(i);
11364
        TB: TTL3State
11365
        generic map(
11366
            tPLH => tPLH,
11367
            tPHL => tPHL,
11368
            tPZH => tPZH,
11369
            tPZL => tPZL,
11370
            tPHZ => tPHZ,
11371
            tPLZ => tPLZ
11372
        )
11373
        port map(
11374
            A    => B,
11375
            E    => E,
11376
            Y    => Z(i)
11377
        );
11378
    end generate;
11379
end architecture BEHAV;
11380
 
11381
-----------------------------------------------------------------------
11382
-- SN74LS367AN: Hex 3-state buffer (2 & 4-bit sections)
11383
--              Verified 21/12/2016
11384
-----------------------------------------------------------------------
11385
library ieee;
11386
    use ieee.std_logic_1164.all;
11387
    use ieee.numeric_std.all;
11388
 
11389
    use work.LSTTL.all;
11390
    use work.TTLPrivate.all;
11391
 
11392
entity SN74LS367AN is
11393
generic(
11394
    tPLH : time := 16 ns;
11395
    tPHL : time := 22 ns;
11396
    tPZH : time := 24 ns;
11397
    tPZL : time := 30 ns;
11398
    tPHZ : time := 20 ns;
11399
    tPLZ : time := 25 ns
11400
);
11401
port(
11402
    X_1  : in    std_logic;  -- E14\
11403
    X_2  : in    std_logic;  -- A1
11404
    X_3  : out   std_logic;  -- Y1
11405
    X_4  : in    std_logic;  -- A2
11406
    X_5  : out   std_logic;  -- Y2
11407
    X_6  : in    std_logic;  -- A3
11408
    X_7  : out   std_logic;  -- Y3
11409
    X_8  : inout std_logic;  -- GND
11410
    X_9  : out   std_logic;  -- Y4
11411
    X_10 : in    std_logic;  -- A4
11412
    X_11 : out   std_logic;  -- Y5
11413
    X_12 : in    std_logic;  -- A5
11414
    X_13 : out   std_logic;  -- Y6
11415
    X_14 : in    std_logic;  -- A6
11416
    X_15 : in    std_logic;  -- E56\
11417
    X_16 : inout std_logic   -- Vcc
11418
);
11419
end entity SN74LS367AN;
11420
 
11421
architecture BEHAV of SN74LS367AN is
11422
    signal A, Z : std_logic_vector(5 downto 0);
11423
begin
11424
    A <= (X_14, X_12, X_10, X_6, X_4, X_2);
11425
    (X_13, X_11, X_9, X_7, X_5, X_3) <= Z;
11426
 
11427
    G: for i in A'range generate
11428
        signal B, E : std_logic;
11429
    begin
11430
        B <= A(i);
11431
        E <= not X_15 when i > 3 else not X_1;
11432
        TB: TTL3State
11433
        generic map(
11434
            tPLH => tPLH,
11435
            tPHL => tPHL,
11436
            tPZH => tPZH,
11437
            tPZL => tPZL,
11438
            tPHZ => tPHZ,
11439
            tPLZ => tPLZ
11440
        )
11441
        port map(
11442
            A    => B,
11443
            E    => E,
11444
            Y    => Z(i)
11445
        );
11446
    end generate;
11447
end architecture BEHAV;
11448
 
11449
-----------------------------------------------------------------------
11450
-- SN74LS368AN: Hex 3-state inverter/buffer (2 & 4-bit sections)
11451
--              Verified 21/12/2016
11452
-----------------------------------------------------------------------
11453
library ieee;
11454
    use ieee.std_logic_1164.all;
11455
    use ieee.numeric_std.all;
11456
 
11457
    use work.LSTTL.all;
11458
    use work.TTLPrivate.all;
11459
 
11460
entity SN74LS368AN is
11461
generic(
11462
    tPLH : time := 16 ns;
11463
    tPHL : time := 22 ns;
11464
    tPZH : time := 24 ns;
11465
    tPZL : time := 30 ns;
11466
    tPHZ : time := 20 ns;
11467
    tPLZ : time := 25 ns
11468
);
11469
port(
11470
    X_1  : in    std_logic;  -- E14\
11471
    X_2  : in    std_logic;  -- A1
11472
    X_3  : out   std_logic;  -- Y1\
11473
    X_4  : in    std_logic;  -- A2
11474
    X_5  : out   std_logic;  -- Y2\
11475
    X_6  : in    std_logic;  -- A3
11476
    X_7  : out   std_logic;  -- Y3\
11477
    X_8  : inout std_logic;  -- GND
11478
    X_9  : out   std_logic;  -- Y4\
11479
    X_10 : in    std_logic;  -- A4
11480
    X_11 : out   std_logic;  -- Y5\
11481
    X_12 : in    std_logic;  -- A5
11482
    X_13 : out   std_logic;  -- Y6\
11483
    X_14 : in    std_logic;  -- A6
11484
    X_15 : in    std_logic;  -- E56\
11485
    X_16 : inout std_logic   -- Vcc
11486
);
11487
end entity SN74LS368AN;
11488
 
11489
architecture BEHAV of SN74LS368AN is
11490
    signal A, Z : std_logic_vector(5 downto 0);
11491
begin
11492
    A <= (X_14, X_12, X_10, X_6, X_4, X_2);
11493
    (X_13, X_11, X_9, X_7, X_5, X_3) <= Z;
11494
 
11495
    G: for i in A'range generate
11496
        signal B, E : std_logic;
11497
    begin
11498
        B <= not A(i);
11499
        E <= not X_15 when i > 3 else not X_1;
11500
        TB: TTL3State
11501
        generic map(
11502
            tPLH => tPLH,
11503
            tPHL => tPHL,
11504
            tPZH => tPZH,
11505
            tPZL => tPZL,
11506
            tPHZ => tPHZ,
11507
            tPLZ => tPLZ
11508
        )
11509
        port map(
11510
            A    => B,
11511
            E    => E,
11512
            Y    => Z(i)
11513
        );
11514
    end generate;
11515
end architecture BEHAV;
11516
 
11517
-----------------------------------------------------------------------
11518
-- SN74LS373N: Octal transparent latch (3-state outputs)
11519
--             Verified 21/12/2016
11520
-----------------------------------------------------------------------
11521
library ieee;
11522
    use ieee.std_logic_1164.all;
11523
 
11524
    use work.LSTTL.all;
11525
    use work.TTLPrivate.all;
11526
 
11527
entity SN74LS373N is
11528
generic(
11529
    tPLH : time := 18 ns;
11530
    tPHL : time := 20 ns;
11531
    tPZH : time := 28 ns;
11532
    tPZL : time := 36 ns;
11533
    tPHZ : time := 20 ns;
11534
    tPLZ : time := 25 ns
11535
);
11536
port(
11537
    X_1  : in    std_logic;  -- OE\
11538
    X_2  : out   std_logic;  -- Q0
11539
    X_3  : in    std_logic;  -- D0
11540
    X_4  : in    std_logic;  -- D1
11541
    X_5  : out   std_logic;  -- Q1
11542
    X_6  : out   std_logic;  -- Q2
11543
    X_7  : in    std_logic;  -- D2
11544
    X_8  : in    std_logic;  -- D3
11545
    X_9  : out   std_logic;  -- Q3
11546
    X_10 : inout std_logic;  -- GND
11547
    X_11 : in    std_logic;  -- LE
11548
    X_12 : out   std_logic;  -- Q4
11549
    X_13 : in    std_logic;  -- D4
11550
    X_14 : in    std_logic;  -- D5
11551
    X_15 : out   std_logic;  -- Q5
11552
    X_16 : out   std_logic;  -- Q6
11553
    X_17 : in    std_logic;  -- D6
11554
    X_18 : in    std_logic;  -- D7
11555
    X_19 : out   std_logic;  -- Q7
11556
    X_20 : inout std_logic   -- Vcc
11557
);
11558
end entity SN74LS373N;
11559
 
11560
architecture BEHAV of SN74LS373N is
11561
    signal D, Q, Z : std_logic_vector(7 downto 0);
11562
    signal LE, OE  : std_logic;
11563
 
11564
begin
11565
    LE <= X_11;
11566
    OE <= not X_1;
11567
    D  <= (X_18, X_17, X_14, X_13, X_8, X_7, X_4, X_3);
11568
    (X_19, X_16, X_15, X_12, X_9,  X_6, X_5, X_2) <= Z;
11569
 
11570
    process(all) is
11571
    begin
11572
        if LE = '1' then
11573
            Q <= D;
11574
        end if;
11575
    end process;
11576
 
11577
    G: for i in D'range generate
11578
    begin
11579
        TB: TTL3State
11580
        generic map(
11581
            tPLH => tPLH,
11582
            tPHL => tPHL,
11583
            tPZH => tPZH,
11584
            tPZL => tPZL,
11585
            tPHZ => tPHZ,
11586
            tPLZ => tPLZ
11587
        )
11588
        port map(
11589
            A    => Q(i),
11590
            E    => OE,
11591
            Y    => Z(i)
11592
        );
11593
    end generate;
11594
end architecture BEHAV;
11595
 
11596
-----------------------------------------------------------------------
11597
-- SN74LS374N: Octal D-flipflop (3-state outputs)
11598
--             Verified 21/12/2016
11599
-----------------------------------------------------------------------
11600
library ieee;
11601
    use ieee.std_logic_1164.all;
11602
 
11603
    use work.LSTTL.all;
11604
    use work.TTLPrivate.all;
11605
 
11606
entity SN74LS374N is
11607
generic(
11608
    tPLH : time := 18 ns;
11609
    tPHL : time := 20 ns;
11610
    tPZH : time := 28 ns;
11611
    tPZL : time := 36 ns;
11612
    tPHZ : time := 20 ns;
11613
    tPLZ : time := 25 ns
11614
);
11615
port(
11616
    X_1  : in    std_logic;  -- OE\
11617
    X_2  : out   std_logic;  -- Q0
11618
    X_3  : in    std_logic;  -- D0
11619
    X_4  : in    std_logic;  -- D1
11620
    X_5  : out   std_logic;  -- Q1
11621
    X_6  : out   std_logic;  -- Q2
11622
    X_7  : in    std_logic;  -- D2
11623
    X_8  : in    std_logic;  -- D3
11624
    X_9  : out   std_logic;  -- Q3
11625
    X_10 : inout std_logic;  -- GND
11626
    X_11 : in    std_logic;  -- CP
11627
    X_12 : out   std_logic;  -- Q4
11628
    X_13 : in    std_logic;  -- D4
11629
    X_14 : in    std_logic;  -- D5
11630
    X_15 : out   std_logic;  -- Q5
11631
    X_16 : out   std_logic;  -- Q6
11632
    X_17 : in    std_logic;  -- D6
11633
    X_18 : in    std_logic;  -- D7
11634
    X_19 : out   std_logic;  -- Q7
11635
    X_20 : inout std_logic   -- Vcc
11636
);
11637
end entity SN74LS374N;
11638
 
11639
architecture BEHAV of SN74LS374N is
11640
    signal D, Q, Z : std_logic_vector(7 downto 0);
11641
    signal CP, OE  : std_logic;
11642
 
11643
begin
11644
    CP <= X_11;
11645
    OE <= not X_1;
11646
    D  <= (X_18, X_17, X_14, X_13, X_8, X_7, X_4, X_3);
11647
    (X_19, X_16, X_15, X_12, X_9,  X_6, X_5, X_2) <= Z;
11648
 
11649
    process(CP) is
11650
    begin
11651
        if rising_edge(CP) then
11652
            Q <= D;
11653
        end if;
11654
    end process;
11655
 
11656
    G: for i in D'range generate
11657
    begin
11658
        TB: TTL3State
11659
        generic map(
11660
            tPLH => tPLH,
11661
            tPHL => tPHL,
11662
            tPZH => tPZH,
11663
            tPZL => tPZL,
11664
            tPHZ => tPHZ,
11665
            tPLZ => tPLZ
11666
        )
11667
        port map(
11668
            A    => Q(i),
11669
            E    => OE,
11670
            Y    => Z(i)
11671
        );
11672
    end generate;
11673
end architecture BEHAV;
11674
 
11675
-----------------------------------------------------------------------
11676
-- SN74LS375N: 4-bit latch
11677
--             Verified 21/12/2016
11678
-----------------------------------------------------------------------
11679
library ieee;
11680
    use ieee.std_logic_1164.all;
11681
 
11682
    use work.LSTTL.all;
11683
    use work.TTLPrivate.all;
11684
 
11685
entity SN74LS375N is
11686
generic(
11687
    tSETUP : time := 20 ns;     -- Setup time before clock
11688
    tPLHCP : time := 40 ns;     -- Rising
11689
    tPHLCP : time := 25 ns      -- Ralling
11690
);
11691
port(
11692
    X_1  : in    std_logic;  -- D1
11693
    X_2  : out   std_logic;  -- Q1\
11694
    X_3  : out   std_logic;  -- Q1
11695
    X_4  : in    std_logic;  -- E12
11696
    X_5  : out   std_logic;  -- Q2
11697
    X_6  : out   std_logic;  -- Q2\
11698
    X_7  : in    std_logic;  -- D2
11699
    X_8  : inout std_logic;  -- GND
11700
    X_9  : in    std_logic;  -- D3
11701
    X_10 : out   std_logic;  -- Q3\
11702
    X_11 : out   std_logic;  -- Q3
11703
    X_12 : in    std_logic;  -- E34
11704
    X_13 : out   std_logic;  -- Q4
11705
    X_14 : out   std_logic;  -- Q4\
11706
    X_15 : in    std_logic;  -- D4
11707
    X_16 : inout std_logic   -- Vcc
11708
);
11709
end entity SN74LS375N;
11710
 
11711
-- '375 is just a '75 with the pins rearranged
11712
architecture BEHAV of SN74LS375N is
11713
begin
11714
    D: SN74LS75N
11715
    generic map(
11716
        tSETUP => tSETUP,
11717
        tPLHCP => tPLHCP,
11718
        tPHLCP => tPHLCP
11719
    )
11720
    port map(
11721
        X_1  => X_2,  -- Q1\
11722
        X_2  => X_1,  -- D1
11723
        X_3  => X_7,  -- D2
11724
        X_4  => X_12, -- E34
11725
        X_5  => open, -- Vcc
11726
        X_6  => X_9,  -- D3
11727
        X_7  => X_15, -- D4
11728
        X_8  => X_14, -- Q4\
11729
        X_9  => X_13, -- Q4
11730
        X_10 => X_10, -- Q3\
11731
        X_11 => X_11, -- Q3
11732
        X_12 => open, -- GND
11733
        X_13 => X_4,  -- E12
11734
        X_14 => X_6,  -- Q2\
11735
        X_15 => X_5,  -- Q2
11736
        X_16 => X_3   -- Q1
11737
    );
11738
end architecture BEHAV;
11739
 
11740
-----------------------------------------------------------------------
11741
-- SN74LS377N: Octal D-flipflop
11742
--             Verified 21/12/2016
11743
-----------------------------------------------------------------------
11744
library ieee;
11745
    use ieee.std_logic_1164.all;
11746
 
11747
    use work.LSTTL.all;
11748
    use work.TTLPrivate.all;
11749
 
11750
entity SN74LS377N is
11751
generic(
11752
    tPXX : time := 25 ns
11753
);
11754
port(
11755
    X_1  : in    std_logic;  -- E\
11756
    X_2  : out   std_logic;  -- Q0
11757
    X_3  : in    std_logic;  -- D0
11758
    X_4  : in    std_logic;  -- D1
11759
    X_5  : out   std_logic;  -- Q1
11760
    X_6  : out   std_logic;  -- Q2
11761
    X_7  : in    std_logic;  -- D2
11762
    X_8  : in    std_logic;  -- D3
11763
    X_9  : out   std_logic;  -- Q3
11764
    X_10 : inout std_logic;  -- GND
11765
    X_11 : in    std_logic;  -- CP
11766
    X_12 : out   std_logic;  -- Q4
11767
    X_13 : in    std_logic;  -- D4
11768
    X_14 : in    std_logic;  -- D5
11769
    X_15 : out   std_logic;  -- Q5
11770
    X_16 : out   std_logic;  -- Q6
11771
    X_17 : in    std_logic;  -- D6
11772
    X_18 : in    std_logic;  -- D7
11773
    X_19 : out   std_logic;  -- Q7
11774
    X_20 : inout std_logic   -- Vcc
11775
);
11776
end entity SN74LS377N;
11777
 
11778
architecture BEHAV of SN74LS377N is
11779
    signal D, R : std_logic_vector(7 downto 0);
11780
 
11781
    alias CP is X_11;
11782
    alias E  is X_1;
11783
 
11784
begin
11785
    D <= (X_18, X_17, X_14, X_13, X_8, X_7, X_4, X_3);
11786
    (X_19, X_16, X_15, X_12, X_9, X_6, X_5, X_2) <= R after tPXX;
11787
 
11788
    process(CP) is
11789
    begin
11790
        if rising_edge(CP) then
11791
            if E = '0' then
11792
                R <= D;
11793
            end if;
11794
        end if;
11795
    end process;
11796
end architecture BEHAV;
11797
 
11798
-----------------------------------------------------------------------
11799
-- SN74LS378N: 6-bit D register
11800
--             Verified 21/12/2016
11801
-----------------------------------------------------------------------
11802
library ieee;
11803
    use ieee.std_logic_1164.all;
11804
 
11805
    use work.LSTTL.all;
11806
    use work.TTLPrivate.all;
11807
 
11808
entity SN74LS378N is
11809
generic(
11810
    tPXX : time := 27 ns
11811
);
11812
port(
11813
    X_1  : in    std_logic;  -- E\
11814
    X_2  : out   std_logic;  -- Q0
11815
    X_3  : in    std_logic;  -- D0
11816
    X_4  : in    std_logic;  -- D1
11817
    X_5  : out   std_logic;  -- Q1
11818
    X_6  : in    std_logic;  -- D2
11819
    X_7  : out   std_logic;  -- Q2
11820
    X_8  : inout std_logic;  -- GND
11821
    X_9  : in    std_logic;  -- CP
11822
    X_10 : out   std_logic;  -- Q3
11823
    X_11 : in    std_logic;  -- D3
11824
    X_12 : out   std_logic;  -- Q4
11825
    X_13 : in    std_logic;  -- D4
11826
    X_14 : in    std_logic;  -- D5
11827
    X_15 : out   std_logic;  -- Q5
11828
    X_16 : inout std_logic   -- Vcc
11829
);
11830
end entity SN74LS378N;
11831
 
11832
architecture BEHAV of SN74LS378N is
11833
    signal D, R : std_logic_vector(5 downto 0);
11834
 
11835
    alias CP is X_9;
11836
    alias E  is X_1;
11837
 
11838
begin
11839
    D <= (X_14, X_13, X_11, X_6, X_4, X_3);
11840
    (X_15, X_12, X_10, X_7, X_5, X_2) <= R after tPXX;
11841
 
11842
    process(CP) is
11843
    begin
11844
        if rising_edge(CP) then
11845
            if E = '0' then
11846
                R <= D;
11847
            end if;
11848
        end if;
11849
    end process;
11850
end architecture BEHAV;
11851
 
11852
-----------------------------------------------------------------------
11853
-- SN74LS379N: 4-bit D register
11854
--             Verified 21/12/2016
11855
-----------------------------------------------------------------------
11856
library ieee;
11857
    use ieee.std_logic_1164.all;
11858
 
11859
    use work.LSTTL.all;
11860
    use work.TTLPrivate.all;
11861
 
11862
entity SN74LS379N is
11863
generic(
11864
    tPXX : time := 27 ns
11865
);
11866
port(
11867
    X_1  : in    std_logic;  -- E\
11868
    X_2  : out   std_logic;  -- Q0
11869
    X_3  : out   std_logic;  -- Q0\
11870
    X_4  : in    std_logic;  -- D0
11871
    X_5  : in    std_logic;  -- D1
11872
    X_6  : out   std_logic;  -- Q1\
11873
    X_7  : out   std_logic;  -- Q1
11874
    X_8  : inout std_logic;  -- GND
11875
    X_9  : in    std_logic;  -- CP
11876
    X_10 : out   std_logic;  -- Q2
11877
    X_11 : out   std_logic;  -- Q2\
11878
    X_12 : in    std_logic;  -- D2
11879
    X_13 : in    std_logic;  -- D3
11880
    X_14 : out   std_logic;  -- Q3\
11881
    X_15 : out   std_logic;  -- Q3
11882
    X_16 : inout std_logic   -- Vcc
11883
);
11884
end entity SN74LS379N;
11885
 
11886
architecture BEHAV of SN74LS379N is
11887
    signal D, R, N : std_logic_vector(3 downto 0);
11888
 
11889
    alias CP is X_9;
11890
    alias E  is X_1;
11891
 
11892
begin
11893
    D <= (X_13, X_12, X_5, X_4);
11894
    (X_15, X_10, X_7, X_2) <= R after tPXX;
11895
    N <= not R;
11896
    (X_14, X_11, X_6, X_3) <= N after tPXX;
11897
 
11898
 
11899
    process(CP) is
11900
    begin
11901
        if rising_edge(CP) then
11902
            if E = '0' then
11903
                R <= D;
11904
            end if;
11905
        end if;
11906
    end process;
11907
end architecture BEHAV;
11908
 
11909
-----------------------------------------------------------------------
11910
-- SN74LS386N: Quad 2-input xor gate
11911
--             Verified 30/05/2016
11912
-----------------------------------------------------------------------
11913
library ieee;
11914
    use ieee.std_logic_1164.all;
11915
 
11916
    use work.LSTTL.all;
11917
    use work.TTLPrivate.all;
11918
 
11919
entity SN74LS386N is
11920
generic(
11921
    tPLH : time := 30 ns;
11922
    tPHL : time := 30 ns
11923
);
11924
port(
11925
    X_1  : in    std_logic;  -- 1A
11926
    X_2  : in    std_logic;  -- 1B
11927
    X_3  : out   std_logic;  -- 1Y\
11928
    X_4  : out   std_logic;  -- 2Y\
11929
    X_5  : in    std_logic;  -- 2A
11930
    X_6  : in    std_logic;  -- 2B
11931
    X_7  : inout std_logic;  -- GND
11932
    X_8  : in    std_logic;  -- 3B
11933
    X_9  : in    std_logic;  -- 3A
11934
    X_10 : out   std_logic;  -- 3Y\
11935
    X_11 : out   std_logic;  -- 4Y\
11936
    X_12 : in    std_logic;  -- 4B
11937
    X_13 : in    std_logic;  -- 4A
11938
    X_14 : inout std_logic   -- Vcc 
11939
);
11940
end entity SN74LS386N;
11941
 
11942
architecture BEHAV of SN74LS386N is
11943
    signal A : TTLInputs (1 to 4, 1 to 2);
11944
    signal Y : TTLOutputs(1 to 4);
11945
 
11946
begin
11947
    A <= ( (X_1, X_2), (X_5, X_6), (X_8, X_9), (X_12, X_13) );
11948
 
11949
    (X_3, X_4, X_10, X_11) <= Y;
11950
 
11951
    G: TTLgate
11952
    generic map(
11953
        mode   => Zxor,     -- Zand, Zor, Zxor, Zbuf
11954
        invert => '0',      -- '1' will invert the output
11955
        ohigh  => '1',      -- '1' = normal, 'Z' = open collectors
11956
        tPLH   => tPLH,
11957
        tPHL   => tPHL
11958
    )
11959
    port map(
11960
        ins   => A,
11961
        outs  => Y
11962
    );
11963
 
11964
end architecture BEHAV;
11965
 
11966
-----------------------------------------------------------------------
11967
-- SN74LS390N: Dual decade counter
11968
--             Verified 31/05/2016
11969
-----------------------------------------------------------------------
11970
library ieee;
11971
    use ieee.std_logic_1164.all;
11972
 
11973
    use work.LSTTL.all;
11974
    use work.TTLPrivate.all;
11975
 
11976
entity SN74LS390N is
11977
generic(
11978
    tPLH0 : time := 15 ns;
11979
    tPHL0 : time := 15 ns;
11980
    tPLH1 : time := 21 ns;
11981
    tPHL1 : time := 21 ns;
11982
    tPLH2 : time := 30 ns;
11983
    tPHL2 : time := 30 ns;
11984
    tPLH3 : time := 21 ns;
11985
    tPHL3 : time := 21 ns
11986
);
11987
port(
11988
    X_1  : in    std_logic;  -- CPA0\
11989
    X_2  : in    std_logic;  -- MRA
11990
    X_3  : out   std_logic;  -- Q0A
11991
    X_4  : in    std_logic;  -- CPA1\
11992
    X_5  : out   std_logic;  -- Q1A
11993
    X_6  : out   std_logic;  -- Q2A
11994
    X_7  : out   std_logic;  -- Q3A
11995
    X_8  : inout std_logic;  -- GND
11996
    X_9  : out   std_logic;  -- Q3B
11997
    X_10 : out   std_logic;  -- Q2B
11998
    X_11 : out   std_logic;  -- Q1B
11999
    X_12 : in    std_logic;  -- CPB1\
12000
    X_13 : out   std_logic;  -- Q0B
12001
    X_14 : in    std_logic;  -- MRB
12002
    X_15 : in    std_logic;  -- CPB0\
12003
    X_16 : inout std_logic   -- Vcc
12004
);
12005
end entity SN74LS390N;
12006
 
12007
architecture BEHAV of SN74LS390N is
12008
begin
12009
    C1: SN74LS90AN
12010
    generic map(
12011
        tPLH0 => tPLH0,
12012
        tPHL0 => tPHL0,
12013
        tPLH1 => tPLH1 - tPLH0,     -- Reduce, as CLK(3..1) is already delayed
12014
        tPHL1 => tPHL1 - tPHL0,
12015
        tPLH2 => tPLH2 - tPLH0,
12016
        tPHL2 => tPHL2 - tPHL0,
12017
        tPLH3 => tPLH3 - tPLH0,
12018
        tPHL3 => tPHL3 - tPHL0
12019
    )
12020
    port map(
12021
        X_1  => X_4,   -- CP1\
12022
        X_2  => X_2,   -- MR1
12023
        X_3  => X_2,   -- MR2
12024
                       -- 
12025
        X_5  => open,  -- Vcc
12026
        X_6  => '0',   -- MS1
12027
        X_7  => '0',   -- MS2
12028
        X_8  => X_6,   -- Q2
12029
        X_9  => X_5,   -- Q1
12030
        X_10 => open,  -- GND
12031
        X_11 => X_7,   -- Q3
12032
        X_12 => X_3,   -- Q0
12033
                       -- 
12034
        X_14 => X_1    -- CP0\
12035
    );
12036
 
12037
    C2: SN74LS90AN
12038
    generic map(
12039
        tPLH0 => tPLH0,
12040
        tPHL0 => tPHL0,
12041
        tPLH1 => tPLH1 - tPLH0,     -- Reduce, as CLK(3..1) is already delayed
12042
        tPHL1 => tPHL1 - tPHL0,
12043
        tPLH2 => tPLH2 - tPLH0,
12044
        tPHL2 => tPHL2 - tPHL0,
12045
        tPLH3 => tPLH3 - tPLH0,
12046
        tPHL3 => tPHL3 - tPHL0
12047
    )
12048
    port map(
12049
        X_1  => X_12,  -- CP1\
12050
        X_2  => X_14,  -- MR1
12051
        X_3  => X_14,  -- MR2
12052
                       -- 
12053
        X_5  => open,  -- Vcc
12054
        X_6  => '0',   -- MS1
12055
        X_7  => '0',   -- MS2
12056
        X_8  => X_10,  -- Q2
12057
        X_9  => X_11,  -- Q1
12058
        X_10 => open,  -- GND
12059
        X_11 => X_9,   -- Q3
12060
        X_12 => X_13,  -- Q0
12061
                       -- 
12062
        X_14 => X_15   -- CP0\
12063
    );
12064
 
12065
end architecture BEHAV;
12066
 
12067
-----------------------------------------------------------------------
12068
-- SN74LS393N: Dual 4-bit binary counter
12069
--             Verified 31/05/2016
12070
-----------------------------------------------------------------------
12071
library ieee;
12072
    use ieee.std_logic_1164.all;
12073
 
12074
    use work.LSTTL.all;
12075
    use work.TTLPrivate.all;
12076
 
12077
entity SN74LS393N is
12078
generic(
12079
    tPLH0 : time := 15 ns;
12080
    tPHL0 : time := 15 ns;
12081
    tPLH1 : time := 30 ns;
12082
    tPHL1 : time := 30 ns;
12083
    tPLH2 : time := 40 ns;
12084
    tPHL2 : time := 40 ns;
12085
    tPLH3 : time := 54 ns;
12086
    tPHL3 : time := 54 ns
12087
);
12088
port(
12089
    X_1  : in    std_logic;  -- CPA\
12090
    X_2  : in    std_logic;  -- MRA
12091
    X_3  : out   std_logic;  -- Q0A
12092
    X_4  : out   std_logic;  -- Q1A
12093
    X_5  : out   std_logic;  -- Q2A
12094
    X_6  : out   std_logic;  -- Q3A
12095
    X_7  : inout std_logic;  -- GND
12096
    X_8  : out   std_logic;  -- Q3B
12097
    X_9  : out   std_logic;  -- Q2B
12098
    X_10 : out   std_logic;  -- Q1B
12099
    X_11 : out   std_logic;  -- Q0B
12100
    X_12 : in    std_logic;  -- MRB
12101
    X_13 : in    std_logic;  -- CPB\
12102
    X_14 : inout std_logic   -- Vcc
12103
);
12104
end entity SN74LS393N;
12105
 
12106
architecture BEHAV of SN74LS393N is
12107
    signal q0a,  q0b  : std_logic;
12108
begin
12109
    C1: SN74LS93N
12110
    generic map(
12111
        tPLH0 => tPLH0,
12112
        tPHL0 => tPHL0,
12113
        tPLH1 => tPLH1 - tPLH0,     -- Reduce, as CLK(3..1) is already delayed
12114
        tPHL1 => tPHL1 - tPHL0,
12115
        tPLH2 => tPLH2 - tPLH0,
12116
        tPHL2 => tPHL2 - tPHL0,
12117
        tPLH3 => tPLH3 - tPLH0,
12118
        tPHL3 => tPHL3 - tPHL0
12119
    )
12120
    port map(
12121
        X_1  => q0a,   -- CP1\
12122
        X_2  => X_2,   -- MR1
12123
        X_3  => X_2,   -- MR2
12124
                       -- 
12125
        X_5  => open,  -- Vcc
12126
                       --
12127
                       --
12128
        X_8  => X_5,   -- Q2
12129
        X_9  => X_4,   -- Q1
12130
        X_10 => open,  -- GND
12131
        X_11 => X_6,   -- Q3
12132
        X_12 => q0a,   -- Q0
12133
                       -- 
12134
        X_14 => X_1    -- CP0\
12135
    );
12136
    X_3 <= q0a;
12137
 
12138
    C2: SN74LS93N
12139
    generic map(
12140
        tPLH0 => tPLH0,
12141
        tPHL0 => tPHL0,
12142
        tPLH1 => tPLH1 - tPLH0,     -- Reduce, as CLK(3..1) is already delayed
12143
        tPHL1 => tPHL1 - tPHL0,
12144
        tPLH2 => tPLH2 - tPLH0,
12145
        tPHL2 => tPHL2 - tPHL0,
12146
        tPLH3 => tPLH3 - tPLH0,
12147
        tPHL3 => tPHL3 - tPHL0
12148
    )
12149
    port map(
12150
        X_1  => q0b,   -- CP1\
12151
        X_2  => X_12,  -- MR1
12152
        X_3  => X_12,  -- MR2
12153
                       -- 
12154
        X_5  => open,  -- Vcc
12155
                       --
12156
                       --
12157
        X_8  => X_9,   -- Q2
12158
        X_9  => X_10,  -- Q1
12159
        X_10 => open,  -- GND
12160
        X_11 => X_8,   -- Q3
12161
        X_12 => q0b,   -- Q0
12162
                       -- 
12163
        X_14 => X_13   -- CP0\
12164
    );
12165
    X_11 <= q0b;
12166
 
12167
end architecture BEHAV;
12168
 
12169
-----------------------------------------------------------------------
12170
-- SN74LS395N: 4-bit shift register (3-state outputs)
12171
--             Verified 22/12/2016
12172
-----------------------------------------------------------------------
12173
library ieee;
12174
    use ieee.std_logic_1164.all;
12175
 
12176
    use work.LSTTL.all;
12177
    use work.TTLPrivate.all;
12178
 
12179
entity SN74LS395N is
12180
generic(
12181
    tPLH : time := 35 ns;
12182
    tPHL : time := 25 ns;
12183
    tPZH : time := 20 ns;
12184
    tPZL : time := 20 ns;
12185
    tPHZ : time := 17 ns;
12186
    tPLZ : time := 23 ns
12187
);
12188
port(
12189
    X_1  : in    std_logic;  -- MR\
12190
    X_2  : in    std_logic;  -- DS
12191
    X_3  : in    std_logic;  -- P0
12192
    X_4  : in    std_logic;  -- P1
12193
    X_5  : in    std_logic;  -- P2
12194
    X_6  : in    std_logic;  -- P3
12195
    X_7  : in    std_logic;  -- S
12196
    X_8  : inout std_logic;  -- GND
12197
    X_9  : in    std_logic;  -- OE\
12198
    X_10 : in    std_logic;  -- CP\
12199
    X_11 : out   std_logic;  -- Q3
12200
    X_12 : out   std_logic;  -- O3
12201
    X_13 : out   std_logic;  -- O2
12202
    X_14 : out   std_logic;  -- O1
12203
    X_15 : out   std_logic;  -- O0
12204
    X_16 : inout std_logic   -- Vcc
12205
);
12206
end entity SN74LS395N;
12207
 
12208
architecture BEHAV of SN74LS395N is
12209
    signal D, R, Z : std_logic_vector(3 downto 0);
12210
    signal OE      : std_logic;
12211
 
12212
    alias CP is X_10;
12213
    alias S  is X_7;
12214
    alias DS is X_2;
12215
    alias MR is X_1;
12216
 
12217
begin
12218
    OE <= not X_9;
12219
    D  <= (X_6, X_5, X_4, X_3);
12220
    (X_12, X_13, X_14, X_15) <= Z;
12221
 
12222
    OB3: TTLdelay
12223
    generic map(
12224
        tPLH => tPLH,
12225
        tPHL => tPHL
12226
    )
12227
    port map(
12228
        A => R(3),
12229
        B => X_11
12230
    );
12231
 
12232
    G1: for i in R'range generate
12233
    begin
12234
        OBN: TTL3State
12235
        generic map(
12236
            tPLH => tPLH,
12237
            tPHL => tPHL,
12238
            tPZH => tPZH,
12239
            tPZL => tPZL,
12240
            tPHZ => tPHZ,
12241
            tPLZ => tPLZ
12242
        )
12243
        port map(
12244
            A    => R(i),
12245
            E    => OE,
12246
            Y    => Z(i)
12247
        );
12248
    end generate;
12249
 
12250
    process(MR, CP) is
12251
    begin
12252
        if MR = '0' then
12253
            R <= (others => '0');
12254
        elsif falling_edge(CP) then
12255
            if S = '0' then
12256
                R <= R(2 downto 0) & DS;
12257
            else
12258
                R <= D;
12259
            end if;
12260
        end if;
12261
    end process;
12262
end architecture BEHAV;
12263
 
12264
-----------------------------------------------------------------------
12265
-- SN74LS490N: Dual decade counter
12266
--             Verified 31/05/2016
12267
-----------------------------------------------------------------------
12268
library ieee;
12269
    use ieee.std_logic_1164.all;
12270
 
12271
    use work.LSTTL.all;
12272
    use work.TTLPrivate.all;
12273
 
12274
entity SN74LS490N is
12275
generic(
12276
    tPLH0   : time := 15 ns;
12277
    tPHL0   : time := 15 ns;
12278
    tPLH1   : time := 30 ns;
12279
    tPHL1   : time := 30 ns;
12280
    tPLH2   : time := 45 ns;
12281
    tPHL2   : time := 45 ns;
12282
    tPLH3   : time := 35 ns;
12283
    tPHL3   : time := 35 ns
12284
);
12285
port(
12286
    X_1  : in    std_logic;  -- CPA\
12287
    X_2  : in    std_logic;  -- MRA
12288
    X_3  : out   std_logic;  -- Q0A
12289
    X_4  : in    std_logic;  -- MSA
12290
    X_5  : out   std_logic;  -- Q1A
12291
    X_6  : out   std_logic;  -- Q2A
12292
    X_7  : out   std_logic;  -- Q3A
12293
    X_8  : inout std_logic;  -- GND
12294
    X_9  : out   std_logic;  -- Q3B
12295
    X_10 : out   std_logic;  -- Q2B
12296
    X_11 : out   std_logic;  -- Q1B
12297
    X_12 : in    std_logic;  -- MSB
12298
    X_13 : out   std_logic;  -- Q0B
12299
    X_14 : in    std_logic;  -- MRB
12300
    X_15 : in    std_logic;  -- CPB\
12301
    X_16 : inout std_logic   -- Vcc
12302
);
12303
end entity SN74LS490N;
12304
 
12305
architecture BEHAV of SN74LS490N is
12306
    signal Z : TTL2word;
12307
    signal set, rst, clk : std_logic_vector(2 downto 1);
12308
begin
12309
    set <= (X_12, X_4);
12310
    rst <= (X_14, X_2);
12311
    clk <= (X_15, X_1);
12312
    (X_9, X_10, X_11, X_13) <= Z(2);
12313
    (X_7, X_6,  X_5,  X_3 ) <= Z(1);
12314
 
12315
    G1: for i in Z'range generate
12316
        signal X : TTLword;
12317
        signal Y : std_logic_vector(3 downto 0);
12318
    begin
12319
        process(set(i), rst(i), clk(i)) is
12320
        begin
12321
            if    rst(i) = '1' then
12322
                X <= "0000";
12323
            elsif set(i) = '1' then
12324
                X <= "1001";
12325
            elsif clk(i)'event and clk(i) = '0' then
12326
                X <= TTL490(Z(i));
12327
            end if;
12328
        end process;
12329
 
12330
        D3: TTLdelay
12331
        generic map(
12332
            tPLH => tPLH3,
12333
            tPHL => tPHL3
12334
        )
12335
        port map(
12336
            A => X(3),
12337
            B => Y(3)
12338
        );
12339
 
12340
        D2: TTLdelay
12341
        generic map(
12342
            tPLH => tPLH2,
12343
            tPHL => tPHL2
12344
        )
12345
        port map(
12346
            A => X(2),
12347
            B => Y(2)
12348
        );
12349
 
12350
        D1: TTLdelay
12351
        generic map(
12352
            tPLH => tPLH1,
12353
            tPHL => tPHL1
12354
        )
12355
        port map(
12356
            A => X(1),
12357
            B => Y(1)
12358
        );
12359
 
12360
        D0: TTLdelay
12361
        generic map(
12362
            tPLH => tPLH0,
12363
            tPHL => tPHL0
12364
        )
12365
        port map(
12366
            A => X(0),
12367
            B => Y(0)
12368
        );
12369
        Z(i) <= TTLword(Y);
12370
    end generate;
12371
 
12372
end architecture BEHAV;
12373
 
12374
-----------------------------------------------------------------------
12375
-- SN74LS533N: Octal transparent latch (3-state inverting outputs)
12376
--             Verified 22/12/2016
12377
-----------------------------------------------------------------------
12378
library ieee;
12379
    use ieee.std_logic_1164.all;
12380
 
12381
    use work.LSTTL.all;
12382
    use work.TTLPrivate.all;
12383
 
12384
entity SN74LS533N is
12385
generic(
12386
    tPLH : time := 23 ns;
12387
    tPHL : time := 25 ns;
12388
    tPZH : time := 28 ns;
12389
    tPZL : time := 36 ns;
12390
    tPHZ : time := 20 ns;
12391
    tPLZ : time := 25 ns
12392
);
12393
port(
12394
    X_1  : in    std_logic;  -- OE\
12395
    X_2  : out   std_logic;  -- O0\
12396
    X_3  : in    std_logic;  -- D0
12397
    X_4  : in    std_logic;  -- D1
12398
    X_5  : out   std_logic;  -- O1\
12399
    X_6  : out   std_logic;  -- O2\
12400
    X_7  : in    std_logic;  -- D2
12401
    X_8  : in    std_logic;  -- D3
12402
    X_9  : out   std_logic;  -- O3\
12403
    X_10 : inout std_logic;  -- GND
12404
    X_11 : in    std_logic;  -- LE
12405
    X_12 : out   std_logic;  -- O4\
12406
    X_13 : in    std_logic;  -- D4
12407
    X_14 : in    std_logic;  -- D5
12408
    X_15 : out   std_logic;  -- O5\
12409
    X_16 : out   std_logic;  -- O6\
12410
    X_17 : in    std_logic;  -- D6
12411
    X_18 : in    std_logic;  -- D7
12412
    X_19 : out   std_logic;  -- O7\
12413
    X_20 : inout std_logic   -- Vcc
12414
);
12415
end entity SN74LS533N;
12416
 
12417
architecture BEHAV of SN74LS533N is
12418
    signal D, Q, Z : std_logic_vector(7 downto 0);
12419
    signal LE, OE  : std_logic;
12420
 
12421
begin
12422
    LE <= X_11;
12423
    OE <= not X_1;
12424
    D  <= (X_18, X_17, X_14, X_13, X_8, X_7, X_4, X_3);
12425
    (X_19, X_16, X_15, X_12, X_9,  X_6, X_5, X_2) <= Z;
12426
 
12427
    process(all) is
12428
    begin
12429
        if LE = '1' then
12430
            Q <= not D;
12431
        end if;
12432
    end process;
12433
 
12434
    G: for i in D'range generate
12435
    begin
12436
        TB: TTL3State
12437
        generic map(
12438
            tPLH => tPLH,
12439
            tPHL => tPHL,
12440
            tPZH => tPZH,
12441
            tPZL => tPZL,
12442
            tPHZ => tPHZ,
12443
            tPLZ => tPLZ
12444
        )
12445
        port map(
12446
            A    => Q(i),
12447
            E    => OE,
12448
            Y    => Z(i)
12449
        );
12450
    end generate;
12451
end architecture BEHAV;
12452
 
12453
-----------------------------------------------------------------------
12454
-- SN74LS534N: Octal D-flipflop (3-state outputs)
12455
--             Verified 22/12/2016
12456
-----------------------------------------------------------------------
12457
library ieee;
12458
    use ieee.std_logic_1164.all;
12459
 
12460
    use work.LSTTL.all;
12461
    use work.TTLPrivate.all;
12462
 
12463
entity SN74LS534N is
12464
generic(
12465
    tPLH : time := 18 ns;
12466
    tPHL : time := 20 ns;
12467
    tPZH : time := 28 ns;
12468
    tPZL : time := 36 ns;
12469
    tPHZ : time := 20 ns;
12470
    tPLZ : time := 25 ns
12471
);
12472
port(
12473
    X_1  : in    std_logic;  -- OE\
12474
    X_2  : out   std_logic;  -- O0\
12475
    X_3  : in    std_logic;  -- D0
12476
    X_4  : in    std_logic;  -- D1
12477
    X_5  : out   std_logic;  -- O1\
12478
    X_6  : out   std_logic;  -- O2\
12479
    X_7  : in    std_logic;  -- D2
12480
    X_8  : in    std_logic;  -- D3
12481
    X_9  : out   std_logic;  -- O3\
12482
    X_10 : inout std_logic;  -- GND
12483
    X_11 : in    std_logic;  -- CP
12484
    X_12 : out   std_logic;  -- O4\
12485
    X_13 : in    std_logic;  -- D4
12486
    X_14 : in    std_logic;  -- D5
12487
    X_15 : out   std_logic;  -- O5\
12488
    X_16 : out   std_logic;  -- O6\
12489
    X_17 : in    std_logic;  -- D6
12490
    X_18 : in    std_logic;  -- D7
12491
    X_19 : out   std_logic;  -- O7\
12492
    X_20 : inout std_logic   -- Vcc
12493
);
12494
end entity SN74LS534N;
12495
 
12496
architecture BEHAV of SN74LS534N is
12497
    signal D, Q, Z : std_logic_vector(7 downto 0);
12498
    signal CP, OE  : std_logic;
12499
 
12500
begin
12501
    CP <= X_11;
12502
    OE <= not X_1;
12503
    D  <= (X_18, X_17, X_14, X_13, X_8, X_7, X_4, X_3);
12504
    (X_19, X_16, X_15, X_12, X_9,  X_6, X_5, X_2) <= Z;
12505
 
12506
    process(CP) is
12507
    begin
12508
        if rising_edge(CP) then
12509
            Q <= not D;
12510
        end if;
12511
    end process;
12512
 
12513
    G: for i in D'range generate
12514
    begin
12515
        TB: TTL3State
12516
        generic map(
12517
            tPLH => tPLH,
12518
            tPHL => tPHL,
12519
            tPZH => tPZH,
12520
            tPZL => tPZL,
12521
            tPHZ => tPHZ,
12522
            tPLZ => tPLZ
12523
        )
12524
        port map(
12525
            A    => Q(i),
12526
            E    => OE,
12527
            Y    => Z(i)
12528
        );
12529
    end generate;
12530
end architecture BEHAV;
12531
 
12532
-----------------------------------------------------------------------
12533
-- SN74LS540N: Octal buffer/line driver (inverting 3-state outputs)
12534
--             Verified 22/12/2016
12535
-----------------------------------------------------------------------
12536
library ieee;
12537
    use ieee.std_logic_1164.all;
12538
 
12539
    use work.LSTTL.all;
12540
    use work.TTLPrivate.all;
12541
 
12542
entity SN74LS540N is
12543
generic(
12544
    tPLH : time := 14 ns;
12545
    tPHL : time := 18 ns;
12546
    tPZH : time := 23 ns;
12547
    tPZL : time := 30 ns;
12548
    tPHZ : time := 25 ns;
12549
    tPLZ : time := 18 ns
12550
);
12551
port(
12552
    X_1  : in    std_logic;  -- E1\
12553
    X_2  : in    std_logic;  -- A0
12554
    X_3  : in    std_logic;  -- A1
12555
    X_4  : in    std_logic;  -- A2
12556
    X_5  : in    std_logic;  -- A3
12557
    X_6  : in    std_logic;  -- A4
12558
    X_7  : in    std_logic;  -- A5
12559
    X_8  : in    std_logic;  -- A6
12560
    X_9  : in    std_logic;  -- A7
12561
    X_10 : inout std_logic;  -- GND
12562
    X_11 : out   std_logic;  -- Y7\
12563
    X_12 : out   std_logic;  -- Y6\
12564
    X_13 : out   std_logic;  -- Y5\
12565
    X_14 : out   std_logic;  -- Y4\
12566
    X_15 : out   std_logic;  -- Y3\
12567
    X_16 : out   std_logic;  -- Y2\
12568
    X_17 : out   std_logic;  -- Y1\
12569
    X_18 : out   std_logic;  -- Y0\
12570
    X_19 : in    std_logic;  -- E2\
12571
    X_20 : inout std_logic   -- Vcc
12572
);
12573
end entity SN74LS540N;
12574
 
12575
architecture BEHAV of SN74LS540N is
12576
    signal I, A, Y : std_logic_vector(7 downto 0);
12577
    signal E       : std_logic;
12578
 
12579
begin
12580
    E <= not(X_1 or X_19);
12581
    I <= (X_9, X_8, X_7, X_6, X_5, X_4, X_3, X_2);
12582
    A <= not I;
12583
    (X_11, X_12, X_13, X_14, X_15, X_16, X_17, X_18) <= Y;
12584
 
12585
    G: for j in I'range generate
12586
    begin
12587
        B: TTL3State
12588
        generic map(
12589
            tPLH => tPLH,
12590
            tPHL => tPHL,
12591
            tPZH => tPZH,
12592
            tPZL => tPZL,
12593
            tPHZ => tPHZ,
12594
            tPLZ => tPLZ
12595
        )
12596
        port map(
12597
            A    => A(j),
12598
            E    => E,
12599
            Y    => Y(j)
12600
        );
12601
    end generate;
12602
end architecture BEHAV;
12603
 
12604
-----------------------------------------------------------------------
12605
-- SN74LS541N: Octal buffer/line driver (3-state outputs)
12606
--             Verified 22/12/2016
12607
-----------------------------------------------------------------------
12608
library ieee;
12609
    use ieee.std_logic_1164.all;
12610
 
12611
    use work.LSTTL.all;
12612
    use work.TTLPrivate.all;
12613
 
12614
entity SN74LS541N is
12615
generic(
12616
    tPLH : time := 14 ns;
12617
    tPHL : time := 18 ns;
12618
    tPZH : time := 23 ns;
12619
    tPZL : time := 30 ns;
12620
    tPHZ : time := 25 ns;
12621
    tPLZ : time := 18 ns
12622
);
12623
port(
12624
    X_1  : in    std_logic;  -- E1\
12625
    X_2  : in    std_logic;  -- A0
12626
    X_3  : in    std_logic;  -- A1
12627
    X_4  : in    std_logic;  -- A2
12628
    X_5  : in    std_logic;  -- A3
12629
    X_6  : in    std_logic;  -- A4
12630
    X_7  : in    std_logic;  -- A5
12631
    X_8  : in    std_logic;  -- A6
12632
    X_9  : in    std_logic;  -- A7
12633
    X_10 : inout std_logic;  -- GND
12634
    X_11 : out   std_logic;  -- Y7 
12635
    X_12 : out   std_logic;  -- Y6 
12636
    X_13 : out   std_logic;  -- Y5 
12637
    X_14 : out   std_logic;  -- Y4 
12638
    X_15 : out   std_logic;  -- Y3 
12639
    X_16 : out   std_logic;  -- Y2 
12640
    X_17 : out   std_logic;  -- Y1 
12641
    X_18 : out   std_logic;  -- Y0 
12642
    X_19 : in    std_logic;  -- E2\
12643
    X_20 : inout std_logic   -- Vcc
12644
);
12645
end entity SN74LS541N;
12646
 
12647
architecture BEHAV of SN74LS541N is
12648
    signal I, A, Y : std_logic_vector(7 downto 0);
12649
    signal E       : std_logic;
12650
 
12651
begin
12652
    E <= not(X_1 or X_19);
12653
    I <= (X_9, X_8, X_7, X_6, X_5, X_4, X_3, X_2);
12654
    A <= I;
12655
    (X_11, X_12, X_13, X_14, X_15, X_16, X_17, X_18) <= Y;
12656
 
12657
    G: for j in I'range generate
12658
    begin
12659
        B: TTL3State
12660
        generic map(
12661
            tPLH => tPLH,
12662
            tPHL => tPHL,
12663
            tPZH => tPZH,
12664
            tPZL => tPZL,
12665
            tPHZ => tPHZ,
12666
            tPLZ => tPLZ
12667
        )
12668
        port map(
12669
            A    => A(j),
12670
            E    => E,
12671
            Y    => Y(j)
12672
        );
12673
    end generate;
12674
end architecture BEHAV;
12675
 
12676
-----------------------------------------------------------------------
12677
-- SN74LS563N: Octal D-type latch (3-state outputs)
12678
--             Verified 22/12/2016
12679
-----------------------------------------------------------------------
12680
library ieee;
12681
    use ieee.std_logic_1164.all;
12682
 
12683
    use work.LSTTL.all;
12684
    use work.TTLPrivate.all;
12685
 
12686
entity SN74LS563N is
12687
generic(
12688
    tPLH : time := 23 ns;
12689
    tPHL : time := 25 ns;
12690
    tPZH : time := 28 ns;
12691
    tPZL : time := 36 ns;
12692
    tPHZ : time := 20 ns;
12693
    tPLZ : time := 25 ns
12694
);
12695
port(
12696
    X_1  : in    std_logic;  -- OE\
12697
    X_2  : in    std_logic;  -- D0
12698
    X_3  : in    std_logic;  -- D1
12699
    X_4  : in    std_logic;  -- D2
12700
    X_5  : in    std_logic;  -- D3
12701
    X_6  : in    std_logic;  -- D4
12702
    X_7  : in    std_logic;  -- D5
12703
    X_8  : in    std_logic;  -- D6
12704
    X_9  : in    std_logic;  -- D7
12705
    X_10 : inout std_logic;  -- GND
12706
    X_11 : in    std_logic;  -- LE
12707
    X_12 : out   std_logic;  -- O7\
12708
    X_13 : out   std_logic;  -- O6\
12709
    X_14 : out   std_logic;  -- O5\
12710
    X_15 : out   std_logic;  -- O4\
12711
    X_16 : out   std_logic;  -- O3\
12712
    X_17 : out   std_logic;  -- O2\
12713
    X_18 : out   std_logic;  -- O1\
12714
    X_19 : out   std_logic;  -- O0\
12715
    X_20 : inout std_logic   -- Vcc
12716
);
12717
end entity SN74LS563N;
12718
 
12719
architecture BEHAV of SN74LS563N is
12720
    signal D, Q, Z : std_logic_vector(7 downto 0);
12721
    signal LE, OE  : std_logic;
12722
 
12723
begin
12724
    LE <= X_11;
12725
    OE <= not X_1;
12726
    D  <= (X_9, X_8, X_7, X_6, X_5, X_4, X_3, X_2);
12727
    (X_12, X_13, X_14, X_15, X_16,  X_17, X_18, X_19) <= Z;
12728
 
12729
    process(all) is
12730
    begin
12731
        if LE = '1' then
12732
            Q <= not D;
12733
        end if;
12734
    end process;
12735
 
12736
    G: for i in D'range generate
12737
    begin
12738
        TB: TTL3State
12739
        generic map(
12740
            tPLH => tPLH,
12741
            tPHL => tPHL,
12742
            tPZH => tPZH,
12743
            tPZL => tPZL,
12744
            tPHZ => tPHZ,
12745
            tPLZ => tPLZ
12746
        )
12747
        port map(
12748
            A    => Q(i),
12749
            E    => OE,
12750
            Y    => Z(i)
12751
        );
12752
    end generate;
12753
end architecture BEHAV;
12754
 
12755
-----------------------------------------------------------------------
12756
-- SN74LS564N: Octal D-flipflop (3-state outputs)
12757
--             Verified 22/12/2016
12758
-----------------------------------------------------------------------
12759
library ieee;
12760
    use ieee.std_logic_1164.all;
12761
 
12762
    use work.LSTTL.all;
12763
    use work.TTLPrivate.all;
12764
 
12765
entity SN74LS564N is
12766
generic(
12767
    tPLH : time := 18 ns;
12768
    tPHL : time := 20 ns;
12769
    tPZH : time := 28 ns;
12770
    tPZL : time := 36 ns;
12771
    tPHZ : time := 20 ns;
12772
    tPLZ : time := 25 ns
12773
);
12774
port(
12775
    X_1  : in    std_logic;  -- OE\
12776
    X_2  : in    std_logic;  -- D0
12777
    X_3  : in    std_logic;  -- D1
12778
    X_4  : in    std_logic;  -- D2
12779
    X_5  : in    std_logic;  -- D3
12780
    X_6  : in    std_logic;  -- D4
12781
    X_7  : in    std_logic;  -- D5
12782
    X_8  : in    std_logic;  -- D6
12783
    X_9  : in    std_logic;  -- D7
12784
    X_10 : inout std_logic;  -- GND
12785
    X_11 : in    std_logic;  -- CP
12786
    X_12 : out   std_logic;  -- O7\
12787
    X_13 : out   std_logic;  -- O6\
12788
    X_14 : out   std_logic;  -- O5\
12789
    X_15 : out   std_logic;  -- O4\
12790
    X_16 : out   std_logic;  -- O3\
12791
    X_17 : out   std_logic;  -- O2\
12792
    X_18 : out   std_logic;  -- O1\
12793
    X_19 : out   std_logic;  -- O0\
12794
    X_20 : inout std_logic   -- Vcc
12795
);
12796
end entity SN74LS564N;
12797
 
12798
architecture BEHAV of SN74LS564N is
12799
    signal D, Q, Z : std_logic_vector(7 downto 0);
12800
    signal CP, OE  : std_logic;
12801
 
12802
begin
12803
    CP <= X_11;
12804
    OE <= not X_1;
12805
    D  <= (X_9, X_8, X_7, X_6, X_5, X_4, X_3, X_2);
12806
    (X_12, X_13, X_14, X_15, X_16,  X_17, X_18, X_19) <= Z;
12807
 
12808
    process(CP) is
12809
    begin
12810
        if rising_edge(CP) then
12811
            Q <= not D;
12812
        end if;
12813
    end process;
12814
 
12815
    G: for i in D'range generate
12816
    begin
12817
        TB: TTL3State
12818
        generic map(
12819
            tPLH => tPLH,
12820
            tPHL => tPHL,
12821
            tPZH => tPZH,
12822
            tPZL => tPZL,
12823
            tPHZ => tPHZ,
12824
            tPLZ => tPLZ
12825
        )
12826
        port map(
12827
            A    => Q(i),
12828
            E    => OE,
12829
            Y    => Z(i)
12830
        );
12831
    end generate;
12832
end architecture BEHAV;
12833
 
12834
-----------------------------------------------------------------------
12835
-- SN74LS573N: Octal D-type latch (3-state outputs)
12836
--             Verified 21/12/2016
12837
-----------------------------------------------------------------------
12838
library ieee;
12839
    use ieee.std_logic_1164.all;
12840
 
12841
    use work.LSTTL.all;
12842
    use work.TTLPrivate.all;
12843
 
12844
entity SN74LS573N is
12845
generic(
12846
    tPLH : time := 18 ns;
12847
    tPHL : time := 20 ns;
12848
    tPZH : time := 28 ns;
12849
    tPZL : time := 36 ns;
12850
    tPHZ : time := 20 ns;
12851
    tPLZ : time := 25 ns
12852
);
12853
port(
12854
    X_1  : in    std_logic;  -- OE\
12855
    X_2  : in    std_logic;  -- D0
12856
    X_3  : in    std_logic;  -- D1
12857
    X_4  : in    std_logic;  -- D2
12858
    X_5  : in    std_logic;  -- D3
12859
    X_6  : in    std_logic;  -- D4
12860
    X_7  : in    std_logic;  -- D5
12861
    X_8  : in    std_logic;  -- D6
12862
    X_9  : in    std_logic;  -- D7
12863
    X_10 : inout std_logic;  -- GND
12864
    X_11 : in    std_logic;  -- LE
12865
    X_12 : out   std_logic;  -- O7\
12866
    X_13 : out   std_logic;  -- O6\
12867
    X_14 : out   std_logic;  -- O5\
12868
    X_15 : out   std_logic;  -- O4\
12869
    X_16 : out   std_logic;  -- O3\
12870
    X_17 : out   std_logic;  -- O2\
12871
    X_18 : out   std_logic;  -- O1\
12872
    X_19 : out   std_logic;  -- O0\
12873
    X_20 : inout std_logic   -- Vcc
12874
);
12875
end entity SN74LS573N;
12876
 
12877
architecture BEHAV of SN74LS573N is
12878
    signal D, Q, Z : std_logic_vector(7 downto 0);
12879
    signal LE, OE  : std_logic;
12880
 
12881
begin
12882
    LE <= X_11;
12883
    OE <= not X_1;
12884
    D  <= (X_9, X_8, X_7, X_6, X_5, X_4, X_3, X_2);
12885
    (X_12, X_13, X_14, X_15, X_16,  X_17, X_18, X_19) <= Z;
12886
 
12887
    process(all) is
12888
    begin
12889
        if LE = '1' then
12890
            Q <= D;
12891
        end if;
12892
    end process;
12893
 
12894
    G: for i in D'range generate
12895
    begin
12896
        TB: TTL3State
12897
        generic map(
12898
            tPLH => tPLH,
12899
            tPHL => tPHL,
12900
            tPZH => tPZH,
12901
            tPZL => tPZL,
12902
            tPHZ => tPHZ,
12903
            tPLZ => tPLZ
12904
        )
12905
        port map(
12906
            A    => Q(i),
12907
            E    => OE,
12908
            Y    => Z(i)
12909
        );
12910
    end generate;
12911
end architecture BEHAV;
12912
 
12913
-----------------------------------------------------------------------
12914
-- SN74LS574N: Octal D-flipflop (3-state outputs)
12915
--             Verified 21/12/2016
12916
-----------------------------------------------------------------------
12917
library ieee;
12918
    use ieee.std_logic_1164.all;
12919
 
12920
    use work.LSTTL.all;
12921
    use work.TTLPrivate.all;
12922
 
12923
entity SN74LS574N is
12924
generic(
12925
    tPLH : time := 18 ns;
12926
    tPHL : time := 20 ns;
12927
    tPZH : time := 28 ns;
12928
    tPZL : time := 36 ns;
12929
    tPHZ : time := 20 ns;
12930
    tPLZ : time := 25 ns
12931
);
12932
port(
12933
    X_1  : in    std_logic;  -- OE\
12934
    X_2  : in    std_logic;  -- D0
12935
    X_3  : in    std_logic;  -- D1
12936
    X_4  : in    std_logic;  -- D2
12937
    X_5  : in    std_logic;  -- D3
12938
    X_6  : in    std_logic;  -- D4
12939
    X_7  : in    std_logic;  -- D5
12940
    X_8  : in    std_logic;  -- D6
12941
    X_9  : in    std_logic;  -- D7
12942
    X_10 : inout std_logic;  -- GND
12943
    X_11 : in    std_logic;  -- CP
12944
    X_12 : out   std_logic;  -- O7\
12945
    X_13 : out   std_logic;  -- O6\
12946
    X_14 : out   std_logic;  -- O5\
12947
    X_15 : out   std_logic;  -- O4\
12948
    X_16 : out   std_logic;  -- O3\
12949
    X_17 : out   std_logic;  -- O2\
12950
    X_18 : out   std_logic;  -- O1\
12951
    X_19 : out   std_logic;  -- O0\
12952
    X_20 : inout std_logic   -- Vcc
12953
);
12954
end entity SN74LS574N;
12955
 
12956
architecture BEHAV of SN74LS574N is
12957
    signal D, Q, Z : std_logic_vector(7 downto 0);
12958
    signal CP, OE  : std_logic;
12959
 
12960
begin
12961
    CP <= X_11;
12962
    OE <= not X_1;
12963
    D  <= (X_9, X_8, X_7, X_6, X_5, X_4, X_3, X_2);
12964
    (X_12, X_13, X_14, X_15, X_16,  X_17, X_18, X_19) <= Z;
12965
 
12966
    process(CP) is
12967
    begin
12968
        if rising_edge(CP) then
12969
            Q <= D;
12970
        end if;
12971
    end process;
12972
 
12973
    G: for i in D'range generate
12974
    begin
12975
        TB: TTL3State
12976
        generic map(
12977
            tPLH => tPLH,
12978
            tPHL => tPHL,
12979
            tPZH => tPZH,
12980
            tPZL => tPZL,
12981
            tPHZ => tPHZ,
12982
            tPLZ => tPLZ
12983
        )
12984
        port map(
12985
            A    => Q(i),
12986
            E    => OE,
12987
            Y    => Z(i)
12988
        );
12989
    end generate;
12990
end architecture BEHAV;
12991
 
12992
-----------------------------------------------------------------------
12993
-- SN74LS670N: 4 x 4 register file (3-state outputs)
12994
--             Verified 21/12/2016
12995
-----------------------------------------------------------------------
12996
library ieee;
12997
    use ieee.std_logic_1164.all;
12998
 
12999
    use work.LSTTL.all;
13000
    use work.TTLPrivate.all;
13001
 
13002
entity SN74LS670N is
13003
generic(
13004
    tPLC : time    := 35 ns;
13005
    tPLA : time    := 35 ns;
13006
    tSUD : time    := 10 ns;
13007
    tSUA : time    := 10 ns
13008
);
13009
port(
13010
    X_1  : in    std_logic;  -- D2
13011
    X_2  : in    std_logic;  -- D3
13012
    X_3  : in    std_logic;  -- D4
13013
    X_4  : in    std_logic;  -- RA1
13014
    X_5  : in    std_logic;  -- RA0
13015
    X_6  : out   std_logic;  -- O4
13016
    X_7  : out   std_logic;  -- O3
13017
    X_8  : inout std_logic;  -- GND
13018
    X_9  : out   std_logic;  -- O2
13019
    X_10 : out   std_logic;  -- O1
13020
    X_11 : in    std_logic;  -- OE\
13021
    X_12 : in    std_logic;  -- WE\
13022
    X_13 : in    std_logic;  -- WA1
13023
    X_14 : in    std_logic;  -- WA0
13024
    X_15 : in    std_logic;  -- D1
13025
    X_16 : inout std_logic   -- Vcc
13026
);
13027
end entity SN74LS670N;
13028
 
13029
architecture BEHAV of SN74LS670N is
13030
    signal  RE, WE   : std_logic := '1';
13031
    signal  RA, WA   : std_logic_vector(1 downto 0) := (others => '0');
13032
    signal  D,  Q    : std_logic_vector(3 downto 0);
13033
begin
13034
    RE <= X_11;
13035
    WE <= X_12;
13036
    RA <= (X_4, X_5);
13037
    WA <= (X_13, X_14);
13038
    D  <= (X_3, X_2, X_1, X_15);
13039
    (X_6, X_7, X_9, X_10) <= Q;
13040
 
13041
    MB: TTLramblock
13042
    generic map(
13043
        Omode => TriState,
13044
        INVT  => '0',
13045
        tPLC  => tPLC,
13046
        tPLA  => tPLA,
13047
        tSUD  => tSUD,
13048
        tSUA  => tSUA
13049
    )
13050
    port map(
13051
        RA    => RA,
13052
        WA    => WA,
13053
        D     => D,
13054
        O     => Q,
13055
        CE    => '0',
13056
        RE    => RE,
13057
        WE    => WE
13058
    );
13059
end architecture BEHAV;
13060
 

powered by: WebSVN 2.1.0

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