Разработка цифрового автомата, имеющего два режима работы: М=0 – двоичный суммирующий счетчик, М=1 – двоично-десятичный суммирующий счетчик, страница 4

              INPUT D0_0, D0_1, D0_2, D0_3, D1_0, D1_1, D1_2, D1_3, A ;

              OUTPUT Y0, Y1, Y2, Y3 ;

);

Y0=/A*D0_0 + A*D1_0;

Y1=/A*D0_1 + A*D1_1;

Y2=/A*D0_2 + A*D1_2;

Y3=/A*D0_3 + A*D1_3;

END MUX2_3_DSL;

------------------------------------------------------------------------------------------------------------------------------------

PROCEDURE D_DSL(INPUT D, C, R; OUTPUT Q, NQ);

D_FLOP NODE Y CLOCKED_BY C RESET_BY /R;

Y.D=D;

Q=Y; NQ=/Y;

END D_DSL;

------------------------------------------------------------------------------------------------------------------------------------

PROCEDURE DC_DSL (

              INPUT D1, D2, D4, D8, D16 ;

              OUTPUT Y0, Y1, Y2, Y3, Y4, Y5, Y6, Y7, Y8, Y9, Y10, Y11, Y12, Y13, Y14, Y15 ;

              OUTPUT Y16, Y17, Y18, Y19, Y20, Y21, Y22, Y23, Y24, Y25 ;

);

              " TODO: add your DSL code below.

TRUTH_TABLE

[D16,D8,D4,D2,D1]       ::  [Y25..Y0];

0                                                       ::            1;

1                                                       ::            2;

2                                                       ::             4;

3                                                       ::            8;

4                                                       ::            16;

5                                                       ::             32;

6                                                       ::            64;

7                                                       ::            128;

8                                                       ::            256;

9                                                       ::            512;

10                                                     ::            1024;

11                                                     ::            2048;

12                                                     ::             4096;

13                                                     ::            8192;

14                                                     ::            16384;

15                                                     ::            32768;

16                                                     ::            65536;

17                                                     ::            131072;

18                                                     ::            262144;

19                                                     ::            524288;

20                                                     ::            1048576;

21                                                     ::            2097152;

22                                                     ::             4194304;

23                                                     ::            8388608;

24                                                     ::            16777216;

25                                                     ::            33554432;

END TRUTH_TABLE;

END DC_DSL;

------------------------------------------------------------------------------------------------------------------------------------

PROCEDURE PROM_DSL (

              INPUT Q0, Q1, Q2, Q3, M;

              OUTPUT D0, D1, D2, D3;

);

TRUTH_TABLE

[M,Q3..Q0]::[D3..D0];    

0            ::            1;

1            ::            2;

2            ::            3;

3            ::            4;

4            ::            5;

5            ::            6;

6            ::            7;

7            ::            8;

8            ::            9;

9            ::            10;

10          ::            11;