# A 4-bit combinatorial circuit that outputs 1 when integer greater than 7 and is odd number

I need to draw a combinatorial circuit that when an integer is greater than 7 and is an odd number, the output will be 1. There are 4 inputs representing 4 bits and 1 output wire. The output wire is only 1 if an integer is greater than 7 and is an odd number.

My attempt: If I segment the 4-bit input as r x y z where if the input was 8, the 4-bits would be 1 0 0 1. I know that r and z must have an AND gate but cannot figure out a way to get x y to work. I drew a truth table and found that

• 1 0 0 1
• 1 0 1 1
• 1 1 0 1
• 1 1 1 1

must all equal to 1 to satisfy the condition placed. Any help is appreciated.

• Hint: only one gate is required. – Yuval Filmus Jan 24 '18 at 19:09
• @YuvalFilmus My initial thought was that as well; however, how do I check for integers greater than 8? If I use only one AND gate on r and z, how do I check for 1 1 0 1 (11) or 1 1 1 1 (15)? I'm not allowed to ground a charge apparently. I know it would be a very easy solution to simply have the r z bits connected to an AND gate and x y being grounded since as long as r z bits output a 1, then the x y bits do not matter. – JJMin Jan 24 '18 at 19:16
• Combinatorial circuits don't care about electromagnetism. If your question is about electromagnetism then it doesn't belong in this site. – Yuval Filmus Jan 24 '18 at 19:24
• JJMin: You asked about greater than seven, not eight. But you should figure out why greater than eight makes no difference. – gnasher729 Aug 23 '18 at 8:50

## 2 Answers

You've got the answer!

The number is eight or higher if the first bit is set. The number is odd if the last bit is set. So the answer is simply those two bits ANDed together. The two middle bits don't matter, you don't need to bother with them.

Greater than $7$ along with being odd implies numbers $9, 11, 13, 15$ which you have already listed out. Going by the bit pattern generated, the resulting circuit consists of only $r . z$. You won't need to check for other even numbers $>=8$ since they have $z$ bit as $0$, and numbers smaller than $8$ will ahve $r$ bit as $0$ and will thus output $0$.