1 * Z:\trinary\code\circuits\main.asc
\r
2 XX2 $G_Vdd $G_Vss tpower
\r
3 XCYCLE_PC PC PC_PLUS_1 tcycle_up
\r
4 XMUX_PC PC_PLUS_1 0 JUMP_ADDR IS_BE NEXT_PC mux3-1
\r
5 XX3 I0_opcode IS_CMP IS_LWI IS_BE decoder1-3
\r
6 XREGISTER_A I2 CLK_A A2 I1 A1 A0 0 trit_reg3
\r
7 XDO_LWI IS_LWI EXECUTE CLK_A min
\r
8 XMUX_ALU_A 0 $G_Vss 0 0 0 0 A0_BUF A1_BUF A2_BUF I1 ALU_IN_A0 ALU_IN_A1 ALU_IN_A2 mux9-3
\r
9 XMUX_ALU_B 0 $G_Vss 0 0 0 0 A0_BUF A1_BUF A2_BUF I2 ALU_IN_B0 ALU_IN_B1 ALU_IN_B2 mux9-3
\r
10 XDO_CMP IS_CMP EXECUTE CLK_STATUS min
\r
11 XXalu ALU_IN_A2 ALU_IN_A1 ALU_IN_A0 ALU_IN_B2 ALU_IN_B1 ALU_IN_B0 S_IN alu
\r
12 Xcg FETCH EXECUTE clock_gen
\r
13 XPROGRAM_COUNTER NEXT_PC FETCH PC NC_01 dtflop-ms2
\r
14 XSTATUS_REG S_IN CLK_STATUS S NC_02 dtflop-ms2
\r
15 XBUF_A1 A1 A1_BUF tbuf
\r
16 XBUF_A0 A0 A0_BUF tbuf
\r
17 XBUF_A2 A2 A2_BUF tbuf
\r
18 XJUMP_MUX I2 I1 I2 S JUMP_ADDR mux3-1
\r
19 XX1 PC I0_opcode I1 I2 swrom-guess
\r
21 * block symbol definitions
\r
22 .subckt tpower Vdd Vss
\r
27 .subckt tcycle_up IN OUT
\r
28 XXnti _IN _IN_NTI nti
\r
29 XXpti _IN _IN_PTI pti
\r
31 XXtnor1 _IN_NTI INI OUT tnor
\r
32 XXtnor0 _IN_PTI 0 INI tnor
\r
35 .subckt mux3-1 A B C S Q
\r
39 XXdecoder S CTRL_A CTRL_B CTRL_C decoder1-3
\r
42 .subckt decoder1-3 IN OUT_i OUT_0 OUT_1
\r
43 XX1pti IN IN_pti pti
\r
44 XX1sti IN_pti OUT_1 sti
\r
46 XX0nor OUT_1 OUT_i OUT_0 tnor
\r
49 .subckt trit_reg3 D2 CLK Q2 D1 Q1 Q0 D0
\r
50 XXtrit0 D0 CLK Q0 NC_01 dtflop-ms2
\r
51 XXtrit1 D1 CLK Q1 NC_02 dtflop-ms2
\r
52 XXtrit2 D2 CLK Q2 NC_03 dtflop-ms2
\r
55 .subckt min A B MIN_OUT
\r
56 XXsti_tand AtnandB MIN_OUT sti
\r
57 XXtnand A B AtnandB tnand
\r
60 .subckt mux9-3 IiA IiB IiC I0A I0B I0C I1A I1B I1C S QC QB QA
\r
61 XXmux1 IiA I0A I1A S QA mux3-1
\r
62 XXmux2 IiB I0B I1B S QB mux3-1
\r
63 XXmux3 IiC I0C I1C S QC mux3-1
\r
66 .subckt alu A2 A1 A0 B2 B1 B0 S
\r
67 XXfa0 A0 C1 S0 _B0 0 full_adder
\r
68 XXfa1 A1 C2 S1 _B1 C1 full_adder
\r
69 XXfa2 A2 C3 S2 _B2 C2 full_adder
\r
70 XX1 S0 S1 S2 S C3 tsign4
\r
76 .subckt clock_gen FETCH EXECUTE
\r
77 VCLK EXECUTE 0 PULSE(-5 5 30u 1n 1n 30u 60u)
\r
78 Xinvert_clk EXECUTE FETCH sti
\r
81 .subckt dtflop-ms2 D CLK Q _Q
\r
82 XMaster D _CLK between NC_01 dtflop
\r
83 XSlave between CLK Q _Q dtflop
\r
84 XXstiCLK CLK _CLK sti
\r
92 .subckt swrom-guess ADDRESS D0 D1 D2
\r
93 XX1 $G_Vdd 0 $G_Vdd 0 $G_Vss 0 $G_Vss $G_Vss $G_Vdd ADDRESS D2 D1 D0 mux9-3
\r
97 Xinv IN NC_01 NC_02 OUT tinv
\r
101 Xinv IN OUT NC_01 NC_02 tinv
\r
105 XXinv IN NC_01 OUT NC_02 tinv
\r
108 .subckt tnor A B TNOR_Out
\r
111 MN1 NN A $G_Vss $G_Vss CD4007N
\r
112 MP2 NI A $G_Vdd $G_Vdd CD4007P
\r
113 MN2 NN B $G_Vss $G_Vss CD4007N
\r
114 MP1 NI B NP $G_Vdd CD4007P
\r
117 .subckt tg IN_OUT OUT_IN CONTROL
\r
118 M1 OUT_IN _C IN_OUT $G_Vdd CD4007P
\r
119 M2 IN_OUT C OUT_IN $G_Vss CD4007N
\r
120 M3 $G_Vdd CONTROL _C $G_Vdd CD4007P
\r
121 M4 _C CONTROL $G_Vss $G_Vss CD4007N
\r
122 M5 $G_Vdd _C C $G_Vdd CD4007P
\r
123 M6 C _C $G_Vss $G_Vss CD4007N
\r
126 .subckt tnand A B TNAND_Out
\r
127 RP NP TNAND_Out 12k
\r
128 RN TNAND_Out NN 12k
\r
129 MP1 NP B $G_Vdd $G_Vdd CD4007P
\r
130 MP2 NP A $G_Vdd $G_Vdd CD4007P
\r
131 MN2 NI B $G_Vss $G_Vss CD4007N
\r
132 MN1 NN A NI $G_Vss CD4007N
\r
135 .subckt full_adder X CO S Y CI
\r
136 XXdecodeX X CTRL_XC CTRL_XB CTRL_XA decoder1-3
\r
137 XXtgA1 $G_Vss A1 CTRL_XA tg
\r
138 XXtgC1 0 A1 CTRL_XC tg
\r
139 XXtgB1 $G_Vdd A1 CTRL_XB tg
\r
140 XXtgA2 0 A2 CTRL_XA tg
\r
141 XXtgC2 $G_Vdd A2 CTRL_XC tg
\r
142 XXtgB2 $G_Vss A2 CTRL_XB tg
\r
143 XXtgA3 0 A3 CTRL_XA tg
\r
144 XXtgC3 $G_Vss A3 CTRL_XC tg
\r
145 XXtgB3 $G_Vss A3 CTRL_XB tg
\r
146 XXtgA4 0 A4 CTRL_XA tg
\r
147 XXtgC4 $G_Vss A4 CTRL_XC tg
\r
148 XXtgB4 0 A4 CTRL_XB tg
\r
149 XXtgA5 $G_Vdd A5 CTRL_XA tg
\r
150 XXtgC5 0 A5 CTRL_XC tg
\r
151 XXtgB5 0 A5 CTRL_XB tg
\r
152 XXtgA6 $G_Vdd A6 CTRL_XA tg
\r
153 XXtgC6 0 A6 CTRL_XC tg
\r
154 XXtgB6 $G_Vdd A6 CTRL_XB tg
\r
155 XXtgA7 X CTRL_SA CTRL_YA tg
\r
156 XXtgC7 A1 CTRL_SA CTRL_YC tg
\r
157 XXtgB7 A2 CTRL_SA CTRL_YB tg
\r
158 XXtgA8 A1 CTRL_SB CTRL_YA tg
\r
159 XXtgC8 A2 CTRL_SB CTRL_YC tg
\r
160 XXtgB8 X CTRL_SB CTRL_YB tg
\r
161 XXtgA9 A2 CTRL_SC CTRL_YA tg
\r
162 XXtgC9 X CTRL_SC CTRL_YC tg
\r
163 XXtgB9 A1 CTRL_SC CTRL_YB tg
\r
164 XXtgA10 0 CTRL_C0A CTRL_YA tg
\r
165 XXtgC10 A3 CTRL_C0A CTRL_YC tg
\r
166 XXtgB10 A4 CTRL_C0A CTRL_YB tg
\r
167 XXtgA11 A5 CTRL_C0B CTRL_YA tg
\r
168 XXtgC11 A4 CTRL_C0B CTRL_YC tg
\r
169 XXtgB11 0 CTRL_C0B CTRL_YB tg
\r
170 XXtgA12 A6 CTRL_C0C CTRL_YA tg
\r
171 XXtgC12 0 CTRL_C0C CTRL_YC tg
\r
172 XXtgB12 A5 CTRL_C0C CTRL_YB tg
\r
173 XXdecodeY Y CTRL_YC CTRL_YB CTRL_YA decoder1-3
\r
174 XXtgA15 CTRL_SA S CTRL_CA tg
\r
175 XXtgC15 CTRL_SC S CTRL_CC tg
\r
176 XXtgB15 CTRL_SB S CTRL_CB tg
\r
177 XXtgA18 CTRL_C0A CO CTRL_CA tg
\r
178 XXtgC18 CTRL_C0C CO CTRL_CC tg
\r
179 XXtgB18 CTRL_C0B CO CTRL_CB tg
\r
180 XX1 CI CTRL_CA CTRL_CB CTRL_CC decoder1-3
\r
183 .subckt tsign4 I0 I1 I2 SIGN I3
\r
184 XXcheckI2 $G_Vss N001 $G_Vdd I2 N002 mux3-1
\r
185 XXcheckI3 $G_Vss N002 $G_Vdd I3 SIGN mux3-1
\r
186 XXcheckI1 $G_Vss I0 $G_Vdd I1 N001 mux3-1
\r
189 .subckt dtflop D CLK Q _Q
\r
190 XXlatch Q_storage _Q Q tnand
\r
191 X_Xlatch Q _Q_storage _Q tnand
\r
192 XXgatetop D CLK Q_storage tnand
\r
193 XXgatebot CLK _D _Q_storage tnand
\r
197 .subckt tinv Vin PTI_Out STI_Out NTI_Out
\r
198 RP PTI_Out STI_Out 12k
\r
199 RN STI_Out NTI_Out 12k
\r
200 MN NTI_Out Vin $G_Vss $G_Vss CD4007N
\r
201 MP PTI_Out Vin $G_Vdd $G_Vdd CD4007P
\r
206 .lib C:\Program Files\LTC\SwCADIII\lib\cmp\standard.mos
\r
208 * IN "Register"\n(User input)
\r
209 * OUT "Register"\n(Cannot read from)
\r
211 * IN "Register"\n(User input)
\r
212 * OUT "Register"\n(Cannot read from)
\r
221 * 3-TRIT TRINARY COMPUTER ARCHITECTURE
\r