๐Ÿ“ฆ furkan / fakequidditch

๐Ÿ“„ alt_u_div_0te.tdf ยท 142 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142--alt_u_div DEVICE_FAMILY="Cyclone V" LPM_PIPELINE=0 MAXIMIZE_SPEED=5 SKIP_BITS=0 WIDTH_D=6 WIDTH_N=8 WIDTH_Q=8 WIDTH_R=6 denominator numerator quotient remainder
--VERSION_BEGIN 13.1 cbx_cycloneii 2013:10:23:18:05:48:SJ cbx_lpm_abs 2013:10:23:18:05:48:SJ cbx_lpm_add_sub 2013:10:23:18:05:48:SJ cbx_lpm_divide 2013:10:23:18:05:48:SJ cbx_mgl 2013:10:23:18:06:54:SJ cbx_stratix 2013:10:23:18:05:48:SJ cbx_stratixii 2013:10:23:18:05:48:SJ cbx_util_mgl 2013:10:23:18:05:48:SJ  VERSION_END


-- Copyright (C) 1991-2013 Altera Corporation
--  Your use of Altera 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 Altera Program License 
--  Subscription Agreement, Altera MegaCore Function License 
--  Agreement, or other applicable license agreement, including, 
--  without limitation, that your use is for the sole purpose of 
--  programming logic devices manufactured by Altera and sold by 
--  Altera or its authorized distributors.  Please refer to the 
--  applicable agreement for further details.



--synthesis_resources = lut 43 
SUBDESIGN alt_u_div_0te
( 
	denominator[5..0]	:	input;
	numerator[7..0]	:	input;
	quotient[7..0]	:	output;
	remainder[5..0]	:	output;
) 
VARIABLE
	add_sub_0_result_int[1..0]	:	WIRE;
	add_sub_0_cout	:	WIRE;
	add_sub_0_dataa[0..0]	:	WIRE;
	add_sub_0_datab[0..0]	:	WIRE;
	add_sub_0_result[0..0]	:	WIRE;
	add_sub_1_result_int[2..0]	:	WIRE;
	add_sub_1_cout	:	WIRE;
	add_sub_1_dataa[1..0]	:	WIRE;
	add_sub_1_datab[1..0]	:	WIRE;
	add_sub_1_result[1..0]	:	WIRE;
	add_sub_2_result_int[3..0]	:	WIRE;
	add_sub_2_cout	:	WIRE;
	add_sub_2_dataa[2..0]	:	WIRE;
	add_sub_2_datab[2..0]	:	WIRE;
	add_sub_2_result[2..0]	:	WIRE;
	add_sub_3_result_int[4..0]	:	WIRE;
	add_sub_3_cout	:	WIRE;
	add_sub_3_dataa[3..0]	:	WIRE;
	add_sub_3_datab[3..0]	:	WIRE;
	add_sub_3_result[3..0]	:	WIRE;
	add_sub_4_result_int[5..0]	:	WIRE;
	add_sub_4_cout	:	WIRE;
	add_sub_4_dataa[4..0]	:	WIRE;
	add_sub_4_datab[4..0]	:	WIRE;
	add_sub_4_result[4..0]	:	WIRE;
	add_sub_5_result_int[6..0]	:	WIRE;
	add_sub_5_cout	:	WIRE;
	add_sub_5_dataa[5..0]	:	WIRE;
	add_sub_5_datab[5..0]	:	WIRE;
	add_sub_5_result[5..0]	:	WIRE;
	add_sub_6_result_int[7..0]	:	WIRE;
	add_sub_6_cout	:	WIRE;
	add_sub_6_dataa[6..0]	:	WIRE;
	add_sub_6_datab[6..0]	:	WIRE;
	add_sub_6_result[6..0]	:	WIRE;
	add_sub_7_result_int[7..0]	:	WIRE;
	add_sub_7_cout	:	WIRE;
	add_sub_7_dataa[6..0]	:	WIRE;
	add_sub_7_datab[6..0]	:	WIRE;
	add_sub_7_result[6..0]	:	WIRE;
	DenominatorIn[62..0]	: WIRE;
	DenominatorIn_tmp[62..0]	: WIRE;
	gnd_wire	: WIRE;
	nose[71..0]	: WIRE;
	NumeratorIn[71..0]	: WIRE;
	NumeratorIn_tmp[71..0]	: WIRE;
	prestg[55..0]	: WIRE;
	quotient_tmp[7..0]	: WIRE;
	sel[53..0]	: WIRE;
	selnose[71..0]	: WIRE;
	StageIn[62..0]	: WIRE;
	StageIn_tmp[62..0]	: WIRE;
	StageOut[55..0]	: WIRE;

BEGIN 
	add_sub_0_result_int[] = (0, add_sub_0_dataa[]) - (0, add_sub_0_datab[]);
	add_sub_0_result[] = add_sub_0_result_int[0..0];
	add_sub_0_cout = !add_sub_0_result_int[1];
	add_sub_0_dataa[] = NumeratorIn[7..7];
	add_sub_0_datab[] = DenominatorIn[0..0];
	add_sub_1_result_int[] = (0, add_sub_1_dataa[]) - (0, add_sub_1_datab[]);
	add_sub_1_result[] = add_sub_1_result_int[1..0];
	add_sub_1_cout = !add_sub_1_result_int[2];
	add_sub_1_dataa[] = ( StageIn[7..7], NumeratorIn[14..14]);
	add_sub_1_datab[] = DenominatorIn[8..7];
	add_sub_2_result_int[] = (0, add_sub_2_dataa[]) - (0, add_sub_2_datab[]);
	add_sub_2_result[] = add_sub_2_result_int[2..0];
	add_sub_2_cout = !add_sub_2_result_int[3];
	add_sub_2_dataa[] = ( StageIn[15..14], NumeratorIn[21..21]);
	add_sub_2_datab[] = DenominatorIn[16..14];
	add_sub_3_result_int[] = (0, add_sub_3_dataa[]) - (0, add_sub_3_datab[]);
	add_sub_3_result[] = add_sub_3_result_int[3..0];
	add_sub_3_cout = !add_sub_3_result_int[4];
	add_sub_3_dataa[] = ( StageIn[23..21], NumeratorIn[28..28]);
	add_sub_3_datab[] = DenominatorIn[24..21];
	add_sub_4_result_int[] = (0, add_sub_4_dataa[]) - (0, add_sub_4_datab[]);
	add_sub_4_result[] = add_sub_4_result_int[4..0];
	add_sub_4_cout = !add_sub_4_result_int[5];
	add_sub_4_dataa[] = ( StageIn[31..28], NumeratorIn[35..35]);
	add_sub_4_datab[] = DenominatorIn[32..28];
	add_sub_5_result_int[] = (0, add_sub_5_dataa[]) - (0, add_sub_5_datab[]);
	add_sub_5_result[] = add_sub_5_result_int[5..0];
	add_sub_5_cout = !add_sub_5_result_int[6];
	add_sub_5_dataa[] = ( StageIn[39..35], NumeratorIn[42..42]);
	add_sub_5_datab[] = DenominatorIn[40..35];
	add_sub_6_result_int[] = (0, add_sub_6_dataa[]) - (0, add_sub_6_datab[]);
	add_sub_6_result[] = add_sub_6_result_int[6..0];
	add_sub_6_cout = !add_sub_6_result_int[7];
	add_sub_6_dataa[] = ( StageIn[47..42], NumeratorIn[49..49]);
	add_sub_6_datab[] = DenominatorIn[48..42];
	add_sub_7_result_int[] = (0, add_sub_7_dataa[]) - (0, add_sub_7_datab[]);
	add_sub_7_result[] = add_sub_7_result_int[6..0];
	add_sub_7_cout = !add_sub_7_result_int[7];
	add_sub_7_dataa[] = ( StageIn[54..49], NumeratorIn[56..56]);
	add_sub_7_datab[] = DenominatorIn[55..49];
	DenominatorIn[] = DenominatorIn_tmp[];
	DenominatorIn_tmp[] = ( DenominatorIn[55..0], ( gnd_wire, denominator[]));
	gnd_wire = B"0";
	nose[] = ( B"00000000", add_sub_7_cout, B"00000000", add_sub_6_cout, B"00000000", add_sub_5_cout, B"00000000", add_sub_4_cout, B"00000000", add_sub_3_cout, B"00000000", add_sub_2_cout, B"00000000", add_sub_1_cout, B"00000000", add_sub_0_cout);
	NumeratorIn[] = NumeratorIn_tmp[];
	NumeratorIn_tmp[] = ( NumeratorIn[63..0], numerator[]);
	prestg[] = ( add_sub_7_result[], add_sub_6_result[], GND, add_sub_5_result[], B"00", add_sub_4_result[], B"000", add_sub_3_result[], B"0000", add_sub_2_result[], B"00000", add_sub_1_result[], B"000000", add_sub_0_result[]);
	quotient[] = quotient_tmp[];
	quotient_tmp[] = ( (! selnose[0..0]), (! selnose[9..9]), (! selnose[18..18]), (! selnose[27..27]), (! selnose[36..36]), (! selnose[45..45]), (! selnose[54..54]), (! selnose[63..63]));
	remainder[5..0] = StageIn[61..56];
	sel[] = ( gnd_wire, (sel[53..53] # DenominatorIn[61..61]), (sel[52..52] # DenominatorIn[60..60]), (sel[51..51] # DenominatorIn[59..59]), (sel[50..50] # DenominatorIn[58..58]), (sel[49..49] # DenominatorIn[57..57]), gnd_wire, (sel[47..47] # DenominatorIn[54..54]), (sel[46..46] # DenominatorIn[53..53]), (sel[45..45] # DenominatorIn[52..52]), (sel[44..44] # DenominatorIn[51..51]), (sel[43..43] # DenominatorIn[50..50]), gnd_wire, (sel[41..41] # DenominatorIn[47..47]), (sel[40..40] # DenominatorIn[46..46]), (sel[39..39] # DenominatorIn[45..45]), (sel[38..38] # DenominatorIn[44..44]), (sel[37..37] # DenominatorIn[43..43]), gnd_wire, (sel[35..35] # DenominatorIn[40..40]), (sel[34..34] # DenominatorIn[39..39]), (sel[33..33] # DenominatorIn[38..38]), (sel[32..32] # DenominatorIn[37..37]), (sel[31..31] # DenominatorIn[36..36]), gnd_wire, (sel[29..29] # DenominatorIn[33..33]), (sel[28..28] # DenominatorIn[32..32]), (sel[27..27] # DenominatorIn[31..31]), (sel[26..26] # DenominatorIn[30..30]), (sel[25..25] # DenominatorIn[29..29]), gnd_wire, (sel[23..23] # DenominatorIn[26..26]), (sel[22..22] # DenominatorIn[25..25]), (sel[21..21] # DenominatorIn[24..24]), (sel[20..20] # DenominatorIn[23..23]), (sel[19..19] # DenominatorIn[22..22]), gnd_wire, (sel[17..17] # DenominatorIn[19..19]), (sel[16..16] # DenominatorIn[18..18]), (sel[15..15] # DenominatorIn[17..17]), (sel[14..14] # DenominatorIn[16..16]), (sel[13..13] # DenominatorIn[15..15]), gnd_wire, (sel[11..11] # DenominatorIn[12..12]), (sel[10..10] # DenominatorIn[11..11]), (sel[9..9] # DenominatorIn[10..10]), (sel[8..8] # DenominatorIn[9..9]), (sel[7..7] # DenominatorIn[8..8]), gnd_wire, (sel[5..5] # DenominatorIn[5..5]), (sel[4..4] # DenominatorIn[4..4]), (sel[3..3] # DenominatorIn[3..3]), (sel[2..2] # DenominatorIn[2..2]), (sel[1..1] # DenominatorIn[1..1]));
	selnose[] = ( (! nose[71..71]), (! nose[70..70]), ((! nose[69..69]) # sel[53..53]), ((! nose[68..68]) # sel[52..52]), ((! nose[67..67]) # sel[51..51]), ((! nose[66..66]) # sel[50..50]), ((! nose[65..65]) # sel[49..49]), ((! nose[64..64]) # sel[48..48]), (! nose[63..63]), (! nose[62..62]), ((! nose[61..61]) # sel[47..47]), ((! nose[60..60]) # sel[46..46]), ((! nose[59..59]) # sel[45..45]), ((! nose[58..58]) # sel[44..44]), ((! nose[57..57]) # sel[43..43]), ((! nose[56..56]) # sel[42..42]), (! nose[55..55]), (! nose[54..54]), ((! nose[53..53]) # sel[41..41]), ((! nose[52..52]) # sel[40..40]), ((! nose[51..51]) # sel[39..39]), ((! nose[50..50]) # sel[38..38]), ((! nose[49..49]) # sel[37..37]), ((! nose[48..48]) # sel[36..36]), (! nose[47..47]), (! nose[46..46]), ((! nose[45..45]) # sel[35..35]), ((! nose[44..44]) # sel[34..34]), ((! nose[43..43]) # sel[33..33]), ((! nose[42..42]) # sel[32..32]), ((! nose[41..41]) # sel[31..31]), ((! nose[40..40]) # sel[30..30]), (! nose[39..39]), (! nose[38..38]), ((! nose[37..37]) # sel[29..29]), ((! nose[36..36]) # sel[28..28]), ((! nose[35..35]) # sel[27..27]), ((! nose[34..34]) # sel[26..26]), ((! nose[33..33]) # sel[25..25]), ((! nose[32..32]) # sel[24..24]), (! nose[31..31]), (! nose[30..30]), ((! nose[29..29]) # sel[23..23]), ((! nose[28..28]) # sel[22..22]), ((! nose[27..27]) # sel[21..21]), ((! nose[26..26]) # sel[20..20]), ((! nose[25..25]) # sel[19..19]), ((! nose[24..24]) # sel[18..18]), (! nose[23..23]), (! nose[22..22]), ((! nose[21..21]) # sel[17..17]), ((! nose[20..20]) # sel[16..16]), ((! nose[19..19]) # sel[15..15]), ((! nose[18..18]) # sel[14..14]), ((! nose[17..17]) # sel[13..13]), ((! nose[16..16]) # sel[12..12]), (! nose[15..15]), (! nose[14..14]), ((! nose[13..13]) # sel[11..11]), ((! nose[12..12]) # sel[10..10]), ((! nose[11..11]) # sel[9..9]), ((! nose[10..10]) # sel[8..8]), ((! nose[9..9]) # sel[7..7]), ((! nose[8..8]) # sel[6..6]), (! nose[7..7]), (! nose[6..6]), ((! nose[5..5]) # sel[5..5]), ((! nose[4..4]) # sel[4..4]), ((! nose[3..3]) # sel[3..3]), ((! nose[2..2]) # sel[2..2]), ((! nose[1..1]) # sel[1..1]), ((! nose[0..0]) # sel[0..0]));
	StageIn[] = StageIn_tmp[];
	StageIn_tmp[] = ( StageOut[55..0], B"0000000");
	StageOut[] = ( ((( StageIn[54..49], NumeratorIn[56..56]) & selnose[63..63]) # (prestg[55..49] & (! selnose[63..63]))), ((( StageIn[47..42], NumeratorIn[49..49]) & selnose[54..54]) # (prestg[48..42] & (! selnose[54..54]))), ((( StageIn[40..35], NumeratorIn[42..42]) & selnose[45..45]) # (prestg[41..35] & (! selnose[45..45]))), ((( StageIn[33..28], NumeratorIn[35..35]) & selnose[36..36]) # (prestg[34..28] & (! selnose[36..36]))), ((( StageIn[26..21], NumeratorIn[28..28]) & selnose[27..27]) # (prestg[27..21] & (! selnose[27..27]))), ((( StageIn[19..14], NumeratorIn[21..21]) & selnose[18..18]) # (prestg[20..14] & (! selnose[18..18]))), ((( StageIn[12..7], NumeratorIn[14..14]) & selnose[9..9]) # (prestg[13..7] & (! selnose[9..9]))), ((( StageIn[5..0], NumeratorIn[7..7]) & selnose[0..0]) # (prestg[6..0] & (! selnose[0..0]))));
END;
--VALID FILE