# Logic Circuits - Binary divisible by 16 [closed]

I have a question

  Given a 16-bit register A holding a number in 2’s complement form, use a
single gate (e.g., AND, OR,
XOR, NAND, NOR, NOT) with an arbitrary number of inputs to implement a
circuit that produces an
output 1 if the number is divisible by 16, and an output 0 otherwise. The
bits are labelled A15, A14, ..., A0.


I'm confused at how this answer is expected because the question is only 2 marks my answer was that it would be a single XOR gate with inputs a0-a15 - would this be correct and why?

## closed as unclear what you're asking by Evil, fade2black, David Richerby, Yuval Filmus, codyDec 7 '17 at 16:07

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• We discourage "please check whether my answer is correct" questions, as only "yes/no" answers are possible, which won't help you or future visitors. See here and here. Can you edit your post to ask about a specific conceptual issue you're uncertain about? As a rule of thumb, a good conceptual question should be useful even to someone who isn't looking at the problem you happen to be working on. If you just need someone to check your work, you might seek out a friend, classmate, or teacher. – D.W. Dec 7 '17 at 6:04
• Why don't you write some code to implement your solution, and check what it computes for all $2^{16}$ possible values of the register and check whether it is correct in all cases? That way you can check your own answer... you don't need us. – D.W. Dec 7 '17 at 6:05

A decimal number is divisible by 100 if it ends with two zeroes. The same thing happens in your case, and leads to a solution using a single NOR gate.

• How is this possible? So are you saying the NOR gate would have 2 inputs A0,A1? – rahulchawla Dec 7 '17 at 14:44
• I think I have given you enough hints. – Yuval Filmus Dec 7 '17 at 14:45
• I'm just a little confused at the wording of question because it says 'arbitrary num of inputs' so does that mean the inputs have to include all the bits or not? – rahulchawla Dec 7 '17 at 16:31
• The number of inputs is arbitrary. Your circuit is definitely not arbitrary. – Yuval Filmus Dec 7 '17 at 16:33