xofun
Newbie level 3
Judge a leap year
Hi,all:
It is easy to achieve it in C code:
if(year%4==0 && year% 100!=0 || year%400==0 )
I want to transfer the C code to verilog code. Is there a function aviliable to judge a year can be divided exactly by 4,100,or 400?By right shift "year" with code "year>>1" for twice time,it is OK if i get 2 zeros.Then how about 100 and 400?
Best regards
Hi,all:
It is easy to achieve it in C code:
if(year%4==0 && year% 100!=0 || year%400==0 )
I want to transfer the C code to verilog code. Is there a function aviliable to judge a year can be divided exactly by 4,100,or 400?By right shift "year" with code "year>>1" for twice time,it is OK if i get 2 zeros.Then how about 100 and 400?
Best regards