0
$\begingroup$

Suppose, I have a 4-bit binary Incrementor that uses XOR gates to increment the inputted number by the value of 1 (b0001, to be precise).

Suppose, we connect it to 4 D-Flip-Flops (DFF) to create a counter that goes up every time we send the clock pulse. This is straightforward: Just connect the outputs of DFFs to the corresponding inputs of the Incrementor, and the outputs of the incrementor—to the corresponding inputs of the DFFs.

What I would like to figure out is how to alter the set up in order to make the counter go down instead of up at the flip of the up/down switch (e.g., goes down every time we send the clock pulse and the up/down switch is activated). I would prefer a walk through the entire process instead of just a ready answer.

$\endgroup$
0
$\begingroup$

Hint: what happens when you add $2^4$ each clock tick? What about $2^4-1$? How can you implement this (efficiently)?

You can also solve this in general: what happens when you add $2^n-1$ for an $n$-bit number? What would be the general way to implement this?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.