Description
Even Digits
Design a hardware module that finds numbers with only even digits (0,2,4,6,8) within a given range [A,B]. The module should efficiently count and optionally enumerate all such numbers in the range, optimizing for parallel digit processing.
Example: For N=42, find count of numbers with only even digits (0,2,4,6,8) from 1 to 42. Numbers like 2, 4, 6, 8, 20, 22, 24, 26, 28, 40, 42.
Source: Google Kickstart 2018 Round A - Problem A: Even Digits
Input
n
32-bit Unsigned IntegerNumber to find closest even-digit number.
Output
32-bit Unsigned Integer
Closest number with only even digits.