(a) When the offense is punished by imprisonment in the county jail or workhouse, the term of imprisonment shall be fixed by the court, unless otherwise provided; provided, that when any person is indicted or presented in a court of record for the alleged commission of any misdemeanor, and pleads not guilty and is tried by a jury, upon demand of defendant timely made, the trial jury shall as a part of its verdict assess the punishment for the offense both as to fine and imprisonment within the limits now or later prescribed by law.
(b) When a defendant has timely made a request for a jury trial, the judge shall charge the jury that as a part of its verdict in the case, if it finds the defendant guilty, it shall fix the punishment for the offense within the limits prescribed by law, which limits shall be stated in the charge, and the judge shall not comment on the fact that the defendant has made the request for a jury trial.