leap year checking with vhdl

I still have hard time doing the assignment, Please I need help.
Here s the problem:

I have to design a circuit that takes as input YEAR (Y15…Y0), and generates the leap-year flag (L). The rule for a leap year is: a year is leap if it is divisible by 4 and greater than 1582, unless it is divisible by 100 and not by 400. I must implement my work in VHDL. I am NOT ALLOWED TO USE THE BUILT-IN VHDL ARITHMETIC OPERATORS (+, -, <, >, …). I can however use the built-in modulo operator. I should design my own blocks to implement the above leap-year conditions (divisible by 4, 100, 400), and to check whether the input is greater than 1582. I should take into account that the year is represented in BCD and not as a regular binary number. At the end ,Imust include a testbench for the code.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!