--lpm_add_sub CARRY_CHAIN="MANUAL" CARRY_CHAIN_LENGTH=48 DEVICE_FAMILY="MAX7000S" LPM_DIRECTION="ADD" LPM_REPRESENTATION="UNSIGNED" LPM_WIDTH=58 ONE_INPUT_IS_CONSTANT="YES" cin dataa datab result
--VERSION_BEGIN 13.0 cbx_cycloneii 2013:06:12:18:04:00:SJ cbx_lpm_add_sub 2013:06:12:18:04:00:SJ cbx_mgl 2013:06:12:18:04:42:SJ cbx_stratix 2013:06:12:18:04:00:SJ cbx_stratixii 2013:06:12:18:04:00: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.


FUNCTION carry_sum (cin, sin)
RETURNS ( cout, sout);

--synthesis_resources = lut 61 
SUBDESIGN add_sub_gph
( 
	cin	:	input;
	dataa[57..0]	:	input;
	datab[57..0]	:	input;
	result[57..0]	:	output;
) 
VARIABLE 
	add_sub_cella[57..0] : carry_sum;
	cs1 : carry_sum;
	cs2 : carry_sum;
	external_cin_cell : carry_sum;
	datab_node[57..0]	: WIRE;
	main_cin_wire	: WIRE;

BEGIN 
	add_sub_cella[].cin = ( ((dataa[57..57] & datab_node[57..57]) # ((dataa[57..57] # datab_node[57..57]) & add_sub_cella[56].cout)), ((dataa[56..56] & datab_node[56..56]) # ((dataa[56..56] # datab_node[56..56]) & add_sub_cella[55].cout)), ((dataa[55..55] & datab_node[55..55]) # ((dataa[55..55] # datab_node[55..55]) & add_sub_cella[54].cout)), ((dataa[54..54] & datab_node[54..54]) # ((dataa[54..54] # datab_node[54..54]) & add_sub_cella[53].cout)), ((dataa[53..53] & datab_node[53..53]) # ((dataa[53..53] # datab_node[53..53]) & add_sub_cella[52].cout)), ((dataa[52..52] & datab_node[52..52]) # ((dataa[52..52] # datab_node[52..52]) & add_sub_cella[51].cout)), ((dataa[51..51] & datab_node[51..51]) # ((dataa[51..51] # datab_node[51..51]) & add_sub_cella[50].cout)), ((dataa[50..50] & datab_node[50..50]) # ((dataa[50..50] # datab_node[50..50]) & add_sub_cella[49].cout)), ((dataa[49..49] & datab_node[49..49]) # ((dataa[49..49] # datab_node[49..49]) & add_sub_cella[48].cout)), ((dataa[48..48] & datab_node[48..48]) # ((dataa[48..48] # datab_node[48..48]) & cs2.cout)), ((dataa[47..47] & datab_node[47..47]) # ((dataa[47..47] # datab_node[47..47]) & add_sub_cella[46].cout)), ((dataa[46..46] & datab_node[46..46]) # ((dataa[46..46] # datab_node[46..46]) & add_sub_cella[45].cout)), ((dataa[45..45] & datab_node[45..45]) # ((dataa[45..45] # datab_node[45..45]) & add_sub_cella[44].cout)), ((dataa[44..44] & datab_node[44..44]) # ((dataa[44..44] # datab_node[44..44]) & add_sub_cella[43].cout)), ((dataa[43..43] & datab_node[43..43]) # ((dataa[43..43] # datab_node[43..43]) & add_sub_cella[42].cout)), ((dataa[42..42] & datab_node[42..42]) # ((dataa[42..42] # datab_node[42..42]) & add_sub_cella[41].cout)), ((dataa[41..41] & datab_node[41..41]) # ((dataa[41..41] # datab_node[41..41]) & add_sub_cella[40].cout)), ((dataa[40..40] & datab_node[40..40]) # ((dataa[40..40] # datab_node[40..40]) & add_sub_cella[39].cout)), ((dataa[39..39] & datab_node[39..39]) # ((dataa[39..39] # datab_node[39..39]) & add_sub_cella[38].cout)), ((dataa[38..38] & datab_node[38..38]) # ((dataa[38..38] # datab_node[38..38]) & add_sub_cella[37].cout)), ((dataa[37..37] & datab_node[37..37]) # ((dataa[37..37] # datab_node[37..37]) & add_sub_cella[36].cout)), ((dataa[36..36] & datab_node[36..36]) # ((dataa[36..36] # datab_node[36..36]) & add_sub_cella[35].cout)), ((dataa[35..35] & datab_node[35..35]) # ((dataa[35..35] # datab_node[35..35]) & add_sub_cella[34].cout)), ((dataa[34..34] & datab_node[34..34]) # ((dataa[34..34] # datab_node[34..34]) & add_sub_cella[33].cout)), ((dataa[33..33] & datab_node[33..33]) # ((dataa[33..33] # datab_node[33..33]) & add_sub_cella[32].cout)), ((dataa[32..32] & datab_node[32..32]) # ((dataa[32..32] # datab_node[32..32]) & add_sub_cella[31].cout)), ((dataa[31..31] & datab_node[31..31]) # ((dataa[31..31] # datab_node[31..31]) & add_sub_cella[30].cout)), ((dataa[30..30] & datab_node[30..30]) # ((dataa[30..30] # datab_node[30..30]) & add_sub_cella[29].cout)), ((dataa[29..29] & datab_node[29..29]) # ((dataa[29..29] # datab_node[29..29]) & add_sub_cella[28].cout)), ((dataa[28..28] & datab_node[28..28]) # ((dataa[28..28] # datab_node[28..28]) & add_sub_cella[27].cout)), ((dataa[27..27] & datab_node[27..27]) # ((dataa[27..27] # datab_node[27..27]) & add_sub_cella[26].cout)), ((dataa[26..26] & datab_node[26..26]) # ((dataa[26..26] # datab_node[26..26]) & add_sub_cella[25].cout)), ((dataa[25..25] & datab_node[25..25]) # ((dataa[25..25] # datab_node[25..25]) & add_sub_cella[24].cout)), ((dataa[24..24] & datab_node[24..24]) # ((dataa[24..24] # datab_node[24..24]) & add_sub_cella[23].cout)), ((dataa[23..23] & datab_node[23..23]) # ((dataa[23..23] # datab_node[23..23]) & add_sub_cella[22].cout)), ((dataa[22..22] & datab_node[22..22]) # ((dataa[22..22] # datab_node[22..22]) & add_sub_cella[21].cout)), ((dataa[21..21] & datab_node[21..21]) # ((dataa[21..21] # datab_node[21..21]) & add_sub_cella[20].cout)), ((dataa[20..20] & datab_node[20..20]) # ((dataa[20..20] # datab_node[20..20]) & add_sub_cella[19].cout)), ((dataa[19..19] & datab_node[19..19]) # ((dataa[19..19] # datab_node[19..19]) & add_sub_cella[18].cout)), ((dataa[18..18] & datab_node[18..18]) # ((dataa[18..18] # datab_node[18..18]) & add_sub_cella[17].cout)), ((dataa[17..17] & datab_node[17..17]) # ((dataa[17..17] # datab_node[17..17]) & add_sub_cella[16].cout)), ((dataa[16..16] & datab_node[16..16]) # ((dataa[16..16] # datab_node[16..16]) & add_sub_cella[15].cout)), ((dataa[15..15] & datab_node[15..15]) # ((dataa[15..15] # datab_node[15..15]) & add_sub_cella[14].cout)), ((dataa[14..14] & datab_node[14..14]) # ((dataa[14..14] # datab_node[14..14]) & add_sub_cella[13].cout)), ((dataa[13..13] & datab_node[13..13]) # ((dataa[13..13] # datab_node[13..13]) & add_sub_cella[12].cout)), ((dataa[12..12] & datab_node[12..12]) # ((dataa[12..12] # datab_node[12..12]) & add_sub_cella[11].cout)), ((dataa[11..11] & datab_node[11..11]) # ((dataa[11..11] # datab_node[11..11]) & add_sub_cella[10].cout)), ((dataa[10..10] & datab_node[10..10]) # ((dataa[10..10] # datab_node[10..10]) & add_sub_cella[9].cout)), ((dataa[9..9] & datab_node[9..9]) # ((dataa[9..9] # datab_node[9..9]) & add_sub_cella[8].cout)), ((dataa[8..8] & datab_node[8..8]) # ((dataa[8..8] # datab_node[8..8]) & add_sub_cella[7].cout)), ((dataa[7..7] & datab_node[7..7]) # ((dataa[7..7] # datab_node[7..7]) & add_sub_cella[6].cout)), ((dataa[6..6] & datab_node[6..6]) # ((dataa[6..6] # datab_node[6..6]) & add_sub_cella[5].cout)), ((dataa[5..5] & datab_node[5..5]) # ((dataa[5..5] # datab_node[5..5]) & add_sub_cella[4].cout)), ((dataa[4..4] & datab_node[4..4]) # ((dataa[4..4] # datab_node[4..4]) & add_sub_cella[3].cout)), ((dataa[3..3] & datab_node[3..3]) # ((dataa[3..3] # datab_node[3..3]) & add_sub_cella[2].cout)), ((dataa[2..2] & datab_node[2..2]) # ((dataa[2..2] # datab_node[2..2]) & add_sub_cella[1].cout)), ((dataa[1..1] & datab_node[1..1]) # ((dataa[1..1] # datab_node[1..1]) & add_sub_cella[0].cout)), ((dataa[0..0] & datab_node[0..0]) # ((dataa[0..0] # datab_node[0..0]) & main_cin_wire)));
	add_sub_cella[].sin = ( ((dataa[57..57] $ datab_node[57..57]) $ add_sub_cella[56].cout), ((dataa[56..56] $ datab_node[56..56]) $ add_sub_cella[55].cout), ((dataa[55..55] $ datab_node[55..55]) $ add_sub_cella[54].cout), ((dataa[54..54] $ datab_node[54..54]) $ add_sub_cella[53].cout), ((dataa[53..53] $ datab_node[53..53]) $ add_sub_cella[52].cout), ((dataa[52..52] $ datab_node[52..52]) $ add_sub_cella[51].cout), ((dataa[51..51] $ datab_node[51..51]) $ add_sub_cella[50].cout), ((dataa[50..50] $ datab_node[50..50]) $ add_sub_cella[49].cout), ((dataa[49..49] $ datab_node[49..49]) $ add_sub_cella[48].cout), ((dataa[48..48] $ datab_node[48..48]) $ cs2.cout), ((dataa[47..47] $ datab_node[47..47]) $ add_sub_cella[46].cout), ((dataa[46..46] $ datab_node[46..46]) $ add_sub_cella[45].cout), ((dataa[45..45] $ datab_node[45..45]) $ add_sub_cella[44].cout), ((dataa[44..44] $ datab_node[44..44]) $ add_sub_cella[43].cout), ((dataa[43..43] $ datab_node[43..43]) $ add_sub_cella[42].cout), ((dataa[42..42] $ datab_node[42..42]) $ add_sub_cella[41].cout), ((dataa[41..41] $ datab_node[41..41]) $ add_sub_cella[40].cout), ((dataa[40..40] $ datab_node[40..40]) $ add_sub_cella[39].cout), ((dataa[39..39] $ datab_node[39..39]) $ add_sub_cella[38].cout), ((dataa[38..38] $ datab_node[38..38]) $ add_sub_cella[37].cout), ((dataa[37..37] $ datab_node[37..37]) $ add_sub_cella[36].cout), ((dataa[36..36] $ datab_node[36..36]) $ add_sub_cella[35].cout), ((dataa[35..35] $ datab_node[35..35]) $ add_sub_cella[34].cout), ((dataa[34..34] $ datab_node[34..34]) $ add_sub_cella[33].cout), ((dataa[33..33] $ datab_node[33..33]) $ add_sub_cella[32].cout), ((dataa[32..32] $ datab_node[32..32]) $ add_sub_cella[31].cout), ((dataa[31..31] $ datab_node[31..31]) $ add_sub_cella[30].cout), ((dataa[30..30] $ datab_node[30..30]) $ add_sub_cella[29].cout), ((dataa[29..29] $ datab_node[29..29]) $ add_sub_cella[28].cout), ((dataa[28..28] $ datab_node[28..28]) $ add_sub_cella[27].cout), ((dataa[27..27] $ datab_node[27..27]) $ add_sub_cella[26].cout), ((dataa[26..26] $ datab_node[26..26]) $ add_sub_cella[25].cout), ((dataa[25..25] $ datab_node[25..25]) $ add_sub_cella[24].cout), ((dataa[24..24] $ datab_node[24..24]) $ add_sub_cella[23].cout), ((dataa[23..23] $ datab_node[23..23]) $ add_sub_cella[22].cout), ((dataa[22..22] $ datab_node[22..22]) $ add_sub_cella[21].cout), ((dataa[21..21] $ datab_node[21..21]) $ add_sub_cella[20].cout), ((dataa[20..20] $ datab_node[20..20]) $ add_sub_cella[19].cout), ((dataa[19..19] $ datab_node[19..19]) $ add_sub_cella[18].cout), ((dataa[18..18] $ datab_node[18..18]) $ add_sub_cella[17].cout), ((dataa[17..17] $ datab_node[17..17]) $ add_sub_cella[16].cout), ((dataa[16..16] $ datab_node[16..16]) $ add_sub_cella[15].cout), ((dataa[15..15] $ datab_node[15..15]) $ add_sub_cella[14].cout), ((dataa[14..14] $ datab_node[14..14]) $ add_sub_cella[13].cout), ((dataa[13..13] $ datab_node[13..13]) $ add_sub_cella[12].cout), ((dataa[12..12] $ datab_node[12..12]) $ add_sub_cella[11].cout), ((dataa[11..11] $ datab_node[11..11]) $ add_sub_cella[10].cout), ((dataa[10..10] $ datab_node[10..10]) $ add_sub_cella[9].cout), ((dataa[9..9] $ datab_node[9..9]) $ add_sub_cella[8].cout), ((dataa[8..8] $ datab_node[8..8]) $ add_sub_cella[7].cout), ((dataa[7..7] $ datab_node[7..7]) $ add_sub_cella[6].cout), ((dataa[6..6] $ datab_node[6..6]) $ add_sub_cella[5].cout), ((dataa[5..5] $ datab_node[5..5]) $ add_sub_cella[4].cout), ((dataa[4..4] $ datab_node[4..4]) $ add_sub_cella[3].cout), ((dataa[3..3] $ datab_node[3..3]) $ add_sub_cella[2].cout), ((dataa[2..2] $ datab_node[2..2]) $ add_sub_cella[1].cout), ((dataa[1..1] $ datab_node[1..1]) $ add_sub_cella[0].cout), ((dataa[0..0] $ datab_node[0..0]) $ main_cin_wire));
	cs1.cin = B"0";
	cs1.sin = add_sub_cella[47].cout;
	cs2.cin = cs1.sout;
	cs2.sin = B"0";
	external_cin_cell.cin = cin;
	external_cin_cell.sin = B"0";
	datab_node[] = datab[];
	main_cin_wire = external_cin_cell.cout;
	result[] = add_sub_cella[].sout;
END;
--VALID FILE
