diff --git a/CPUProject.bdf b/CPUProject.bdf index 3210abb..6372c4e 100644 --- a/CPUProject.bdf +++ b/CPUProject.bdf @@ -21,7 +21,7 @@ refer to the applicable agreement for further details. (header "graphic" (version "1.4")) (pin (input) - (rect 192 752 360 768) + (rect 168 720 336 736) (text "INPUT" (rect 125 0 153 10)(font "Arial" (font_size 6))) (text "CLK" (rect 5 0 26 12)(font "Arial" )) (pt 168 8) @@ -35,9 +35,25 @@ refer to the applicable agreement for further details. ) (text "VCC" (rect 128 7 148 17)(font "Arial" (font_size 6))) ) +(pin + (input) + (rect 168 736 336 752) + (text "INPUT" (rect 125 0 153 10)(font "Arial" (font_size 6))) + (text "stack_rst" (rect 5 0 52 12)(font "Arial" )) + (pt 168 8) + (drawing + (line (pt 84 12)(pt 109 12)) + (line (pt 84 4)(pt 109 4)) + (line (pt 113 8)(pt 168 8)) + (line (pt 84 12)(pt 84 4)) + (line (pt 109 4)(pt 113 8)) + (line (pt 109 12)(pt 113 8)) + ) + (text "VCC" (rect 128 7 148 17)(font "Arial" (font_size 6))) +) (pin (output) - (rect 1096 512 1272 528) + (rect 1232 656 1408 672) (text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6))) (text "ALU_carry" (rect 90 0 139 17)(font "Intel Clear" )) (pt 0 8) @@ -53,7 +69,7 @@ refer to the applicable agreement for further details. ) (pin (output) - (rect 1096 544 1272 560) + (rect 1232 688 1408 704) (text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6))) (text "Rs1[15..0]" (rect 90 0 137 17)(font "Intel Clear" )) (pt 0 8) @@ -69,7 +85,7 @@ refer to the applicable agreement for further details. ) (pin (output) - (rect 1096 560 1272 576) + (rect 1232 704 1408 720) (text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6))) (text "Rs2[15..0]" (rect 90 0 137 17)(font "Intel Clear" )) (pt 0 8) @@ -85,7 +101,7 @@ refer to the applicable agreement for further details. ) (pin (output) - (rect 1096 528 1272 544) + (rect 1232 672 1408 688) (text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6))) (text "Rd[15..0]" (rect 90 0 136 12)(font "Arial" )) (pt 0 8) @@ -101,7 +117,7 @@ refer to the applicable agreement for further details. ) (pin (output) - (rect 1096 576 1272 592) + (rect 1232 720 1408 736) (text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6))) (text "instr[15..0]" (rect 90 0 139 17)(font "Intel Clear" )) (pt 0 8) @@ -117,7 +133,7 @@ refer to the applicable agreement for further details. ) (pin (output) - (rect 1096 592 1272 608) + (rect 1232 736 1408 752) (text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6))) (text "FETCH" (rect 90 0 121 17)(font "Intel Clear" )) (pt 0 8) @@ -133,7 +149,7 @@ refer to the applicable agreement for further details. ) (pin (output) - (rect 1096 608 1272 624) + (rect 1232 752 1408 768) (text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6))) (text "EXEC1" (rect 90 0 121 17)(font "Intel Clear" )) (pt 0 8) @@ -149,7 +165,7 @@ refer to the applicable agreement for further details. ) (pin (output) - (rect 1096 624 1272 640) + (rect 1232 768 1408 784) (text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6))) (text "EXEC2" (rect 90 0 121 17)(font "Intel Clear" )) (pt 0 8) @@ -165,7 +181,7 @@ refer to the applicable agreement for further details. ) (pin (output) - (rect 1096 496 1272 512) + (rect 1232 640 1408 656) (text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6))) (text "reg_in[15..0]" (rect 90 0 151 12)(font "Arial" )) (pt 0 8) @@ -180,331 +196,7 @@ refer to the applicable agreement for further details. ) ) (symbol - (rect 632 112 816 336) - (text "mux_8x16" (rect 5 0 67 19)(font "Intel Clear" (font_size 8))) - (text "MUX1" (rect 8 203 37 220)(font "Intel Clear" )) - (port - (pt 0 32) - (input) - (text "s0" (rect 0 0 14 19)(font "Intel Clear" (font_size 8))) - (text "s0" (rect 21 27 35 46)(font "Intel Clear" (font_size 8))) - (line (pt 0 32)(pt 16 32)) - ) - (port - (pt 0 48) - (input) - (text "s1" (rect 0 0 14 19)(font "Intel Clear" (font_size 8))) - (text "s1" (rect 21 43 35 62)(font "Intel Clear" (font_size 8))) - (line (pt 0 48)(pt 16 48)) - ) - (port - (pt 0 64) - (input) - (text "s2" (rect 0 0 14 19)(font "Intel Clear" (font_size 8))) - (text "s2" (rect 21 59 35 78)(font "Intel Clear" (font_size 8))) - (line (pt 0 64)(pt 16 64)) - ) - (port - (pt 0 80) - (input) - (text "in0[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in0[15..0]" (rect 21 75 78 94)(font "Intel Clear" (font_size 8))) - (line (pt 0 80)(pt 16 80)(line_width 3)) - ) - (port - (pt 0 96) - (input) - (text "in1[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in1[15..0]" (rect 21 91 78 110)(font "Intel Clear" (font_size 8))) - (line (pt 0 96)(pt 16 96)(line_width 3)) - ) - (port - (pt 0 112) - (input) - (text "in2[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in2[15..0]" (rect 21 107 78 126)(font "Intel Clear" (font_size 8))) - (line (pt 0 112)(pt 16 112)(line_width 3)) - ) - (port - (pt 0 128) - (input) - (text "in3[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in3[15..0]" (rect 21 123 78 142)(font "Intel Clear" (font_size 8))) - (line (pt 0 128)(pt 16 128)(line_width 3)) - ) - (port - (pt 0 144) - (input) - (text "in4[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in4[15..0]" (rect 21 139 78 158)(font "Intel Clear" (font_size 8))) - (line (pt 0 144)(pt 16 144)(line_width 3)) - ) - (port - (pt 0 160) - (input) - (text "in5[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in5[15..0]" (rect 21 155 78 174)(font "Intel Clear" (font_size 8))) - (line (pt 0 160)(pt 16 160)(line_width 3)) - ) - (port - (pt 0 176) - (input) - (text "in6[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in6[15..0]" (rect 21 171 78 190)(font "Intel Clear" (font_size 8))) - (line (pt 0 176)(pt 16 176)(line_width 3)) - ) - (port - (pt 0 192) - (input) - (text "in7[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in7[15..0]" (rect 21 187 78 206)(font "Intel Clear" (font_size 8))) - (line (pt 0 192)(pt 16 192)(line_width 3)) - ) - (port - (pt 184 32) - (output) - (text "result[15..0]" (rect 0 0 71 19)(font "Intel Clear" (font_size 8))) - (text "result[15..0]" (rect 92 27 163 46)(font "Intel Clear" (font_size 8))) - (line (pt 184 32)(pt 168 32)(line_width 3)) - ) - (drawing - (rectangle (rect 16 16 168 208)) - ) -) -(symbol - (rect 632 336 816 560) - (text "mux_8x16" (rect 5 0 67 19)(font "Intel Clear" (font_size 8))) - (text "MUX2" (rect 8 203 37 220)(font "Intel Clear" )) - (port - (pt 0 32) - (input) - (text "s0" (rect 0 0 14 19)(font "Intel Clear" (font_size 8))) - (text "s0" (rect 21 27 35 46)(font "Intel Clear" (font_size 8))) - (line (pt 0 32)(pt 16 32)) - ) - (port - (pt 0 48) - (input) - (text "s1" (rect 0 0 14 19)(font "Intel Clear" (font_size 8))) - (text "s1" (rect 21 43 35 62)(font "Intel Clear" (font_size 8))) - (line (pt 0 48)(pt 16 48)) - ) - (port - (pt 0 64) - (input) - (text "s2" (rect 0 0 14 19)(font "Intel Clear" (font_size 8))) - (text "s2" (rect 21 59 35 78)(font "Intel Clear" (font_size 8))) - (line (pt 0 64)(pt 16 64)) - ) - (port - (pt 0 80) - (input) - (text "in0[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in0[15..0]" (rect 21 75 78 94)(font "Intel Clear" (font_size 8))) - (line (pt 0 80)(pt 16 80)(line_width 3)) - ) - (port - (pt 0 96) - (input) - (text "in1[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in1[15..0]" (rect 21 91 78 110)(font "Intel Clear" (font_size 8))) - (line (pt 0 96)(pt 16 96)(line_width 3)) - ) - (port - (pt 0 112) - (input) - (text "in2[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in2[15..0]" (rect 21 107 78 126)(font "Intel Clear" (font_size 8))) - (line (pt 0 112)(pt 16 112)(line_width 3)) - ) - (port - (pt 0 128) - (input) - (text "in3[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in3[15..0]" (rect 21 123 78 142)(font "Intel Clear" (font_size 8))) - (line (pt 0 128)(pt 16 128)(line_width 3)) - ) - (port - (pt 0 144) - (input) - (text "in4[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in4[15..0]" (rect 21 139 78 158)(font "Intel Clear" (font_size 8))) - (line (pt 0 144)(pt 16 144)(line_width 3)) - ) - (port - (pt 0 160) - (input) - (text "in5[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in5[15..0]" (rect 21 155 78 174)(font "Intel Clear" (font_size 8))) - (line (pt 0 160)(pt 16 160)(line_width 3)) - ) - (port - (pt 0 176) - (input) - (text "in6[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in6[15..0]" (rect 21 171 78 190)(font "Intel Clear" (font_size 8))) - (line (pt 0 176)(pt 16 176)(line_width 3)) - ) - (port - (pt 0 192) - (input) - (text "in7[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in7[15..0]" (rect 21 187 78 206)(font "Intel Clear" (font_size 8))) - (line (pt 0 192)(pt 16 192)(line_width 3)) - ) - (port - (pt 184 32) - (output) - (text "result[15..0]" (rect 0 0 71 19)(font "Intel Clear" (font_size 8))) - (text "result[15..0]" (rect 92 27 163 46)(font "Intel Clear" (font_size 8))) - (line (pt 184 32)(pt 168 32)(line_width 3)) - ) - (drawing - (rectangle (rect 16 16 168 208)) - ) -) -(symbol - (rect 632 560 816 784) - (text "mux_8x16" (rect 5 0 67 19)(font "Intel Clear" (font_size 8))) - (text "MUX3" (rect 8 203 37 220)(font "Intel Clear" )) - (port - (pt 0 32) - (input) - (text "s0" (rect 0 0 14 19)(font "Intel Clear" (font_size 8))) - (text "s0" (rect 21 27 35 46)(font "Intel Clear" (font_size 8))) - (line (pt 0 32)(pt 16 32)) - ) - (port - (pt 0 48) - (input) - (text "s1" (rect 0 0 14 19)(font "Intel Clear" (font_size 8))) - (text "s1" (rect 21 43 35 62)(font "Intel Clear" (font_size 8))) - (line (pt 0 48)(pt 16 48)) - ) - (port - (pt 0 64) - (input) - (text "s2" (rect 0 0 14 19)(font "Intel Clear" (font_size 8))) - (text "s2" (rect 21 59 35 78)(font "Intel Clear" (font_size 8))) - (line (pt 0 64)(pt 16 64)) - ) - (port - (pt 0 80) - (input) - (text "in0[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in0[15..0]" (rect 21 75 78 94)(font "Intel Clear" (font_size 8))) - (line (pt 0 80)(pt 16 80)(line_width 3)) - ) - (port - (pt 0 96) - (input) - (text "in1[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in1[15..0]" (rect 21 91 78 110)(font "Intel Clear" (font_size 8))) - (line (pt 0 96)(pt 16 96)(line_width 3)) - ) - (port - (pt 0 112) - (input) - (text "in2[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in2[15..0]" (rect 21 107 78 126)(font "Intel Clear" (font_size 8))) - (line (pt 0 112)(pt 16 112)(line_width 3)) - ) - (port - (pt 0 128) - (input) - (text "in3[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in3[15..0]" (rect 21 123 78 142)(font "Intel Clear" (font_size 8))) - (line (pt 0 128)(pt 16 128)(line_width 3)) - ) - (port - (pt 0 144) - (input) - (text "in4[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in4[15..0]" (rect 21 139 78 158)(font "Intel Clear" (font_size 8))) - (line (pt 0 144)(pt 16 144)(line_width 3)) - ) - (port - (pt 0 160) - (input) - (text "in5[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in5[15..0]" (rect 21 155 78 174)(font "Intel Clear" (font_size 8))) - (line (pt 0 160)(pt 16 160)(line_width 3)) - ) - (port - (pt 0 176) - (input) - (text "in6[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in6[15..0]" (rect 21 171 78 190)(font "Intel Clear" (font_size 8))) - (line (pt 0 176)(pt 16 176)(line_width 3)) - ) - (port - (pt 0 192) - (input) - (text "in7[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in7[15..0]" (rect 21 187 78 206)(font "Intel Clear" (font_size 8))) - (line (pt 0 192)(pt 16 192)(line_width 3)) - ) - (port - (pt 184 32) - (output) - (text "result[15..0]" (rect 0 0 71 19)(font "Intel Clear" (font_size 8))) - (text "result[15..0]" (rect 92 27 163 46)(font "Intel Clear" (font_size 8))) - (line (pt 184 32)(pt 168 32)(line_width 3)) - ) - (drawing - (rectangle (rect 16 16 168 208)) - ) -) -(symbol - (rect 1168 272 1280 360) - (text "BUSMUX" (rect 28 0 91 16)(font "Arial" (font_size 10))) - (text "MUX4" (rect 3 77 32 94)(font "Intel Clear" )) - (port - (pt 0 64) - (input) - (text "datab[WIDTH-1..0]" (rect 6 51 108 65)(font "Arial" (font_size 8))) - (text "datab[]" (rect 6 51 44 65)(font "Arial" (font_size 8))) - (line (pt 0 64)(pt 44 64)(line_width 3)) - ) - (port - (pt 56 88) - (input) - (text "sel" (rect 59 70 75 84)(font "Arial" (font_size 8))) - (text "sel" (rect 59 70 75 84)(font "Arial" (font_size 8))) - (line (pt 56 88)(pt 56 72)) - ) - (port - (pt 0 32) - (input) - (text "dataa[WIDTH-1..0]" (rect 6 19 108 33)(font "Arial" (font_size 8))) - (text "dataa[]" (rect 6 19 44 33)(font "Arial" (font_size 8))) - (line (pt 0 32)(pt 44 32)(line_width 3)) - ) - (port - (pt 112 48) - (output) - (text "result[WIDTH-1..0]" (rect 75 35 177 49)(font "Arial" (font_size 8))) - (text "result[]" (rect 75 35 113 49)(font "Arial" (font_size 8))) - (line (pt 68 48)(pt 112 48)(line_width 3)) - ) - (parameter - "WIDTH" - "16" - "Width of I/O, any integer > 0" - " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" " 9" "10" "11" "12" "13" "14" "15" "16" "20" "24" "28" "32" "40" "48" "56" "64" - ) - (drawing - (text "0" (rect 52 31 56 41)(font "Arial" (font_size 6))) - (text "1" (rect 52 55 56 65)(font "Arial" (font_size 6))) - (line (pt 68 64)(pt 68 32)) - (line (pt 44 80)(pt 44 16)) - (line (pt 44 16)(pt 68 32)) - (line (pt 44 80)(pt 68 64)) - ) - (annotation_block (parameter)(rect 1280 272 1304 288)) -) -(symbol - (rect 224 160 432 512) + (rect 200 160 408 512) (text "reg_file" (rect 5 0 49 19)(font "Intel Clear" (font_size 8))) (text "REG" (rect 8 331 28 348)(font "Intel Clear" )) (port @@ -1079,7 +771,7 @@ refer to the applicable agreement for further details. ) ) (symbol - (rect 968 -184 1176 152) + (rect 968 -216 1176 120) (text "DECODE" (rect 5 0 52 12)(font "Arial" )) (text "DECODE" (rect 8 320 55 332)(font "Arial" )) (port @@ -1311,195 +1003,380 @@ refer to the applicable agreement for further details. (rectangle (rect 16 16 168 144)) ) ) -(connector - (pt 504 416) - (pt 632 416) - (bus) +(symbol + (rect 936 480 1120 624) + (text "LIFOstack" (rect 5 0 56 12)(font "Arial" )) + (text "STACK" (rect 8 128 43 140)(font "Arial" )) + (port + (pt 0 32) + (input) + (text "Din[15..0]" (rect 0 0 48 12)(font "Arial" )) + (text "Din[15..0]" (rect 21 27 69 39)(font "Arial" )) + (line (pt 0 32)(pt 16 32)(line_width 3)) + ) + (port + (pt 0 48) + (input) + (text "clk" (rect 0 0 14 12)(font "Arial" )) + (text "clk" (rect 21 43 35 55)(font "Arial" )) + (line (pt 0 48)(pt 16 48)) + ) + (port + (pt 0 64) + (input) + (text "en" (rect 0 0 11 12)(font "Arial" )) + (text "en" (rect 21 59 32 71)(font "Arial" )) + (line (pt 0 64)(pt 16 64)) + ) + (port + (pt 0 80) + (input) + (text "rst" (rect 0 0 12 12)(font "Arial" )) + (text "rst" (rect 21 75 33 87)(font "Arial" )) + (line (pt 0 80)(pt 16 80)) + ) + (port + (pt 0 96) + (input) + (text "rw" (rect 0 0 10 12)(font "Arial" )) + (text "rw" (rect 21 91 31 103)(font "Arial" )) + (line (pt 0 96)(pt 16 96)) + ) + (port + (pt 184 32) + (output) + (text "Dout[15..0]" (rect 0 0 55 12)(font "Arial" )) + (text "Dout[15..0]" (rect 117 27 172 39)(font "Arial" )) + (line (pt 184 32)(pt 168 32)(line_width 3)) + ) + (port + (pt 184 48) + (output) + (text "empty" (rect 0 0 31 12)(font "Arial" )) + (text "empty" (rect 137 43 168 55)(font "Arial" )) + (line (pt 184 48)(pt 168 48)) + ) + (port + (pt 184 64) + (output) + (text "full" (rect 0 0 15 12)(font "Arial" )) + (text "full" (rect 151 59 166 71)(font "Arial" )) + (line (pt 184 64)(pt 168 64)) + ) + (drawing + (rectangle (rect 16 16 168 128)) + ) ) -(connector - (pt 520 432) - (pt 632 432) - (bus) +(symbol + (rect 776 -32 824 32) + (text "OR2" (rect 0 45 10 63)(font "Arial" (font_size 6))(vertical)) + (text "OR_MUX5" (rect 38 43 50 93)(font "Arial" )(vertical)) + (port + (pt 32 64) + (input) + (text "IN2" (rect 2 23 19 35)(font "Courier New" (bold))(invisible)) + (text "IN2" (rect 23 45 35 62)(font "Courier New" (bold))(vertical)(invisible)) + (line (pt 32 64)(pt 32 49)) + ) + (port + (pt 16 64) + (input) + (text "IN1" (rect 2 7 19 19)(font "Courier New" (bold))(invisible)) + (text "IN1" (rect 7 45 19 62)(font "Courier New" (bold))(vertical)(invisible)) + (line (pt 16 64)(pt 16 49)) + ) + (port + (pt 24 0) + (output) + (text "OUT" (rect 48 15 65 27)(font "Courier New" (bold))(invisible)) + (text "OUT" (rect 15 -1 27 16)(font "Courier New" (bold))(vertical)(invisible)) + (line (pt 24 16)(pt 24 0)) + ) + (drawing + (line (pt 36 50)(pt 36 39)) + (line (pt 13 50)(pt 13 39)) + (arc (pt 29 57)(pt 19 57)(rect 8 45 41 78)) + (arc (pt 24 15)(pt 13 39)(rect 13 7 76 70)) + (arc (pt 35 39)(pt 24 15)(rect -27 7 36 70)) + ) + (rotate90) ) -(connector - (pt 536 448) - (pt 632 448) - (bus) +(symbol + (rect 632 144 816 352) + (text "mux_8x16" (rect 5 0 55 12)(font "Arial" )) + (text "MUX1" (rect 8 192 36 204)(font "Arial" )) + (port + (pt 0 32) + (input) + (text "s[2..0]" (rect 0 0 31 12)(font "Arial" )) + (text "s[2..0]" (rect 21 27 52 39)(font "Arial" )) + (line (pt 0 32)(pt 16 32)(line_width 3)) + ) + (port + (pt 0 48) + (input) + (text "in0[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in0[15..0]" (rect 21 43 67 55)(font "Arial" )) + (line (pt 0 48)(pt 16 48)(line_width 3)) + ) + (port + (pt 0 64) + (input) + (text "in1[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in1[15..0]" (rect 21 59 67 71)(font "Arial" )) + (line (pt 0 64)(pt 16 64)(line_width 3)) + ) + (port + (pt 0 80) + (input) + (text "in2[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in2[15..0]" (rect 21 75 67 87)(font "Arial" )) + (line (pt 0 80)(pt 16 80)(line_width 3)) + ) + (port + (pt 0 96) + (input) + (text "in3[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in3[15..0]" (rect 21 91 67 103)(font "Arial" )) + (line (pt 0 96)(pt 16 96)(line_width 3)) + ) + (port + (pt 0 112) + (input) + (text "in4[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in4[15..0]" (rect 21 107 67 119)(font "Arial" )) + (line (pt 0 112)(pt 16 112)(line_width 3)) + ) + (port + (pt 0 128) + (input) + (text "in5[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in5[15..0]" (rect 21 123 67 135)(font "Arial" )) + (line (pt 0 128)(pt 16 128)(line_width 3)) + ) + (port + (pt 0 144) + (input) + (text "in6[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in6[15..0]" (rect 21 139 67 151)(font "Arial" )) + (line (pt 0 144)(pt 16 144)(line_width 3)) + ) + (port + (pt 0 160) + (input) + (text "in7[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in7[15..0]" (rect 21 155 67 167)(font "Arial" )) + (line (pt 0 160)(pt 16 160)(line_width 3)) + ) + (port + (pt 184 32) + (output) + (text "result[15..0]" (rect 0 0 59 12)(font "Arial" )) + (text "result[15..0]" (rect 114 27 173 39)(font "Arial" )) + (line (pt 184 32)(pt 168 32)(line_width 3)) + ) + (drawing + (rectangle (rect 16 16 168 192)) + ) ) -(connector - (pt 552 464) - (pt 632 464) - (bus) +(symbol + (rect 632 352 816 560) + (text "mux_8x16" (rect 5 0 55 12)(font "Arial" )) + (text "MUX2" (rect 8 192 37 209)(font "Intel Clear" )) + (port + (pt 0 32) + (input) + (text "s[2..0]" (rect 0 0 31 12)(font "Arial" )) + (text "s[2..0]" (rect 21 27 52 39)(font "Arial" )) + (line (pt 0 32)(pt 16 32)(line_width 3)) + ) + (port + (pt 0 48) + (input) + (text "in0[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in0[15..0]" (rect 21 43 67 55)(font "Arial" )) + (line (pt 0 48)(pt 16 48)(line_width 3)) + ) + (port + (pt 0 64) + (input) + (text "in1[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in1[15..0]" (rect 21 59 67 71)(font "Arial" )) + (line (pt 0 64)(pt 16 64)(line_width 3)) + ) + (port + (pt 0 80) + (input) + (text "in2[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in2[15..0]" (rect 21 75 67 87)(font "Arial" )) + (line (pt 0 80)(pt 16 80)(line_width 3)) + ) + (port + (pt 0 96) + (input) + (text "in3[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in3[15..0]" (rect 21 91 67 103)(font "Arial" )) + (line (pt 0 96)(pt 16 96)(line_width 3)) + ) + (port + (pt 0 112) + (input) + (text "in4[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in4[15..0]" (rect 21 107 67 119)(font "Arial" )) + (line (pt 0 112)(pt 16 112)(line_width 3)) + ) + (port + (pt 0 128) + (input) + (text "in5[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in5[15..0]" (rect 21 123 67 135)(font "Arial" )) + (line (pt 0 128)(pt 16 128)(line_width 3)) + ) + (port + (pt 0 144) + (input) + (text "in6[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in6[15..0]" (rect 21 139 67 151)(font "Arial" )) + (line (pt 0 144)(pt 16 144)(line_width 3)) + ) + (port + (pt 0 160) + (input) + (text "in7[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in7[15..0]" (rect 21 155 67 167)(font "Arial" )) + (line (pt 0 160)(pt 16 160)(line_width 3)) + ) + (port + (pt 184 32) + (output) + (text "result[15..0]" (rect 0 0 59 12)(font "Arial" )) + (text "result[15..0]" (rect 114 27 173 39)(font "Arial" )) + (line (pt 184 32)(pt 168 32)(line_width 3)) + ) + (drawing + (rectangle (rect 16 16 168 192)) + ) ) -(connector - (pt 568 480) - (pt 632 480) - (bus) +(symbol + (rect 632 560 816 768) + (text "mux_8x16" (rect 5 0 55 12)(font "Arial" )) + (text "MUX3" (rect 8 192 37 209)(font "Intel Clear" )) + (port + (pt 0 32) + (input) + (text "s[2..0]" (rect 0 0 31 12)(font "Arial" )) + (text "s[2..0]" (rect 21 27 52 39)(font "Arial" )) + (line (pt 0 32)(pt 16 32)(line_width 3)) + ) + (port + (pt 0 48) + (input) + (text "in0[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in0[15..0]" (rect 21 43 67 55)(font "Arial" )) + (line (pt 0 48)(pt 16 48)(line_width 3)) + ) + (port + (pt 0 64) + (input) + (text "in1[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in1[15..0]" (rect 21 59 67 71)(font "Arial" )) + (line (pt 0 64)(pt 16 64)(line_width 3)) + ) + (port + (pt 0 80) + (input) + (text "in2[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in2[15..0]" (rect 21 75 67 87)(font "Arial" )) + (line (pt 0 80)(pt 16 80)(line_width 3)) + ) + (port + (pt 0 96) + (input) + (text "in3[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in3[15..0]" (rect 21 91 67 103)(font "Arial" )) + (line (pt 0 96)(pt 16 96)(line_width 3)) + ) + (port + (pt 0 112) + (input) + (text "in4[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in4[15..0]" (rect 21 107 67 119)(font "Arial" )) + (line (pt 0 112)(pt 16 112)(line_width 3)) + ) + (port + (pt 0 128) + (input) + (text "in5[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in5[15..0]" (rect 21 123 67 135)(font "Arial" )) + (line (pt 0 128)(pt 16 128)(line_width 3)) + ) + (port + (pt 0 144) + (input) + (text "in6[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in6[15..0]" (rect 21 139 67 151)(font "Arial" )) + (line (pt 0 144)(pt 16 144)(line_width 3)) + ) + (port + (pt 0 160) + (input) + (text "in7[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in7[15..0]" (rect 21 155 67 167)(font "Arial" )) + (line (pt 0 160)(pt 16 160)(line_width 3)) + ) + (port + (pt 184 32) + (output) + (text "result[15..0]" (rect 0 0 59 12)(font "Arial" )) + (text "result[15..0]" (rect 114 27 173 39)(font "Arial" )) + (line (pt 184 32)(pt 168 32)(line_width 3)) + ) + (drawing + (rectangle (rect 16 16 168 192)) + ) ) -(connector - (pt 584 496) - (pt 632 496) - (bus) -) -(connector - (pt 600 512) - (pt 632 512) - (bus) -) -(connector - (pt 616 528) - (pt 632 528) - (bus) -) -(connector - (pt 504 640) - (pt 632 640) - (bus) -) -(connector - (pt 520 656) - (pt 632 656) - (bus) -) -(connector - (pt 536 672) - (pt 632 672) - (bus) -) -(connector - (pt 552 688) - (pt 632 688) - (bus) -) -(connector - (pt 568 704) - (pt 632 704) - (bus) -) -(connector - (pt 584 720) - (pt 632 720) - (bus) -) -(connector - (pt 600 736) - (pt 632 736) - (bus) -) -(connector - (pt 616 752) - (pt 632 752) - (bus) -) -(connector - (pt 504 416) - (pt 504 640) - (bus) -) -(connector - (pt 520 432) - (pt 520 656) - (bus) -) -(connector - (pt 536 448) - (pt 536 672) - (bus) -) -(connector - (pt 552 464) - (pt 552 688) - (bus) -) -(connector - (pt 568 480) - (pt 568 704) - (bus) -) -(connector - (pt 584 496) - (pt 584 720) - (bus) -) -(connector - (pt 600 512) - (pt 600 736) - (bus) -) -(connector - (pt 616 528) - (pt 616 752) - (bus) -) -(connector - (text "s2[1]" (rect 474 368 497 385)(font "Intel Clear" )) - (pt 632 384) - (pt 464 384) -) -(connector - (text "s2[0]" (rect 474 352 497 369)(font "Intel Clear" )) - (pt 632 368) - (pt 464 368) -) -(connector - (text "s2[2]" (rect 474 384 497 401)(font "Intel Clear" )) - (pt 632 400) - (pt 464 400) -) -(connector - (pt 592 176) - (pt 592 160) - (bus) -) -(connector - (pt 592 144) - (pt 592 160) - (bus) -) -(connector - (pt 592 128) - (pt 592 144) - (bus) -) -(connector - (pt 464 384) - (pt 464 400) - (bus) -) -(connector - (text "s3[2]" (rect 474 608 497 625)(font "Intel Clear" )) - (pt 632 624) - (pt 448 624) -) -(connector - (text "s3[0]" (rect 474 576 497 593)(font "Intel Clear" )) - (pt 448 592) - (pt 632 592) -) -(connector - (text "s3[1]" (rect 474 592 497 609)(font "Intel Clear" )) - (pt 448 608) - (pt 632 608) -) -(connector - (pt 448 608) - (pt 448 624) - (bus) -) -(connector - (pt 1280 320) - (pt 1288 320) - (bus) -) -(connector - (pt 160 792) - (pt 1288 792) - (bus) -) -(connector - (text "s4" (rect 1203 368 1220 378)(font "Intel Clear" )(vertical)) - (pt 1224 360) - (pt 1224 392) +(symbol + (rect 1216 272 1400 384) + (text "mux_3x16" (rect 5 0 55 12)(font "Arial" )) + (text "MUX4" (rect 8 96 36 108)(font "Arial" )) + (port + (pt 0 32) + (input) + (text "s[1..0]" (rect 0 0 31 12)(font "Arial" )) + (text "s[1..0]" (rect 21 27 52 39)(font "Arial" )) + (line (pt 0 32)(pt 16 32)(line_width 3)) + ) + (port + (pt 0 48) + (input) + (text "in0[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in0[15..0]" (rect 21 43 67 55)(font "Arial" )) + (line (pt 0 48)(pt 16 48)(line_width 3)) + ) + (port + (pt 0 64) + (input) + (text "in1[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in1[15..0]" (rect 21 59 67 71)(font "Arial" )) + (line (pt 0 64)(pt 16 64)(line_width 3)) + ) + (port + (pt 0 80) + (input) + (text "in2[15..0]" (rect 0 0 46 12)(font "Arial" )) + (text "in2[15..0]" (rect 21 75 67 87)(font "Arial" )) + (line (pt 0 80)(pt 16 80)(line_width 3)) + ) + (port + (pt 184 32) + (output) + (text "result[15..0]" (rect 0 0 59 12)(font "Arial" )) + (text "result[15..0]" (rect 114 27 173 39)(font "Arial" )) + (line (pt 184 32)(pt 168 32)(line_width 3)) + ) + (drawing + (rectangle (rect 16 16 168 96)) + ) ) (connector (pt 728 -88) @@ -1541,291 +1418,16 @@ refer to the applicable agreement for further details. (pt 744 -56) (bus) ) -(connector - (pt 448 592) - (pt 448 608) - (bus) -) -(connector - (pt 464 368) - (pt 464 384) - (bus) -) -(connector - (pt 592 128) - (pt 480 128) - (bus) -) -(connector - (pt 208 144) - (pt 504 144) - (bus) -) (connector (pt 256 -80) (pt 208 -80) (bus) ) -(connector - (pt 208 144) - (pt 208 -80) - (bus) -) -(connector - (pt 504 192) - (pt 504 416) - (bus) -) -(connector - (pt 520 208) - (pt 520 432) - (bus) -) -(connector - (pt 536 224) - (pt 536 448) - (bus) -) -(connector - (pt 552 240) - (pt 552 464) - (bus) -) -(connector - (pt 568 256) - (pt 568 480) - (bus) -) -(connector - (pt 584 272) - (pt 584 496) - (bus) -) -(connector - (pt 600 288) - (pt 600 512) - (bus) -) -(connector - (pt 616 304) - (pt 616 528) - (bus) -) -(connector - (text "R0_en" (rect 186 192 216 209)(font "Intel Clear" )) - (pt 224 208) - (pt 176 208) -) -(connector - (text "CLK" (rect 186 176 206 193)(font "Intel Clear" )) - (pt 224 192) - (pt 176 192) -) -(connector - (text "R0_count" (rect 186 224 230 241)(font "Intel Clear" )) - (pt 224 240) - (pt 176 240) -) -(connector - (text "R1_en" (rect 186 256 216 273)(font "Intel Clear" )) - (pt 224 272) - (pt 176 272) -) -(connector - (text "R2_en" (rect 186 288 216 305)(font "Intel Clear" )) - (pt 224 304) - (pt 176 304) -) -(connector - (text "R3_en" (rect 186 320 216 337)(font "Intel Clear" )) - (pt 224 336) - (pt 176 336) -) -(connector - (text "R4_en" (rect 186 352 216 369)(font "Intel Clear" )) - (pt 224 368) - (pt 176 368) -) -(connector - (text "R5_en" (rect 186 384 216 401)(font "Intel Clear" )) - (pt 224 400) - (pt 176 400) -) -(connector - (text "R6_en" (rect 186 416 216 433)(font "Intel Clear" )) - (pt 224 432) - (pt 176 432) -) -(connector - (text "R7_en" (rect 186 448 216 465)(font "Intel Clear" )) - (pt 224 464) - (pt 176 464) -) -(connector - (pt 160 224) - (pt 224 224) - (bus) -) -(connector - (pt 160 256) - (pt 224 256) - (bus) -) -(connector - (pt 160 288) - (pt 224 288) - (bus) -) -(connector - (pt 160 320) - (pt 224 320) - (bus) -) -(connector - (pt 160 352) - (pt 224 352) - (bus) -) -(connector - (pt 160 384) - (pt 224 384) - (bus) -) -(connector - (pt 160 416) - (pt 224 416) - (bus) -) -(connector - (pt 160 448) - (pt 224 448) - (bus) -) -(connector - (pt 504 192) - (pt 632 192) - (bus) -) -(connector - (pt 432 208) - (pt 520 208) - (bus) -) -(connector - (pt 520 208) - (pt 632 208) - (bus) -) -(connector - (pt 432 224) - (pt 536 224) - (bus) -) -(connector - (pt 536 224) - (pt 632 224) - (bus) -) -(connector - (pt 432 240) - (pt 552 240) - (bus) -) -(connector - (pt 552 240) - (pt 632 240) - (bus) -) -(connector - (pt 432 256) - (pt 568 256) - (bus) -) -(connector - (pt 568 256) - (pt 632 256) - (bus) -) -(connector - (pt 432 272) - (pt 584 272) - (bus) -) -(connector - (pt 584 272) - (pt 632 272) - (bus) -) -(connector - (pt 160 256) - (pt 160 288) - (bus) -) -(connector - (pt 432 288) - (pt 600 288) - (bus) -) -(connector - (pt 600 288) - (pt 632 288) - (bus) -) -(connector - (pt 616 304) - (pt 632 304) - (bus) -) -(connector - (pt 160 288) - (pt 160 320) - (bus) -) -(connector - (pt 160 320) - (pt 160 352) - (bus) -) -(connector - (pt 160 352) - (pt 160 384) - (bus) -) -(connector - (pt 160 384) - (pt 160 416) - (bus) -) -(connector - (pt 160 416) - (pt 160 448) - (bus) -) -(connector - (pt 160 448) - (pt 160 792) - (bus) -) -(connector - (pt 160 224) - (pt 160 256) - (bus) -) -(connector - (text "CLK" (rect 370 744 390 761)(font "Intel Clear" )) - (pt 360 760) - (pt 400 760) -) (connector (text "RAMi_en" (rect 216 -32 259 -15)(font "Intel Clear" )) (pt 256 -16) (pt 216 -16) ) -(connector - (pt 1168 304) - (pt 1160 304) - (bus) -) (connector (pt 1152 192) (pt 1160 192) @@ -1857,82 +1459,16 @@ refer to the applicable agreement for further details. (pt 936 208) (pt 880 208) ) -(connector - (pt 872 -72) - (pt 872 224) - (bus) -) -(connector - (pt 1160 192) - (pt 1160 304) - (bus) -) (connector (pt 856 -72) (pt 872 -72) (bus) ) -(connector - (text "instr[15..0]" (rect 864 -88 913 -71)(font "Intel Clear" )) - (pt 872 -72) - (pt 912 -72) - (bus) -) (connector (pt 472 -112) (pt 488 -112) (bus) ) -(connector - (pt 432 304) - (pt 616 304) - (bus) -) -(connector - (text "s2[2..0]" (rect 446 103 463 137)(font "Intel Clear" )(vertical)) - (pt 464 104) - (pt 464 368) - (bus) -) -(connector - (text "s1[2..0]" (rect 461 104 478 138)(font "Intel Clear" )(vertical)) - (pt 480 128) - (pt 480 104) - (bus) -) -(connector - (text "s3[2..0]" (rect 429 102 446 136)(font "Intel Clear" )(vertical)) - (pt 448 104) - (pt 448 592) - (bus) -) -(connector - (text "s1[0]" (rect 602 128 625 145)(font "Intel Clear" )) - (pt 632 144) - (pt 592 144) -) -(connector - (text "s1[1]" (rect 602 144 625 161)(font "Intel Clear" )) - (pt 632 160) - (pt 592 160) -) -(connector - (text "s1[2]" (rect 602 160 625 177)(font "Intel Clear" )) - (pt 632 176) - (pt 592 176) -) -(connector - (text "PC[15..0]" (rect 442 176 485 193)(font "Intel Clear" )) - (pt 432 192) - (pt 504 192) - (bus) -) -(connector - (text "PC[10..0]" (rect 488 145 505 188)(font "Intel Clear" )(vertical)) - (pt 504 144) - (pt 504 192) - (bus) -) (connector (text "FETCH" (rect 418 32 449 49)(font "Intel Clear" )) (pt 408 48) @@ -1958,153 +1494,12 @@ refer to the applicable agreement for further details. (pt 408 64) (pt 448 64) ) -(connector - (text "R0_count" (rect 1186 -168 1230 -151)(font "Intel Clear" )) - (pt 1176 -152) - (pt 1224 -152) -) -(connector - (text "R0_en" (rect 1186 -152 1216 -135)(font "Intel Clear" )) - (pt 1176 -136) - (pt 1224 -136) -) -(connector - (text "R1_en" (rect 1186 -136 1216 -119)(font "Intel Clear" )) - (pt 1176 -120) - (pt 1224 -120) -) -(connector - (text "R2_en" (rect 1186 -120 1216 -103)(font "Intel Clear" )) - (pt 1176 -104) - (pt 1224 -104) -) -(connector - (text "R3_en" (rect 1186 -104 1216 -87)(font "Intel Clear" )) - (pt 1176 -88) - (pt 1224 -88) -) -(connector - (text "R4_en" (rect 1186 -88 1216 -71)(font "Intel Clear" )) - (pt 1176 -72) - (pt 1224 -72) -) -(connector - (text "R5_en" (rect 1186 -72 1216 -55)(font "Intel Clear" )) - (pt 1176 -56) - (pt 1224 -56) -) -(connector - (text "R6_en" (rect 1186 -56 1216 -39)(font "Intel Clear" )) - (pt 1176 -40) - (pt 1224 -40) -) -(connector - (text "R7_en" (rect 1186 -40 1216 -23)(font "Intel Clear" )) - (pt 1176 -24) - (pt 1224 -24) -) -(connector - (text "s1[2..0]" (rect 1186 -24 1220 -7)(font "Intel Clear" )) - (pt 1176 -8) - (pt 1224 -8) - (bus) -) -(connector - (text "s2[2..0]" (rect 1186 -8 1220 9)(font "Intel Clear" )) - (pt 1176 8) - (pt 1224 8) - (bus) -) -(connector - (text "s3[2..0]" (rect 1186 8 1220 25)(font "Intel Clear" )) - (pt 1176 24) - (pt 1224 24) - (bus) -) -(connector - (text "s4" (rect 1186 24 1196 41)(font "Intel Clear" )) - (pt 1176 40) - (pt 1224 40) -) -(connector - (text "RAMd_en" (rect 1186 56 1233 73)(font "Intel Clear" )) - (pt 1176 72) - (pt 1224 72) -) -(connector - (text "RAMi_en" (rect 1186 72 1229 89)(font "Intel Clear" )) - (pt 1176 88) - (pt 1224 88) -) -(connector - (text "RAMd_wren" (rect 1186 40 1245 57)(font "Intel Clear" )) - (pt 1176 56) - (pt 1240 56) -) -(connector - (text "EXEC1" (rect 938 -152 969 -135)(font "Intel Clear" )) - (pt 968 -136) - (pt 928 -136) -) -(connector - (text "COND" (rect 938 -120 967 -103)(font "Intel Clear" )) - (pt 928 -104) - (pt 968 -104) -) -(connector - (text "ALU_en" (rect 1186 88 1223 105)(font "Intel Clear" )) - (pt 1176 104) - (pt 1224 104) -) -(connector - (text "EXEC2" (rect 938 -136 969 -119)(font "Intel Clear" )) - (pt 968 -120) - (pt 928 -120) -) -(connector - (pt 968 -152) - (pt 912 -152) - (bus) -) -(connector - (text "instr[15..10]" (rect 888 -65 905 -10)(font "Intel Clear" )(vertical)) - (pt 912 -72) - (pt 912 0) - (bus) -) -(connector - (text "instr[15..0]" (rect 888 -148 905 -99)(font "Intel Clear" )(vertical)) - (pt 912 -152) - (pt 912 -72) - (bus) -) -(connector - (text "EXEC1" (rect 783 -28 800 3)(font "Intel Clear" )(vertical)) - (pt 800 -32) - (pt 800 8) -) -(connector - (text "E2" (rect 1186 104 1197 121)(font "Intel Clear" )) - (pt 1176 120) - (pt 1224 120) -) -(connector - (text "Rs1[15..0]" (rect 818 128 865 145)(font "Intel Clear" )) - (pt 816 144) - (pt 856 144) - (bus) -) (connector (text "Rd[15..0]" (rect 818 576 860 593)(font "Intel Clear" )) (pt 816 592) (pt 856 592) (bus) ) -(connector - (pt 1120 336) - (pt 1168 336) - (bus) -) (connector (text "COND" (rect 1122 336 1151 353)(font "Intel Clear" )) (pt 1120 352) @@ -2115,22 +1510,11 @@ refer to the applicable agreement for further details. (pt 936 352) (bus) ) -(connector - (pt 856 144) - (pt 856 192) - (bus) -) (connector (pt 856 192) (pt 856 352) (bus) ) -(connector - (text "Rs2[15..0]" (rect 816 352 863 369)(font "Intel Clear" )) - (pt 816 368) - (pt 936 368) - (bus) -) (connector (pt 856 592) (pt 856 384) @@ -2173,105 +1557,776 @@ refer to the applicable agreement for further details. (pt 1152 368) ) (connector - (text "CARRY" (rect 1050 504 1085 521)(font "Intel Clear" )) - (pt 1096 520) - (pt 1040 520) + (text "R0_count" (rect 1186 -200 1230 -183)(font "Intel Clear" )) + (pt 1176 -184) + (pt 1224 -184) ) (connector - (text "Rd[15..0]" (rect 1050 520 1092 537)(font "Intel Clear" )) - (pt 1096 536) - (pt 1040 536) + (text "R0_en" (rect 1186 -184 1216 -167)(font "Intel Clear" )) + (pt 1176 -168) + (pt 1224 -168) +) +(connector + (text "R1_en" (rect 1186 -168 1216 -151)(font "Intel Clear" )) + (pt 1176 -152) + (pt 1224 -152) +) +(connector + (text "R2_en" (rect 1186 -152 1216 -135)(font "Intel Clear" )) + (pt 1176 -136) + (pt 1224 -136) +) +(connector + (text "R3_en" (rect 1186 -136 1216 -119)(font "Intel Clear" )) + (pt 1176 -120) + (pt 1224 -120) +) +(connector + (text "R4_en" (rect 1186 -120 1216 -103)(font "Intel Clear" )) + (pt 1176 -104) + (pt 1224 -104) +) +(connector + (text "R5_en" (rect 1186 -104 1216 -87)(font "Intel Clear" )) + (pt 1176 -88) + (pt 1224 -88) +) +(connector + (text "R6_en" (rect 1186 -88 1216 -71)(font "Intel Clear" )) + (pt 1176 -72) + (pt 1224 -72) +) +(connector + (text "R7_en" (rect 1186 -72 1216 -55)(font "Intel Clear" )) + (pt 1176 -56) + (pt 1224 -56) +) +(connector + (text "s1[2..0]" (rect 1186 -56 1220 -39)(font "Intel Clear" )) + (pt 1176 -40) + (pt 1224 -40) (bus) ) (connector - (text "Rs1[15..0]" (rect 1050 536 1097 553)(font "Intel Clear" )) - (pt 1096 552) - (pt 1040 552) + (text "s2[2..0]" (rect 1186 -40 1220 -23)(font "Intel Clear" )) + (pt 1176 -24) + (pt 1224 -24) (bus) ) (connector - (text "Rs2[15..0]" (rect 1050 552 1097 569)(font "Intel Clear" )) - (pt 1096 568) - (pt 1040 568) + (text "s3[2..0]" (rect 1186 -24 1220 -7)(font "Intel Clear" )) + (pt 1176 -8) + (pt 1224 -8) (bus) ) (connector - (text "instr[15..0]" (rect 1048 568 1097 585)(font "Intel Clear" )) - (pt 1096 584) - (pt 1040 584) + (text "s4" (rect 1186 -8 1196 9)(font "Intel Clear" )) + (pt 1176 8) + (pt 1224 8) +) +(connector + (text "RAMd_en" (rect 1186 24 1233 41)(font "Intel Clear" )) + (pt 1176 40) + (pt 1224 40) +) +(connector + (text "RAMi_en" (rect 1186 40 1229 57)(font "Intel Clear" )) + (pt 1176 56) + (pt 1224 56) +) +(connector + (text "RAMd_wren" (rect 1186 8 1245 25)(font "Intel Clear" )) + (pt 1176 24) + (pt 1240 24) +) +(connector + (text "EXEC1" (rect 938 -184 969 -167)(font "Intel Clear" )) + (pt 968 -168) + (pt 928 -168) +) +(connector + (text "COND" (rect 938 -152 967 -135)(font "Intel Clear" )) + (pt 928 -136) + (pt 968 -136) +) +(connector + (text "ALU_en" (rect 1186 56 1223 73)(font "Intel Clear" )) + (pt 1176 72) + (pt 1224 72) +) +(connector + (text "EXEC2" (rect 938 -168 969 -151)(font "Intel Clear" )) + (pt 968 -152) + (pt 928 -152) +) +(connector + (pt 912 -184) + (pt 968 -184) (bus) ) (connector - (text "FETCH" (rect 1050 584 1081 601)(font "Intel Clear" )) - (pt 1096 600) - (pt 1040 600) + (text "E2" (rect 1186 72 1197 89)(font "Intel Clear" )) + (pt 1176 88) + (pt 1224 88) ) (connector - (text "EXEC1" (rect 1050 600 1081 617)(font "Intel Clear" )) - (pt 1096 616) - (pt 1040 616) -) -(connector - (text "EXEC2" (rect 1050 616 1081 633)(font "Intel Clear" )) - (pt 1096 632) - (pt 1040 632) -) -(connector - (pt 1288 480) - (pt 1088 480) + (text "instr[15..0]" (rect 896 -130 913 -81)(font "Intel Clear" )(vertical)) + (pt 912 -184) + (pt 912 -72) (bus) ) (connector - (pt 1096 504) - (pt 1088 504) + (text "instr[15..0]" (rect 864 -88 913 -71)(font "Intel Clear" )) + (pt 872 -72) + (pt 912 -72) (bus) ) (connector - (pt 1088 504) - (pt 1088 480) + (pt 872 -72) + (pt 872 -32) (bus) ) (connector - (pt 1288 320) - (pt 1288 480) + (pt 872 -32) + (pt 872 224) (bus) ) (connector - (pt 1288 480) - (pt 1288 792) + (text "instr[15..10]" (rect 882 -48 937 -31)(font "Intel Clear" )) + (pt 872 -32) + (pt 936 -32) + (bus) +) +(connector + (text "EXEC2" (rect 792 27 809 58)(font "Intel Clear" )(vertical)) + (pt 808 32) + (pt 808 64) +) +(connector + (text "EXEC1" (rect 776 27 793 58)(font "Intel Clear" )(vertical)) + (pt 792 32) + (pt 792 64) +) +(connector + (text "Rs1[15..0]" (rect 818 160 865 177)(font "Intel Clear" )) + (pt 856 176) + (pt 816 176) + (bus) +) +(connector + (pt 208 -80) + (pt 208 144) + (bus) +) +(connector + (text "R0_en" (rect 162 192 192 209)(font "Intel Clear" )) + (pt 200 208) + (pt 152 208) +) +(connector + (text "CLK" (rect 162 176 182 193)(font "Intel Clear" )) + (pt 200 192) + (pt 152 192) +) +(connector + (text "R0_count" (rect 162 224 206 241)(font "Intel Clear" )) + (pt 200 240) + (pt 152 240) +) +(connector + (text "R1_en" (rect 162 256 192 273)(font "Intel Clear" )) + (pt 200 272) + (pt 152 272) +) +(connector + (text "R2_en" (rect 162 288 192 305)(font "Intel Clear" )) + (pt 200 304) + (pt 152 304) +) +(connector + (text "R3_en" (rect 162 320 192 337)(font "Intel Clear" )) + (pt 200 336) + (pt 152 336) +) +(connector + (text "R4_en" (rect 162 352 192 369)(font "Intel Clear" )) + (pt 200 368) + (pt 152 368) +) +(connector + (text "R5_en" (rect 162 384 192 401)(font "Intel Clear" )) + (pt 200 400) + (pt 152 400) +) +(connector + (text "R6_en" (rect 162 416 192 433)(font "Intel Clear" )) + (pt 200 432) + (pt 152 432) +) +(connector + (text "R7_en" (rect 162 448 192 465)(font "Intel Clear" )) + (pt 200 464) + (pt 152 464) +) +(connector + (pt 136 224) + (pt 200 224) + (bus) +) +(connector + (pt 136 256) + (pt 200 256) + (bus) +) +(connector + (pt 136 288) + (pt 200 288) + (bus) +) +(connector + (pt 136 320) + (pt 200 320) + (bus) +) +(connector + (pt 136 352) + (pt 200 352) + (bus) +) +(connector + (pt 136 384) + (pt 200 384) + (bus) +) +(connector + (pt 136 416) + (pt 200 416) + (bus) +) +(connector + (pt 136 448) + (pt 200 448) + (bus) +) +(connector + (pt 136 352) + (pt 136 384) + (bus) +) +(connector + (pt 136 384) + (pt 136 416) + (bus) +) +(connector + (pt 136 416) + (pt 136 448) + (bus) +) +(connector + (pt 136 448) + (pt 136 792) + (bus) +) +(connector + (pt 136 224) + (pt 136 256) + (bus) +) +(connector + (pt 136 256) + (pt 136 288) + (bus) +) +(connector + (pt 136 288) + (pt 136 320) + (bus) +) +(connector + (pt 136 320) + (pt 136 352) + (bus) +) +(connector + (text "CLK" (rect 346 712 366 729)(font "Intel Clear" )) + (pt 336 728) + (pt 392 728) +) +(connector + (text "stack_rst" (rect 346 728 388 745)(font "Intel Clear" )) + (pt 336 744) + (pt 392 744) +) +(connector + (pt 208 144) + (pt 464 144) + (bus) +) +(connector + (pt 408 208) + (pt 480 208) + (bus) +) +(connector + (pt 480 208) + (pt 632 208) + (bus) +) +(connector + (pt 408 224) + (pt 496 224) + (bus) +) +(connector + (pt 496 224) + (pt 632 224) + (bus) +) +(connector + (pt 408 240) + (pt 512 240) + (bus) +) +(connector + (pt 512 240) + (pt 632 240) + (bus) +) +(connector + (pt 408 256) + (pt 528 256) + (bus) +) +(connector + (pt 528 256) + (pt 632 256) + (bus) +) +(connector + (pt 408 272) + (pt 544 272) + (bus) +) +(connector + (pt 544 272) + (pt 632 272) + (bus) +) +(connector + (pt 408 288) + (pt 560 288) + (bus) +) +(connector + (pt 560 288) + (pt 632 288) + (bus) +) +(connector + (pt 408 304) + (pt 576 304) + (bus) +) +(connector + (pt 576 304) + (pt 632 304) + (bus) +) +(connector + (text "PC[10..0]" (rect 448 145 465 188)(font "Intel Clear" )(vertical)) + (pt 464 144) + (pt 464 192) + (bus) +) +(connector + (text "PC[15..0]" (rect 410 176 453 193)(font "Intel Clear" )) + (pt 408 192) + (pt 464 192) + (bus) +) +(connector + (pt 464 192) + (pt 632 192) + (bus) +) +(connector + (text "s1[2..0]" (rect 602 160 636 177)(font "Intel Clear" )) + (pt 632 176) + (pt 592 176) + (bus) +) +(connector + (pt 464 400) + (pt 632 400) + (bus) +) +(connector + (pt 480 416) + (pt 632 416) + (bus) +) +(connector + (pt 496 432) + (pt 632 432) + (bus) +) +(connector + (pt 512 448) + (pt 632 448) + (bus) +) +(connector + (pt 528 464) + (pt 632 464) + (bus) +) +(connector + (pt 544 480) + (pt 632 480) + (bus) +) +(connector + (pt 560 496) + (pt 632 496) + (bus) +) +(connector + (pt 576 512) + (pt 632 512) + (bus) +) +(connector + (pt 464 608) + (pt 632 608) + (bus) +) +(connector + (pt 480 624) + (pt 632 624) + (bus) +) +(connector + (pt 496 640) + (pt 632 640) + (bus) +) +(connector + (pt 512 656) + (pt 632 656) + (bus) +) +(connector + (pt 528 672) + (pt 632 672) + (bus) +) +(connector + (pt 544 688) + (pt 632 688) + (bus) +) +(connector + (pt 560 704) + (pt 632 704) + (bus) +) +(connector + (pt 576 720) + (pt 632 720) + (bus) +) +(connector + (pt 464 192) + (pt 464 400) + (bus) +) +(connector + (pt 464 400) + (pt 464 608) + (bus) +) +(connector + (pt 480 208) + (pt 480 416) + (bus) +) +(connector + (pt 480 416) + (pt 480 624) + (bus) +) +(connector + (pt 496 224) + (pt 496 432) + (bus) +) +(connector + (pt 496 432) + (pt 496 640) + (bus) +) +(connector + (pt 512 240) + (pt 512 448) + (bus) +) +(connector + (pt 512 448) + (pt 512 656) + (bus) +) +(connector + (pt 528 256) + (pt 528 464) + (bus) +) +(connector + (pt 528 464) + (pt 528 672) + (bus) +) +(connector + (pt 544 272) + (pt 544 480) + (bus) +) +(connector + (pt 544 480) + (pt 544 688) + (bus) +) +(connector + (pt 560 288) + (pt 560 496) + (bus) +) +(connector + (pt 560 496) + (pt 560 704) + (bus) +) +(connector + (pt 576 304) + (pt 576 512) + (bus) +) +(connector + (pt 576 512) + (pt 576 720) + (bus) +) +(connector + (text "Rs2[15..0]" (rect 824 352 871 369)(font "Intel Clear" )) + (pt 936 368) + (pt 824 368) + (bus) +) +(connector + (pt 816 384) + (pt 824 384) + (bus) +) +(connector + (pt 824 384) + (pt 824 368) + (bus) +) +(connector + (text "s2[2..0]" (rect 602 368 636 385)(font "Intel Clear" )) + (pt 632 384) + (pt 592 384) + (bus) +) +(connector + (text "s3[2..0]" (rect 602 576 636 593)(font "Intel Clear" )) + (pt 632 592) + (pt 592 592) + (bus) +) +(connector + (text "Rs1[15..0]" (rect 882 128 929 145)(font "Intel Clear" )) + (pt 856 144) + (pt 928 144) + (bus) +) +(connector + (pt 856 144) + (pt 856 176) + (bus) +) +(connector + (pt 856 176) + (pt 856 192) + (bus) +) +(connector + (pt 1160 192) + (pt 1160 320) + (bus) +) +(connector + (pt 1160 320) + (pt 1216 320) + (bus) +) +(connector + (pt 1120 336) + (pt 1216 336) + (bus) +) +(connector + (text "s4[1..0]" (rect 1186 288 1220 305)(font "Intel Clear" )) + (pt 1216 304) + (pt 1176 304) + (bus) +) +(connector + (pt 1400 304) + (pt 1416 304) + (bus) +) +(connector + (pt 1416 624) + (pt 1224 624) + (bus) +) +(connector + (pt 1232 648) + (pt 1224 648) + (bus) +) +(connector + (pt 1224 648) + (pt 1224 624) + (bus) +) +(connector + (pt 136 792) + (pt 1416 792) + (bus) +) +(connector + (pt 1416 304) + (pt 1416 624) + (bus) +) +(connector + (pt 1416 624) + (pt 1416 792) + (bus) +) +(connector + (text "CARRY" (rect 1186 648 1221 665)(font "Intel Clear" )) + (pt 1176 664) + (pt 1232 664) +) +(connector + (text "Rs1[15..0]" (rect 1186 680 1233 697)(font "Intel Clear" )) + (pt 1176 696) + (pt 1232 696) + (bus) +) +(connector + (text "Rs2[15..0]" (rect 1186 696 1233 713)(font "Intel Clear" )) + (pt 1176 712) + (pt 1232 712) + (bus) +) +(connector + (text "Rd[15..0]" (rect 1186 664 1228 681)(font "Intel Clear" )) + (pt 1176 680) + (pt 1232 680) + (bus) +) +(connector + (text "instr[15..0]" (rect 1184 712 1233 729)(font "Intel Clear" )) + (pt 1176 728) + (pt 1232 728) + (bus) +) +(connector + (text "FETCH" (rect 1186 728 1217 745)(font "Intel Clear" )) + (pt 1176 744) + (pt 1232 744) +) +(connector + (text "EXEC1" (rect 1186 744 1217 761)(font "Intel Clear" )) + (pt 1176 760) + (pt 1232 760) +) +(connector + (text "EXEC2" (rect 1186 760 1217 777)(font "Intel Clear" )) + (pt 1176 776) + (pt 1232 776) +) +(connector + (text "CLK" (rect 890 512 910 529)(font "Intel Clear" )) + (pt 936 528) + (pt 880 528) +) +(connector + (text "Rs1[15..0]" (rect 890 496 937 513)(font "Intel Clear" )) + (pt 936 512) + (pt 880 512) + (bus) +) +(connector + (text "stack_rst" (rect 890 544 932 561)(font "Intel Clear" )) + (pt 936 560) + (pt 880 560) +) +(connector + (text "stack_en" (rect 890 528 932 545)(font "Intel Clear" )) + (pt 936 544) + (pt 880 544) +) +(connector + (text "stack_rw" (rect 890 560 932 577)(font "Intel Clear" )) + (pt 936 576) + (pt 880 576) +) +(connector + (pt 1120 512) + (pt 1184 512) + (bus) +) +(connector + (pt 1184 352) + (pt 1184 512) + (bus) +) +(connector + (pt 1216 352) + (pt 1184 352) (bus) ) -(junction (pt 504 416)) -(junction (pt 504 192)) -(junction (pt 520 432)) -(junction (pt 536 448)) -(junction (pt 552 464)) -(junction (pt 568 480)) -(junction (pt 584 496)) -(junction (pt 600 512)) -(junction (pt 616 528)) -(junction (pt 592 160)) -(junction (pt 464 368)) -(junction (pt 464 384)) -(junction (pt 592 144)) -(junction (pt 448 592)) -(junction (pt 448 608)) (junction (pt 488 -72)) -(junction (pt 520 208)) -(junction (pt 536 224)) -(junction (pt 552 240)) -(junction (pt 568 256)) -(junction (pt 584 272)) -(junction (pt 600 288)) -(junction (pt 616 304)) -(junction (pt 160 256)) -(junction (pt 160 288)) -(junction (pt 160 320)) -(junction (pt 160 352)) -(junction (pt 160 384)) -(junction (pt 160 416)) -(junction (pt 160 448)) (junction (pt 856 192)) (junction (pt 872 -72)) -(junction (pt 912 -72)) -(junction (pt 1288 480)) +(junction (pt 872 -32)) +(junction (pt 856 176)) +(junction (pt 136 320)) +(junction (pt 136 352)) +(junction (pt 136 384)) +(junction (pt 136 416)) +(junction (pt 136 448)) +(junction (pt 136 256)) +(junction (pt 136 288)) +(junction (pt 480 208)) +(junction (pt 496 224)) +(junction (pt 512 240)) +(junction (pt 528 256)) +(junction (pt 464 192)) +(junction (pt 544 272)) +(junction (pt 560 288)) +(junction (pt 576 304)) +(junction (pt 464 400)) +(junction (pt 480 416)) +(junction (pt 496 432)) +(junction (pt 512 448)) +(junction (pt 528 464)) +(junction (pt 544 480)) +(junction (pt 560 496)) +(junction (pt 576 512)) +(junction (pt 1416 624)) diff --git a/CPUProject.qsf b/CPUProject.qsf index 12816d7..867f441 100644 --- a/CPUProject.qsf +++ b/CPUProject.qsf @@ -38,23 +38,19 @@ set_global_assignment -name FAMILY "Cyclone IV E" set_global_assignment -name DEVICE AUTO -set_global_assignment -name TOP_LEVEL_ENTITY CPUProject +set_global_assignment -name TOP_LEVEL_ENTITY mux_8x16 set_global_assignment -name ORIGINAL_QUARTUS_VERSION 18.1.0 set_global_assignment -name PROJECT_CREATION_TIME_DATE "12:38:11 MAY 20, 2020" set_global_assignment -name LAST_QUARTUS_VERSION "18.1.0 Standard Edition" set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files set_global_assignment -name TIMING_ANALYZER_MULTICORNER_ANALYSIS ON set_global_assignment -name NUM_PARALLEL_PROCESSORS ALL -set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top -set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top -set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top set_global_assignment -name VERILOG_FILE alu.v set_global_assignment -name MIF_FILE LUTSquares.mif set_global_assignment -name BDF_FILE mul8.bdf set_global_assignment -name BDF_FILE abs.bdf set_global_assignment -name BDF_FILE CPUProject.bdf set_global_assignment -name BDF_FILE reg_file.bdf -set_global_assignment -name BDF_FILE mux_8x16.bdf set_global_assignment -name QIP_FILE ram_data.qip set_global_assignment -name QIP_FILE ram_instr.qip set_global_assignment -name VERILOG_FILE DECODE.v @@ -64,6 +60,10 @@ set_global_assignment -name BDF_FILE mul16.bdf set_global_assignment -name QIP_FILE LUT.qip set_global_assignment -name VERILOG_FILE min.v set_global_assignment -name VERILOG_FILE SM.v -set_global_assignment -name VECTOR_WAVEFORM_FILE Waveform.vwf set_global_assignment -name BDF_FILE ALU_top.bdf +set_global_assignment -name VERILOG_FILE mux_8x16.v +set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top +set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top +set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top +set_global_assignment -name VERILOG_FILE mux_3x16.v set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top \ No newline at end of file diff --git a/DECODE.v b/DECODE.v index c958414..9676be8 100644 --- a/DECODE.v +++ b/DECODE.v @@ -21,7 +21,10 @@ module DECODE output RAMd_en, output RAMi_en, output ALU_en, - output E2 + output E2, + output stack_en, + output stack_rst, + output stack_rw ); wire msb = instr[15]; //MSB of the instruction word @@ -41,21 +44,23 @@ module DECODE wire MUL = ~op[5] & op[4] & op[3] & op[2] & ~op[1] & ~op[0]; wire MLA = ~op[5] & op[4] & op[3] & op[2] & ~op[1] & op[0]; wire MLS = ~op[5] & op[4] & op[3] & op[2] & op[1] & ~op[0]; + wire PSH = op[5] & ~op[4] & op[3] & ~op[2] & ~op[1] & ~op[0]; + wire POP = op[5] & ~op[4] & op[3] & ~op[2] & ~op[1] & op[0]; wire NOP = op[5] & op[4] & op[3] & op[2] & op[1] & ~op[0]; wire STP = op[5] & op[4] & op[3] & op[2] & op[1] & op[0]; assign R0_count = EXEC1 & (~(UJMP | JMP | STP)); - assign R0_en = EXEC1 & (~(STORE | NOP | STP) & ~Rd[2] & ~Rd[1] & ~Rd[0] | UJMP | JMP & COND_result) | EXEC2 & (LOAD | MUL | MLA | MLS) & ~Rls[2] & ~Rls[1] & ~Rls[0]; - assign R1_en = EXEC1 & ~(UJMP | JMP | STORE | LOAD | MUL | MLA | MLS | NOP | STP) & ~Rd[2] & ~Rd[1] & Rd[0] | EXEC2 & (LOAD | MUL | MLA | MLS) & ~Rls[2] & ~Rls[1] & Rls[0]; - assign R2_en = EXEC1 & ~(UJMP | JMP | STORE | LOAD | MUL | MLA | MLS | NOP | STP) & ~Rd[2] & Rd[1] & ~Rd[0] | EXEC2 & (LOAD | MUL | MLA | MLS) & ~Rls[2] & Rls[1] & ~Rls[0]; - assign R3_en = EXEC1 & ~(UJMP | JMP | STORE | LOAD | MUL | MLA | MLS | NOP | STP) & ~Rd[2] & Rd[1] & Rd[0] | EXEC2 & (LOAD | MUL | MLA | MLS) & ~Rls[2] & Rls[1] & Rls[0]; - assign R4_en = EXEC1 & ~(UJMP | JMP | STORE | LOAD | MUL | MLA | MLS | NOP | STP) & Rd[2] & ~Rd[1] & ~Rd[0] | EXEC2 & (LOAD | MUL | MLA | MLS) & Rls[2] & ~Rls[1] & ~Rls[0]; - assign R5_en = EXEC1 & ~(UJMP | JMP | STORE | LOAD | MUL | MLA | MLS | NOP | STP) & Rd[2] & ~Rd[1] & Rd[0] | EXEC2 & (LOAD | MUL | MLA | MLS) & Rls[2] & ~Rls[1] & Rls[0]; - assign R6_en = EXEC1 & ~(UJMP | JMP | STORE | LOAD | MUL | MLA | MLS | NOP | STP) & Rd[2] & Rd[1] & ~Rd[0] | EXEC2 & (LOAD | MUL | MLA | MLS) & Rls[2] & Rls[1] & ~Rls[0]; - assign R7_en = EXEC1 & ~(UJMP | JMP | STORE | LOAD | MUL | MLA | MLS | NOP | STP) & Rd[2] & Rd[1] & Rd[0] | EXEC2 & (LOAD | MUL | MLA | MLS) & Rls[2] & Rls[1] & Rls[0]; - assign s1[2] = EXEC1 & ((~(UJMP | JMP | STORE | LOAD | NOP | STP) & Rs1[2]) | (STORE & Rls[2])); - assign s1[1] = EXEC1 & ((~(UJMP | JMP | STORE | LOAD | NOP | STP) & Rs1[1]) | (STORE & Rls[1])); - assign s1[0] = EXEC1 & ((~(UJMP | JMP | STORE | LOAD | NOP | STP) & Rs1[0]) | (STORE & Rls[0])); + assign R0_en = EXEC1 & (~(STORE | NOP | STP) & ~Rd[2] & ~Rd[1] & ~Rd[0] | UJMP | JMP & COND_result) | EXEC2 & LOAD & ~Rls[2] & ~Rls[1] & ~Rls[0] | EXEC2 & (MUL | MLA | MLS | POP) & ~Rd[2] & ~Rd[1] & ~Rd[0]; + assign R1_en = EXEC1 & ~(UJMP | JMP | STORE | LOAD | MUL | MLA | MLS | NOP | STP | POP) & ~Rd[2] & ~Rd[1] & Rd[0] | EXEC2 & LOAD & ~Rls[2] & ~Rls[1] & Rls[0] | EXEC2 & (MUL | MLA | MLS | POP) & ~Rd[2] & ~Rd[1] & Rd[0]; + assign R2_en = EXEC1 & ~(UJMP | JMP | STORE | LOAD | MUL | MLA | MLS | NOP | STP | POP) & ~Rd[2] & Rd[1] & ~Rd[0] | EXEC2 & LOAD & ~Rls[2] & Rls[1] & ~Rls[0] | EXEC2 & (MUL | MLA | MLS | POP) & ~Rd[2] & Rd[1] & ~Rd[0]; + assign R3_en = EXEC1 & ~(UJMP | JMP | STORE | LOAD | MUL | MLA | MLS | NOP | STP | POP) & ~Rd[2] & Rd[1] & Rd[0] | EXEC2 & LOAD & ~Rls[2] & Rls[1] & Rls[0] | EXEC2 & (MUL | MLA | MLS | POP) & ~Rd[2] & Rd[1] & Rd[0]; + assign R4_en = EXEC1 & ~(UJMP | JMP | STORE | LOAD | MUL | MLA | MLS | NOP | STP | POP) & Rd[2] & ~Rd[1] & ~Rd[0] | EXEC2 & LOAD & Rls[2] & ~Rls[1] & ~Rls[0] | EXEC2 & (MUL | MLA | MLS | POP) & Rd[2] & ~Rd[1] & ~Rd[0]; + assign R5_en = EXEC1 & ~(UJMP | JMP | STORE | LOAD | MUL | MLA | MLS | NOP | STP | POP) & Rd[2] & ~Rd[1] & Rd[0] | EXEC2 & LOAD & Rls[2] & ~Rls[1] & Rls[0] | EXEC2 & (MUL | MLA | MLS | POP) & Rd[2] & ~Rd[1] & Rd[0]; + assign R6_en = EXEC1 & ~(UJMP | JMP | STORE | LOAD | MUL | MLA | MLS | NOP | STP | POP) & Rd[2] & Rd[1] & ~Rd[0] | EXEC2 & LOAD & Rls[2] & Rls[1] & ~Rls[0] | EXEC2 & (MUL | MLA | MLS | POP) & Rd[2] & Rd[1] & ~Rd[0]; + assign R7_en = EXEC1 & ~(UJMP | JMP | STORE | LOAD | MUL | MLA | MLS | NOP | STP | POP) & Rd[2] & Rd[1] & Rd[0] | EXEC2 & LOAD & Rls[2] & Rls[1] & Rls[0] | EXEC2 & (MUL | MLA | MLS | POP) & Rd[2] & Rd[1] & Rd[0]; + assign s1[2] = EXEC1 & ((~(UJMP | JMP | STORE | LOAD | NOP | STP) & Rs1[2]) | (STORE & Rls[2]) | (PSH & Rs1[2])); + assign s1[1] = EXEC1 & ((~(UJMP | JMP | STORE | LOAD | NOP | STP) & Rs1[1]) | (STORE & Rls[1]) | (PSH & Rs1[1])); + assign s1[0] = EXEC1 & ((~(UJMP | JMP | STORE | LOAD | NOP | STP) & Rs1[0]) | (STORE & Rls[0]) | (PSH & Rs1[0])); assign s2[2] = EXEC1 & ((~(UJMP | JMP | STORE | LOAD | NOP | STP)) & Rs2[2]); assign s2[1] = EXEC1 & ((~(UJMP | JMP | STORE | LOAD | NOP | STP)) & Rs2[1]); assign s2[0] = EXEC1 & ((~(UJMP | JMP | STORE | LOAD | NOP | STP)) & Rs2[0]); @@ -67,7 +72,10 @@ module DECODE assign RAMd_en = EXEC1 & (STORE | LOAD); assign RAMi_en = EXEC1 & ~STP | EXEC2 & (LOAD | MUL | MLA | MLS); assign ALU_en = LOAD | STORE; - assign E2 = EXEC1 & (LOAD | MUL | MLA | MLS); + assign E2 = EXEC1 & (LOAD | MUL | MLA | MLS | POP); + assign stack_en = (EXEC1 & PSH) | POP; + assign stack_rst = STP; + assign stack_rw = POP; endmodule \ No newline at end of file diff --git a/Initial MUX 8x16 design.PNG b/Initial MUX 8x16 design.PNG new file mode 100644 index 0000000..2cc23b2 Binary files /dev/null and b/Initial MUX 8x16 design.PNG differ diff --git a/LIFOstack.bsf b/LIFOstack.bsf new file mode 100644 index 0000000..967974d --- /dev/null +++ b/LIFOstack.bsf @@ -0,0 +1,85 @@ +/* +WARNING: Do NOT edit the input and output ports in this file in a text +editor if you plan to continue editing the block that represents it in +the Block Editor! File corruption is VERY likely to occur. +*/ +/* +Copyright (C) 2018 Intel Corporation. All rights reserved. +Your use of Intel Corporation's design tools, logic functions +and other software and tools, and its AMPP partner logic +functions, and any output files from any of the foregoing +(including device programming or simulation files), and any +associated documentation or information are expressly subject +to the terms and conditions of the Intel Program License +Subscription Agreement, the Intel Quartus Prime License Agreement, +the Intel FPGA IP License Agreement, or other applicable license +agreement, including, without limitation, that your use is for +the sole purpose of programming logic devices manufactured by +Intel and sold by Intel or its authorized distributors. Please +refer to the applicable agreement for further details. +*/ +(header "symbol" (version "1.1")) +(symbol + (rect 16 16 200 160) + (text "LIFOstack" (rect 5 0 47 12)(font "Arial" )) + (text "inst" (rect 8 128 20 140)(font "Arial" )) + (port + (pt 0 32) + (input) + (text "Din[15..0]" (rect 0 0 36 12)(font "Arial" )) + (text "Din[15..0]" (rect 21 27 57 39)(font "Arial" )) + (line (pt 0 32)(pt 16 32)(line_width 3)) + ) + (port + (pt 0 48) + (input) + (text "clk" (rect 0 0 10 12)(font "Arial" )) + (text "clk" (rect 21 43 31 55)(font "Arial" )) + (line (pt 0 48)(pt 16 48)(line_width 1)) + ) + (port + (pt 0 64) + (input) + (text "en" (rect 0 0 9 12)(font "Arial" )) + (text "en" (rect 21 59 30 71)(font "Arial" )) + (line (pt 0 64)(pt 16 64)(line_width 1)) + ) + (port + (pt 0 80) + (input) + (text "rst" (rect 0 0 10 12)(font "Arial" )) + (text "rst" (rect 21 75 31 87)(font "Arial" )) + (line (pt 0 80)(pt 16 80)(line_width 1)) + ) + (port + (pt 0 96) + (input) + (text "rw" (rect 0 0 9 12)(font "Arial" )) + (text "rw" (rect 21 91 30 103)(font "Arial" )) + (line (pt 0 96)(pt 16 96)(line_width 1)) + ) + (port + (pt 184 32) + (output) + (text "Dout[15..0]" (rect 0 0 42 12)(font "Arial" )) + (text "Dout[15..0]" (rect 121 27 163 39)(font "Arial" )) + (line (pt 184 32)(pt 168 32)(line_width 3)) + ) + (port + (pt 184 48) + (output) + (text "empty" (rect 0 0 25 12)(font "Arial" )) + (text "empty" (rect 138 43 163 55)(font "Arial" )) + (line (pt 184 48)(pt 168 48)(line_width 1)) + ) + (port + (pt 184 64) + (output) + (text "full" (rect 0 0 10 12)(font "Arial" )) + (text "full" (rect 153 59 163 71)(font "Arial" )) + (line (pt 184 64)(pt 168 64)(line_width 1)) + ) + (drawing + (rectangle (rect 16 16 168 128)(line_width 1)) + ) +) diff --git a/LIFOstack.v b/LIFOstack.v index 1a96087..b758ebd 100644 --- a/LIFOstack.v +++ b/LIFOstack.v @@ -3,39 +3,39 @@ module LIFOstack (Din, clk, en, rst, rw, Dout, empty, full); input [15:0] Din; // Data being fed to stack input clk; // clock signal input input en; // disable stack when not in use -input rst; // reset pin to clear and reinitialise stack +input rst; // reset pin to clear and reinitialise stack (active high) input rw; // 0: read, 1: write output reg [15:0] Dout; // Data being pulled from stack output reg empty; // goes high to indicate SP is at 0 output reg full; // goes high to indicate SP is at (slots) -reg [15:0] stack_mem [3:0]; reg [4:0] SP; // Points to slot to save next value to integer i; +reg [15:0] mem [3:0]; always @ (posedge clk) begin if (!en); // if not enabled, ignore this cycle else begin if (rst) begin // if rst is high, clear memory and reset pointers/outputs + Dout = 16'h0000; SP = 4'b0000; empty = 1'b1; - Dout = 16'h0000; for (i = 0; i < 16; i = i + 1) begin - stack_mem[i] = 16'h0000; + mem[i] = 16'h0000; end end else begin if (!full && rw) begin // Write when NOT full & Writing - stack_mem[SP] = Din; // Store data into current slot + mem[SP] = Din; // Store data into current slot SP = SP + 1'b1; // Increment stack pointer to next empty slot full = (SP == 5'b10000) ? 1 : 0; // Stack is full if SP is (slots) empty = 1'b0; // Stack is never empty after a push end else if (!empty && !rw) begin // Read when NOT empty & reading SP = SP - 1'b1; // Decrement stack pointer to last filled slot - Dout = stack_mem[SP]; // Output data from last filled slot - stack_mem[SP] = 16'h0000; // Clear slot after setting output + Dout = mem[SP]; // Output data from last filled slot + mem[SP] = 16'h0000; // Clear slot after setting output full = 1'b0; // Stack is never full after a pop empty = (SP == 5'b00000) ? 1 : 0; // Stack is empty if SP is 0 end diff --git a/LIFOstack.v.bak b/LIFOstack.v.bak new file mode 100644 index 0000000..1a96087 --- /dev/null +++ b/LIFOstack.v.bak @@ -0,0 +1,46 @@ +module LIFOstack (Din, clk, en, rst, rw, Dout, empty, full); + +input [15:0] Din; // Data being fed to stack +input clk; // clock signal input +input en; // disable stack when not in use +input rst; // reset pin to clear and reinitialise stack +input rw; // 0: read, 1: write + +output reg [15:0] Dout; // Data being pulled from stack +output reg empty; // goes high to indicate SP is at 0 +output reg full; // goes high to indicate SP is at (slots) + +reg [15:0] stack_mem [3:0]; +reg [4:0] SP; // Points to slot to save next value to +integer i; + +always @ (posedge clk) begin + if (!en); // if not enabled, ignore this cycle + else begin + if (rst) begin // if rst is high, clear memory and reset pointers/outputs + SP = 4'b0000; + empty = 1'b1; + Dout = 16'h0000; + for (i = 0; i < 16; i = i + 1) begin + stack_mem[i] = 16'h0000; + end + end + else begin + if (!full && rw) begin // Write when NOT full & Writing + stack_mem[SP] = Din; // Store data into current slot + SP = SP + 1'b1; // Increment stack pointer to next empty slot + full = (SP == 5'b10000) ? 1 : 0; // Stack is full if SP is (slots) + empty = 1'b0; // Stack is never empty after a push + end + else if (!empty && !rw) begin // Read when NOT empty & reading + SP = SP - 1'b1; // Decrement stack pointer to last filled slot + Dout = stack_mem[SP]; // Output data from last filled slot + stack_mem[SP] = 16'h0000; // Clear slot after setting output + full = 1'b0; // Stack is never full after a pop + empty = (SP == 5'b00000) ? 1 : 0; // Stack is empty if SP is 0 + end + end + end + end + +endmodule diff --git a/mux_3x16.bsf b/mux_3x16.bsf new file mode 100644 index 0000000..398ef64 --- /dev/null +++ b/mux_3x16.bsf @@ -0,0 +1,64 @@ +/* +WARNING: Do NOT edit the input and output ports in this file in a text +editor if you plan to continue editing the block that represents it in +the Block Editor! File corruption is VERY likely to occur. +*/ +/* +Copyright (C) 2018 Intel Corporation. All rights reserved. +Your use of Intel Corporation's design tools, logic functions +and other software and tools, and its AMPP partner logic +functions, and any output files from any of the foregoing +(including device programming or simulation files), and any +associated documentation or information are expressly subject +to the terms and conditions of the Intel Program License +Subscription Agreement, the Intel Quartus Prime License Agreement, +the Intel FPGA IP License Agreement, or other applicable license +agreement, including, without limitation, that your use is for +the sole purpose of programming logic devices manufactured by +Intel and sold by Intel or its authorized distributors. Please +refer to the applicable agreement for further details. +*/ +(header "symbol" (version "1.1")) +(symbol + (rect 16 16 200 128) + (text "mux_3x16" (rect 5 0 46 12)(font "Arial" )) + (text "inst" (rect 8 96 20 108)(font "Arial" )) + (port + (pt 0 32) + (input) + (text "s[1..0]" (rect 0 0 23 12)(font "Arial" )) + (text "s[1..0]" (rect 21 27 44 39)(font "Arial" )) + (line (pt 0 32)(pt 16 32)(line_width 3)) + ) + (port + (pt 0 48) + (input) + (text "in0[15..0]" (rect 0 0 34 12)(font "Arial" )) + (text "in0[15..0]" (rect 21 43 55 55)(font "Arial" )) + (line (pt 0 48)(pt 16 48)(line_width 3)) + ) + (port + (pt 0 64) + (input) + (text "in1[15..0]" (rect 0 0 33 12)(font "Arial" )) + (text "in1[15..0]" (rect 21 59 54 71)(font "Arial" )) + (line (pt 0 64)(pt 16 64)(line_width 3)) + ) + (port + (pt 0 80) + (input) + (text "in2[15..0]" (rect 0 0 34 12)(font "Arial" )) + (text "in2[15..0]" (rect 21 75 55 87)(font "Arial" )) + (line (pt 0 80)(pt 16 80)(line_width 3)) + ) + (port + (pt 184 32) + (output) + (text "result[15..0]" (rect 0 0 44 12)(font "Arial" )) + (text "result[15..0]" (rect 119 27 163 39)(font "Arial" )) + (line (pt 184 32)(pt 168 32)(line_width 3)) + ) + (drawing + (rectangle (rect 16 16 168 96)(line_width 1)) + ) +) diff --git a/mux_3x16.v b/mux_3x16.v new file mode 100644 index 0000000..710f8c1 --- /dev/null +++ b/mux_3x16.v @@ -0,0 +1,18 @@ +module mux_3x16 (s, in0, in1, in2, result); + +input [1:0]s; +input [15:0]in0; +input [15:0]in1; +input [15:0]in2; + +output reg [15:0]result; + +always @(*) begin + case(s) + 2'b00: result = in0; + 2'b01: result = in1; + 2'b10: result = in2; + endcase +end + +endmodule diff --git a/mux_8x16.bdf b/mux_8x16.bdf deleted file mode 100644 index 8a70abc..0000000 --- a/mux_8x16.bdf +++ /dev/null @@ -1,784 +0,0 @@ -/* -WARNING: Do NOT edit the input and output ports in this file in a text -editor if you plan to continue editing the block that represents it in -the Block Editor! File corruption is VERY likely to occur. -*/ -/* -Copyright (C) 2018 Intel Corporation. All rights reserved. -Your use of Intel Corporation's design tools, logic functions -and other software and tools, and its AMPP partner logic -functions, and any output files from any of the foregoing -(including device programming or simulation files), and any -associated documentation or information are expressly subject -to the terms and conditions of the Intel Program License -Subscription Agreement, the Intel Quartus Prime License Agreement, -the Intel FPGA IP License Agreement, or other applicable license -agreement, including, without limitation, that your use is for -the sole purpose of programming logic devices manufactured by -Intel and sold by Intel or its authorized distributors. Please -refer to the applicable agreement for further details. -*/ -(header "graphic" (version "1.4")) -(pin - (input) - (rect 104 64 272 80) - (text "INPUT" (rect 125 0 153 10)(font "Arial" (font_size 6))) - (text "s0" (rect 5 0 17 12)(font "Arial" )) - (pt 168 8) - (drawing - (line (pt 84 12)(pt 109 12)) - (line (pt 84 4)(pt 109 4)) - (line (pt 113 8)(pt 168 8)) - (line (pt 84 12)(pt 84 4)) - (line (pt 109 4)(pt 113 8)) - (line (pt 109 12)(pt 113 8)) - ) - (text "VCC" (rect 128 7 148 17)(font "Arial" (font_size 6))) -) -(pin - (input) - (rect 104 80 272 96) - (text "INPUT" (rect 125 0 153 10)(font "Arial" (font_size 6))) - (text "s1" (rect 5 0 16 17)(font "Intel Clear" )) - (pt 168 8) - (drawing - (line (pt 84 12)(pt 109 12)) - (line (pt 84 4)(pt 109 4)) - (line (pt 113 8)(pt 168 8)) - (line (pt 84 12)(pt 84 4)) - (line (pt 109 4)(pt 113 8)) - (line (pt 109 12)(pt 113 8)) - ) - (text "VCC" (rect 128 7 148 17)(font "Arial" (font_size 6))) -) -(pin - (input) - (rect 104 96 272 112) - (text "INPUT" (rect 125 0 153 10)(font "Arial" (font_size 6))) - (text "s2" (rect 5 0 16 17)(font "Intel Clear" )) - (pt 168 8) - (drawing - (line (pt 84 12)(pt 109 12)) - (line (pt 84 4)(pt 109 4)) - (line (pt 113 8)(pt 168 8)) - (line (pt 84 12)(pt 84 4)) - (line (pt 109 4)(pt 113 8)) - (line (pt 109 12)(pt 113 8)) - ) - (text "VCC" (rect 128 7 148 17)(font "Arial" (font_size 6))) -) -(pin - (input) - (rect 104 176 272 192) - (text "INPUT" (rect 125 0 153 10)(font "Arial" (font_size 6))) - (text "in0[15..0]" (rect 5 0 52 12)(font "Arial" )) - (pt 168 8) - (drawing - (line (pt 84 12)(pt 109 12)) - (line (pt 84 4)(pt 109 4)) - (line (pt 113 8)(pt 168 8)) - (line (pt 84 12)(pt 84 4)) - (line (pt 109 4)(pt 113 8)) - (line (pt 109 12)(pt 113 8)) - ) - (text "VCC" (rect 128 7 148 17)(font "Arial" (font_size 6))) -) -(pin - (input) - (rect 104 208 272 224) - (text "INPUT" (rect 125 0 153 10)(font "Arial" (font_size 6))) - (text "in1[15..0]" (rect 5 0 49 17)(font "Intel Clear" )) - (pt 168 8) - (drawing - (line (pt 84 12)(pt 109 12)) - (line (pt 84 4)(pt 109 4)) - (line (pt 113 8)(pt 168 8)) - (line (pt 84 12)(pt 84 4)) - (line (pt 109 4)(pt 113 8)) - (line (pt 109 12)(pt 113 8)) - ) - (text "VCC" (rect 128 7 148 17)(font "Arial" (font_size 6))) -) -(pin - (input) - (rect 104 296 272 312) - (text "INPUT" (rect 125 0 153 10)(font "Arial" (font_size 6))) - (text "in2[15..0]" (rect 5 0 49 17)(font "Intel Clear" )) - (pt 168 8) - (drawing - (line (pt 84 12)(pt 109 12)) - (line (pt 84 4)(pt 109 4)) - (line (pt 113 8)(pt 168 8)) - (line (pt 84 12)(pt 84 4)) - (line (pt 109 4)(pt 113 8)) - (line (pt 109 12)(pt 113 8)) - ) - (text "VCC" (rect 128 7 148 17)(font "Arial" (font_size 6))) -) -(pin - (input) - (rect 104 328 272 344) - (text "INPUT" (rect 125 0 153 10)(font "Arial" (font_size 6))) - (text "in3[15..0]" (rect 5 0 49 17)(font "Intel Clear" )) - (pt 168 8) - (drawing - (line (pt 84 12)(pt 109 12)) - (line (pt 84 4)(pt 109 4)) - (line (pt 113 8)(pt 168 8)) - (line (pt 84 12)(pt 84 4)) - (line (pt 109 4)(pt 113 8)) - (line (pt 109 12)(pt 113 8)) - ) - (text "VCC" (rect 128 7 148 17)(font "Arial" (font_size 6))) -) -(pin - (input) - (rect 104 416 272 432) - (text "INPUT" (rect 125 0 153 10)(font "Arial" (font_size 6))) - (text "in4[15..0]" (rect 5 0 49 17)(font "Intel Clear" )) - (pt 168 8) - (drawing - (line (pt 84 12)(pt 109 12)) - (line (pt 84 4)(pt 109 4)) - (line (pt 113 8)(pt 168 8)) - (line (pt 84 12)(pt 84 4)) - (line (pt 109 4)(pt 113 8)) - (line (pt 109 12)(pt 113 8)) - ) - (text "VCC" (rect 128 7 148 17)(font "Arial" (font_size 6))) -) -(pin - (input) - (rect 104 448 272 464) - (text "INPUT" (rect 125 0 153 10)(font "Arial" (font_size 6))) - (text "in5[15..0]" (rect 5 0 49 17)(font "Intel Clear" )) - (pt 168 8) - (drawing - (line (pt 84 12)(pt 109 12)) - (line (pt 84 4)(pt 109 4)) - (line (pt 113 8)(pt 168 8)) - (line (pt 84 12)(pt 84 4)) - (line (pt 109 4)(pt 113 8)) - (line (pt 109 12)(pt 113 8)) - ) - (text "VCC" (rect 128 7 148 17)(font "Arial" (font_size 6))) -) -(pin - (input) - (rect 104 536 272 552) - (text "INPUT" (rect 125 0 153 10)(font "Arial" (font_size 6))) - (text "in6[15..0]" (rect 5 0 49 17)(font "Intel Clear" )) - (pt 168 8) - (drawing - (line (pt 84 12)(pt 109 12)) - (line (pt 84 4)(pt 109 4)) - (line (pt 113 8)(pt 168 8)) - (line (pt 84 12)(pt 84 4)) - (line (pt 109 4)(pt 113 8)) - (line (pt 109 12)(pt 113 8)) - ) - (text "VCC" (rect 128 7 148 17)(font "Arial" (font_size 6))) -) -(pin - (input) - (rect 104 568 272 584) - (text "INPUT" (rect 125 0 153 10)(font "Arial" (font_size 6))) - (text "in7[15..0]" (rect 5 0 49 17)(font "Intel Clear" )) - (pt 168 8) - (drawing - (line (pt 84 12)(pt 109 12)) - (line (pt 84 4)(pt 109 4)) - (line (pt 113 8)(pt 168 8)) - (line (pt 84 12)(pt 84 4)) - (line (pt 109 4)(pt 113 8)) - (line (pt 109 12)(pt 113 8)) - ) - (text "VCC" (rect 128 7 148 17)(font "Arial" (font_size 6))) -) -(pin - (output) - (rect 872 192 1048 208) - (text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6))) - (text "result[15..0]" (rect 90 0 149 12)(font "Arial" )) - (pt 0 8) - (drawing - (line (pt 0 8)(pt 52 8)) - (line (pt 52 4)(pt 78 4)) - (line (pt 52 12)(pt 78 12)) - (line (pt 52 12)(pt 52 4)) - (line (pt 78 4)(pt 82 8)) - (line (pt 82 8)(pt 78 12)) - (line (pt 78 12)(pt 82 8)) - ) -) -(symbol - (rect 312 272 424 360) - (text "BUSMUX" (rect 28 0 91 16)(font "Arial" (font_size 10))) - (text "inst5" (rect 3 77 25 94)(font "Intel Clear" )) - (port - (pt 0 64) - (input) - (text "datab[WIDTH-1..0]" (rect 6 51 108 65)(font "Arial" (font_size 8))) - (text "datab[]" (rect 6 51 44 65)(font "Arial" (font_size 8))) - (line (pt 0 64)(pt 44 64)(line_width 3)) - ) - (port - (pt 56 88) - (input) - (text "sel" (rect 59 70 75 84)(font "Arial" (font_size 8))) - (text "sel" (rect 59 70 75 84)(font "Arial" (font_size 8))) - (line (pt 56 88)(pt 56 72)) - ) - (port - (pt 0 32) - (input) - (text "dataa[WIDTH-1..0]" (rect 6 19 108 33)(font "Arial" (font_size 8))) - (text "dataa[]" (rect 6 19 44 33)(font "Arial" (font_size 8))) - (line (pt 0 32)(pt 44 32)(line_width 3)) - ) - (port - (pt 112 48) - (output) - (text "result[WIDTH-1..0]" (rect 75 35 177 49)(font "Arial" (font_size 8))) - (text "result[]" (rect 75 35 113 49)(font "Arial" (font_size 8))) - (line (pt 68 48)(pt 112 48)(line_width 3)) - ) - (parameter - "WIDTH" - "16" - "Width of I/O, any integer > 0" - " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" " 9" "10" "11" "12" "13" "14" "15" "16" "20" "24" "28" "32" "40" "48" "56" "64" - ) - (drawing - (text "0" (rect 52 31 56 41)(font "Arial" (font_size 6))) - (text "1" (rect 52 55 56 65)(font "Arial" (font_size 6))) - (line (pt 68 64)(pt 68 32)) - (line (pt 44 80)(pt 44 16)) - (line (pt 44 16)(pt 68 32)) - (line (pt 44 80)(pt 68 64)) - ) - (annotation_block (parameter)(rect 424 272 448 288)) -) -(symbol - (rect 312 392 424 480) - (text "BUSMUX" (rect 28 0 91 16)(font "Arial" (font_size 10))) - (text "inst6" (rect 3 77 25 94)(font "Intel Clear" )) - (port - (pt 0 64) - (input) - (text "datab[WIDTH-1..0]" (rect 6 51 108 65)(font "Arial" (font_size 8))) - (text "datab[]" (rect 6 51 44 65)(font "Arial" (font_size 8))) - (line (pt 0 64)(pt 44 64)(line_width 3)) - ) - (port - (pt 56 88) - (input) - (text "sel" (rect 59 70 75 84)(font "Arial" (font_size 8))) - (text "sel" (rect 59 70 75 84)(font "Arial" (font_size 8))) - (line (pt 56 88)(pt 56 72)) - ) - (port - (pt 0 32) - (input) - (text "dataa[WIDTH-1..0]" (rect 6 19 108 33)(font "Arial" (font_size 8))) - (text "dataa[]" (rect 6 19 44 33)(font "Arial" (font_size 8))) - (line (pt 0 32)(pt 44 32)(line_width 3)) - ) - (port - (pt 112 48) - (output) - (text "result[WIDTH-1..0]" (rect 75 35 177 49)(font "Arial" (font_size 8))) - (text "result[]" (rect 75 35 113 49)(font "Arial" (font_size 8))) - (line (pt 68 48)(pt 112 48)(line_width 3)) - ) - (parameter - "WIDTH" - "16" - "Width of I/O, any integer > 0" - " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" " 9" "10" "11" "12" "13" "14" "15" "16" "20" "24" "28" "32" "40" "48" "56" "64" - ) - (drawing - (text "0" (rect 52 31 56 41)(font "Arial" (font_size 6))) - (text "1" (rect 52 55 56 65)(font "Arial" (font_size 6))) - (line (pt 68 64)(pt 68 32)) - (line (pt 44 80)(pt 44 16)) - (line (pt 44 16)(pt 68 32)) - (line (pt 44 80)(pt 68 64)) - ) - (annotation_block (parameter)(rect 424 392 448 408)) -) -(symbol - (rect 312 512 424 600) - (text "BUSMUX" (rect 28 0 91 16)(font "Arial" (font_size 10))) - (text "inst7" (rect 3 77 25 94)(font "Intel Clear" )) - (port - (pt 0 64) - (input) - (text "datab[WIDTH-1..0]" (rect 6 51 108 65)(font "Arial" (font_size 8))) - (text "datab[]" (rect 6 51 44 65)(font "Arial" (font_size 8))) - (line (pt 0 64)(pt 44 64)(line_width 3)) - ) - (port - (pt 56 88) - (input) - (text "sel" (rect 59 70 75 84)(font "Arial" (font_size 8))) - (text "sel" (rect 59 70 75 84)(font "Arial" (font_size 8))) - (line (pt 56 88)(pt 56 72)) - ) - (port - (pt 0 32) - (input) - (text "dataa[WIDTH-1..0]" (rect 6 19 108 33)(font "Arial" (font_size 8))) - (text "dataa[]" (rect 6 19 44 33)(font "Arial" (font_size 8))) - (line (pt 0 32)(pt 44 32)(line_width 3)) - ) - (port - (pt 112 48) - (output) - (text "result[WIDTH-1..0]" (rect 75 35 177 49)(font "Arial" (font_size 8))) - (text "result[]" (rect 75 35 113 49)(font "Arial" (font_size 8))) - (line (pt 68 48)(pt 112 48)(line_width 3)) - ) - (parameter - "WIDTH" - "16" - "Width of I/O, any integer > 0" - " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" " 9" "10" "11" "12" "13" "14" "15" "16" "20" "24" "28" "32" "40" "48" "56" "64" - ) - (drawing - (text "0" (rect 52 31 56 41)(font "Arial" (font_size 6))) - (text "1" (rect 52 55 56 65)(font "Arial" (font_size 6))) - (line (pt 68 64)(pt 68 32)) - (line (pt 44 80)(pt 44 16)) - (line (pt 44 16)(pt 68 32)) - (line (pt 44 80)(pt 68 64)) - ) - (annotation_block (parameter)(rect 424 512 448 528)) -) -(symbol - (rect 528 152 640 240) - (text "BUSMUX" (rect 28 0 91 16)(font "Arial" (font_size 10))) - (text "inst8" (rect 3 77 25 94)(font "Intel Clear" )) - (port - (pt 0 64) - (input) - (text "datab[WIDTH-1..0]" (rect 6 51 108 65)(font "Arial" (font_size 8))) - (text "datab[]" (rect 6 51 44 65)(font "Arial" (font_size 8))) - (line (pt 0 64)(pt 44 64)(line_width 3)) - ) - (port - (pt 56 88) - (input) - (text "sel" (rect 59 70 75 84)(font "Arial" (font_size 8))) - (text "sel" (rect 59 70 75 84)(font "Arial" (font_size 8))) - (line (pt 56 88)(pt 56 72)) - ) - (port - (pt 0 32) - (input) - (text "dataa[WIDTH-1..0]" (rect 6 19 108 33)(font "Arial" (font_size 8))) - (text "dataa[]" (rect 6 19 44 33)(font "Arial" (font_size 8))) - (line (pt 0 32)(pt 44 32)(line_width 3)) - ) - (port - (pt 112 48) - (output) - (text "result[WIDTH-1..0]" (rect 75 35 177 49)(font "Arial" (font_size 8))) - (text "result[]" (rect 75 35 113 49)(font "Arial" (font_size 8))) - (line (pt 68 48)(pt 112 48)(line_width 3)) - ) - (parameter - "WIDTH" - "16" - "Width of I/O, any integer > 0" - " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" " 9" "10" "11" "12" "13" "14" "15" "16" "20" "24" "28" "32" "40" "48" "56" "64" - ) - (drawing - (text "0" (rect 52 31 56 41)(font "Arial" (font_size 6))) - (text "1" (rect 52 55 56 65)(font "Arial" (font_size 6))) - (line (pt 68 64)(pt 68 32)) - (line (pt 44 80)(pt 44 16)) - (line (pt 44 16)(pt 68 32)) - (line (pt 44 80)(pt 68 64)) - ) - (annotation_block (parameter)(rect 640 152 664 168)) -) -(symbol - (rect 528 272 640 360) - (text "BUSMUX" (rect 28 0 91 16)(font "Arial" (font_size 10))) - (text "inst9" (rect 3 77 25 94)(font "Intel Clear" )) - (port - (pt 0 64) - (input) - (text "datab[WIDTH-1..0]" (rect 6 51 108 65)(font "Arial" (font_size 8))) - (text "datab[]" (rect 6 51 44 65)(font "Arial" (font_size 8))) - (line (pt 0 64)(pt 44 64)(line_width 3)) - ) - (port - (pt 56 88) - (input) - (text "sel" (rect 59 70 75 84)(font "Arial" (font_size 8))) - (text "sel" (rect 59 70 75 84)(font "Arial" (font_size 8))) - (line (pt 56 88)(pt 56 72)) - ) - (port - (pt 0 32) - (input) - (text "dataa[WIDTH-1..0]" (rect 6 19 108 33)(font "Arial" (font_size 8))) - (text "dataa[]" (rect 6 19 44 33)(font "Arial" (font_size 8))) - (line (pt 0 32)(pt 44 32)(line_width 3)) - ) - (port - (pt 112 48) - (output) - (text "result[WIDTH-1..0]" (rect 75 35 177 49)(font "Arial" (font_size 8))) - (text "result[]" (rect 75 35 113 49)(font "Arial" (font_size 8))) - (line (pt 68 48)(pt 112 48)(line_width 3)) - ) - (parameter - "WIDTH" - "16" - "Width of I/O, any integer > 0" - " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" " 9" "10" "11" "12" "13" "14" "15" "16" "20" "24" "28" "32" "40" "48" "56" "64" - ) - (drawing - (text "0" (rect 52 31 56 41)(font "Arial" (font_size 6))) - (text "1" (rect 52 55 56 65)(font "Arial" (font_size 6))) - (line (pt 68 64)(pt 68 32)) - (line (pt 44 80)(pt 44 16)) - (line (pt 44 16)(pt 68 32)) - (line (pt 44 80)(pt 68 64)) - ) - (annotation_block (parameter)(rect 640 272 664 288)) -) -(symbol - (rect 720 152 832 240) - (text "BUSMUX" (rect 28 0 91 16)(font "Arial" (font_size 10))) - (text "inst10" (rect 3 77 31 94)(font "Intel Clear" )) - (port - (pt 0 64) - (input) - (text "datab[WIDTH-1..0]" (rect 6 51 108 65)(font "Arial" (font_size 8))) - (text "datab[]" (rect 6 51 44 65)(font "Arial" (font_size 8))) - (line (pt 0 64)(pt 44 64)(line_width 3)) - ) - (port - (pt 56 88) - (input) - (text "sel" (rect 59 70 75 84)(font "Arial" (font_size 8))) - (text "sel" (rect 59 70 75 84)(font "Arial" (font_size 8))) - (line (pt 56 88)(pt 56 72)) - ) - (port - (pt 0 32) - (input) - (text "dataa[WIDTH-1..0]" (rect 6 19 108 33)(font "Arial" (font_size 8))) - (text "dataa[]" (rect 6 19 44 33)(font "Arial" (font_size 8))) - (line (pt 0 32)(pt 44 32)(line_width 3)) - ) - (port - (pt 112 48) - (output) - (text "result[WIDTH-1..0]" (rect 75 35 177 49)(font "Arial" (font_size 8))) - (text "result[]" (rect 75 35 113 49)(font "Arial" (font_size 8))) - (line (pt 68 48)(pt 112 48)(line_width 3)) - ) - (parameter - "WIDTH" - "16" - "Width of I/O, any integer > 0" - " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" " 9" "10" "11" "12" "13" "14" "15" "16" "20" "24" "28" "32" "40" "48" "56" "64" - ) - (drawing - (text "0" (rect 52 31 56 41)(font "Arial" (font_size 6))) - (text "1" (rect 52 55 56 65)(font "Arial" (font_size 6))) - (line (pt 68 64)(pt 68 32)) - (line (pt 44 80)(pt 44 16)) - (line (pt 44 16)(pt 68 32)) - (line (pt 44 80)(pt 68 64)) - ) - (annotation_block (parameter)(rect 832 152 856 168)) -) -(symbol - (rect 312 152 424 240) - (text "BUSMUX" (rect 28 0 91 16)(font "Arial" (font_size 10))) - (text "inst" (rect 3 77 23 91)(font "Arial" (font_size 8))) - (port - (pt 0 64) - (input) - (text "datab[WIDTH-1..0]" (rect 6 51 108 65)(font "Arial" (font_size 8))) - (text "datab[]" (rect 6 51 44 65)(font "Arial" (font_size 8))) - (line (pt 0 64)(pt 44 64)(line_width 3)) - ) - (port - (pt 56 88) - (input) - (text "sel" (rect 59 70 75 84)(font "Arial" (font_size 8))) - (text "sel" (rect 59 70 75 84)(font "Arial" (font_size 8))) - (line (pt 56 88)(pt 56 72)) - ) - (port - (pt 0 32) - (input) - (text "dataa[WIDTH-1..0]" (rect 6 19 108 33)(font "Arial" (font_size 8))) - (text "dataa[]" (rect 6 19 44 33)(font "Arial" (font_size 8))) - (line (pt 0 32)(pt 44 32)(line_width 3)) - ) - (port - (pt 112 48) - (output) - (text "result[WIDTH-1..0]" (rect 75 35 177 49)(font "Arial" (font_size 8))) - (text "result[]" (rect 75 35 113 49)(font "Arial" (font_size 8))) - (line (pt 68 48)(pt 112 48)(line_width 3)) - ) - (parameter - "WIDTH" - "16" - "Width of I/O, any integer > 0" - " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" " 9" "10" "11" "12" "13" "14" "15" "16" "20" "24" "28" "32" "40" "48" "56" "64" - (type "PARAMETER_SIGNED_DEC") ) - (drawing - (text "0" (rect 52 31 56 41)(font "Arial" (font_size 6))) - (text "1" (rect 52 55 56 65)(font "Arial" (font_size 6))) - (line (pt 68 64)(pt 68 32)) - (line (pt 44 80)(pt 44 16)) - (line (pt 44 16)(pt 68 32)) - (line (pt 44 80)(pt 68 64)) - ) - (annotation_block (parameter)(rect 424 152 456 176)) -) -(connector - (pt 424 200) - (pt 440 200) - (bus) -) -(connector - (pt 456 320) - (pt 424 320) - (bus) -) -(connector - (pt 424 440) - (pt 472 440) - (bus) -) -(connector - (pt 424 560) - (pt 488 560) - (bus) -) -(connector - (pt 656 184) - (pt 720 184) - (bus) -) -(connector - (pt 440 200) - (pt 440 184) - (bus) -) -(connector - (pt 456 320) - (pt 456 216) - (bus) -) -(connector - (pt 656 200) - (pt 640 200) - (bus) -) -(connector - (pt 656 184) - (pt 656 200) - (bus) -) -(connector - (pt 456 216) - (pt 528 216) - (bus) -) -(connector - (pt 440 184) - (pt 528 184) - (bus) -) -(connector - (pt 472 440) - (pt 472 304) - (bus) -) -(connector - (pt 488 560) - (pt 488 336) - (bus) -) -(connector - (pt 488 336) - (pt 528 336) - (bus) -) -(connector - (pt 472 304) - (pt 528 304) - (bus) -) -(connector - (pt 720 216) - (pt 672 216) - (bus) -) -(connector - (pt 640 320) - (pt 672 320) - (bus) -) -(connector - (pt 672 216) - (pt 672 320) - (bus) -) -(connector - (pt 368 240) - (pt 368 256) -) -(connector - (pt 368 256) - (pt 296 256) -) -(connector - (pt 368 360) - (pt 368 376) -) -(connector - (pt 368 376) - (pt 296 376) -) -(connector - (pt 296 608) - (pt 368 608) -) -(connector - (pt 368 608) - (pt 368 600) -) -(connector - (pt 368 496) - (pt 296 496) -) -(connector - (pt 296 496) - (pt 296 608) -) -(connector - (pt 368 496) - (pt 368 480) -) -(connector - (pt 296 376) - (pt 296 496) -) -(connector - (pt 584 240) - (pt 584 256) -) -(connector - (pt 512 256) - (pt 584 256) -) -(connector - (pt 512 376) - (pt 584 376) -) -(connector - (pt 584 360) - (pt 584 376) -) -(connector - (pt 272 184) - (pt 312 184) - (bus) -) -(connector - (pt 312 216) - (pt 272 216) - (bus) -) -(connector - (pt 312 304) - (pt 272 304) - (bus) -) -(connector - (pt 312 336) - (pt 272 336) - (bus) -) -(connector - (pt 312 424) - (pt 272 424) - (bus) -) -(connector - (pt 312 456) - (pt 272 456) - (bus) -) -(connector - (pt 312 544) - (pt 272 544) - (bus) -) -(connector - (pt 312 576) - (pt 272 576) - (bus) -) -(connector - (pt 272 72) - (pt 296 72) -) -(connector - (pt 296 72) - (pt 296 256) -) -(connector - (pt 296 256) - (pt 296 376) -) -(connector - (pt 272 88) - (pt 512 88) -) -(connector - (pt 512 88) - (pt 512 256) -) -(connector - (pt 512 256) - (pt 512 376) -) -(connector - (pt 776 240) - (pt 776 256) -) -(connector - (pt 272 104) - (pt 704 104) -) -(connector - (pt 776 256) - (pt 704 256) -) -(connector - (pt 704 104) - (pt 704 256) -) -(connector - (pt 832 200) - (pt 872 200) - (bus) -) -(junction (pt 296 496)) -(junction (pt 296 376)) -(junction (pt 296 256)) -(junction (pt 512 256)) diff --git a/mux_8x16.bsf b/mux_8x16.bsf index b94421f..252ad5e 100644 --- a/mux_8x16.bsf +++ b/mux_8x16.bsf @@ -18,96 +18,82 @@ the sole purpose of programming logic devices manufactured by Intel and sold by Intel or its authorized distributors. Please refer to the applicable agreement for further details. */ -(header "symbol" (version "1.2")) +(header "symbol" (version "1.1")) (symbol - (rect 16 16 200 240) - (text "mux_8x16" (rect 5 0 67 19)(font "Intel Clear" (font_size 8))) - (text "inst" (rect 8 203 24 220)(font "Intel Clear" )) + (rect 16 16 200 224) + (text "mux_8x16" (rect 5 0 46 12)(font "Arial" )) + (text "inst" (rect 8 192 20 204)(font "Arial" )) (port (pt 0 32) (input) - (text "s0" (rect 0 0 14 19)(font "Intel Clear" (font_size 8))) - (text "s0" (rect 21 27 35 46)(font "Intel Clear" (font_size 8))) - (line (pt 0 32)(pt 16 32)) + (text "s[2..0]" (rect 0 0 24 12)(font "Arial" )) + (text "s[2..0]" (rect 21 27 45 39)(font "Arial" )) + (line (pt 0 32)(pt 16 32)(line_width 3)) ) (port (pt 0 48) (input) - (text "s1" (rect 0 0 14 19)(font "Intel Clear" (font_size 8))) - (text "s1" (rect 21 43 35 62)(font "Intel Clear" (font_size 8))) - (line (pt 0 48)(pt 16 48)) + (text "in0[15..0]" (rect 0 0 34 12)(font "Arial" )) + (text "in0[15..0]" (rect 21 43 55 55)(font "Arial" )) + (line (pt 0 48)(pt 16 48)(line_width 3)) ) (port (pt 0 64) (input) - (text "s2" (rect 0 0 14 19)(font "Intel Clear" (font_size 8))) - (text "s2" (rect 21 59 35 78)(font "Intel Clear" (font_size 8))) - (line (pt 0 64)(pt 16 64)) + (text "in1[15..0]" (rect 0 0 33 12)(font "Arial" )) + (text "in1[15..0]" (rect 21 59 54 71)(font "Arial" )) + (line (pt 0 64)(pt 16 64)(line_width 3)) ) (port (pt 0 80) (input) - (text "in0[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in0[15..0]" (rect 21 75 78 94)(font "Intel Clear" (font_size 8))) + (text "in2[15..0]" (rect 0 0 34 12)(font "Arial" )) + (text "in2[15..0]" (rect 21 75 55 87)(font "Arial" )) (line (pt 0 80)(pt 16 80)(line_width 3)) ) (port (pt 0 96) (input) - (text "in1[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in1[15..0]" (rect 21 91 78 110)(font "Intel Clear" (font_size 8))) + (text "in3[15..0]" (rect 0 0 34 12)(font "Arial" )) + (text "in3[15..0]" (rect 21 91 55 103)(font "Arial" )) (line (pt 0 96)(pt 16 96)(line_width 3)) ) (port (pt 0 112) (input) - (text "in2[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in2[15..0]" (rect 21 107 78 126)(font "Intel Clear" (font_size 8))) + (text "in4[15..0]" (rect 0 0 35 12)(font "Arial" )) + (text "in4[15..0]" (rect 21 107 56 119)(font "Arial" )) (line (pt 0 112)(pt 16 112)(line_width 3)) ) (port (pt 0 128) (input) - (text "in3[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in3[15..0]" (rect 21 123 78 142)(font "Intel Clear" (font_size 8))) + (text "in5[15..0]" (rect 0 0 34 12)(font "Arial" )) + (text "in5[15..0]" (rect 21 123 55 135)(font "Arial" )) (line (pt 0 128)(pt 16 128)(line_width 3)) ) (port (pt 0 144) (input) - (text "in4[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in4[15..0]" (rect 21 139 78 158)(font "Intel Clear" (font_size 8))) + (text "in6[15..0]" (rect 0 0 34 12)(font "Arial" )) + (text "in6[15..0]" (rect 21 139 55 151)(font "Arial" )) (line (pt 0 144)(pt 16 144)(line_width 3)) ) (port (pt 0 160) (input) - (text "in5[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in5[15..0]" (rect 21 155 78 174)(font "Intel Clear" (font_size 8))) + (text "in7[15..0]" (rect 0 0 34 12)(font "Arial" )) + (text "in7[15..0]" (rect 21 155 55 167)(font "Arial" )) (line (pt 0 160)(pt 16 160)(line_width 3)) ) - (port - (pt 0 176) - (input) - (text "in6[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in6[15..0]" (rect 21 171 78 190)(font "Intel Clear" (font_size 8))) - (line (pt 0 176)(pt 16 176)(line_width 3)) - ) - (port - (pt 0 192) - (input) - (text "in7[15..0]" (rect 0 0 57 19)(font "Intel Clear" (font_size 8))) - (text "in7[15..0]" (rect 21 187 78 206)(font "Intel Clear" (font_size 8))) - (line (pt 0 192)(pt 16 192)(line_width 3)) - ) (port (pt 184 32) (output) - (text "result[15..0]" (rect 0 0 71 19)(font "Intel Clear" (font_size 8))) - (text "result[15..0]" (rect 92 27 163 46)(font "Intel Clear" (font_size 8))) + (text "result[15..0]" (rect 0 0 44 12)(font "Arial" )) + (text "result[15..0]" (rect 119 27 163 39)(font "Arial" )) (line (pt 184 32)(pt 168 32)(line_width 3)) ) (drawing - (rectangle (rect 16 16 168 208)) + (rectangle (rect 16 16 168 192)(line_width 1)) ) ) diff --git a/mux_8x16.v b/mux_8x16.v new file mode 100644 index 0000000..56a6cc4 --- /dev/null +++ b/mux_8x16.v @@ -0,0 +1,28 @@ +module mux_8x16 (s, in0, in1, in2, in3, in4, in5, in6, in7, result); + +input [2:0]s; +input [15:0]in0; +input [15:0]in1; +input [15:0]in2; +input [15:0]in3; +input [15:0]in4; +input [15:0]in5; +input [15:0]in6; +input [15:0]in7; + +output reg [15:0]result; + +always @(*) begin + case(s) + 3'b000: result = in0; + 3'b001: result = in1; + 3'b010: result = in2; + 3'b011: result = in3; + 3'b100: result = in4; + 3'b101: result = in5; + 3'b110: result = in6; + 3'b111: result = in7; + endcase +end + +endmodule diff --git a/mux_8x16.v.bak b/mux_8x16.v.bak new file mode 100644 index 0000000..1478bcd --- /dev/null +++ b/mux_8x16.v.bak @@ -0,0 +1,21 @@ +module mux_8x16 (s, in0, in1, in2, in3, in4, in5, in6, in7, result); + +input [2:0]s; +input [15:0]in0, [15:0]in1, [15:0]in2, [15:0]in3, [15:0]in4, [15:0]in5, [15:0]in6, [15:0]in7; + +output [15:0]result; + +always @(*) begin + case(s) + 3'b000: result = in0; + 3'b001: result = in1; + 3'b010: result = in2; + 3'b011: result = in3; + 3'b100: result = in4; + 3'b101: result = in5; + 3'b110: result = in6; + 3'b111: result = in7; + endcase +end + +endmodule