2
$\begingroup$

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.

$\endgroup$
  • 3
    $\begingroup$ Hint: only one gate is required. $\endgroup$ – Yuval Filmus Jan 24 '18 at 19:09
  • $\begingroup$ @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. $\endgroup$ – JJMin Jan 24 '18 at 19:16
  • 1
    $\begingroup$ Combinatorial circuits don't care about electromagnetism. If your question is about electromagnetism then it doesn't belong in this site. $\endgroup$ – Yuval Filmus Jan 24 '18 at 19:24
  • $\begingroup$ JJMin: You asked about greater than seven, not eight. But you should figure out why greater than eight makes no difference. $\endgroup$ – gnasher729 Aug 23 '18 at 8:50
1
$\begingroup$

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.

$\endgroup$
0
$\begingroup$

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$.

$\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.