1- module cla ( co, ci, xo, to_idu_carry1, to_idu_carry2, idu_carry_out);
1+ // Toshiba Z80 MPU (CMOS)
2+ // Внешнее вычисление переноса (Carry Lookahead, CLA) для Increment/Decrement Unit-а (IDU).
23
3- output wire [15 :0 ] co;
4- input wire [15 :0 ] ci;
5- input wire [15 :0 ] xo;
6- input wire to_idu_carry1;
7- input wire to_idu_carry2;
8- output wire idu_carry_out;
4+ module idu_cla ( co, ci, xo, to_idu_carry1, to_idu_carry2, idu_carry_out);
5+
6+ output wire [15 :0 ] co; // Результат вычисления CLA для IDU_FF XNOR
7+ input wire [15 :0 ] ci; // Выход значения входного IDU FF в CLA
8+ input wire [15 :0 ] xo; // Выход с правого XOR в CLA; xo[15] не подключен (не используется).
9+ input wire to_idu_carry1; // Пока хз (режим работы?)
10+ input wire to_idu_carry2; // Пока хз (режим работы?)
11+ output wire idu_carry_out; // IDU Carry Out
912
1013 // Wires
1114
@@ -140,8 +143,8 @@ module cla ( co, ci, xo, to_idu_carry1, to_idu_carry2, idu_carry_out);
140143 cla_nand3 g6 (.c(w48), .b(w22), .a(w60), .x (w21) );
141144 cla_nand3 g7 (.a(w22), .b(w67), .c(w48), .x (w61) );
142145 cla_nand g8 (.b(w48), .a(w67), .x (w59) );
143- cla_not3 g9 (.c(w47), .b(w68), .a(w37), .x (w66) );
144- cla_not4 g10 (.a(w63), .b(w62), .c(w64), .d(w65), .x (w23) );
146+ cla_nand3 g9 (.c(w47), .b(w68), .a(w37), .x (w66) );
147+ cla_nand4 g10 (.a(w63), .b(w62), .c(w64), .d(w65), .x (w23) );
145148 cla_nand g11 (.a(w37), .b(w68), .x (w69) );
146149 cla_nor3 g12 (.a(w45), .b(w3), .c(w36), .x (w37) );
147150 cla_nand3 g13 (.a(w11), .b(w16), .c(w43), .x (w39) );
@@ -168,7 +171,7 @@ module cla ( co, ci, xo, to_idu_carry1, to_idu_carry2, idu_carry_out);
168171 cla_not g34 (.a(w66), .x (w67) );
169172 cla_not g35 (.a(w19), .x (w20) );
170173 cla_not g36 (.a(w55), .x (w17) );
171- endmodule // cla
174+ endmodule // idu_cla
172175
173176// Module Definitions [It is possible to wrap here on your primitives]
174177
@@ -180,6 +183,8 @@ module cla_nand4 ( a, b, c, d, x);
180183 input wire d;
181184 output wire x ;
182185
186+ assign x = ~ (a& b& c& d);
187+
183188endmodule // cla_nand4
184189
185190module cla_nand3 ( c, b, a, x );
@@ -189,6 +194,8 @@ module cla_nand3 ( c, b, a, x);
189194 input wire a;
190195 output wire x ;
191196
197+ assign x = ~ (a& b& c);
198+
192199endmodule // cla_nand3
193200
194201module cla_nand ( a, b, x );
@@ -197,6 +204,8 @@ module cla_nand ( a, b, x);
197204 input wire b;
198205 output wire x ;
199206
207+ assign x = ~ (a& b);
208+
200209endmodule // cla_nand
201210
202211module cla_nor ( a, b, x );
@@ -205,26 +214,9 @@ module cla_nor ( a, b, x);
205214 input wire b;
206215 output wire x ;
207216
208- endmodule // cla_nor
209-
210- module cla_not3 ( c, b, a, x );
211-
212- input wire c;
213- input wire b;
214- input wire a;
215- output wire x ;
216-
217- endmodule // cla_not3
218-
219- module cla_not4 ( a, b, c, d, x );
217+ assign x = ~ (a| b);
220218
221- input wire a;
222- input wire b;
223- input wire c;
224- input wire d;
225- output wire x ;
226-
227- endmodule // cla_not4
219+ endmodule // cla_nor
228220
229221module cla_nor3 ( a, b, c, x );
230222
@@ -233,12 +225,16 @@ module cla_nor3 ( a, b, c, x);
233225 input wire c;
234226 output wire x ;
235227
228+ assign x = ~ (a| b| c);
229+
236230endmodule // cla_nor3
237231
238232module cla_not ( a, x );
239233
240234 input wire a;
241235 output wire x ;
242236
237+ assign x = ~ a;
238+
243239endmodule // cla_not
244240
0 commit comments