
831 So.2d 59 (2001)
STATE of Alabama
v.
Herman R. CORLEY.
CR-00-1012.
Court of Criminal Appeals of Alabama.
December 21, 2001.
Rehearing Denied January 25, 2002.
Certiorari Denied March 22, 2002.
*60 William F. Addison, asst. gen. counsel, Department of Corrections, for appellant.
Herman Corley, pro se.
Alabama Supreme Court 1010932.
WISE, Judge.
On October 27, 1998, Herman R. Corley pleaded guilty to one count of distribution of a controlled substance, a violation of § 13A-12-211, Ala.Code 1975.[1] The trial court sentenced Corley to a base sentence of 10 years' imprisonment. However, because the offense occurred within a three-mile radius of school campus, Corley's sentence was enhanced by five years, as mandated by § 13A-12-250, Ala.Code 1975, and by an additional five years because the offense also occurred within a three-mile radius of a public housing facility, as mandated by § 13A-12-270, Ala.Code 1975, so that Corley's sentence was 20 years' imprisonment. No direct appeal was taken from this conviction.
While he was an inmate at the Frank Lee Correctional Facility in Elmore County, Corley filed several motions in the Montgomery Circuit Court and the Elmore Circuit Court, challenging the decision by the Department of Corrections ("DOC") that he was not entitled to correctional incentive good time ("good time"), pursuant to § 14-9-41, Ala.Code 1975. The motions challenged whether the State had correctly calculated the time Corley must serve in prison; therefore, the circuit courts treated Corley's motions as petitions for a writ of habeas corpus. However, because the motions were filed while Corley was an inmate in Elmore County, the motions filed in Montgomery Circuit Court were transferred to Elmore County, where venue was proper. See § 15-21-6, Ala.Code 1975.
Corley contended in his petition that DOC had erroneously denied him good-time earning status. Specifically, he alleged that his 20-year sentence was, in fact, three separate sentences of 10 years, 5 years, and 5 years, thereby qualifying him for good-time status on each sentence. DOC filed a motion to dismiss, alleging that Corley was serving one 20-year sentence, *61 as opposed to three sentences aggregating 20 years. Therefore, DOC argued, Corley was prohibited from earning good time under § 14-9-41, Ala.Code 1975, because he was serving a sentence of more than 15 years.
The circuit court held an evidentiary hearing on November 20, 2000, and on December 12, 2000, it entered an order stating that Corley was serving three separate sentences "pursuant to separate acts of the legislature," and it concluded that Corley was entitled to earn good time. The State appealed from the circuit court's granting of Corley's habeas corpus petition.
A petition for a writ of habeas corpus is the proper method by which to test whether the State has correctly calculated the time an inmate must serve in prison. Breach v. State, 687 So.2d 1257 (Ala.Crim. App.1996); Swicegood v. State, 646 So.2d 158 (Ala.Crim.App.1993). Therefore, the circuit court properly treated Corley's motions as petitions for a writ of habeas corpus. However, the trial court incorrectly concluded that Corley was serving three separate sentences of 10 years, 5 years, and 5 years. This Court has consistently treated sentences imposed pursuant to §§ 13A-12-250 and 13A-12-270, Ala. Code 1975, as enhancements to a base sentence and, thus, as part of a single aggregate sentence for an offense. See, e.g., Pearson v. State, 777 So.2d 308, 310 (Ala.Crim.App.2000); Ford v. State, 645 So.2d 317, 319 (Ala.Crim.App.1994); Nye v. State, 639 So.2d 1383, 1387 (Ala.Crim. App.1993); Pettway v. State, 624 So.2d 696, 698-99 (Ala.Crim.App.), cert. denied, 624 So.2d 700 (Ala.1993); Jones v. State, 593 So.2d 155, 157 (Ala.Crim.App.1991); Dixon v. State, 572 So.2d 512, 513 (Ala. Crim.App.1990). Although never specifically addressing this issue, the Supreme Court has likewise treated sentence enhancements imposed pursuant to §§ 13A-12-250 and -270 as part of a single sentence, rather than separate sentences. See Ex parte Garner, 781 So.2d 253, 256 (Ala.2000); Ex parte Bailey, 778 So.2d 163, 166 (Ala.2000).
Indeed, this Court rejected a claim similar to Corley's in Davis v. State, 673 So.2d 845 (Ala.Crim.App.1995). In Davis, the appellant argued that the trial court had erroneously sentenced him to a single 20-year term of imprisonment for each conviction, rather than a sentence of 10 years plus 2 additional sentences of 5 years, and that its doing so deprived him of the opportunity to qualify for good time. We held that because the appellant's sentence was within the range prescribed by law, "the trial court committed no error in sentencing the appellant to 20 years for each conviction regardless of the applicability of the Correctional Incentive Time Act." 673 So.2d at 847. Our decision in Davis is consistent with our more recent decision in Pearson v. State, 794 So.2d 448, 449 (Ala.Crim.App.2001), in which we treated the appellant's sentence as a single sentence.
In further support of our holding, we note that we are persuaded by an attorney general's opinion submitted to the circuit court by the State. That opinion stands for the proposition that the base sentence, together with any enhancements, must total less than 15 years' imprisonment for an inmate to be eligible to earn good time. See Attorney General Opinion No. 91-00129, December 19, 1990. We recognize that "[w]hile an opinion of the attorney general is not binding, it can constitute persuasive authority." Alabama-Tennessee Natural Gas Co. v. Southern Natural Gas Co., 694 So.2d 1344, 1346 (Ala.1997) (citing Poe v. Grove Hill Mem'l Hosp. Bd., 441 So.2d 861, 863 (Ala.1983)).
*62 Given that the two 5-year sentence-enhancements could not have been imposed absent the initial 10-year base sentence, the circuit court's conclusion that Corley's 20-year sentence constituted three separate sentences is unsupported by the plain language of §§ 13A-12-250 and -270 and by prior caselaw. Corley's 20-year sentence was a single sentence. Therefore, pursuant to the language of § 14-9-41, Corley is prohibited from earning good time.
Based on the foregoing, the trial court's order is reversed and this cause is remanded for further proceedings consistent with this opinion.
REVERSED AND REMANDED.
McMILLAN, P.J., and COBB, BASCHAB, and SHAW, JJ., concur.
NOTES
[1]  Corley also pleaded guilty to one count of possession of a controlled substance, a violation of § 13A-12-212, Ala.Code 1975. However, no issues raised in this appeal are related to that conviction.
