Home › Practice › RTL Design › Up/down counter with load
Up/down counter with load
MediumRTLcounters
Build a 4-bit counter that can count up, count down, or load a value.
rstis synchronous, active-high, and setsqto 0. It wins over everything else.- Otherwise, if
load=1,qtakes the value ofd. This wins over counting. - Otherwise, if
en=1:up=1adds 1,up=0subtracts 1. It wraps: 15 to 0 going up, 0 to 15 going down. - Otherwise
qholds.
Priority from highest: rst, load, en.
No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.