Home > other >  Using Verilog HDL design a leap year calculator, calculating the time range is 1900-2100, the year o
Using Verilog HDL design a leap year calculator, calculating the time range is 1900-2100, the year o

Time:12-02

Although this code can run, but the function is wrong, it judgment for leap years, 2100 is not a leap year, but can't find the statement of the problem, have something wrong with the bosses to give directions

CodePudding user response:

Trouble, also don't know the post code, stick figure good trouble

CodePudding user response:

reference 1st floor qq_708907433 response:
, also don't know the post code, stick figure good trouble

Hello thank you for your reply, I input is BCD code, want to invoke trans BCD to decimal, doing a leap year judgment if delete call, BCD can't turn the decimal?

CodePudding user response:

Z=a + b * 1000 * 100 * 10 + c + d.
Is the ABCD four decimal number converted to hexadecimal number, ABCD without special transformation.

CodePudding user response:

The
reference 3 floor qq_708907433 response:
1000 + z=a * b * 100 * 10 + c + d;
Is the ABCD four decimal number converted to hexadecimal number, ABCD without special transformation,

A, b, c, and d are four binary said 0001, 1001, 0000, 0000, 1900 and 1900 is a leap year, that is what I mean, the same as you?

CodePudding user response:

You said the correct

CodePudding user response:

Also forgot the z is less only four bits wide, need 16
The output [15:0] z

CodePudding user response:

Don't know what I wrote, right, and it is also 2100 judgment for leap years, there should be a problem, I don't know how to change, for advice

CodePudding user response:

refer to 6th floor qq_708907433 response:
has forgotten z bits wide only four less, need 16
The output/15:0 z

Ok thank you very much
  • Related