How to go from truth table to circuit schematic and then breadboard?

Thread Starter

Jamie Kyle Thomas

Joined Dec 9, 2016
24
So for thee last 5 days I have been struggling to complete some work for University. So much so that my lecturer laughed when I handed him my effort for the weekend.

I need to design a machine using combinational logic circuits with 3 inputs (A,B,C).

A Red LED will turn on whenever the value of the combination inputs are Even number, a Green LED if the value of the combination inputs is Odd number, and no Green LED, or Red LED will turn on if the combination input are Zero.

upload_2016-12-14_16-8-28.png

So this is what I have so far
upload_2016-12-14_16-7-21.png

I'm not even 100% sure this is correct as the wording of the document is a bit difficult to understand.

From there I wrote my output functions, this was task 2.

upload_2016-12-14_16-9-59.png


I then was asked to simplify these functions for task 3 using either Boolean logic or a Karnaugh map.

upload_2016-12-14_16-11-4.png

upload_2016-12-14_16-11-36.png

Highlighted in green is everything that I have done so far. From here I am expected to sketch a schematic from these simplifications I have.

Honestly, despite watching what feels like hundreds of youtube videos, I just cannot understand or comprehend how to go from the simplification to the circuit diagram, and then on to the breadboard.

I have attatched the full document with my attempts to this thread.

Thanks in advance.
 

Attachments

WBahn

Joined Mar 31, 2012
30,077
Let's focus on the truth table first.

First, simply go through your truth table and identify those combinations that are (1) even, (2) odd, (3) zero. Do it any way that is easy. Perhaps just add three new columns, one for each, and fill it in with a 0 if it is false and a 1 if it is true.
 

WBahn

Joined Mar 31, 2012
30,077
Oh, it might help to add another column that is nothing more than the value represented by each input combination.
 

Thread Starter

Jamie Kyle Thomas

Joined Dec 9, 2016
24
Thanks for the quick reply. I'm having a bit of a problem with the wording of the question, this specific part - "If the combinational inputs where C, B and A as (0 1 0), this combination input value is equal to 2 (it is an Even number)" The problem I have though, isn't 0 1 0 odd rather than the even it says in the example?

The next example also says "If the combinational inputs where C, B and A as (0 1 1), this input combination value is equal to 3 (it is an Odd number); "

How do I know the input combination value is equal to 3? Is it because there is a 1 in the third column?
 

WBahn

Joined Mar 31, 2012
30,077
Thanks for the quick reply. I'm having a bit of a problem with the wording of the question, this specific part - "If the combinational inputs where C, B and A as (0 1 0), this combination input value is equal to 2 (it is an Even number)" The problem I have though, isn't 0 1 0 odd rather than the even it says in the example?

The next example also says "If the combinational inputs where C, B and A as (0 1 1), this input combination value is equal to 3 (it is an Odd number); "

How do I know the input combination value is equal to 3? Is it because there is a 1 in the third column?
Ah, so this helps focus us on the heart of the problem (at least at this stage).

Are you familiar with binary numbers? For instance, if asked to represent the value 12 in binary, could you come up with "1100"? Or if asked what value is represented by the binary value "1001" could you come up with 9?

If so, then all they are saying is to take the values for C, B, and A and interpret them as a binary value in which C is the most significant bit and A is the least significant bit.

If not, then Google for "binary numbers" or something similar and see if that helps, then come back and ask about what is still uncertain about it.
 

Thread Starter

Jamie Kyle Thomas

Joined Dec 9, 2016
24
I'm familiar with Binary numbers and converting between that and decimal. I either missed or completely forgot that that CBA would be assigned to the powers of 2. I have updated my truth table so now I have this

upload_2016-12-14_17-10-51.png

So now my output functions are

Green LED - CBA' + CB'A + C'BA' + CBA
Red LED - C'BA' + CB'A' + CBA'

I have then inserted these in to their respective Karnaugh Maps

Green LED
upload_2016-12-14_17-16-22.png

Red LED
upload_2016-12-14_17-15-54.png

Now that I've corrected my truth table (hopefully) am I now more along the right lines? I know the next step is now to group these and simplify my expression but I have zero confidence in my working and am very worried about messing it up.
 

WBahn

Joined Mar 31, 2012
30,077
At each step of the problem solving process, ask yourself (where possible) is the results thus far make sense.

So look at your K-map for the Green LED. Your map says that the LED should be ON whenever A is LO and B is HI. Does this agree with your truth table?

Then look at your K-map for the Red LED. Your map says that the LED should be OFF whenever C is HI. Does this agree with your truth table?
 

Thread Starter

Jamie Kyle Thomas

Joined Dec 9, 2016
24
Thanks for the clarifaction, I'm making such simple errors it's honestly very frustrating.

I have updated my maps and checked a few times to see if they correlate with my truth table and it appears this time they do.

upload_2016-12-14_17-43-34.png
upload_2016-12-14_17-41-0.png

Are these looking better now?
 

Attachments

MrAl

Joined Jun 17, 2014
11,496
Hi,

Yeah this does not sound like a parity type problem but a pure binary number problem.
In other words, 1, 3, 5, 7 are considered odd, and 2,4,6 are considered even.
Input A is the first digit, B the second, and C the third. So C=1 B=1 A=0 which is binary 110 is decimal "6".

This is actually a very simple problem if you look at it this way and the circuit will be ultra simple. I dont want to say too much yet though.
 

Thread Starter

Jamie Kyle Thomas

Joined Dec 9, 2016
24
Hi,

Yeah this does not sound like a parity type problem but a pure binary number problem.
In other words, 1, 3, 5, 7 are considered odd, and 2,4,6 are considered even.
Input A is the first digit, B the second, and C the third. So C=1 B=1 A=0 which is binary 110 is decimal "6".

This is actually a very simple problem if you look at it this way and the circuit will be ultra simple. I dont want to say too much yet though.
I believe I have done this in my updated truth table in my last post.
Does this look better?



Thanks very much for the reply.
 

WBahn

Joined Mar 31, 2012
30,077
Thanks for the clarifaction, I'm making such simple errors it's honestly very frustrating.

I have updated my maps and checked a few times to see if they correlate with my truth table and it appears this time they do.

View attachment 116868
View attachment 116867

Are these looking better now?
Yes, much better.

We all make simple mistakes, which just underscores the critical need to develop the second-nature habit of always doing everything reasonable to check your work. One of the beauties of most engineering fields is that the correctness of the answer is usually pretty easy to establish from the answer itself, no matter how hard it was to come up with the answer in the first place.

Once you reduce your K-map for the Green LED, you will want to ask yourself if that result wasn't pretty obvious from the truth table itself. But we don't always see "obvious" answers, except possibly in hindsight, so it's reassuring to know that slugging it out will still yield the same result.
 

Thread Starter

Jamie Kyle Thomas

Joined Dec 9, 2016
24
Yes, much better.

We all make simple mistakes, which just underscores the critical need to develop the second-nature habit of always doing everything reasonable to check your work. One of the beauties of most engineering fields is that the correctness of the answer is usually pretty easy to establish from the answer itself, no matter how hard it was to come up with the answer in the first place.

Once you reduce your K-map for the Green LED, you will want to ask yourself if that result wasn't pretty obvious from the truth table itself. But we don't always see "obvious" answers, except possibly in hindsight, so it's reassuring to know that slugging it out will still yield the same result.
Finally I feel like I'm making progress. Thank you so much for the help so far.
Looking back from my answer to the problem originally has given me some clarity I feel.

I have had a go at simplifying my Karnaugh maps (I used a youtube tutorial) I came up with the following

Red LED = A'C + A'B
Green LED = A (not 100% sure on this as it seems to simple, but looking at my map it seems A is the only consistent thing throughout)

Can you let me know if this is correct?
 

WBahn

Joined Mar 31, 2012
30,077
Finally I feel like I'm making progress. Thank you so much for the help so far.
Looking back from my answer to the problem originally has given me some clarity I feel.

I have had a go at simplifying my Karnaugh maps (I used a youtube tutorial) I came up with the following

Red LED = A'C + A'B
Green LED = A (not 100% sure on this as it seems to simple, but looking at my map it seems A is the only consistent thing throughout)

Can you let me know if this is correct?
That is correct.

Let's consider the nature of even/odd binary numbers. A number is even if it is divisible by two. For a binary number, the weight for every position except the least-significant one is divisible by two, so as long as the least significant bit is zero, the number is even. Similarly, the number is odd if the least significant bit is a one. So to determine even and odd you only need to look at the least significant bit. Since the green LED is on for odd numbers and off for zero, we don't need to do anything special for the case of zero because zero is not an odd number and, hence, the green LED wouldn't have been on anyway. So the signal for the green LED is simply the least significant bit. For the red LED, it is on for even numbers and off for zero. We get the even numbers by inverting the least significant bit, but that would make it on for zero, too. So we suppress that by noting that if either B or C are a one, then the number is not zero. So our logic can be restated as: The Red LED is ON if (A is LO) AND (B or C is HI). This translates directly to:

Red = A'(B + C) = A'B + A'C
 

Thread Starter

Jamie Kyle Thomas

Joined Dec 9, 2016
24
That is correct.

Let's consider the nature of even/odd binary numbers. A number is even if it is divisible by two. For a binary number, the weight for every position except the least-significant one is divisible by two, so as long as the least significant bit is zero, the number is even. Similarly, the number is odd if the least significant bit is a one. So to determine even and odd you only need to look at the least significant bit. Since the green LED is on for odd numbers and off for zero, we don't need to do anything special for the case of zero because zero is not an odd number and, hence, the green LED wouldn't have been on anyway. So the signal for the green LED is simply the least significant bit. For the red LED, it is on for even numbers and off for zero. We get the even numbers by inverting the least significant bit, but that would make it on for zero, too. So we suppress that by noting that if either B or C are a one, then the number is not zero. So our logic can be restated as: The Red LED is ON if (A is LO) AND (B or C is HI). This translates directly to:

Red = A'(B + C) = A'B + A'C
If I want to no get a circuit diagram from this, do I further simplify? so does A'B + A'C = A'BC?

So just before I start my circuit diagram, should my final expression be A'BC + A?
 

Thread Starter

Jamie Kyle Thomas

Joined Dec 9, 2016
24
I'm not sure that A'BC + A is the correct answer. I have tried converting this to a circuit diagram and have had trouble. What I have so far is

A' ----INVERTER------!______
B ------------------------! AND ) --------->
C-------------------------!______)
................................................................ (NOT GATE)-------------- Output
.................................. !______
A-------------------------! AND )---------->
..................................!______)
IGNORE the ..... these are just fillers used for formatting

I hope it's clear to see what I have so far and I hope someone can send me in the correct direction
 

djsfantasi

Joined Apr 11, 2010
9,163
Are you sure about that? Is A'BC+A the same as A'BC+A? As WBahn has pointed out, have you done everything reasonable to check your work?
 

Thread Starter

Jamie Kyle Thomas

Joined Dec 9, 2016
24
Are you sure about that? Is A'BC+A the same as A'BC+A? As WBahn has pointed out, have you done everything reasonable to check your work?
> Is A'BC+A the same as A'BC+A?

Well it looks the same but I'm guessing it's not (otherwise you probably wouldn't either)

> have you done everything reasonable to check your work?

The problem I'm having is not actually understanding what is reasonable to compare too. Like I've said before I'm really struggling grasping these concepts, although I do feel like I made some progress today I feel I've hit a wall this evening.
 

djsfantasi

Joined Apr 11, 2010
9,163
> Is A'BC+A the same as A'BC+A?

Well it looks the same but I'm guessing it's not (otherwise you probably wouldn't either)

> have you done everything reasonable to check your work?

The problem I'm having is not actually understanding what is reasonable to compare too. Like I've said before I'm really struggling grasping these concepts, although I do feel like I made some progress today I feel I've hit a wall this evening.
Make two truth tables, one for A'B+A'C and one for A'BC+A and compare them...
 

Thread Starter

Jamie Kyle Thomas

Joined Dec 9, 2016
24
Make two truth tables, one for A'B+A'C and one for A'BC+A and compare them...
So I can see that they are not the same, so back to my initial part of A'B + A'C + A.

Would this be represented in a circuit diagram with
by having the first A' go through an inverter to an AND gate, B also going to the same AND gate. Then the 2nd A' to a seperate AND gate and C to the same gate. And then finally A on it's own goes directly in to a seperate AND gate, and then all of these go to one OR gate at the end?

Is this the best way to do it or am I able to fit all inputs in to one AND gate?
 

MrAl

Joined Jun 17, 2014
11,496
I believe I have done this in my updated truth table in my last post.
Does this look better?



Thanks very much for the reply.
Hi,

Yes that looks good :)

See how simple this gets now (as i think you have spotted the simplification for the Green LED)?

There is a catch however, and that is the assignment question seems to be asking for you to perform specific tasks one step after the other. First [1] they want the truth table (which you have accomplished), and then [2] they want the logic statements, and then [3] they want the reduction of those statements, and then finally [4] they want the logic circuit using standard gates.
So you have completed step 1, and for step 2 you probably have to do the full logic statement for the Green LED and Red LED where you include all three inputs ABC in the statements, then for step 3 show how you reduce those statements from step 2, then for step 4 show the circuit.
So for a quick example of step 2 for the Green LED (the simpler one) we would probably have to see at first:
C'B'A+C'BA+CB'A+CBA

and then for step 3 show how you reduce these to get the single A statement. That seems to be part of the assignment.

BTW, bit A is the odd/even bit and that's true for any number of binary bits. A typical test for odd or even integer in a language like C or C++ is to use the logical AND function to mask out the other bits and then see if the result is zero or non zero.

As for choosing the logic gates, do you know how a statement like AB converts to an AND gate and A+B converts to an OR gate for example?
 
Top