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

Subversion Repositories mips_enhanced

[/] [mips_enhanced/] [trunk/] [grlib-gpl-1.0.19-b3188/] [lib/] [tech/] [axcelerator/] [components/] [axcelerator.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dimamali
------------------------------------------------------------------------------
2
--  This file is a part of the GRLIB VHDL IP LIBRARY
3
--  Copyright (C) 2003, Gaisler Research
4
--
5
--  This program is free software; you can redistribute it and/or modify
6
--  it under the terms of the GNU General Public License as published by
7
--  the Free Software Foundation; either version 2 of the License, or
8
--  (at your option) any later version.
9
--
10
--  This program is distributed in the hope that it will be useful,
11
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
--  GNU General Public License for more details.
14
--
15
--  You should have received a copy of the GNU General Public License
16
--  along with this program; if not, write to the Free Software
17
--  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
18
 
19
-- pragma translate_on
20
 
21
library ieee;
22
use ieee.std_logic_1164.all;
23
use ieee.numeric_std.all;
24
 
25
entity RAM64K36 is
26
-- pragma translate_off
27
   generic (MEMORYFILE:string := "");
28
-- pragma translate_on
29
   port(
30
        DEPTH3, DEPTH2, DEPTH1, DEPTH0,
31
        WRAD15, WRAD14, WRAD13, WRAD12, WRAD11, WRAD10, WRAD9 ,
32
        WRAD8 , WRAD7 , WRAD6 , WRAD5 , WRAD4 , WRAD3 , WRAD2 ,
33
        WRAD1 , WRAD0 , WD35  , WD34  , WD33  , WD32  , WD31  ,
34
        WD30  , WD29  , WD28  , WD27  , WD26  , WD25  , WD24  ,
35
        WD23  , WD22  , WD21  , WD20  , WD19  , WD18  , WD17  ,
36
        WD16  , WD15  , WD14  , WD13  , WD12  , WD11  , WD10  ,
37
        WD9   , WD8   , WD7   , WD6   , WD5   , WD4   , WD3   ,
38
        WD2   , WD1   , WD0   , WW2   , WW1   , WW0   , WEN   ,
39
        WCLK  , RDAD15, RDAD14, RDAD13, RDAD12, RDAD11, RDAD10,
40
        RDAD9 , RDAD8 , RDAD7 , RDAD6 , RDAD5 , RDAD4 , RDAD3 ,
41
        RDAD2 , RDAD1 , RDAD0 , RW2   , RW1   , RW0   , REN   ,
42
        RCLK   : in  std_ulogic ;
43
        RD35  , RD34  , RD33  , RD32  , RD31  , RD30  , RD29  ,
44
        RD28  , RD27  , RD26  , RD25  , RD24  , RD23  , RD22  ,
45
        RD21  , RD20  , RD19  , RD18  , RD17  , RD16  , RD15  ,
46
        RD14  , RD13  , RD12  , RD11  , RD10  , RD9   , RD8   ,
47
        RD7   , RD6   , RD5   , RD4   , RD3   , RD2   , RD1   ,
48
        RD0    : out std_ulogic);
49
end;
50
 
51
architecture rtl of RAM64K36 is
52
  signal re : std_ulogic;
53
begin
54
 
55
  rp : process(RCLK, WCLK)
56
  constant words : integer := 2**16;
57
  subtype word is std_logic_vector(35 downto 0);
58
  type dregtype is array (0 to words - 1) of word;
59
  variable rfd : dregtype;
60
  variable wa, ra : std_logic_vector(15 downto 0);
61
  variable q : std_logic_vector(35 downto 0);
62
  begin
63
    if rising_edge(RCLK) then
64
      ra := RDAD15 & RDAD14 & RDAD13 & RDAD12 & RDAD11 & RDAD10 & RDAD9 &
65
            RDAD8 & RDAD7 & RDAD6 & RDAD5 & RDAD4 & RDAD3 & RDAD2 & RDAD1 & RDAD0;
66
      if not (is_x (ra)) and REN = '1' then
67
        q := rfd(to_integer(unsigned(ra)) mod words);
68
      else q := (others => 'X'); end if;
69
    end if;
70
    if rising_edge(WCLK) and (wen = '1') then
71
      wa := WRAD15 & WRAD14 & WRAD13 & WRAD12 & WRAD11 & WRAD10 & WRAD9 &
72
            WRAD8 & WRAD7 & WRAD6 & WRAD5 & WRAD4 & WRAD3 & WRAD2 & WRAD1 & WRAD0;
73
      if not is_x (wa) then
74
        rfd(to_integer(unsigned(wa)) mod words) :=
75
          WD35 & WD34 & WD33 & WD32 & WD31 & WD30 & WD29 & WD28 & WD27 &
76
          WD26 & WD25 & WD24 & WD23 & WD22 & WD21 & WD20 & WD19 & WD18 &
77
          WD17 & WD16 & WD15 & WD14 & WD13 & WD12 & WD11 & WD10 & WD9 &
78
          WD8 & WD7 & WD6 & WD5 & WD4 & WD3 & WD2 & WD1 & WD0;
79
      end if;
80
      if ra = wa then q := (others => 'X'); end if;  -- no write-through
81
    end if;
82
    RD35 <= q(35); RD34 <= q(34); RD33 <= q(33); RD32 <= q(32); RD31 <= q(31);
83
    RD30 <= q(30); RD29 <= q(29); RD28 <= q(28); RD27 <= q(27); RD26 <= q(26);
84
    RD25 <= q(25); RD24 <= q(24); RD23 <= q(23); RD22 <= q(22); RD21 <= q(21);
85
    RD20 <= q(20); RD19 <= q(19); RD18 <= q(18); RD17 <= q(17); RD16 <= q(16);
86
    RD15 <= q(15); RD14 <= q(14); RD13 <= q(13); RD12 <= q(12); RD11 <= q(11);
87
    RD10 <= q(10); RD9 <= q(9); RD8 <= q(8); RD7 <= q(7); RD6 <= q(6);
88
    RD5 <= q(5); RD4 <= q(4); RD3 <= q(3); RD2 <= q(2); RD1 <= q(1);
89
    RD0 <= q(0);
90
  end process;
91
end;
92
 
93
-- PCI PADS ----------------------------------------------------
94
 
95
library ieee;
96
use ieee.std_logic_1164.all;
97
entity hclkbuf_pci is port( pad : in  std_logic; y   : out std_logic); end;
98
architecture struct of hclkbuf_pci is begin y <= to_X01(pad); end;
99
 
100
library ieee;
101
use ieee.std_logic_1164.all;
102
entity clkbuf_pci is port( pad : in  std_logic; y   : out std_logic); end;
103
architecture struct of clkbuf_pci is begin y <= to_X01(pad); end;
104
 
105
library ieee;
106
use ieee.std_logic_1164.all;
107
entity inbuf_pci is port( pad : in  std_logic; y   : out std_logic); end;
108
architecture struct of inbuf_pci is begin y <= to_X01(pad) after 2 ns; end;
109
 
110
library ieee;
111
use ieee.std_logic_1164.all;
112
entity bibuf_pci is port
113
  (d, e : in  std_logic; pad : inout std_logic; y : out std_logic);
114
end;
115
architecture struct of bibuf_pci is begin
116
  y <= to_X01(pad) after 2 ns;
117
  pad <= d after 5 ns when to_X01(e) = '1' else
118
         'Z' after 5 ns when to_X01(e) = '0' else 'X' after 5 ns;
119
end;
120
 
121
library ieee;
122
use ieee.std_logic_1164.all;
123
entity tribuff_pci is port (d, e : in  std_logic; pad : out std_logic ); end;
124
architecture struct of tribuff_pci is begin
125
  pad <= d after 5 ns when to_X01(e) = '1' else
126
         'Z' after 5 ns when to_X01(e) = '0' else 'X' after 5 ns;
127
end;
128
 
129
library ieee;
130
use ieee.std_logic_1164.all;
131
entity outbuf_pci is port (d : in  std_logic; pad : out std_logic ); end;
132
architecture struct of outbuf_pci is begin pad <= d after 5 ns; end;
133
 
134
-- STANDARD PADS ----------------------------------------------------
135
 
136
library ieee;
137
use ieee.std_logic_1164.all;
138
entity clkbuf is port( pad : in  std_logic; y   : out std_logic); end;
139
architecture struct of clkbuf is begin y <= to_X01(pad); end;
140
 
141
library ieee;
142
use ieee.std_logic_1164.all;
143
entity hclkbuf is port( pad : in  std_logic; y   : out std_logic); end;
144
architecture struct of hclkbuf is begin y <= to_X01(pad); end;
145
 
146
library ieee;
147
use ieee.std_logic_1164.all;
148
entity inbuf is port( pad : in  std_logic; y   : out std_logic); end;
149
architecture struct of inbuf is begin y <= to_X01(pad) after 1 ns; end;
150
 
151
library ieee;
152
use ieee.std_logic_1164.all;
153
entity iopad_in is port( pad : in  std_logic; y   : out std_logic); end;
154
architecture struct of iopad_in is begin y <= to_X01(pad) after 1 ns; end;
155
 
156
library ieee;
157
use ieee.std_logic_1164.all;
158
entity iopad_in_u is port( pad : in  std_logic; y   : out std_logic); end;
159
architecture struct of iopad_in_u is begin y <= to_X01(pad) after 1 ns; end;
160
 
161
library ieee;
162
use ieee.std_logic_1164.all;
163
entity iopad_in_u is port( pad : in  std_logic; y   : out std_logic); end;
164
architecture struct of iopad_in_u is begin y <= to_X01(pad) after 1 ns; end;
165
 
166
library ieee;
167
use ieee.std_logic_1164.all;
168
entity bibuf is port
169
  (d, e : in  std_logic; pad : inout std_logic; y : out std_logic);
170
end;
171
architecture struct of bibuf is begin
172
  y <= to_X01(pad) after 2 ns;
173
  pad <= d after 2 ns when to_X01(e) = '1' else
174
         'Z' after 2 ns when to_X01(e) = '0' else 'X' after 2 ns;
175
end;
176
 
177
library ieee;
178
use ieee.std_logic_1164.all;
179
entity iopad_bi is port
180
  (d, e : in  std_logic; pad : inout std_logic; y : out std_logic);
181
end;
182
architecture struct of iopad_bi is begin
183
  y <= to_X01(pad) after 2 ns;
184
  pad <= d after 2 ns when to_X01(e) = '1' else
185
         'Z' after 2 ns when to_X01(e) = '0' else 'X' after 2 ns;
186
end;
187
 
188
library ieee;
189
use ieee.std_logic_1164.all;
190
entity tribuff is port (d, e : in  std_logic; pad : out std_logic ); end;
191
architecture struct of tribuff is begin
192
  pad <= d after 2 ns when to_X01(e) = '1' else
193
         'Z' after 2 ns when to_X01(e) = '0' else 'X' after 2 ns;
194
end;
195
 
196
library ieee;
197
use ieee.std_logic_1164.all;
198
entity iopad_tri is port (d, e : in  std_logic; pad : out std_logic ); end;
199
architecture struct of iopad_tri is begin
200
  pad <= d after 2 ns when to_X01(e) = '1' else
201
         'Z' after 2 ns when to_X01(e) = '0' else 'X' after 2 ns;
202
end;
203
 
204
library ieee;
205
use ieee.std_logic_1164.all;
206
entity iopad_tri_u is port (d, e : in  std_logic; pad : out std_logic ); end;
207
architecture struct of iopad_tri_u is begin
208
  pad <= d after 2 ns when to_X01(e) = '1' else
209
         'Z' after 2 ns when to_X01(e) = '0' else 'X' after 2 ns;
210
end;
211
 
212
library ieee;
213
use ieee.std_logic_1164.all;
214
entity iopadp_tri is port (d, e : in  std_logic; pad : out std_logic ); end;
215
architecture struct of iopadp_tri is begin
216
  pad <= d after 2 ns when to_X01(e) = '1' else
217
         'Z' after 2 ns when to_X01(e) = '0' else 'X' after 2 ns;
218
end;
219
 
220
library ieee;
221
use ieee.std_logic_1164.all;
222
entity iopadp_in is port (n2pin, pad : in  std_logic; y : out std_logic ); end;
223
architecture struct of iopadp_in is begin
224
  y <= pad after 2 ns;
225
end;
226
 
227
library ieee;
228
use ieee.std_logic_1164.all;
229
entity iopadn_in is port ( pad : in  std_logic; n2pout : out std_logic ); end;
230
architecture struct of iopadn_in is begin
231
  n2pout <= pad after 2 ns;
232
end;
233
 
234
library ieee;
235
use ieee.std_logic_1164.all;
236
entity iopadn_tri is port (db, e : in  std_logic; pad : out std_logic ); end;
237
architecture struct of iopadn_tri is begin
238
  pad <= not db after 2 ns when to_X01(e) = '1' else
239
         'Z' after 2 ns when to_X01(e) = '0' else 'X' after 2 ns;
240
end;
241
 
242
library ieee;
243
use ieee.std_logic_1164.all;
244
entity outbuf is port (d : in  std_logic; pad : out std_logic ); end;
245
architecture struct of outbuf is begin pad <= d after 2 ns; end;
246
 
247
library ieee;
248
use ieee.std_logic_1164.all;
249
entity outbuf_f_8 is port (d : in  std_logic; pad : out std_logic ); end;
250
architecture struct of outbuf_f_8 is begin pad <= d after 2 ns; end;
251
 
252
library ieee;
253
use ieee.std_logic_1164.all;
254
entity outbuf_f_12 is port (d : in  std_logic; pad : out std_logic ); end;
255
architecture struct of outbuf_f_12 is begin pad <= d after 2 ns; end;
256
 
257
library ieee;
258
use ieee.std_logic_1164.all;
259
entity outbuf_f_16 is port (d : in  std_logic; pad : out std_logic ); end;
260
architecture struct of outbuf_f_16 is begin pad <= d after 2 ns; end;
261
 
262
library ieee;
263
use ieee.std_logic_1164.all;
264
entity outbuf_f_24 is port (d : in  std_logic; pad : out std_logic ); end;
265
architecture struct of outbuf_f_24 is begin pad <= d after 2 ns; end;
266
 
267
library ieee;
268
use ieee.std_logic_1164.all;
269
entity inbuf_lvds is port( y : out std_logic; padp, padn : in  std_logic); end;
270
architecture struct of inbuf_lvds is
271
signal yn : std_ulogic := '0';
272
begin
273
  yn <= to_X01(padp) after 1 ns when to_x01(padp xor padn) = '1' else yn after 1 ns;
274
  y <= yn;
275
end;
276
 
277
library ieee;
278
use ieee.std_logic_1164.all;
279
entity outbuf_lvds is port (d : in  std_logic; padp, padn : out std_logic ); end;
280
architecture struct of outbuf_lvds is begin
281
  padp <= d after 1 ns;
282
  padn <= not d after 1 ns;
283
end;
284
 
285
-- clock buffers ----------------------
286
 
287
library ieee;
288
use ieee.std_logic_1164.all;
289
entity hclkint is port( a : in  std_logic; y   : out std_logic); end;
290
architecture struct of hclkint is begin y <= to_X01(a); end;
291
 
292
library ieee;
293
use ieee.std_logic_1164.all;
294
entity clkint is port( a : in  std_logic; y   : out std_logic); end;
295
architecture struct of clkint is begin y <= to_X01(a); end;
296
 
297
library ieee;
298
use ieee.std_logic_1164.all;
299
 
300
entity IOFIFO_BIBUF is
301
    port( AIN  : in    std_logic;
302
          AOUT : in    std_logic;
303
          YIN  : out   std_logic;
304
          YOUT : out   std_logic
305
        );
306
end ;
307
architecture struct of IOFIFO_BIBUF is begin
308
  YIN <= to_X01(AIN);
309
  YOUT <= to_X01(AOUT);
310
end;
311
 
312
library ieee;
313
use ieee.std_logic_1164.all;
314
entity add1 is
315
   port(
316
   a : in std_logic;
317
   b : in std_logic;
318
   fci : in std_logic;
319
   s : out std_logic;
320
   fco : out std_logic);
321
end add1;
322
architecture beh of add1 is
323
   signal un1_fco : std_logic;
324
   signal un2_fco : std_logic;
325
   signal un3_fco : std_logic;
326
begin
327
   s <= a xor b xor fci;
328
   un1_fco <= a and b;
329
   un2_fco <= a and fci;
330
   un3_fco <= b and fci;
331
   fco <= un1_fco or un2_fco or un3_fco;
332
end beh;
333
 
334
 
335
library ieee;
336
use ieee.std_logic_1164.all;
337
entity and2 is
338
   port(
339
   a : in std_logic;
340
   b : in std_logic;
341
   y : out std_logic);
342
end and2;
343
architecture beh of and2 is
344
begin
345
   y <= b and a;
346
end beh;
347
 
348
 
349
library ieee;
350
use ieee.std_logic_1164.all;
351
entity and2a is
352
   port(
353
   a : in std_logic;
354
   b : in std_logic;
355
   y : out std_logic);
356
end and2a;
357
architecture beh of and2a is
358
   signal ai : std_logic;
359
begin
360
   ai <= not a;
361
   y <= b and ai;
362
end beh;
363
 
364
 
365
library ieee;
366
use ieee.std_logic_1164.all;
367
entity and2b is
368
   port(
369
   a : in std_logic;
370
   b : in std_logic;
371
   y : out std_logic);
372
end and2b;
373
architecture beh of and2b is
374
   signal ai : std_logic;
375
   signal bi : std_logic;
376
begin
377
   ai <= not a;
378
   bi <= not b;
379
   y <= bi and ai;
380
end beh;
381
 
382
 
383
library ieee;
384
use ieee.std_logic_1164.all;
385
entity and3 is
386
   port(
387
   a : in std_logic;
388
   b : in std_logic;
389
   c : in std_logic;
390
   y : out std_logic);
391
end and3;
392
architecture beh of and3 is
393
begin
394
   y <= c and b and a;
395
end beh;
396
 
397
 
398
library ieee;
399
use ieee.std_logic_1164.all;
400
entity and3a is
401
   port(
402
   a : in std_logic;
403
   b : in std_logic;
404
   c : in std_logic;
405
   y : out std_logic);
406
end and3a;
407
architecture beh of and3a is
408
   signal ai : std_logic;
409
begin
410
   ai <= not a;
411
   y <= c and b and ai;
412
end beh;
413
 
414
 
415
library ieee;
416
use ieee.std_logic_1164.all;
417
entity and3b is
418
   port(
419
   a : in std_logic;
420
   b : in std_logic;
421
   c : in std_logic;
422
   y : out std_logic);
423
end and3b;
424
architecture beh of and3b is
425
   signal ai : std_logic;
426
   signal bi : std_logic;
427
begin
428
   ai <= not a;
429
   bi <= not b;
430
   y <= c and bi and ai;
431
end beh;
432
 
433
 
434
library ieee;
435
use ieee.std_logic_1164.all;
436
entity and3c is
437
   port(
438
   a : in std_logic;
439
   b : in std_logic;
440
   c : in std_logic;
441
   y : out std_logic);
442
end and3c;
443
architecture beh of and3c is
444
   signal ai : std_logic;
445
   signal bi : std_logic;
446
   signal ci : std_logic;
447
begin
448
   ai <= not a;
449
   bi <= not b;
450
   ci <= not c;
451
   y <= ci and bi and ai;
452
end beh;
453
 
454
 
455
library ieee;
456
use ieee.std_logic_1164.all;
457
entity and4 is
458
   port(
459
   a : in std_logic;
460
   b : in std_logic;
461
   c : in std_logic;
462
   d : in std_logic;
463
   y : out std_logic);
464
end and4;
465
architecture beh of and4 is
466
begin
467
   y <= d and c and b and a;
468
end beh;
469
 
470
 
471
library ieee;
472
use ieee.std_logic_1164.all;
473
entity and4a is
474
   port(
475
   a : in std_logic;
476
   b : in std_logic;
477
   c : in std_logic;
478
   d : in std_logic;
479
   y : out std_logic);
480
end and4a;
481
architecture beh of and4a is
482
   signal ai : std_logic;
483
begin
484
   ai <= not a;
485
   y <= d and c and b and ai;
486
end beh;
487
 
488
 
489
library ieee;
490
use ieee.std_logic_1164.all;
491
entity and4b is
492
   port(
493
   a : in std_logic;
494
   b : in std_logic;
495
   c : in std_logic;
496
   d : in std_logic;
497
   y : out std_logic);
498
end and4b;
499
architecture beh of and4b is
500
   signal ai : std_logic;
501
   signal bi : std_logic;
502
begin
503
   ai <= not a;
504
   bi <= not b;
505
   y <= d and c and bi and ai;
506
end beh;
507
 
508
 
509
library ieee;
510
use ieee.std_logic_1164.all;
511
entity and4c is
512
   port(
513
   a : in std_logic;
514
   b : in std_logic;
515
   c : in std_logic;
516
   d : in std_logic;
517
   y : out std_logic);
518
end and4c;
519
architecture beh of and4c is
520
   signal ai : std_logic;
521
   signal bi : std_logic;
522
   signal ci : std_logic;
523
begin
524
   ai <= not a;
525
   bi <= not b;
526
   ci <= not c;
527
   y <= d and ci and bi and ai;
528
end beh;
529
 
530
 
531
library ieee;
532
use ieee.std_logic_1164.all;
533
entity buff is
534
   port(
535
   a : in std_logic;
536
   y : out std_logic);
537
end buff;
538
architecture beh of buff is
539
begin
540
   y <= a;
541
end beh;
542
 
543
library ieee;
544
use ieee.std_logic_1164.all;
545
entity ioi_buff is
546
   port(
547
   a : in std_logic;
548
   y : out std_logic);
549
end ioi_buff;
550
architecture beh of ioi_buff is
551
begin
552
   y <= a;
553
end beh;
554
 
555
library ieee;
556
use ieee.std_logic_1164.all;
557
entity iooe_buff is
558
   port(
559
   a : in std_logic;
560
   y : out std_logic);
561
end iooe_buff;
562
architecture beh of iooe_buff is
563
begin
564
   y <= a;
565
end beh;
566
 
567
library ieee;
568
use ieee.std_logic_1164.all;
569
entity iofifo_outbuf is
570
   port(
571
   a : in std_logic;
572
   y : out std_logic);
573
end iofifo_outbuf;
574
architecture beh of iofifo_outbuf is
575
begin
576
   y <= a;
577
end beh;
578
 
579
library ieee;
580
use ieee.std_logic_1164.all;
581
entity cm8buff is
582
   port(
583
   a : in std_logic;
584
   y : out std_logic);
585
end cm8buff;
586
architecture beh of cm8buff is
587
begin
588
   y <= a;
589
end beh;
590
 
591
library ieee;
592
use ieee.std_logic_1164.all;
593
entity hclkmux is
594
   port(
595
   a : in std_logic;
596
   y : out std_logic);
597
end hclkmux;
598
architecture beh of hclkmux is
599
begin
600
   y <= a;
601
end beh;
602
 
603
library ieee;
604
use ieee.std_logic_1164.all;
605
entity rclkmux is
606
   port(
607
   a : in std_logic;
608
   y : out std_logic);
609
end rclkmux;
610
architecture beh of rclkmux is
611
begin
612
   y <= a;
613
end beh;
614
 
615
library ieee;
616
use ieee.std_logic_1164.all;
617
entity IOFIFO_INBUF is
618
   port(
619
   a : in std_logic;
620
   y : out std_logic);
621
end IOFIFO_INBUF;
622
architecture beh of IOFIFO_INBUF is
623
begin
624
   y <= a;
625
end beh;
626
 
627
library ieee;
628
use ieee.std_logic_1164.all;
629
entity CLKINT_W is
630
   port(
631
   a : in std_logic;
632
   y : out std_logic);
633
end CLKINT_W;
634
architecture beh of CLKINT_W is
635
begin
636
   y <= a;
637
end beh;
638
 
639
library ieee;
640
use ieee.std_logic_1164.all;
641
entity fcend_buff is
642
   port(
643
   fci : in std_logic;
644
   co : out std_logic);
645
end fcend_buff;
646
architecture beh of fcend_buff is
647
begin
648
   co <= fci;
649
end beh;
650
 
651
library ieee;
652
use ieee.std_logic_1164.all;
653
entity fcinit_buff is
654
   port(
655
   a : in std_logic;
656
   fco : out std_logic);
657
end fcinit_buff;
658
architecture beh of fcinit_buff is
659
begin
660
   fco <= a;
661
end beh;
662
 
663
library ieee;
664
use ieee.std_logic_1164.all;
665
entity cm8 is
666
   port(
667
   d0 : in std_logic;
668
   d1 : in std_logic;
669
   d2 : in std_logic;
670
   d3 : in std_logic;
671
   s00 : in std_logic;
672
   s01 : in std_logic;
673
   s10 : in std_logic;
674
   s11 : in std_logic;
675
   y : out std_logic);
676
end cm8;
677
architecture beh of cm8 is
678
   signal s0 : std_logic;
679
   signal s1 : std_logic;
680
   signal m0 : std_logic;
681
   signal m1 : std_logic;
682
begin
683
   s0 <= s01 and s00;
684
   s1 <= s11 or s10;
685
   m0 <= d0 when s0 = '0' else d1;
686
   m1 <= d2 when s0 = '0' else d3;
687
   y <= m0 when s1 = '0' else m1;
688
end beh;
689
 
690
 
691
library ieee;
692
use ieee.std_logic_1164.all;
693
entity cm8inv is
694
   port(
695
   a : in std_logic;
696
   y : out std_logic);
697
end cm8inv;
698
architecture beh of cm8inv is
699
begin
700
   y <= not a;
701
end beh;
702
 
703
 
704
library ieee;
705
use ieee.std_logic_1164.all;
706
entity df1 is
707
   port(
708
   d : in std_logic;
709
   clk : in std_logic;
710
   q : out std_logic);
711
end df1;
712
architecture beh of df1 is
713
begin
714
    ff : process (clk)
715
    begin
716
      if rising_edge(clk) then
717
         q <= d;
718
      end if;
719
    end process ff;
720
end beh;
721
 
722
library ieee;
723
use ieee.std_logic_1164.all;
724
entity df1b is
725
   port(
726
   d : in std_logic;
727
   clk : in std_logic;
728
   q : out std_logic);
729
end df1b;
730
architecture beh of df1b is
731
begin
732
    ff : process (clk)
733
    begin
734
      if falling_edge(clk) then
735
         q <= d;
736
      end if;
737
    end process ff;
738
end beh;
739
 
740
library ieee;
741
use ieee.std_logic_1164.all;
742
entity dfc1b is
743
   port(
744
   d : in std_logic;
745
   clk : in std_logic;
746
   clr : in std_logic;
747
   q : out std_logic);
748
end dfc1b;
749
architecture beh of dfc1b is
750
begin
751
   ff : process (clk, clr)
752
   begin
753
     if clr = '0' then
754
        q <= '0';
755
     elsif rising_edge(clk) then
756
        q <= d;
757
     end if;
758
   end process ff;
759
end beh;
760
 
761
library ieee;
762
use ieee.std_logic_1164.all;
763
entity dfc1c is
764
   port(
765
   d : in std_logic;
766
   clk : in std_logic;
767
   clr : in std_logic;
768
   q : out std_logic);
769
end dfc1c;
770
architecture beh of dfc1c is
771
begin
772
   ff : process (clk, clr)
773
   begin
774
     if clr = '1' then
775
        q <= '1';
776
     elsif rising_edge(clk) then
777
        q <= not d;
778
     end if;
779
   end process ff;
780
end beh;
781
 
782
library ieee;
783
use ieee.std_logic_1164.all;
784
entity dfc1d is
785
   port(
786
   d : in std_logic;
787
   clk : in std_logic;
788
   clr : in std_logic;
789
   q : out std_logic);
790
end dfc1d;
791
architecture beh of dfc1d is
792
begin
793
   ff : process (clk, clr)
794
   begin
795
     if clr = '0' then
796
        q <= '0';
797
     elsif falling_edge(clk) then
798
        q <= d;
799
     end if;
800
   end process ff;
801
end beh;
802
 
803
library ieee;
804
use ieee.std_logic_1164.all;
805
entity dfe1b is
806
   port(
807
   d : in std_logic;
808
   e : in std_logic;
809
   clk : in std_logic;
810
   q : out std_logic);
811
end dfe1b;
812
architecture beh of dfe1b is
813
   signal q_int_1 : std_logic;
814
   signal nq : std_logic;
815
begin
816
   nq <= d when e = '0' else q_int_1;
817
   q <= q_int_1;
818
   ff : process (clk)
819
   begin
820
     if rising_edge(clk) then
821
        q_int_1 <= nq;
822
     end if;
823
   end process ff;
824
end beh;
825
 
826
 
827
library ieee;
828
use ieee.std_logic_1164.all;
829
entity dfe3c is
830
   port(
831
   d : in std_logic;
832
   e : in std_logic;
833
   clk : in std_logic;
834
   clr : in std_logic;
835
   q : out std_logic);
836
end dfe3c;
837
architecture beh of dfe3c is
838
   signal q_int_0 : std_logic;
839
   signal md : std_logic;
840
begin
841
   md <= d when e = '0' else q_int_0;
842
   q <= q_int_0;
843
   ff : process (clk, clr)
844
   begin
845
     if clr = '0' then
846
        q_int_0 <= '0';
847
     elsif rising_edge(clk) then
848
        q_int_0 <= md;
849
     end if;
850
   end process ff;
851
end beh;
852
 
853
 
854
library ieee;
855
use ieee.std_logic_1164.all;
856
entity dfe4f is
857
   port(
858
   d : in std_logic;
859
   e : in std_logic;
860
   clk : in std_logic;
861
   pre : in std_logic;
862
   q : out std_logic);
863
end dfe4f;
864
architecture beh of dfe4f is
865
   signal q_int_1 : std_logic;
866
   signal un1 : std_logic;
867
begin
868
   un1 <= d when e = '0' else q_int_1;
869
   q <= q_int_1;
870
   ff : process (clk, pre)
871
   begin
872
     if pre = '0' then
873
        q_int_1 <= '1';
874
     elsif rising_edge(clk) then
875
        q_int_1 <= un1;
876
     end if;
877
   end process ff;
878
end beh;
879
 
880
 
881
library ieee;
882
use ieee.std_logic_1164.all;
883
entity dfp1 is
884
   port(
885
   d : in std_logic;
886
   clk : in std_logic;
887
   pre : in std_logic;
888
   q : out std_logic);
889
end dfp1;
890
architecture beh of dfp1 is
891
begin
892
   ff : process (clk, pre)
893
   begin
894
     if pre = '1' then
895
        q <= '1';
896
     elsif rising_edge(clk) then
897
        q <= d;
898
     end if;
899
   end process ff;
900
end beh;
901
 
902
 
903
library ieee;
904
use ieee.std_logic_1164.all;
905
entity dfp1b is
906
   port(
907
   d : in std_logic;
908
   clk : in std_logic;
909
   pre : in std_logic;
910
   q : out std_logic);
911
end dfp1b;
912
architecture beh of dfp1b is
913
begin
914
   ff : process (clk, pre)
915
   begin
916
     if pre = '0' then
917
        q <= '1';
918
     elsif rising_edge(clk) then
919
        q <= d;
920
     end if;
921
   end process ff;
922
end beh;
923
 
924
 
925
library ieee;
926
use ieee.std_logic_1164.all;
927
entity dfp1d is
928
   port(
929
   d : in std_logic;
930
   clk : in std_logic;
931
   pre : in std_logic;
932
   q : out std_logic);
933
end dfp1d;
934
architecture beh of dfp1d is
935
begin
936
   ff : process (clk, pre)
937
   begin
938
     if pre = '0' then
939
        q <= '1';
940
     elsif falling_edge(clk) then
941
        q <= d;
942
     end if;
943
   end process ff;
944
end beh;
945
 
946
library ieee;
947
use ieee.std_logic_1164.all;
948
entity dfeh is
949
   port(
950
   d : in std_logic;
951
   clk : in std_logic;
952
   clr : in std_logic;
953
   pre : in std_logic;
954
   e   : in std_logic;
955
   q : out std_logic);
956
end dfeh;
957
architecture beh of dfeh is
958
begin
959
   ff : process (clk, pre, clr)
960
   begin
961
     if clr = '0' then
962
        q <= '0';
963
     elsif pre = '0' then
964
        q <= '1';
965
     elsif falling_edge(clk) and (e = '0') then
966
        q <= d;
967
     end if;
968
   end process ff;
969
end beh;
970
 
971
library ieee;
972
use ieee.std_logic_1164.all;
973
entity iooe_dfeh is
974
   port(
975
   d : in std_logic;
976
   clk : in std_logic;
977
   clr : in std_logic;
978
   pre : in std_logic;
979
   e   : in std_logic;
980
   q : out std_logic;
981
   yout : out std_logic);
982
end iooe_dfeh;
983
architecture beh of iooe_dfeh is
984
begin
985
   ff : process (clk, pre, clr)
986
   begin
987
     if clr = '0' then
988
        q <= '0';
989
        yout <= '0';
990
     elsif pre = '0' then
991
        q <= '1';
992
        yout <= '1';
993
     elsif falling_edge(clk) and (e = '0') then
994
        q <= d;
995
        yout <= d;
996
     end if;
997
   end process ff;
998
end beh;
999
 
1000
 
1001
library ieee;
1002
use ieee.std_logic_1164.all;
1003
entity dfeg is
1004
   port(
1005
   d : in std_logic;
1006
   clk : in std_logic;
1007
   clr : in std_logic;
1008
   pre : in std_logic;
1009
   e   : in std_logic;
1010
   q : out std_logic);
1011
end dfeg;
1012
architecture beh of dfeg is
1013
begin
1014
   ff : process (clk, pre, clr)
1015
   begin
1016
     if clr = '0' then
1017
        q <= '0';
1018
     elsif pre = '0' then
1019
        q <= '1';
1020
     elsif rising_edge(clk) and (e = '0') then
1021
        q <= d;
1022
     end if;
1023
   end process ff;
1024
end beh;
1025
 
1026
library ieee;
1027
use ieee.std_logic_1164.all;
1028
entity dfmeg is
1029
   port(
1030
   a : in std_logic;
1031
   b : in std_logic;
1032
   clk : in std_logic;
1033
   clr : in std_logic;
1034
   pre : in std_logic;
1035
   e   : in std_logic;
1036
   s : in std_logic;
1037
   q : out std_logic);
1038
end dfmeg;
1039
architecture beh of dfmeg is
1040
begin
1041
   ff : process (clk, pre, clr)
1042
   begin
1043
     if clr = '0' then
1044
        q <= '0';
1045
     elsif pre = '0' then
1046
        q <= '1';
1047
     elsif rising_edge(clk) and (e = '0') then
1048
        if s = '0' then q <= a; else q <= b; end if;
1049
     end if;
1050
   end process ff;
1051
end beh;
1052
 
1053
library ieee;
1054
use ieee.std_logic_1164.all;
1055
entity ioi_dfeg is
1056
   port(
1057
   d : in std_logic;
1058
   clk : in std_logic;
1059
   clr : in std_logic;
1060
   pre : in std_logic;
1061
   e   : in std_logic;
1062
   q : out std_logic);
1063
end ioi_dfeg;
1064
architecture beh of ioi_dfeg is
1065
begin
1066
   ff : process (clk, pre, clr)
1067
   begin
1068
     if clr = '0' then
1069
        q <= '0';
1070
     elsif pre = '0' then
1071
        q <= '1';
1072
     elsif rising_edge(clk) and (e = '0') then
1073
        q <= d;
1074
     end if;
1075
   end process ff;
1076
end beh;
1077
 
1078
library ieee;
1079
use ieee.std_logic_1164.all;
1080
entity iooe_dfeg is
1081
   port(
1082
   d : in std_logic;
1083
   clk : in std_logic;
1084
   clr : in std_logic;
1085
   pre : in std_logic;
1086
   e   : in std_logic;
1087
   q : out std_logic;
1088
   yout : out std_logic);
1089
end iooe_dfeg;
1090
architecture beh of iooe_dfeg is
1091
begin
1092
   ff : process (clk, pre, clr)
1093
   begin
1094
     if clr = '0' then
1095
        q <= '0';
1096
        yout <= '0';
1097
     elsif pre = '0' then
1098
        q <= '1';
1099
        yout <= '1';
1100
     elsif rising_edge(clk) and (e = '0') then
1101
        q <= d;
1102
        yout <= d;
1103
     end if;
1104
   end process ff;
1105
end beh;
1106
 
1107
library ieee;
1108
use ieee.std_logic_1164.all;
1109
entity gnd is
1110
   port(
1111
   y : out std_logic);
1112
end gnd;
1113
architecture beh of gnd is
1114
begin
1115
   y <= '0';
1116
end beh;
1117
 
1118
library ieee;
1119
use ieee.std_logic_1164.all;
1120
entity dfm is
1121
   port(
1122
      clk : in std_logic;
1123
      s : in std_logic;
1124
      a : in std_logic;
1125
      b : in std_logic;
1126
      q : out std_logic);
1127
end dfm;
1128
architecture beh of dfm is
1129
begin
1130
   ff : process (clk)
1131
   begin
1132
     if rising_edge(clk) then
1133
        if s = '0' then q <= a;
1134
        else q <= b; end if;
1135
     end if;
1136
   end process ff;
1137
end beh;
1138
 
1139
--
1140
--library ieee;
1141
--use ieee.std_logic_1164.all;
1142
--entity hclkbuf is
1143
--   port(
1144
--   pad : in std_logic;
1145
--   y : out std_logic);
1146
--end hclkbuf;
1147
--architecture beh of hclkbuf is
1148
--begin
1149
--   y <= pad;
1150
--end beh;
1151
--
1152
--
1153
--library ieee;
1154
--use ieee.std_logic_1164.all;
1155
--entity inbuf is
1156
--   port(
1157
--   pad : in std_logic;
1158
--   y : out std_logic);
1159
--end inbuf;
1160
--architecture beh of inbuf is
1161
--begin
1162
--   y <= pad;
1163
--end beh;
1164
 
1165
 
1166
library ieee;
1167
use ieee.std_logic_1164.all;
1168
entity inv is
1169
   port(
1170
   a : in std_logic;
1171
   y : out std_logic);
1172
end inv;
1173
architecture beh of inv is
1174
begin
1175
   y <= not a;
1176
end beh;
1177
 
1178
library ieee;
1179
use ieee.std_logic_1164.all;
1180
entity nand2 is
1181
   port(
1182
   a : in std_logic;
1183
   b : in std_logic;
1184
   y : out std_logic);
1185
end nand2;
1186
architecture beh of nand2 is
1187
   signal yx : std_logic;
1188
begin
1189
   yx <= b and a;
1190
   y <= not yx;
1191
end beh;
1192
 
1193
library ieee;
1194
use ieee.std_logic_1164.all;
1195
entity nand4 is
1196
   port(
1197
   a : in std_logic;
1198
   b : in std_logic;
1199
   c : in std_logic;
1200
   d : in std_logic;
1201
   y : out std_logic);
1202
end nand4;
1203
architecture beh of nand4 is
1204
   signal yx : std_logic;
1205
begin
1206
   yx <= d and c and b and a;
1207
   y <= not yx;
1208
end beh;
1209
 
1210
 
1211
library ieee;
1212
use ieee.std_logic_1164.all;
1213
entity or2 is
1214
   port(
1215
   a : in std_logic;
1216
   b : in std_logic;
1217
   y : out std_logic);
1218
end or2;
1219
architecture beh of or2 is
1220
begin
1221
   y <= b or a;
1222
end beh;
1223
 
1224
 
1225
library ieee;
1226
use ieee.std_logic_1164.all;
1227
entity or2a is
1228
   port(
1229
   a : in std_logic;
1230
   b : in std_logic;
1231
   y : out std_logic);
1232
end or2a;
1233
architecture beh of or2a is
1234
   signal ai : std_logic;
1235
begin
1236
   ai <= not a;
1237
   y <= b or ai;
1238
end beh;
1239
 
1240
 
1241
library ieee;
1242
use ieee.std_logic_1164.all;
1243
entity or2b is
1244
   port(
1245
   a : in std_logic;
1246
   b : in std_logic;
1247
   y : out std_logic);
1248
end or2b;
1249
architecture beh of or2b is
1250
   signal ai : std_logic;
1251
   signal bi : std_logic;
1252
begin
1253
   ai <= not a;
1254
   bi <= not b;
1255
   y <= bi or ai;
1256
end beh;
1257
 
1258
 
1259
library ieee;
1260
use ieee.std_logic_1164.all;
1261
entity or3 is
1262
   port(
1263
   a : in std_logic;
1264
   b : in std_logic;
1265
   c : in std_logic;
1266
   y : out std_logic);
1267
end or3;
1268
architecture beh of or3 is
1269
begin
1270
   y <= c or b or a;
1271
end beh;
1272
 
1273
 
1274
library ieee;
1275
use ieee.std_logic_1164.all;
1276
entity or3a is
1277
   port(
1278
   a : in std_logic;
1279
   b : in std_logic;
1280
   c : in std_logic;
1281
   y : out std_logic);
1282
end or3a;
1283
architecture beh of or3a is
1284
   signal ai : std_logic;
1285
begin
1286
   ai <= not a;
1287
   y <= c or b or ai;
1288
end beh;
1289
 
1290
 
1291
library ieee;
1292
use ieee.std_logic_1164.all;
1293
entity or3b is
1294
   port(
1295
   a : in std_logic;
1296
   b : in std_logic;
1297
   c : in std_logic;
1298
   y : out std_logic);
1299
end or3b;
1300
architecture beh of or3b is
1301
   signal ai : std_logic;
1302
   signal bi : std_logic;
1303
begin
1304
   ai <= not a;
1305
   bi <= not b;
1306
   y <= c or bi or ai;
1307
end beh;
1308
 
1309
 
1310
library ieee;
1311
use ieee.std_logic_1164.all;
1312
entity or3c is
1313
   port(
1314
   a : in std_logic;
1315
   b : in std_logic;
1316
   c : in std_logic;
1317
   y : out std_logic);
1318
end or3c;
1319
architecture beh of or3c is
1320
   signal ai : std_logic;
1321
   signal bi : std_logic;
1322
   signal ci : std_logic;
1323
begin
1324
   ai <= not a;
1325
   bi <= not b;
1326
   ci <= not c;
1327
   y <= ci or bi or ai;
1328
end beh;
1329
 
1330
 
1331
library ieee;
1332
use ieee.std_logic_1164.all;
1333
entity or4 is
1334
   port(
1335
   a : in std_logic;
1336
   b : in std_logic;
1337
   c : in std_logic;
1338
   d : in std_logic;
1339
   y : out std_logic);
1340
end or4;
1341
architecture beh of or4 is
1342
begin
1343
   y <= d or c or b or a;
1344
end beh;
1345
 
1346
 
1347
library ieee;
1348
use ieee.std_logic_1164.all;
1349
entity or4a is
1350
   port(
1351
   a : in std_logic;
1352
   b : in std_logic;
1353
   c : in std_logic;
1354
   d : in std_logic;
1355
   y : out std_logic);
1356
end or4a;
1357
architecture beh of or4a is
1358
   signal ai : std_logic;
1359
begin
1360
   ai <= not a;
1361
   y <= d or c or b or ai;
1362
end beh;
1363
 
1364
 
1365
library ieee;
1366
use ieee.std_logic_1164.all;
1367
entity or4b is
1368
   port(
1369
   a : in std_logic;
1370
   b : in std_logic;
1371
   c : in std_logic;
1372
   d : in std_logic;
1373
   y : out std_logic);
1374
end or4b;
1375
architecture beh of or4b is
1376
   signal ai : std_logic;
1377
   signal bi : std_logic;
1378
begin
1379
   ai <= not a;
1380
   bi <= not b;
1381
   y <= d or c or bi or ai;
1382
end beh;
1383
 
1384
 
1385
library ieee;
1386
use ieee.std_logic_1164.all;
1387
entity or4c is
1388
   port(
1389
   a : in std_logic;
1390
   b : in std_logic;
1391
   c : in std_logic;
1392
   d : in std_logic;
1393
   y : out std_logic);
1394
end or4c;
1395
architecture beh of or4c is
1396
   signal ai : std_logic;
1397
   signal bi : std_logic;
1398
   signal ci : std_logic;
1399
begin
1400
   ai <= not a;
1401
   bi <= not b;
1402
   ci <= not c;
1403
   y <= d or ci or bi or ai;
1404
end beh;
1405
 
1406
 
1407
library ieee;
1408
use ieee.std_logic_1164.all;
1409
entity or4d is
1410
   port(
1411
   a : in std_logic;
1412
   b : in std_logic;
1413
   c : in std_logic;
1414
   d : in std_logic;
1415
   y : out std_logic);
1416
end or4d;
1417
architecture beh of or4d is
1418
   signal ai : std_logic;
1419
   signal bi : std_logic;
1420
   signal ci : std_logic;
1421
   signal di : std_logic;
1422
begin
1423
   ai <= not a;
1424
   bi <= not b;
1425
   ci <= not c;
1426
   di <= not d;
1427
   y <= di or ci or bi or ai;
1428
end beh;
1429
 
1430
library ieee;
1431
use ieee.std_logic_1164.all;
1432
entity sub1 is
1433
   port(
1434
   a : in std_logic;
1435
   b : in std_logic;
1436
   fci : in std_logic;
1437
   s : out std_logic;
1438
   fco : out std_logic);
1439
end sub1;
1440
architecture beh of sub1 is
1441
   signal un1_b : std_logic;
1442
   signal un3_fco : std_logic;
1443
   signal un1_fco : std_logic;
1444
   signal un4_fco : std_logic;
1445
begin
1446
   un1_b <= not b;
1447
   un3_fco <= a and fci;
1448
   s <= a xor fci xor un1_b;
1449
   un1_fco <= a and un1_b;
1450
   un4_fco <= fci and un1_b;
1451
   fco <= un1_fco or un3_fco or un4_fco;
1452
end beh;
1453
 
1454
 
1455
library ieee;
1456
use ieee.std_logic_1164.all;
1457
entity vcc is
1458
   port(
1459
   y : out std_logic);
1460
end vcc;
1461
architecture beh of vcc is
1462
begin
1463
   y <= '1';
1464
end beh;
1465
 
1466
 
1467
library ieee;
1468
use ieee.std_logic_1164.all;
1469
entity xa1 is
1470
   port(
1471
   a : in std_logic;
1472
   b : in std_logic;
1473
   c : in std_logic;
1474
   y : out std_logic);
1475
end xa1;
1476
architecture beh of xa1 is
1477
   signal xab : std_logic;
1478
begin
1479
   xab <= b xor a;
1480
   y <= c and xab;
1481
end beh;
1482
 
1483
 
1484
library ieee;
1485
use ieee.std_logic_1164.all;
1486
entity xnor2 is
1487
   port(
1488
   a : in std_logic;
1489
   b : in std_logic;
1490
   y : out std_logic);
1491
end xnor2;
1492
architecture beh of xnor2 is
1493
   signal yi : std_logic;
1494
begin
1495
   yi <= b xor a;
1496
   y <= not yi;
1497
end beh;
1498
 
1499
 
1500
library ieee;
1501
use ieee.std_logic_1164.all;
1502
entity xor2 is
1503
   port(
1504
   a : in std_logic;
1505
   b : in std_logic;
1506
   y : out std_logic);
1507
end xor2;
1508
architecture beh of xor2 is
1509
begin
1510
   y <= b xor a;
1511
end beh;
1512
 
1513
library ieee;
1514
use ieee.std_logic_1164.all;
1515
entity xor3 is
1516
   port(
1517
   a : in std_logic;
1518
   b : in std_logic;
1519
   c : in std_logic;
1520
   y : out std_logic);
1521
end xor3;
1522
architecture beh of xor3 is
1523
begin
1524
   y <= (c xor b) xor a;
1525
end beh;
1526
 
1527
library ieee;
1528
use ieee.std_logic_1164.all;
1529
entity xor4 is
1530
   port(a,b,c,d : in std_logic;
1531
     y : out std_logic);
1532
end xor4;
1533
architecture beh of xor4 is
1534
   signal xab, xcd : std_logic;
1535
begin
1536
   xab <= b xor a;
1537
   xcd <= c xor d;
1538
   y <= xab xor xcd;
1539
end beh;
1540
 
1541
library ieee;
1542
use ieee.std_logic_1164.all;
1543
entity xor4_fci is
1544
   port(a,b,c,fci : in std_logic;
1545
     y : out std_logic);
1546
end xor4_fci;
1547
architecture beh of xor4_fci is
1548
   signal xab, xcd : std_logic;
1549
begin
1550
   xab <= b xor a;
1551
   xcd <= c xor fci;
1552
   y <= xab xor xcd;
1553
end beh;
1554
 
1555
library ieee;
1556
use ieee.std_logic_1164.all;
1557
entity mx2 is
1558
   port(
1559
   a : in std_logic;
1560
   s : in std_logic;
1561
   b : in std_logic;
1562
   y : out std_logic);
1563
end mx2;
1564
architecture beh of mx2 is
1565
   signal xab : std_logic;
1566
begin
1567
   y <= b when s = '0' else a;
1568
end beh;
1569
 
1570
library ieee;
1571
use ieee.std_logic_1164.all;
1572
entity mx4 is
1573
   port(
1574
   d0 : in std_logic;
1575
   s0 : in std_logic;
1576
   d1 : in std_logic;
1577
   s1 : in std_logic;
1578
   d2 : in std_logic;
1579
   d3 : in std_logic;
1580
   y : out std_logic);
1581
end mx4;
1582
architecture beh of mx4 is
1583
begin
1584
   y <= d0 when (s1 = '0' and s0 = '0') else
1585
        d1 when (s1 = '0' and s0 = '1') else
1586
        d2 when (s1 = '1' and s0 = '0') else d3;
1587
end beh;
1588
 
1589
library ieee;
1590
use ieee.std_logic_1164.all;
1591
entity bufd is
1592
   port(
1593
   a : in std_logic;
1594
   y : out std_logic);
1595
end bufd;
1596
architecture beh of bufd is
1597
begin
1598
   y <= a;
1599
end beh;
1600
 
1601
library ieee;
1602
use ieee.std_logic_1164.all;
1603
entity xai1 is
1604
   port(
1605
   a : in std_logic;
1606
   b : in std_logic;
1607
   c : in std_logic;
1608
   y : out std_logic);
1609
end xai1;
1610
architecture beh of xai1 is
1611
begin
1612
   y <= not (c and not (a xor b));
1613
end beh;
1614
 
1615
library ieee;
1616
use ieee.std_logic_1164.all;
1617
entity ax1c is
1618
   port(
1619
   a : in std_logic;
1620
   b : in std_logic;
1621
   c : in std_logic;
1622
   y : out std_logic);
1623
end ;
1624
architecture beh of ax1c is
1625
begin
1626
   y <= (a and b) xor c;
1627
end beh;
1628
 
1629
library ieee;
1630
use ieee.std_logic_1164.all;
1631
entity ax1 is
1632
   port(
1633
   a : in std_logic;
1634
   b : in std_logic;
1635
   c : in std_logic;
1636
   y : out std_logic);
1637
end ax1;
1638
architecture beh of ax1 is
1639
begin
1640
   y <= (((not a) and b) xor c);
1641
end beh;
1642
 
1643
library ieee;
1644
use ieee.std_logic_1164.all;
1645
entity cy2a is
1646
   port(
1647
   a1 : in std_logic;
1648
   b1 : in std_logic;
1649
   a0 : in std_logic;
1650
   b0 : in std_logic;
1651
   y : out std_logic);
1652
end cy2a;
1653
architecture beh of cy2a is
1654
begin
1655
   y <= ((( a1 AND  b1 ) OR (( a0  AND  b0 ) AND  a1 )) OR (( a0  AND  b0 ) AND  b1 ));
1656
end beh;
1657
 
1658
-- pragma translate_on
1659
 

powered by: WebSVN 2.1.0

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