Home › Practice › RTL Design › Is it a decimal digit?
Is it a decimal digit?
EasyRTLcombinationalcodes
A calculator keypad sends 4 bits for every key you press. But only the keys 0 to 9 are real, so the circuit behind it must flag any pattern that is not a digit.
Concept first. BCD (binary coded decimal) stores each decimal digit in its own group of 4 bits: the digit 7 is 0111, the digit 9 is 1001. Four bits can count from 0 to 15, but a decimal digit only goes up to 9, so six patterns are never used by any digit. A circuit that receives BCD has to tell a real digit from one of those six. Write the six unused patterns down, and look at which bits they have in common.
What to build.
- Input
d[3:0], outputok. okis 1 whendis a value from 0 to 9, and 0 for 10 to 15.- No clock. The output follows the input.
No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.