Even or Odd detection - A simple question

Thread Starter

bjerkset

Joined Nov 8, 2009
5
Good day fellows :)

I am trying to design a combinational logic circuit which has four inputs (A,B,C,D) and one output ( say G), that is one iff the input is greater then one and is divisible by 2. The real problem for me is that the input is a decimal number, so i suspect that i will have to somehow convert this input to binary as a first step.

I also have realized that if a binary number is divisible by 2, the least signifigant bit will be zero.

I assume that i will have to impliment using a multiplexer of some sort but am really unsure beyond that point.

Any help or ideas is grealy appreaciated.
 

SgtWookie

Joined Jul 17, 2007
22,230
Why don't you start by generating a truth table of your inputs and desired outputs?

You've learned about truth tables, right?

Then try to express the output in Boolean algebra, and simplify it.

As far as decimal to binary - construct a truth table of all the possible bit combinations for a valid 4-bit decimal number, and another truth table of all the possible bit combinations for a valid 4-bit binary number. Then compare the two to determine what, if any, conversions you might need to make.

Then show us your work.
 

Thread Starter

bjerkset

Joined Nov 8, 2009
5
Thanks for your help, ill certainly try what you have suggested, however something tells me there is an easier way.
 

SgtWookie

Joined Jul 17, 2007
22,230
If you start with a truth table, you will then know what should happen with any possible input.

Then you use Boolean logic to simplify it.

It may take a while to go through the steps, but if done properly you will simplify the logic considerably.
 

SgtWookie

Joined Jul 17, 2007
22,230
But in that case so will the LSB be one and not zero therfore not a even number. Or am I wrong?
The LSB must be zero in order for the 4-bit number to be even.
Additionally, at least one of the remaining bits must be non-zero to satisfy the "> 1" criteria.
 

JDT

Joined Feb 12, 2009
657
output, that is one iff the input is greater then one and is divisible by 2. .
The fact that zero is also "even" is irrelevant as it is not greater than 1.

iff = "if and only if"

I should not have had the final negate though. Doh!

Correct?
 

SgtWookie

Joined Jul 17, 2007
22,230
Signed or unsigned?
In a 4-bit number? Can't say I've seen one; a range of -8 to 7 wouldn't have much utility. Since the problem statement did not include a sign, it would be safe to assume an unsigned number.

Is the output high on an even number or an odd number?
High on an even number greater than 1, otherwise low.

What about numbers between 1 and 3?
Answered above.
 
Top