text:
Carthage

Carthage was an ancient city in Northern Africa, on the eastern side of the Lake of Tunis in what is now Tunisia. Carthage was one of the most important trading hubs of the Ancient Mediterranean and one of the most affluent cities of the classical world. It became the capital city of the civilisation of Ancient Carthage and later Roman Carthage.

The city developed from a Phoenician colony into the capital of a Punic empire which dominated large parts of the Southwest Mediterranean during the first millennium BC. The legendary Queen Elissa, Alyssa or Dido, originally from Tyre, is regarded as the founder of the city, though her historicity has been questioned. In the myth, Dido asked for land from a local tribe, which told her that she could get as much land as an oxhide could cover. She cut the oxhide into strips and laid out the perimeters of the new city. As Carthage prospered at home, the polity sent colonists abroad as well as magistrates to rule the colonies.

The ancient city was destroyed in the nearly three year siege of Carthage by the Roman Republic during the Third Punic War in 146 BC. It was re-developed a century later as Roman Carthage, which became the major city of the Roman Empire in the province of Africa. The question of Carthaginian decline and demise has remained a subject of literary, political, artistic, and philosophical debates in both ancient and modern histories.

Late antique and medieval Carthage continued to play an important cultural and economic role in the Byzantine period. The city was sacked and destroyed by Umayyad forces after the Battle of Carthage in 698 to prevent it from being reconquered by the Byzantine Empire. It remained occupied during the Muslim period and was used as a fort by the Muslims until the Hafsid period when it was taken by the Crusaders with its inhabitants massacred during the Eighth Crusade. The Hafsids decided to destroy its defenses so it could not be used as a base by a hostile power again. It also continued to function as an episcopal see.

The regional power shifted to Kairouan and the Medina of Tunis in the medieval period, until the early 20th century, when it began to develop into a coastal suburb of Tunis, incorporated as Carthage municipality in 1919. The archaeological site was first surveyed in 1830, by Danish consul Christian Tuxen Falbe. Excavations were performed in the second half of the 19th century by Charles Ernest Beulé and by Alfred Louis Delattre. The Carthage National Museum was founded in 1875 by Cardinal Charles Lavigerie. Excavations performed by French archaeologists in the 1920s first attracted an extraordinary amount of attention because of the evidence they produced for child sacrifice. There has been considerable disagreement among scholars concerning whether child sacrifice was practiced by ancient Carthage. The open-air Carthage Paleo-Christian Museum has exhibits excavated under the auspices of UNESCO from 1975 to 1984. The site of the ruins is a UNESCO World Heritage Site.

Etymology
The name Carthage is the Early Modern anglicisation of Middle French Carthage, from Latin Carthāgō and Karthāgō (cf. Greek  (Καρχηδών) and Etruscan *Carθaza) from the Punic qrt-ḥdšt  "new city", implying it was a "new Tyre". The Latin adjective pūnicus, meaning "Phoenician", is reflected in English in some borrowings from Latin – notably the Punic Wars and the Punic language.

The Modern Standard Arabic form  (قرطاج) is an adoption of French Carthage, replacing an older local toponym reported as Cartagenna that directly continued the Latin name.

Overview
Carthage was built on a promontory with sea inlets to the north and the south. The city's location made it master of the Mediterranean's maritime trade. All ships crossing the sea had to pass between Sicily and the coast of Tunisia, where Carthage was built, affording it great power and influence. Two large, artificial harbors were built within the city, one for harboring the city's prodigious navy of 220 warships and the other for mercantile trade. A walled tower overlooked both harbors. The city had massive walls, 23 mi long, which was longer than the walls of comparable cities. Most of the walls were on the shore and so could be less impressive, as Carthaginian control of the sea made attack from that direction difficult. The 2.5 to 3 mi of wall on the isthmus to the west were truly massive and were never penetrated.

Carthage was one of the largest cities of the Hellenistic period and was among the largest cities in preindustrial history. Whereas by AD 14, Rome had at least 750,000 inhabitants and in the following century may have reached 1 million, the cities of Alexandria and Antioch numbered only a few hundred thousand or less. According to the history of Herodian, Carthage rivaled Alexandria for second place in the Roman empire.

Layout
The Punic Carthage was divided into four equally sized residential areas with the same layout. The Punic had religious areas, market places, council house, towers, a theater, and a huge necropolis; roughly in the middle of the city stood a high citadel called the Byrsa. Surrounding Carthage were walls "of great strength" said in places to rise above 13 m, being nearly 10 m thick, according to ancient authors. To the west, three parallel walls were built. The walls altogether ran for about 33 km to encircle the city. The heights of the Byrsa were additionally fortified; this area being the last to succumb to the Romans in 146 BC. Originally the Romans had landed their army on the strip of land extending southward from the city.

Outside the city walls of Carthage is the Chora or farm lands of Carthage. Chora encompassed a limited area: the north coastal tell, the lower Bagradas river valley (inland from Utica), Cape Bon, and the adjacent sahel on the east coast. Punic culture here achieved the introduction of agricultural sciences first developed for lands of the eastern Mediterranean, and their adaptation to local African conditions.

The urban landscape of Carthage is known in part from ancient authors, augmented by modern digs and surveys conducted by archeologists. The "first urban nucleus" dating to the seventh century, in area about 10 ha, was apparently located on low-lying lands along the coast (north of the later harbors). As confirmed by archaeological excavations, Carthage was a "creation ex nihilo", built on 'virgin' land, and situated at what was then the end of a peninsula. Here among "mud brick walls and beaten clay floors" (recently uncovered) were also found extensive cemeteries, which yielded evocative grave goods like clay masks. "Thanks to this burial archaeology we know more about archaic Carthage than about any other contemporary city in the western Mediterranean." Already in the eighth century, fabric dyeing operations had been established, evident from crushed shells of murex (from which the 'Phoenician purple' was derived). Nonetheless, only a "meager picture" of the cultural life of the earliest pioneers in the city can be conjectured, and not much about housing, monuments or defenses. The Roman poet Virgil (70–19 BC) imagined early Carthage, when his legendary character Aeneas had arrived there:

"Aeneas found, where lately huts had been,

marvelous buildings, gateways, cobbled ways,

and din of wagons. There the Tyrians

were hard at work: laying courses for walls,

rolling up stones to build the citadel,

while others picked out building sites and plowed

a boundary furrow. Laws were being enacted,

magistrates and a sacred senate chosen.

Here men were dredging harbors, there they laid

the deep foundations of a theatre,

and quarried massive pillars... ."

The two inner harbors, named cothon in Punic, were located in the southeast; one being commercial, and the other for war. Their definite functions are not entirely known, probably for the construction, outfitting, or repair of ships, perhaps also loading and unloading cargo. Larger anchorages existed to the north and south of the city. North and west of the cothon were located several industrial areas, e.g., metalworking and pottery (e.g., for amphora), which could serve both inner harbors, and ships anchored to the south of the city.

Considering the importance of the Byrsa, the citadel area to the north, our knowledge of it is patchy. Its prominent heights were the scene of fierce combat during the fiery destruction of the city in 146 BC. The Byrsa was the reported site of the Temple of Eshmun (the healing god), at the top of a stairway of sixty steps. A temple of Tanit (the city's queen goddess) was likely situated on the slope of the 'lesser Byrsa' immediately to the east, which runs down toward the sea. Also situated on the Byrsa were luxury homes.

South of the citadel, near the cothon was the tophet, a special and very old cemetery, which when begun lay outside the city's boundaries. Here the Salammbô was located, the Sanctuary of Tanit, not a temple but an enclosure for placing stone stelae. These were mostly short and upright, carved for funeral purposes. The presence of infant skeletons from here may indicate the occurrence of child sacrifice, as claimed in the Bible, although there has been considerable doubt among archeologists as to this interpretation and many consider it simply a cemetery devoted to infants. Probably the tophet burial fields were "dedicated at an early date, perhaps by the first settlers." Recent studies, on the other hand, indicate that child sacrifice was practiced by the Carthaginians.

Between the sea-filled cothon for shipping and the Byrsa heights lay the agora [Greek: "market"], the city-state's central marketplace for business and commerce. The agora was also an area of public squares and plazas, where the people might formally assemble, or gather for festivals. It was the site of religious shrines, and the location of whatever were the major municipal buildings of Carthage. Here beat the heart of civic life. In this district of Carthage, more probably, the ruling suffets presided, the council of elders convened, the tribunal of the 104 met, and justice was dispensed at trials in the open air.

Early residential districts wrapped around the Byrsa from the south to the north east. Houses usually were whitewashed and blank to the street, but within were courtyards open to the sky. In these neighborhoods multistory construction later became common, some up to six stories tall according to an ancient Greek author. Several architectural floorplans of homes have been revealed by recent excavations, as well as the general layout of several city blocks. Stone stairs were set in the streets, and drainage was planned, e.g., in the form of soakaways leaching into the sandy soil. Along the Byrsa's southern slope were located not only fine old homes, but also many of the earliest grave-sites, juxtaposed in small areas, interspersed with daily life.

Artisan workshops were located in the city at sites north and west of the harbors. The location of three metal workshops (implied from iron slag and other vestiges of such activity) were found adjacent to the naval and commercial harbors, and another two were further up the hill toward the Byrsa citadel. Sites of pottery kilns have been identified, between the agora and the harbors, and further north. Earthenware often used Greek models. A fuller's shop for preparing woolen cloth (shrink and thicken) was evidently situated further to the west and south, then by the edge of the city. Carthage also produced objects of rare refinement. During the 4th and 3rd centuries, the sculptures of the sarcophagi became works of art. "Bronze engraving and stone-carving reached their zenith."

The elevation of the land at the promontory on the seashore to the north-east (now called Sidi Bou Saïd), was twice as high above sea level as that at the Byrsa (100 m and 50 m). In between runs a ridge, several times reaching 50 m; it continues northwestward along the seashore, and forms the edge of a plateau-like area between the Byrsa and the sea. Newer urban developments lay here in these northern districts.

Due to the Roman's leveling of the city, the original Punic urban landscape of Carthage was largely lost. Since 1982, French archaeologist Serge Lancel excavated a residential area of the Punic Carthage on top of Byrsa hill near the Forum of the Roman Carthage. The neighborhood can be dated back to early second century BC, and with its houses, shops, and private spaces, is significant for what it reveals about daily life of the Punic Carthage.

The remains have been preserved under embankments, the substructures of the later Roman forum, whose foundation piles dot the district. The housing blocks are separated by a grid of straight streets about 6 m wide, with a roadway consisting of clay; in situ stairs compensate for the slope of the hill. Construction of this type presupposes organization and political will, and has inspired the name of the neighborhood, "Hannibal district", referring to the legendary Punic general or sufet (consul) at the beginning of the second century BC. The habitat is typical, even stereotypical. The street was often used as a storefront/shopfront; cisterns were installed in basements to collect water for domestic use, and a long corridor on the right side of each residence led to a courtyard containing a sump, around which various other elements may be found. In some places, the ground is covered with mosaics called punica pavement, sometimes using a characteristic red mortar.

Society and local economy
Punic culture and agricultural sciences, after arriving at Carthage from the eastern Mediterranean, gradually adapted to the local conditions. The merchant harbor at Carthage was developed after settlement of the nearby Punic town of Utica, and eventually the surrounding African countryside was brought into the orbit of the Punic urban centers, first commercially, then politically. Direct management over cultivation of neighbouring lands by Punic owners followed. A 28-volume work on agriculture written in Punic by Mago, a retired army general (c. 300), was translated into Latin and later into Greek. The original and both translations have been lost; however, some of Mago's text has survived in other Latin works. Olive trees (e.g., grafting), fruit trees (pomegranate, almond, fig, date palm), viniculture, bees, cattle, sheep, poultry, implements, and farm management were among the ancient topics which Mago discussed. As well, Mago addresses the wine-maker's art (here a type of sherry).

In Punic farming society, according to Mago, the small estate owners were the chief producers. They were, two modern historians write, not absent landlords. Rather, the likely reader of Mago was "the master of a relatively modest estate, from which, by great personal exertion, he extracted the maximum yield." Mago counselled the rural landowner, for the sake of their own 'utilitarian' interests, to treat carefully and well their managers and farm workers, or their overseers and slaves. Yet elsewhere these writers suggest that rural land ownership provided also a new power base among the city's nobility, for those resident in their country villas. By many, farming was viewed as an alternative endeavour to an urban business. Another modern historian opines that more often it was the urban merchant of Carthage who owned rural farming land to some profit, and also to retire there during the heat of summer. It may seem that Mago anticipated such an opinion, and instead issued this contrary advice (as quoted by the Roman writer Columella):

"The man who acquires an estate must sell his house, lest he prefer to live in the town rather than in the country. Anyone who prefers to live in a town has no need of an estate in the country.' 'One who has bought land should sell his town house, so that he will have no desire to worship the household gods of the city rather than those of the country; the man who takes greater delight in his city residence will have no need of a country estate."

The issues involved in rural land management also reveal underlying features of Punic society, its structure and stratification. The hired workers might be considered 'rural proletariat', drawn from the local Berbers. Whether there remained Berber landowners next to Punic-run farms is unclear. Some Berbers became sharecroppers. Slaves acquired for farm work were often prisoners of war. In lands outside Punic political control, independent Berbers cultivated grain and raised horses on their lands. Yet within the Punic domain that surrounded the city-state of Carthage, there were ethnic divisions in addition to the usual quasi feudal distinctions between lord and peasant, or master and serf. This inherent instability in the countryside drew the unwanted attention of potential invaders. Yet for long periods Carthage was able to manage these social difficulties.

The many amphorae with Punic markings subsequently found about ancient Mediterranean coastal settlements testify to Carthaginian trade in locally made olive oil and wine. Carthage's agricultural production was held in high regard by the ancients, and rivaled that of Rome – they were once competitors, e.g., over their olive harvests. Under Roman rule, however, grain production (wheat and barley) for export increased dramatically in 'Africa'; yet these later fell with the rise in Roman Egypt's grain exports. Thereafter olive groves and vineyards were re-established around Carthage. Visitors to the several growing regions that surrounded the city wrote admiringly of the lush green gardens, orchards, fields, irrigation channels, hedgerows (as boundaries), as well as the many prosperous farming towns located across the rural landscape.

Accordingly, the Greek author and compiler Diodorus Siculus (fl. 1st century BC), who enjoyed access to ancient writings later lost, and on which he based most of his writings, described agricultural land near the city of Carthage c. 310 BC:

"It was divided into market gardens and orchards of all sorts of fruit trees, with many streams of water flowing in channels irrigating every part. There were country homes everywhere, lavishly built and covered with stucco. ... Part of the land was planted with vines, part with olives and other productive trees. Beyond these, cattle and sheep were pastured on the plains, and there were meadows with grazing horses."

Ancient history
Greek cities contested with Carthage for the Western Mediterranean culminating in the Sicilian Wars and the Pyrrhic War over Sicily, while the Romans fought three wars against Carthage, known as the Punic Wars, from the Latin "Punic" meaning "Phoenician", as Carthage was a Phoenician colony grown into an empire.

Punic Republic
The Carthaginian republic was one of the longest-lived and largest states in the ancient Mediterranean. Reports relay several wars with Syracuse and finally, Rome, which eventually resulted in the defeat and destruction of Carthage in the Third Punic War. The Carthaginians were Phoenician settlers originating in the Mediterranean coast of the Near East. They spoke Canaanite, a Semitic language, and followed a local variety of the ancient Canaanite religion, the Punic religion. The Carthaginians travelled widely across the seas and set up numerous colonies. Unlike Greek, Phoenician, and Tyrian colonizers who "only required colonies to pay due respect for their home-cities", Carthage is said to have "sent its own magistrates to govern overseas settlements".

The fall of Carthage came at the end of the Third Punic War in 146 BC at the Battle of Carthage. Despite initial devastating Roman naval losses and Hannibal's 15-year occupation of much of Roman Italy, who was on the brink of defeat but managed to recover, the end of the series of wars resulted in the end of Carthaginian power and the complete destruction of the city by Scipio Aemilianus. The Romans pulled the Phoenician warships out into the harbor and burned them before the city, and went from house to house, capturing and enslaving the people. About 50,000 Carthaginians were sold into slavery. The city was set ablaze and razed to the ground, leaving only ruins and rubble. After the fall of Carthage, Rome annexed the majority of the Carthaginian colonies, including other North African locations such as Volubilis, Lixus, Chellah. Today a "Carthaginian peace" can refer to any brutal peace treaty demanding total subjugation of the defeated side.

Salting legend
Since at least 1863, it has been claimed that Carthage was sown with salt after being razed, but there is no evidence for this.

Roman Carthage

When Carthage fell, its nearby rival Utica, a Roman ally, was made capital of the region and replaced Carthage as the leading center of Punic trade and leadership. It had the advantageous position of being situated on the outlet of the Medjerda River, Tunisia's only river that flowed all year long. However, grain cultivation in the Tunisian mountains caused large amounts of silt to erode into the river. This silt accumulated in the harbor until it became useless, and Rome was forced to rebuild Carthage.

By 122 BC, Gaius Gracchus founded a short-lived colony, called Colonia Iunonia, after the Latin name for the Punic goddess Tanit, Iuno Caelestis. The purpose was to obtain arable lands for impoverished farmers. The Senate abolished the colony some time later, to undermine Gracchus' power.

After this ill-fated effort, a new city of Carthage was built on the same land by Julius Caesar in the period from 49 to 44 BC, and by the first century, it had grown to be the second-largest city in the western half of the Roman Empire, with a peak population of 500,000. It was the center of the province of Africa, which was a major breadbasket of the Empire. Among its major monuments was an amphitheater.

Carthage also became a center of early Christianity (see Carthage (episcopal see)). In the first of a string of rather poorly reported councils at Carthage a few years later, no fewer than 70 bishops attended. Tertullian later broke with the mainstream that was increasingly represented in the West by the primacy of the Bishop of Rome, but a more serious rift among Christians was the Donatist controversy, against which Augustine of Hippo spent much time and parchment arguing. At the Council of Carthage (397), the biblical canon for the western Church was confirmed. The Christians at Carthage conducted persecutions against the pagans, during which the pagan temples, notably the famous Temple of Juno Caelesti, were destroyed.

The Vandals under Gaiseric invaded Africa in 429. They relinquished the facade of their allied status to Rome and defeated the Roman general Bonifacius to seize Carthage, the once most treasured province of Rome. The 5th-century Roman bishop Victor Vitensis mentions in his Historia Persecutionis Africanae Provincia that the Vandals destroyed parts of Carthage, including various buildings and churches. Once in power, the ecclesiastical authorities were persecuted, the locals were aggressively taxed, and naval raids were routinely launched on Romans in the Mediterranean.

After a failed attempt to recapture the city in the fifth century, the Eastern Roman Empire finally subdued the Vandals in the Vandalic War in 533–534 and made Carthage capital of Byzantine North Africa. Thereafter, the city became the seat of the praetorian prefecture of Africa, which was made into an exarchate during the emperor Maurice's reign, as was Ravenna on the Italian Peninsula. These two exarchates were the western bulwarks of the Byzantine Empire, all that remained of its power in the West. In the early seventh century Heraclius the Elder, the exarch of Carthage, overthrew the Byzantine emperor Phocas, whereupon his son Heraclius succeeded to the imperial throne.

Islamic period
The Roman Exarchate of Africa was not able to withstand the seventh-century Muslim conquest of the Maghreb. The Umayyad Caliphate under Abd al-Malik ibn Marwan in 686 sent a force led by Zuhayr ibn Qays, who won a battle over the Romans and Berbers led by King Kusaila of the Kingdom of Altava on the plain of Kairouan, but he could not follow that up. In 695, Hassan ibn al-Nu'man captured Carthage and advanced into the Atlas Mountains. An imperial fleet arrived and retook Carthage, but in 698, Hasan ibn al-Nu'man returned and defeated Emperor Tiberios III at the 698 Battle of Carthage. Roman imperial forces withdrew from all of Africa except Ceuta. Fearing that the Byzantine Empire might reconquer it, they decided to destroy Roman Carthage in a scorched earth policy and establish their headquarters somewhere else. Its walls were torn down, the water supply from its aqueducts cut off, the agricultural land was ravaged and its harbors made unusable.

The destruction of the Exarchate of Africa marked a permanent end to the Byzantine Empire's influence in the region.

It is clear from archaeological evidence that the town of Carthage continued to be occupied, as did the neighborhood of Bjordi Djedid. The Baths of Antoninus continued to function in the Arab period and the eleventh-century historian Al-Bakri stated that they were still in good condition at that time. They also had production centers nearby. It is difficult to determine whether the continued habitation of some other buildings belonged to Late Byzantine or Early Arab period. The Bir Ftouha church may have continued to remain in use although it is not clear when it became uninhabited. Constantine the African was born in Carthage.

The Medina of Tunis, originally a Berber settlement, was established as the new regional center under the Umayyad Caliphate in the early 8th century. Under the Aghlabids, the people of Tunis revolted numerous times, but the city profited from economic improvements and quickly became the second most important in the kingdom. It was briefly the national capital, from the end of the reign of Ibrahim II in 902, until 909, when the Shi'ite Berbers took over Ifriqiya and founded the Fatimid Caliphate.

Carthage remained a residential see until the high medieval period, and is mentioned in two letters of Pope Leo IX dated 1053, written in reply to consultations regarding a conflict between the bishops of Carthage and Gummi. In each of the two letters, Pope Leo declares that, after the Bishop of Rome, the first archbishop and chief metropolitan of the whole of Africa is the bishop of Carthage. Later, an archbishop of Carthage named Cyriacus was imprisoned by the Arab rulers because of an accusation by some Christians. Pope Gregory VII wrote Cyriacus a letter of consolation, repeating the hopeful assurances of the primacy of the Church of Carthage, "whether the Church of Carthage should still lie desolate or rise again in glory". By 1076, Cyriacus was set free, but there was only one other bishop in the province. These are the last of whom there is mention in that period of the history of the see.

The fortress of Carthage was used by the Muslims until Hafsid era and was captured by the Crusaders during the Eighth Crusade. The inhabitants of Carthage were slaughtered by the Crusaders after they took it, and it was used as a base of operations against the Hafsids. After repelling them, Muhammad I al-Mustansir decided to raze Cathage's defenses in order to prevent a repeat.

Modern history
Carthage is some 15 km east-northeast of Tunis; the settlements nearest to Carthage were the town of Sidi Bou Said to the north and the village of Le Kram to the south. Sidi Bou Said was a village which had grown around the tomb of the eponymous sufi saint (d. 1231), which had been developed into a town under Ottoman rule in the 18th century. Le Kram was developed in the late 19th century under French administration as a settlement close to the port of La Goulette.

In 1881, Tunisia became a French protectorate, and in the same year Charles Lavigerie, who was archbishop of Algiers, became apostolic administrator of the vicariate of Tunis. In the following year, Lavigerie became a cardinal. He "saw himself as the reviver of the ancient Christian Church of Africa, the Church of Cyprian of Carthage", and, on 10 November 1884, was successful in his great ambition of having the metropolitan see of Carthage restored, with himself as its first archbishop. In line with the declaration of Pope Leo IX in 1053, Pope Leo XIII acknowledged the revived Archdiocese of Carthage as the primatial see of Africa and Lavigerie as primate.

The Acropolium of Carthage (Saint Louis Cathedral of Carthage) was erected on Byrsa hill in 1884.

Archaeological sites
The Danish consul Christian Tuxen Falbe conducted a first survey of the topography of the archaeological site (published in 1833). Antiquarian interest was intensified following the publication of Flaubert's Salammbô in 1858. Charles Ernest Beulé performed some preliminary excavations of Roman remains on Byrsa hill in 1860. A more systematic survey of both Punic and Roman-era remains is due to Alfred Louis Delattre, who was sent to Tunis by cardinal Charles Lavigerie in 1875 on both an apostolic and an archaeological mission. Audollent cites Delattre and Lavigerie to the effect that in the 1880s, locals still knew the area of the ancient city under the name of Cartagenna (i.e. reflecting the Latin n-stem Carthāgine).

Auguste Audollent divided the area of Roman Carthage into four quarters, Cartagenna, Dermèche, Byrsa and La Malga. Cartagenna and Dermèche correspond with the lower city, including the site of Punic Carthage; Byrsa is associated with the upper city, which in Punic times was a walled citadel above the harbour; and La Malga is linked with the more remote parts of the upper city in Roman times.

French-led excavations at Carthage began in 1921, and from 1923 reported finds of a large quantity of urns containing a mixture of animal and children's bones. René Dussaud identified a 4th-century BC stela found in Carthage as depicting a child sacrifice.

A temple at Amman (1400–1250 BC) excavated and reported upon by J.B. Hennessy in 1966, shows the possibility of bestial and human sacrifice by fire. While evidence of child sacrifice in Canaan was the object of academic disagreement, with some scholars arguing that merely children's cemeteries had been unearthed in Carthage, the mixture of children's with animal bones as well as associated epigraphic evidence involving mention of mlk led some to believe that, at least in Carthage, child sacrifice was indeed common practice. However, though the animals were surely sacrificed, this does not entirely indicate that the infants were, and in fact the bones indicate the opposite. Rather, the animal sacrifice was likely done to, in some way, honour the deceased.

A study conducted in 1970 by M. Chabeuf, the then Doctor of Science from the University of Paris, showed little difference between 17 modern Tunisians, and 68 Punic remains. An analysis the following year on 42 North-West African skulls dating back to Roman times concluded that they were overall similar to modern Berbers and other Mediterranean populations, especially eastern Iberians. They also noted the presence of one outlier in Tunisia who appears to have inherited mechtoid traits, which led them to hypothesize the persistence of such affinities well into the Punic and Roman era.

M. C. Chamla and D Ferembach (1988) in their entry dealing with the craniometric conclusions of Protohistorical Algerians and Punics in the region of Tunisia, found strong sexual dimorphism with male skulls being robust. Mediterranean elements were dominant, but Mechtoid features, as well as 'Negroid' traits were present in some of the samples. Overall, Punic burials showed affinities with Algerians, Roman Era skulls from Tarragona (Spain), Guanches, and to a lesser extent Abydos (XVIIIth dynasty), Etruscans, Bronze Age Syrians (Euphrates) and skulls from Lozere (France). The anthropological position of the Algerian and Punic people when it comes to populations of the Mediterranean Basin agreed quite well with the geographical situation.

Jehan Desanges stated that "In the Punic burial grounds, negroid remains were not rare and there were black auxiliaries in the Carthaginian army who were certainly not Nilotics".

In 1990, Shomarka Keita, a biological anthropologist, had conducted a craniometric study which featured a set of remains from Northern Africa. He examined a sample of 49 Maghreban crania which included skulls from pre-Roman Carthage and concluded that, although they were heterogeneous, many of them showed physical similarities to crania from equatorial Africa, ancient Egypt, and Kush; with most having traits conforming to the northern (Lower) Egyptian pattern. S.O.Y. Keita's later report in 2018, found the pre-Roman Carthaginian series to be intermediate between the Phoenician and Maghreban. He noted the findings are consistent with an interpretation that it reflects both local and Levantine ancestry due to specific interactions in the ancient period.

Joel. D. Irish in 2001 when measuring for dental affinities, found strong similarities and very small distances between the Canary Islanders and Punic Carthaginians-whom originated in West Asia, suggesting a particularly close affinity, despite the geographic distance between these two populations. This result according to Irish, may reflect Berber/Carthaginian admixture. Overall, the findings discovered that "the Canary Island sample is most similar to the four samples from Northwest Africa: the Shawia Berbers, Kabyle Berbers, Bedouin Arabs and Carthaginians, less similar to the three Egyptian samples and least like the three Nubian samples."

In 2016, an ancient Carthaginian individual, who was excavated from a Punic tomb in Byrsa Hill, was found to belong to the rare U5b2c1 maternal haplogroup. The Young Man of Byrsa specimen dates from the late 6th century BC, and his lineage is believed to represent early gene flow from Iberia to the Maghreb. Craniometric analysis of the young man indicated likely Mediterranean/European ancestry as opposed to African or Asian.

Climate change
Due to its coastal location, Carthage Archeological Site is vulnerable to sea level rise. In 2022, the IPCC Sixth Assessment Report included it in the list of African cultural sites which would be threatened by flooding and coastal erosion by the end of the century, but only if climate change followed RCP 8.5, which is the scenario of high and continually increasing greenhouse gas emissions associated with the warming of over 4°C., and is no longer considered very likely. The other, more plausible scenarios result in lower warming levels and consequently lower sea level rise: yet, sea levels would continue to increase for about 10,000 years under all of them. Even if the warming is limited to 1.5°C, global sea level rise is still expected to exceed 2-3 m after 2000 years (and higher warming levels will see larger increases by then), consequently exceeding 2100 levels of sea level rise under RCP 8.5 (~0.75 m with a range of 0.5–1 m) well before the year 4000. Thus, it is a matter of time before the Carthage Archeological Site is threatened by rising water levels, unless it can be protected by adaptation efforts such as sea walls.

Commune
The commune of Carthage was created by a decree of the Bey of Tunis on 15 June 1919, during the rule of Naceur Bey.

In 1920, the first seaplane base was built on the Lake of Tunis for the seaplanes of Compagnie Aéronavale. The Tunis Airfield opened in 1938, serving around 5,800 passengers annually on the Paris-Tunis route. During World War II, the airport was used by the United States Army Air Force Twelfth Air Force as a headquarters and command control base for the Italian Campaign of 1943. Construction on the Tunis-Carthage Airport, which was fully funded by France, began in 1944, and in 1948 the airport become the main hub for Tunisair.

In the 1950s the Lycée Français de Carthage was established to serve French families in Carthage. In 1961 it was given to the Tunisian government as part of the Independence of Tunisia, so the nearby Collège Maurice Cailloux in La Marsa, previously an annex of the Lycée Français de Carthage, was renamed to the Lycée Français de La Marsa and began serving the lycée level. It is currently the Lycée Gustave Flaubert.

After Tunisian independence in 1956, the Tunis conurbation gradually extended around the airport, and Carthage (قرطاج Qarṭāj) is now a suburb of Tunis, covering the area between Sidi Bou Said and Le Kram. Its population as of January 2013 was estimated at 21,276, mostly attracting the more wealthy residents. If Carthage is not the capital, it tends to be the political pole, a "place of emblematic power" according to Sophie Bessis, leaving to Tunis the economic and administrative roles. The Carthage Palace (the Tunisian presidential palace) is located in the coast.

The suburb has six train stations of the TGM line between Le Kram and Sidi Bou Said: Carthage Salammbo (named for the ancient children’s cemetery where it stands), Carthage Byrsa (named for Byrsa hill), Carthage Dermech (Dermèche), Carthage Hannibal (named for Hannibal), Carthage Présidence (named for the Presidential Palace) and Carthage Amilcar (named for Hamilcar).

Trade and business
The merchants of Carthage were in part heirs of the Mediterranean trade developed by Phoenicia, and so also heirs of the rivalry with Greek merchants. Business activity was accordingly both stimulated and challenged. Cyprus had been an early site of such commercial contests. The Phoenicians then had ventured into the western Mediterranean, founding trading posts, including Utica and Carthage. The Greeks followed, entering the western seas where the commercial rivalry continued. Eventually it would lead, especially in Sicily, to several centuries of intermittent war. Although Greek-made merchandise was generally considered superior in design, Carthage also produced trade goods in abundance. That Carthage came to function as a manufacturing colossus was shown during the Third Punic War with Rome. Carthage, which had previously disarmed, then was made to face the fatal Roman siege. The city "suddenly organised the manufacture of arms" with great skill and effectiveness. According to Strabo (63 BC – AD 21) in his Geographica:

"[Carthage] each day produced one hundred and forty finished shields, three hundred swords, five hundred spears, and one thousand missiles for the catapults... . Furthermore, [Carthage although surrounded by the Romans] built one hundred and twenty decked ships in two months... for old timber had been stored away in readiness, and a large number of skilled workmen, maintained at public expense."

The textiles industry in Carthage probably started in private homes, but the existence of professional weavers indicates that a sort of factory system later developed. Products included embroidery, carpets, and use of the purple murex dye (for which the Carthaginian isle of Djerba was famous). Metalworkers developed specialized skills, i.e., making various weapons for the armed forces, as well as domestic articles, such as knives, forks, scissors, mirrors, and razors (all articles found in tombs). Artwork in metals included vases and lamps in bronze, also bowls, and plates. Other products came from such crafts as the potters, the glassmakers, and the goldsmiths. Inscriptions on votive stele indicate that many were not slaves but 'free citizens'.

Phoenician and Punic merchant ventures were often run as a family enterprise, putting to work its members and its subordinate clients. Such family-run businesses might perform a variety of tasks: own and maintain the ships, providing the captain and crew; do the negotiations overseas, either by barter or buying and selling, of their own manufactured commodities and trade goods, and native products (metals, foodstuffs, etc.) to carry and trade elsewhere; and send their agents to stay at distant outposts in order to make lasting local contacts, and later to establish a warehouse of shipped goods for exchange, and eventually perhaps a settlement. Over generations, such activity might result in the creation of a wide-ranging network of trading operations. Ancillary would be the growth of reciprocity between different family firms, foreign and domestic.

State protection was extended to its sea traders by the Phoenician city of Tyre and later likewise by the daughter city-state of Carthage. Stéphane Gsell, the well-regarded French historian of ancient North Africa, summarized the major principles guiding the civic rulers of Carthage with regard to its policies for trade and commerce:
 * to open and maintain markets for its merchants, whether by entering into direct contact with foreign peoples using either treaty negotiations or naval power, or by providing security for isolated trading stations
 * the reservation of markets exclusively for the merchants of Carthage, or where competition could not be eliminated, to regulate trade by state-sponsored agreements with its commercial rivals
 * suppression of piracy, and promotion of Carthage's ability to freely navigate the seas

Both the Phoenicians and the Carthaginians were well known in antiquity for their secrecy in general, and especially pertaining to commercial contacts and trade routes. Both cultures excelled in commercial dealings. Strabo (63 BC–AD 21) the Greek geographer wrote that before its fall (in 146 BC) Carthage enjoyed a population of 700,000, and directed an alliance of 300 cities. The Greek historian Polybius (c. 203–120) referred to Carthage as "the wealthiest city in the world".

Constitution of state
A "suffet" (possibly two) was elected by the citizens, and held office with no military power for a one-year term. Carthaginian generals marshalled mercenary armies and were separately elected. From about 550 to 450 the Magonid family monopolized the top military position; later the Barcid family acted similarly. Eventually it came to be that, after a war, the commanding general had to testify justifying his actions before a court of 104 judges.

Aristotle (384–322) discusses Carthage in his work, Politica; he begins: "The Carthaginians are also considered to have an excellent form of government." He briefly describes the city as a "mixed constitution", a political arrangement with cohabiting elements of monarchy, aristocracy, and democracy, i.e., a king (Gk: basileus), a council of elders (Gk: gerusia), and the people (Gk: demos). Later Polybius of Megalopolis (c. 204–122, Greek) in his Histories would describe the Roman Republic in more detail as a mixed constitution in which the Consuls were the monarchy, the Senate the aristocracy, and the Assemblies the democracy.

Evidently Carthage also had an institution of elders who advised the Suffets, similar to a Greek gerusia or the Roman Senate. We do not have a Punic name for this body. At times its members would travel with an army general on campaign. Members also formed permanent committees. The institution had several hundred members drawn from the wealthiest class who held office for life. Vacancies were probably filled by recruitment from among the elite, i.e., by co-option. From among its members were selected the 104 Judges mentioned above. Later the 104 would come to evaluate not only army generals but other office holders as well. Aristotle regarded the 104 as most important; he compared it to the ephorate of Sparta with regard to control over security. In Hannibal's time, such a Judge held office for life. At some stage there also came to be independent self-perpetuating boards of five who filled vacancies and supervised (non-military) government administration.

Popular assemblies also existed at Carthage. When deadlocked the Suffets and the quasi-senatorial institution of elders might request the assembly to vote; also, assembly votes were requested in very crucial matters in order to achieve political consensus and popular coherence. The assembly members had no legal wealth or birth qualification. How its members were selected is unknown, e.g., whether by festival group or urban ward or another method.

The Greeks were favourably impressed by the constitution of Carthage; Aristotle had a separate study of it made which unfortunately is lost. In his Politica he states: "The government of Carthage is oligarchical, but they successfully escape the evils of oligarchy by enriching one portion of the people after another by sending them to their colonies." "[T]heir policy is to send some [poorer citizens] to their dependent towns, where they grow rich." Yet Aristotle continues, "[I]f any misfortune occurred, and the bulk of the subjects revolted, there would be no way of restoring peace by legal means." Aristotle remarked also:

"Many of the Carthaginian institutions are excellent. The superiority of their constitution is proved by the fact that the common people remain loyal to the constitution; the Carthaginians have never had any rebellion worth speaking of, and have never been under the rule of a tyrant."

The city-state of Carthage, whose citizens were mainly Libyphoenicians (of Phoenician ancestry born in Africa), dominated and exploited an agricultural countryside composed mainly of native Berber sharecroppers and farmworkers, whose affiliations to Carthage were open to divergent possibilities. Beyond these more settled Berbers and the Punic farming towns and rural manors, lived the independent Berber tribes, who were mostly pastoralists.

In the brief, uneven review of government at Carthage found in his Politica Aristotle mentions several faults. Thus, "that the same person should hold many offices, which is a favorite practice among the Carthaginians." Aristotle disapproves, mentioning the flute-player and the shoemaker. Also, that "magistrates should be chosen not only for their merit but for their wealth." Aristotle's opinion is that focus on pursuit of wealth will lead to oligarchy and its evils.

"[S]urely it is a bad thing that the greatest offices... should be bought. The law which allows this abuse makes wealth of more account than virtue, and the whole state becomes avaricious. For, whenever the chiefs of the state deem anything honorable, the other citizens are sure to follow their example; and, where virtue has not the first place, their aristocracy cannot be firmly established."

In Carthage the people seemed politically satisfied and submissive, according to the historian Warmington. They in their assemblies only rarely exercised the few opportunities given them to assent to state decisions. Popular influence over government appears not to have been an issue at Carthage. Being a commercial republic fielding a mercenary army, the people were not conscripted for military service, an experience which can foster the feel for popular political action. But perhaps this misunderstands the society; perhaps the people, whose values were based on small-group loyalty, felt themselves sufficiently connected to their city's leadership by the very integrity of the person-to-person linkage within their social fabric. Carthage was very stable; there were few openings for tyrants. Only after defeat by Rome devastated Punic imperial ambitions did the people of Carthage seem to question their governance and to show interest in political reform.

In 196, following the Second Punic War (218–201), Hannibal, still greatly admired as a Barcid military leader, was elected suffet. When his reforms were blocked by a financial official about to become a judge for life, Hannibal rallied the populace against the 104 judges. He proposed a one-year term for the 104, as part of a major civic overhaul. Additionally, the reform included a restructuring of the city's revenues, and the fostering of trade and agriculture. The changes rather quickly resulted in a noticeable increase in prosperity. Yet his incorrigible political opponents cravenly went to Rome, to charge Hannibal with conspiracy, namely, plotting war against Rome in league with Antiochus the Hellenic ruler of Syria. Although the Roman Scipio Africanus resisted such manoeuvre, eventually intervention by Rome forced Hannibal to leave Carthage. Thus, corrupt city officials efficiently blocked Hannibal in his efforts to reform the government of Carthage.

Mago (6th century) was King of Carthage; the head of state, war leader, and religious figurehead. His family was considered to possess a sacred quality. Mago's office was somewhat similar to that of a pharaoh, but although kept in a family it was not hereditary, it was limited by legal consent. Picard, accordingly, believes that the council of elders and the popular assembly are late institutions. Carthage was founded by the king of Tyre who had a royal monopoly on this trading venture. Thus it was the royal authority stemming from this traditional source of power that the King of Carthage possessed. Later, as other Phoenician ship companies entered the trading region, and so associated with the city-state, the King of Carthage had to keep order among a rich variety of powerful merchants in their negotiations among themselves and over risky commerce across the Mediterranean. Under these circumstance, the office of king began to be transformed. Yet it was not until the aristocrats of Carthage became wealthy owners of agricultural lands in Africa that a council of elders was institutionalized at Carthage.

Contemporary sources

Most ancient literature concerning Carthage comes from Greek and Roman sources as Carthage's own documents were destroyed by the Romans. Apart from inscriptions, hardly any Punic literature has survived, and none in its own language and script. A brief catalogue would include:
 * three short treaties with Rome (Latin translations);
 * several pages of Hanno the Navigator's log-book concerning his fifth century maritime exploration of the Atlantic coast of west Africa (Greek translation);
 * fragments quoted from Mago's fourth/third century 28-volume treatise on agriculture (Latin translations);
 * the Roman playwright Plautus (c. 250 – 184) in his Poenulus incorporates a few fictional speeches delivered in Punic, whose written lines are transcribed into Latin letters phonetically;
 * the thousands of inscriptions made in Punic script, thousands, but many extremely short, e.g., a dedication to a deity with the personal name(s) of the devotee(s).

"[F]rom the Greek author Plutarch [(c. 46 – c. 120)] we learn of the 'sacred books' in Punic safeguarded by the city's temples. Few Punic texts survive, however." Once "the City Archives, the Annals, and the scribal lists of Suffets" existed, but evidently these were destroyed in the horrific fires during the Roman capture of the city in 146 BC.

Yet some Punic books (Latin: libri punici) from the libraries of Carthage reportedly did survive the fires. These works were apparently given by Roman authorities to the newly augmented Berber rulers. Over a century after the fall of Carthage, the Roman politician-turned-author Gaius Sallustius Crispus or Sallust (86–34) reported his having seen volumes written in Punic, which books were said to be once possessed by the Berber king, Hiempsal II (r. 88–81). By way of Berber informants and Punic translators, Sallust had used these surviving books to write his brief sketch of Berber affairs.

Probably some of Hiempsal II's libri punici, that had escaped the fires that consumed Carthage in 146 BC, wound up later in the large royal library of his grandson Juba II (r. 25 BC–AD 24). Juba II not only was a Berber king, and husband of Cleopatra's daughter, but also a scholar and author in Greek of no less than nine works. He wrote for the Mediterranean-wide audience then enjoying classical literature. The libri punici inherited from his grandfather surely became useful to him when composing his Libyka, a work on North Africa written in Greek. Unfortunately, only fragments of Libyka survive, mostly from quotations made by other ancient authors. It may have been Juba II who 'discovered' the five-centuries-old 'log book' of Hanno the Navigator, called the Periplus, among library documents saved from fallen Carthage.

In the end, however, most Punic writings that survived the destruction of Carthage "did not escape the immense wreckage in which so many of Antiquity's literary works perished." Accordingly, the long and continuous interactions between Punic citizens of Carthage and the Berber communities that surrounded the city have no local historian. Their political arrangements and periodic crises, their economic and work life, the cultural ties and social relations established and nourished (infrequently as kin), are not known to us directly from ancient Punic authors in written accounts. Neither side has left us their stories about life in Punic-era Carthage.

Regarding Phoenician writings, few remain and these seldom refer to Carthage. The more ancient and most informative are cuneiform tablets, c. 1600–1185, from ancient Ugarit, located to the north of Phoenicia on the Syrian coast; it was a Canaanite city politically affiliated with the Hittites. The clay tablets tell of myths, epics, rituals, medical and administrative matters, and also correspondence. The highly valued works of Sanchuniathon, an ancient priest of Beirut, who reportedly wrote on Phoenician religion and the origins of civilization, are themselves completely lost, but some little content endures twice removed. Sanchuniathon was said to have lived in the 11th century, which is considered doubtful. Much later a Phoenician History by Philo of Byblos (64–141) reportedly existed, written in Greek, but only fragments of this work survive. An explanation proffered for why so few Phoenician works endured: early on (11th century) archives and records began to be kept on papyrus, which does not long survive in a moist coastal climate. Also, both Phoenicians and Carthaginians were well known for their secrecy.

Thus, of their ancient writings we have little of major interest left to us by Carthage, or by Phoenicia the country of origin of the city founders. "Of the various Phoenician and Punic compositions alluded to by the ancient classical authors, not a single work or even fragment has survived in its original idiom." "Indeed, not a single Phoenician manuscript has survived in the original [language] or in translation." We cannot therefore access directly the line of thought or the contour of their worldview as expressed in their own words, in their own voice. Ironically, it was the Phoenicians who "invented or at least perfected and transmitted a form of writing [the alphabet] that has influenced dozens of cultures including our own."

As noted, the celebrated ancient books on agriculture written by Mago of Carthage survives only via quotations in Latin from several later Roman works.

In art and literature
The scant remains of what was once a great city are reflected upon in Letitia Elizabeth Landon's poetical illustration, Carthage, to an engraving of a painting by J. Salmon, published in Fisher's Drawing Room Scrap Book, 1837 with quotes from Sir Grenville Temple's Journal.

The protagonist in Isaac Asimov's 1956 science-fiction short story "The Dead Past" is an academic professor obsessed with debunking historical perceptions of Carthage.

title: Carthage


text:
Coprime integers

In number theory, two integers $a$ and $b$ are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1. Consequently, any prime number that divides $a$ does not divide $b$, and vice versa. This is equivalent to their greatest common divisor (GCD) being 1. One says also $a$ is prime to $b$ or $a$ is coprime with $b$.

The numbers 8 and 9 are coprime, despite the fact that neither—considered individually—is a prime number, since 1 is their only common divisor. On the other hand, 6 and 9 are not coprime, because they are both divisible by 3. The numerator and denominator of a reduced fraction are coprime, by definition.

Notation and testing
When the integers $a$ and $b$ are coprime, the standard way of expressing this fact in mathematical notation is to indicate that their greatest common divisor is one, by the formula $gcd(a, b) = 1$ or $(a, b) = 1$. In their 1989 textbook Concrete Mathematics, Ronald Graham, Donald Knuth, and Oren Patashnik proposed an alternative notation $$a\perp b$$ to indicate that $a$ and $b$ are relatively prime and that the term "prime" be used instead of coprime (as in $a$ is prime to $b$).

A fast way to determine whether two numbers are coprime is given by the Euclidean algorithm and its faster variants such as binary GCD algorithm or Lehmer's GCD algorithm.

The number of integers coprime with a positive integer $n$, between 1 and $n$, is given by Euler's totient function, also known as Euler's phi function, $φ(n)$.

A set of integers can also be called coprime if its elements share no common positive factor except 1. A stronger condition on a set of integers is pairwise coprime, which means that $a$ and $b$ are coprime for every pair $(a, b)$ of different integers in the set. The set ${2, 3, 4}$ is coprime, but it is not pairwise coprime since 2 and 4 are not relatively prime.

Properties
The numbers 1 and −1 are the only integers coprime with every integer, and they are the only integers that are coprime with 0.

A number of conditions are equivalent to $a$ and $b$ being coprime:
 * No prime number divides both $a$ and $b$.
 * There exist integers $x, y$ such that $ax + by = 1$ (see Bézout's identity).
 * The integer $b$ has a multiplicative inverse modulo $a$, meaning that there exists an integer $y$ such that $by ≡ 1 (mod a)$. In ring-theoretic language, $b$ is a unit in the ring $\Z/a\Z$ of integers modulo $a$.
 * Every pair of congruence relations for an unknown integer $x$, of the form $x ≡ k (mod a)$ and $x ≡ m (mod b)$, has a solution (Chinese remainder theorem); in fact the solutions are described by a single congruence relation modulo $ab$.
 * The least common multiple of $a$ and $b$ is equal to their product $ab$, i.e. $lcm(a, b) = ab$.

As a consequence of the third point, if $a$ and $b$ are coprime and $br ≡ bs (mod a)$, then $r ≡ s (mod a)$. That is, we may "divide by $b$" when working modulo $a$. Furthermore, if $b_{1}, b_{2}$ are both coprime with $a$, then so is their product $b_{1}b_{2}$ (i.e., modulo $a$ it is a product of invertible elements, and therefore invertible); this also follows from the first point by Euclid's lemma, which states that if a prime number $p$ divides a product $bc$, then $p$ divides at least one of the factors $b, c$.

As a consequence of the first point, if $a$ and $b$ are coprime, then so are any powers $a^{k}$ and $b^{m}$.

If $a$ and $b$ are coprime and $a$ divides the product $bc$, then $a$ divides $c$. This can be viewed as a generalization of Euclid's lemma.

The two integers $a$ and $b$ are coprime if and only if the point with coordinates $(a, b)$ in a Cartesian coordinate system would be "visible" via an unobstructed line of sight from the origin $(0, 0)$, in the sense that there is no point with integer coordinates anywhere on the line segment  between the origin and $(a, b)$. (See figure 1.)

In a sense that can be made precise, the probability that two randomly chosen integers are coprime is $6/π^{2}$, which is about 61% (see, below).

Two natural numbers $a$ and $b$ are coprime if and only if the numbers $2^{a} – 1$ and $2^{b} – 1$ are coprime. As a generalization of this, following easily from the Euclidean algorithm in base $n > 1$:

 * $$\gcd\left(n^a - 1, n^b - 1\right) = n^{\gcd(a, b)} - 1.$$

Coprimality in sets
A set of integers $$S=\{a_1,a_2, \dots, a_n\}$$ can also be called coprime or setwise coprime if the greatest common divisor of all the elements of the set is 1. For example, the integers 6, 10, 15 are coprime because 1 is the only positive integer that divides all of them.

If every pair in a set of integers is coprime, then the set is said to be pairwise coprime (or pairwise relatively prime, mutually coprime or mutually relatively prime). Pairwise coprimality is a stronger condition than setwise coprimality; every pairwise coprime finite set is also setwise coprime, but the reverse is not true. For example, the integers 4, 5, 6 are (setwise) coprime (because the only positive integer dividing all of them is 1), but they are not pairwise coprime (because $gcd(4, 6) = 2$).

The concept of pairwise coprimality is important as a hypothesis in many results in number theory, such as the Chinese remainder theorem.

It is possible for an infinite set of integers to be pairwise coprime. Notable examples include the set of all prime numbers, the set of elements in Sylvester's sequence, and the set of all Fermat numbers.

Coprimality in ring ideals
Two ideals $A$ and $B$ in a commutative ring $R$ are called coprime (or comaximal) if $$A+B=R.$$ This generalizes Bézout's identity: with this definition, two principal ideals ($a$) and ($b$) in the ring of integers $\Z$ are coprime if and only if $a$ and $b$ are coprime. If the ideals $A$ and $B$ of $R$ are coprime, then $$AB=A\cap B;$$ furthermore, if $C$ is a third ideal such that $A$ contains $BC$, then $A$ contains $C$. The Chinese remainder theorem can be generalized to any commutative ring, using coprime ideals.

Probability of coprimality
Given two randomly chosen integers $a$ and $b$, it is reasonable to ask how likely it is that $a$ and $b$ are coprime. In this determination, it is convenient to use the characterization that $a$ and $b$ are coprime if and only if no prime number divides both of them (see Fundamental theorem of arithmetic).

Informally, the probability that any number is divisible by a prime (or in fact any integer) $p$ is $\tfrac{1}{p};$ for example, every 7th integer is divisible by 7. Hence the probability that two numbers are both divisible by $p$ is $\tfrac{1}{p^2},$ and the probability that at least one of them is not is $1-\tfrac{1}{p^2}.$ Any finite collection of divisibility events associated to distinct primes is mutually independent. For example, in the case of two events, a number is divisible by primes $p$ and $q$ if and only if it is divisible by $pq$; the latter event has probability $\tfrac{1}{pq}.$ If one makes the heuristic assumption that such reasoning can be extended to infinitely many divisibility events, one is led to guess that the probability that two numbers are coprime is given by a product over all primes,

 * $$\prod_{\text{prime } p} \left(1-\frac{1}{p^2}\right) = \left( \prod_{\text{prime } p} \frac{1}{1-p^{-2}} \right)^{-1} = \frac{1}{\zeta(2)} = \frac{6}{\pi^2} \approx 0.607927102 \approx 61\%.$$

Here $ζ$ refers to the Riemann zeta function, the identity relating the product over primes to $ζ(2)$ is an example of an Euler product, and the evaluation of $ζ(2)$ as $π^{2}/6$ is the Basel problem, solved by Leonhard Euler in 1735.

There is no way to choose a positive integer at random so that each positive integer occurs with equal probability, but statements about "randomly chosen integers" such as the ones above can be formalized by using the notion of natural density. For each positive integer $N$, let $PN$ be the probability that two randomly chosen numbers in $$\{1,2,\ldots,N\}$$ are coprime. Although $PN$ will never equal $6/π^{2}$ exactly, with work one can show that in the limit as $$N \to \infty,$$ the probability $PN$ approaches $6/π^{2}$.

More generally, the probability of $k$ randomly chosen integers being setwise coprime is $\tfrac{1}{\zeta(k)}.$

Generating all coprime pairs
All pairs of positive coprime numbers $(m, n)$ (with $m > n$) can be arranged in two disjoint complete ternary trees, one tree starting from $(2, 1)$ (for even–odd and odd–even pairs), and the other tree starting from $(3, 1)$ (for odd–odd pairs). The children of each vertex $(m, n)$ are generated as follows:
 * Branch 1: $$(2m-n,m)$$
 * Branch 2: $$(2m+n,m)$$
 * Branch 3: $$(m+2n,n)$$

This scheme is exhaustive and non-redundant with no invalid members. This can be proved by remarking that, if $$(a,b)$$ is a coprime pair with $$a>b,$$ then In all cases $$(m,n)$$ is a "smaller" coprime pair with $$m>n.$$ This process of "computing the father" can stop only if either $$a=2b$$ or $$a=3b.$$ In these cases, coprimality, implies that the pair is either $$(2,1)$$ or $$(3,1).$$
 * if $$a>3b,$$ then $$(a,b)$$ is a child of $$(m,n)=(a-2b, b)$$ along branch 3;
 * if $$2b<a<3b,$$ then $$(a,b)$$ is a child of $$(m,n)=(b, a-2b)$$ along branch 2;
 * if $$b<a<2b,$$ then $$(a,b)$$ is a child of $$(m,n)=(b, 2b-a)$$ along branch 1.

Applications
In machine design, an even, uniform gear wear is achieved by choosing the tooth counts of the two gears meshing together to be relatively prime. When a 1:1 gear ratio is desired, a gear relatively prime to the two equal-size gears may be inserted between them.

In pre-computer cryptography, some Vernam cipher machines combined several loops of key tape of different lengths. Many rotor machines combine rotors of different numbers of teeth. Such combinations work best when the entire set of lengths are pairwise coprime.

Generalizations
This concept can be extended to other algebraic structures than $\Z;$ for example, polynomials whose greatest common divisor is 1 are called coprime polynomials.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Coprime integers


text:
Control unit

The control unit (CU) is a component of a computer's central processing unit (CPU) that directs the operation of the processor. A CU typically uses a binary decoder to convert coded instructions into timing and control signals that direct the operation of the other units (memory, arithmetic logic unit and input and output devices, etc.).

Most computer resources are managed by the CU. It directs the flow of data between the CPU and the other devices. John von Neumann included the control unit as part of the von Neumann architecture. In modern computer designs, the control unit is typically an internal part of the CPU with its overall role and operation unchanged since its introduction.

Multicycle control units
The simplest computers use a multicycle microarchitecture. These were the earliest designs. They are still popular in the very smallest computers, such as the embedded systems that operate machinery.

In a computer, the control unit often steps through the instruction cycle successively. This consists of fetching the instruction, fetching the operands, decoding the instruction, executing the instruction, and then writing the results back to memory. When the next instruction is placed in the control unit, it changes the behavior of the control unit to complete the instruction correctly. So, the bits of the instruction directly control the control unit, which in turn controls the computer.

The control unit may include a binary counter to tell the control unit's logic what step it should do.

Multicycle control units typically use both the rising and falling edges of their square-wave timing clock. They operate a step of their operation on each edge of the timing clock, so that a four-step operation completes in two clock cycles. This doubles the speed of the computer, given the same logic family.

Many computers have two different types of unexpected events. An interrupt occurs because some type of input or output needs software attention in order to operate correctly. An exception is caused by the computer's operation. One crucial difference is that the timing of an interrupt cannot be predicted. Another is that some exceptions (e.g. a memory-not-available exception) can be caused by an instruction that needs to be restarted.

Control units can be designed to handle interrupts in one of two typical ways. If a quick response is most important, a control unit is designed to abandon work to handle the interrupt. In this case, the work in process will be restarted after the last completed instruction. If the computer is to be very inexpensive, very simple, very reliable, or to get more work done, the control unit will finish the work in process before handling the interrupt. Finishing the work is inexpensive, because it needs no register to record the last finished instruction. It is simple and reliable because it has the fewest states. It also wastes the least amount of work.

Exceptions can be made to operate like interrupts in very simple computers. If virtual memory is required, then a memory-not-available exception must retry the failing instruction.

It is common for multicycle computers to use more cycles. Sometimes it takes longer to take a conditional jump, because the program counter has to be reloaded. Sometimes they do multiplication or division instructions by a process, something like binary long multiplication and division. Very small computers might do arithmetic, one or a few bits at a time. Some other computers have very complex instructions that take many steps.

Pipelined control units
Many medium-complexity computers pipeline instructions. This design is popular because of its economy and speed.

In a pipelined computer, instructions flow through the computer. This design has several stages. For example, it might have one stage for each step of the Von Neumann cycle. A pipelined computer usually has "pipeline registers" after each stage. These store the bits calculated by a stage so that the logic gates of the next stage can use the bits to do the next step.

It is common for even numbered stages to operate on one edge of the square-wave clock, while odd-numbered stages operate on the other edge. This speeds the computer by a factor of two compared to single-edge designs.

In a pipelined computer, the control unit arranges for the flow to start, continue, and stop as a program commands. The instruction data is usually passed in pipeline registers from one stage to the next, with a somewhat separated piece of control logic for each stage. The control unit also assures that the instruction in each stage does not harm the operation of instructions in other stages. For example, if two stages must use the same piece of data, the control logic assures that the uses are done in the correct sequence.

When operating efficiently, a pipelined computer will have an instruction in each stage. It is then working on all of those instructions at the same time. It can finish about one instruction for each cycle of its clock. When a program makes a decision, and switches to a different sequence of instructions, the pipeline sometimes must discard the data in process and restart. This is called a "stall." When two instructions could interfere, sometimes the control unit must stop processing a later instruction until an earlier instruction completes. This is called a "pipeline bubble" because a part of the pipeline is not processing instructions. Pipeline bubbles can occur when two instructions operate on the same register.

Interrupts and unexpected exceptions also stall the pipeline. If a pipelined computer abandons work for an interrupt, more work is lost than in a multicycle computer. Predictable exceptions do not need to stall. For example, if an exception instruction is used to enter the operating system, it does not cause a stall.

For the same speed of electronic logic, a pipelined computer can execute more instructions per second than a multicycle computer. Also, even though the electronic logic has a fixed maximum speed, a pipelined computer can be made faster or slower by varying the number of stages in the pipeline. With more stages, each stage does less work, and so the stage has fewer delays from the logic gates.

A pipelined model of a computer often has less logic gates per instruction per second than multicycle and out-of-order computers. This is because the average stage is less complex than a multicycle computer. An out-of-order computer usually has large amounts of idle logic at any given instant. Similar calculations usually show that a pipelined computer uses less energy per instruction.

However, a pipelined computer is usually more complex and more costly than a comparable multicycle computer. It typically has more logic gates, registers and a more complex control unit. In a like way, it might use more total energy, while using less energy per instruction. Out-of-order CPUs can usually do more instructions per second because they can do several instructions at once.

Preventing stalls
Control units use many methods to keep a pipeline full and avoid stalls. For example, even simple control units can assume that a backwards branch, to a lower-numbered, earlier instruction, is a loop, and will be repeated. So, a control unit with this design will always fill the pipeline with the backwards branch path. If a compiler can detect the most frequently-taken direction of a branch, the compiler can just produce instructions so that the most frequently taken branch is the preferred direction of branch. In a like way, a control unit might get hints from the compiler: Some computers have instructions that can encode hints from the compiler about the direction of branch.

Some control units do branch prediction: A control unit keeps an electronic list of the recent branches, encoded by the address of the branch instruction. This list has a few bits for each branch to remember the direction that was taken most recently.

Some control units can do speculative execution, in which a computer might have two or more pipelines, calculate both directions of a branch, and then discard the calculations of the unused direction.

Results from memory can become available at unpredictable times because very fast computers cache memory. That is, they copy limited amounts of memory data into very fast memory. The CPU must be designed to process at the very fast speed of the cache memory. Therefore, the CPU might stall when it must access main memory directly. In modern PCs, main memory is as much as three hundred times slower than cache.

To help this, out-of-order CPUs and control units were developed to process data as it becomes available. (See next section)

But what if all the calculations are complete, but the CPU is still stalled, waiting for main memory? Then, a control unit can switch to an alternative thread of execution whose data has been fetched while the thread was idle. A thread has its own program counter, a stream of instructions and a separate set of registers. Designers vary the number of threads depending on current memory technologies and the type of computer. Typical computers such as PCs and smart phones usually have control units with a few threads, just enough to keep busy with affordable memory systems. Database computers often have about twice as many threads, to keep their much larger memories busy. Graphic processing units (GPUs) usually have hundreds or thousands of threads, because they have hundreds or thousands of execution units doing repetitive graphic calculations.

When a control unit permits threads, the software also has to be designed to handle them. In general-purpose CPUs like PCs and smartphones, the threads are usually made to look very like normal time-sliced processes. At most, the operating system might need some awareness of them. In GPUs, the thread scheduling usually cannot be hidden from the application software, and is often controlled with a specialized subroutine library.

Out of order control units
A control unit can be designed to finish what it can. If several instructions can be completed at the same time, the control unit will arrange it. So, the fastest computers can process instructions in a sequence that can vary somewhat, depending on when the operands or instruction destinations become available. Most supercomputers and many PC CPUs use this method. The exact organization of this type of control unit depends on the slowest part of the computer.

When the execution of calculations is the slowest, instructions flow from memory into pieces of electronics called "issue units." An issue unit holds an instruction until both its operands and an execution unit are available. Then, the instruction and its operands are "issued" to an execution unit. The execution unit does the instruction. Then the resulting data is moved into a queue of data to be written back to memory or registers. If the computer has multiple execution units, it can usually do several instructions per clock cycle.

It is common to have specialized execution units. For example, a modestly priced computer might have only one floating-point execution unit, because floating point units are expensive. The same computer might have several integer units, because these are relatively inexpensive, and can do the bulk of instructions. One kind of control unit for issuing uses an array of electronic logic, a "scoreboard" that detects when an instruction can be issued. The "height" of the array is the number of execution units, and the "length" and "width" are each the number of sources of operands. When all the items come together, the signals from the operands and execution unit will cross. The logic at this intersection detects that the instruction can work, so the instruction is "issued" to the free execution unit. An alternative style of issuing control unit implements the Tomasulo algorithm, which reorders a hardware queue of instructions. In some sense, both styles utilize a queue. The scoreboard is an alternative way to encode and reorder a queue of instructions, and some designers call it a queue table.

With some additional logic, a scoreboard can compactly combine execution reordering, register renaming and precise exceptions and interrupts. Further it can do this without the power-hungry, complex content-addressable memory used by the Tomasulo algorithm.

If the execution is slower than writing the results, the memory write-back queue always has free entries. But what if the memory writes slowly? Or what if the destination register will be used by an "earlier" instruction that has not yet issued? Then the write-back step of the instruction might need to be scheduled. This is sometimes called "retiring" an instruction. In this case, there must be scheduling logic on the back end of execution units. It schedules access to the registers or memory that will get the results.

Retiring logic can also be designed into an issuing scoreboard or a Tomasulo queue, by including memory or register access in the issuing logic.

Out of order controllers require special design features to handle interrupts. When there are several instructions in progress, it is not clear where in the instruction stream an interrupt occurs. For input and output interrupts, almost any solution works. However, when a computer has virtual memory, an interrupt occurs to indicate that a memory access failed. This memory access must be associated with an exact instruction and an exact processor state, so that the processor's state can be saved and restored by the interrupt. A usual solution preserves copies of registers until a memory access completes.

Also, out of order CPUs have even more problems with stalls from branching, because they can complete several instructions per clock cycle, and usually have many instructions in various stages of progress. So, these control units might use all of the solutions used by pipelined processors.

Translating control units
Some computers translate each single instruction into a sequence of simpler instructions. The advantage is that an out of order computer can be simpler in the bulk of its logic, while handling complex multi-step instructions. x86 Intel CPUs since the Pentium Pro translate complex CISC x86 instructions to more RISC-like internal micro-operations.

In these, the "front" of the control unit manages the translation of instructions. Operands are not translated. The "back" of the CU is an out-of-order CPU that issues the micro-operations and operands to the execution units and data paths.

Control units for low-powered computers
Many modern computers have controls that minimize power usage. In battery-powered computers, such as those in cell-phones, the advantage is longer battery life. In computers with utility power, the justification is to reduce the cost of power, cooling or noise.

Most modern computers use CMOS logic. CMOS wastes power in two common ways: By changing state, i.e. "active power", and by unintended leakage. The active power of a computer can be reduced by turning off control signals. Leakage current can be reduced by reducing the electrical pressure, the voltage, making the transistors with larger depletion regions or turning off the logic completely.

Active power is easier to reduce because data stored in the logic is not affected. The usual method reduces the CPU's clock rate. Most computer systems use this method. It is common for a CPU to idle during the transition to avoid side-effects from the changing clock.

Most computers also have a "halt" instruction. This was invented to stop non-interrupt code so that interrupt code has reliable timing. However, designers soon noticed that a halt instruction was also a good time to turn off a CPU's clock completely, reducing the CPU's active power to zero. The interrupt controller might continue to need a clock, but that usually uses much less power than the CPU.

These methods are relatively easy to design, and became so common that others were invented for commercial advantage. Many modern low-power CMOS CPUs stop and start specialized execution units and bus interfaces depending on the needed instruction. Some computers even arrange the CPU's microarchitecture to use transfer-triggered multiplexers so that each instruction only utilises the exact pieces of logic needed.

One common method is to spread the load to many CPUs, and turn off unused CPUs as the load reduces. The operating system's task switching logic saves the CPUs' data to memory. In some cases, one of the CPUs can be simpler and smaller, literally with fewer logic gates. So, it has low leakage, and it is the last to be turned off, and the first to be turned on. Also it then is the only CPU that requires special low-power features. A similar method is used in most PCs, which usually have an auxiliary embedded CPU that manages the power system. However, in PCs, the software is usually in the BIOS, not the operating system.

Theoretically, computers at lower clock speeds could also reduce leakage by reducing the voltage of the power supply. This affects the reliability of the computer in many ways, so the engineering is expensive, and it is uncommon except in relatively expensive computers such as PCs or cellphones.

Some designs can use very low leakage transistors, but these usually add cost. The depletion barriers of the transistors can be made larger to have less leakage, but this makes the transistor larger and thus both slower and more expensive. Some vendors use this technique in selected portions of an IC by constructing low leakage logic from large transistors that some processes provide for analog circuits. Some processes place the transistors above the surface of the silicon, in "fin fets", but these processes have more steps, so are more expensive. Special transistor doping materials (e.g. hafnium) can also reduce leakage, but this adds steps to the processing, making it more expensive. Some semiconductors have a larger band-gap than silicon. However, these materials and processes are currently (2020) more expensive than silicon.

Managing leakage is more difficult, because before the logic can be turned-off, the data in it must be moved to some type of low-leakage storage.

Some CPUs make use of a special type of flip-flop (to store a bit) that couples a fast, high-leakage storage cell to a slow, large (expensive) low-leakage cell. These two cells have separated power supplies. When the CPU enters a power saving mode (e.g. because of a halt that waits for an interrupt), data is transferred to the low-leakage cells, and the others are turned off. When the CPU leaves a low-leakage mode (e.g. because of an interrupt), the process is reversed.

Older designs would copy the CPU state to memory, or even disk, sometimes with specialized software. Very simple embedded systems sometimes just restart.

Integrating with the Computer
All modern CPUs have control logic to attach the CPU to the rest of the computer. In modern computers, this is usually a bus controller. When an instruction reads or writes memory, the control unit either controls the bus directly, or controls a bus controller. Many modern computers use the same bus interface for memory, input and output. This is called "memory-mapped I/O". To a programmer, the registers of the I/O devices appear as numbers at specific memory addresses. x86 PCs use an older method, a separate I/O bus accessed by I/O instructions.

A modern CPU also tends to include an interrupt controller. It handles interrupt signals from the system bus. The control unit is the part of the computer that responds to the interrupts.

There is often a cache controller to cache memory. The cache controller and the associated cache memory is often the largest physical part of a modern, higher-performance CPU. When the memory, bus or cache is shared with other CPUs, the control logic must communicate with them to assure that no computer ever gets out-of-date old data.

Many historic computers built some type of input and output directly into the control unit. For example, many historic computers had a front panel with switches and lights directly controlled by the control unit. These let a programmer directly enter a program and debug it. In later production computers, the most common use of a front panel was to enter a small bootstrap program to read the operating system from disk. This was annoying. So, front panels were replaced by bootstrap programs in read-only memory.

Most PDP-8 models had a data bus designed to let I/O devices borrow the control unit's memory read and write logic. This reduced the complexity and expense of high speed I/O controllers, e.g. for disk.

The Xerox Alto had a multitasking microprogrammable control unit that performed almost all I/O. This design provided most of the features of a modern PC with only a tiny fraction of the electronic logic. The dual-thread computer was run by the two lowest-priority microthreads. These performed calculations whenever I/O was not required. High priority microthreads provided (in decreasing priority) video, network, disk, a periodic timer, mouse, and keyboard. The microprogram did the complex logic of the I/O device, as well as the logic to integrate the device with the computer. For the actual hardware I/O, the microprogram read and wrote shift registers for most I/O, sometimes with resistor networks and transistors to shift output voltage levels (e.g. for video). To handle outside events, the microcontroller had microinterrupts to switch threads at the end of a thread's cycle, e.g. at the end of an instruction, or after a shift-register was accessed. The microprogram could be rewritten and reinstalled, which was very useful for a research computer.

Functions of the control unit
Thus a program of instructions in memory will cause the CU to configure a CPU's data flows to manipulate the data correctly between instructions. This results in a computer that could run a complete program and require no human intervention to make hardware changes between instructions (as had to be done when using only punch cards for computations before stored programmed computers with CUs were invented).

Hardwired control unit
Hardwired control units are implemented through use of combinational logic units, featuring a finite number of gates that can generate specific results based on the instructions that were used to invoke those responses. Hardwired control units are generally faster than the microprogrammed designs.

This design uses a fixed architecture—it requires changes in the wiring if the instruction set is modified or changed. It can be convenient for simple, fast computers.

A controller that uses this approach can operate at high speed; however, it has little flexibility. A complex instruction set can overwhelm a designer who uses ad hoc logic design.

The hardwired approach has become less popular as computers have evolved. Previously, control units for CPUs used ad hoc logic, and they were difficult to design.

Microprogram control unit
The idea of microprogramming was introduced by Maurice Wilkes in 1951 as an intermediate level to execute computer program instructions. Microprograms were organized as a sequence of microinstructions and stored in special control memory. The algorithm for the microprogram control unit, unlike the hardwired control unit, is usually specified by flowchart description. The main advantage of a microprogrammed control unit is the simplicity of its structure. Outputs from the controller are by microinstructions. The microprogram can be debugged and replaced similarly to software.

Combination methods of design
A popular variation on microcode is to debug the microcode using a software simulator. Then, the microcode is a table of bits. This is a logical truth table, that translates a microcode address into the control unit outputs. This truth table can be fed to a computer program that produces optimized electronic logic. The resulting control unit is almost as easy to design as microprogramming, but it has the fast speed and low number of logic elements of a hard wired control unit. The practical result resembles a Mealy machine or Richards controller.

title: Control unit