cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Can MathCad work with boolean algebra?

xEnOn
1-Visitor

Can MathCad work with boolean algebra?

I've tried to use MathCad to help to simplify and expand boolean algebra but couldn't get it to work. I also tried to plot truth table on MathCad and the best I could get is to use the "explicit" evaluation. Using the simplify and expand keywords for the evaluation does not apply any effect to boolean algebra too.

How can I use MathCad to work with boolean algebra and logics?

21 REPLIES 21

I would say yes but a worksheet would be helpful.


Mike

http://communities.ptc.com/servlet/JiveServlet/showImage/2-149416-2532/bar_anim.gif

nas0k
12-Amethyst
(To:xEnOn)

Hopefully, a helpful worksheet from the old collab .

I wouldn't know to find it now.

nas

xEnOn
1-Visitor
(To:nas0k)

Can Mathcad simplify boolean algebra too? I have long boolean expression and if Mathcad could simplify these expression, it could save me a lot of time.

Ken Smith wrote:

Can Mathcad simplify boolean algebra too?

Yes, if we use not And but *, not Or but + etc

But I still don't quite get it.

I tried this in Mathcad: X v (~X ^ Y) but I don't get X v Y

I also tried like what you said and have it as X + (~X * Y) but Mathcad sees it as multiply and addition.

Also, how do I simplify it? I am using the "Shift + Enter" evaluation and then key in the "simplify" keyword.

StuartBruff
23-Emerald III
(To:xEnOn)

Ken Smith wrote:

But I still don't quite get it.

I tried this in Mathcad: X v (~X ^ Y) but I don't get X v Y

I also tried like what you said and have it as X + (~X * Y) but Mathcad sees it as multiply and addition.

Also, how do I simplify it? I am using the "Shift + Enter" evaluation and then key in the "simplify" keyword.

Could you please post your worksheet (preferably in M11 format).

By 'simplify' do you mean that you want to produce a simplified expression or produce a completely evaluated result?

Stuart

Unfortunately, I don't have a worksheet for this yet. But I am intending to using Mathcad to help me to solve some boolean expression.

And by simplifying, I mean returning a simplified boolean expression. So, if I have a long terms of boolean expression, I need a simplified expression that returns the same results as the long expression. So for example, if I put in (C' + A').C', it will just simplify the expression it and return a simplified expression of just C'.

mzeftel
12-Amethyst
(To:xEnOn)

Ken,

You can type in the Boolean expression, then press Ctrl+Shift+. (period). Type simplify in the placeholder.

See the Symbolics toolbar to see the choice of symbolic keywords.

If you scroll throught the Symbolic quicksheets, you'll find some examples with Boolean operators.

Regards,

Mona

StuartBruff
23-Emerald III
(To:mzeftel)

Mona Zeftel wrote:

Ken,

You can type in the Boolean expression, then press Ctrl+Shift+. (period). Type simplify in the placeholder.

See the Symbolics toolbar to see the choice of symbolic keywords.

If you scroll throught the Symbolic quicksheets, you'll find some examples with Boolean operators.

Mona,

I think what Ken may be after is symbolic simplification rather than evaluation,

eg, 'a and (b or not b)' simplifying to 'a'.

Unfortunately, I don't have M15 and my M14 has stopped playing ball (it opens but resolutely remains invisible), so I don't know what may be different about symbolic simplification of booleans - M11 doesn't appear to offer this capability.

Stuart

xEnOn
1-Visitor
(To:mzeftel)

Mona Zeftel wrote:

Ken,

You can type in the Boolean expression, then press Ctrl+Shift+. (period). Type simplify in the placeholder.

See the Symbolics toolbar to see the choice of symbolic keywords.

If you scroll throught the Symbolic quicksheets, you'll find some examples with Boolean operators.

Regards,

Mona

I tried this:

Untitled.jpg

But the correct simplified answer should be (a ^ b) + (~a ^ ~c)

if I put in (C' + A').C', it will just simplify the expression it and return a simplified expression of just C'.

How would that return just C? I don't think that quire right.

Mike

http://communities.ptc.com/servlet/JiveServlet/showImage/2-149416-2532/bar_anim.gif

Why shouldn't it be C'?

So Mathcad cannot do symbolic simplification? I am using Mathcad 14, by the way.

StuartBruff
23-Emerald III
(To:xEnOn)

Ken Smith wrote:

Why shouldn't it be C'?

So Mathcad cannot do symbolic simplification? I am using Mathcad 14, by the way.

Mathcad can do symbolic simplification in general (eg, calculus), but (not having access to M14 or M15) I don't believe that it can simplify a boolean expression in terms of the variable names only - it will symbolically evaluate a result, though. Eg, (a and not a) will produce (a or not a) if a doesn't have a value, but will give 1 if a has a value.

On a blank worksheet, try typing

(a or not a) simplify -> (using the Mathcad boolean operators in place of 'and' and 'not'.

and see what happens. Then define a:=1 (or 0) above the expression to confirm it evaluates to 1.

Stuart

Yes, it does evaluate to 1 with that expression. Looks like Mathcad can only evaluate but not simplify a boolean expression at the moment.

Hopefully, Mathcad can simplify boolean expression in its future versions.

Thanks so much for all the help!

On a blank worksheet, try typing

(a or not a) simplify -> (using the Mathcad boolean operators in place of 'and' and 'not'.

and see what happens. Then define a:=1 (or 0) above the expression to confirm it evaluates to 1.

Just to speed things up

Clipboard01.jpg

Mike

Why shouldn't it be C'?

Because if you expand out of the brackets you get.

Clipboard01.jpg

Mike

Mike Armstrong wrote:

Why shouldn't it be C'?

Because if you expand out of the brackets you get.

Clipboard01.jpg

Mike

I was referring to boolean algebra, not the usual arithemetic algebra. Mathcad can do the usual algebra very well. And I thought I could try boolean algebra in it.

Can you confirm that (C' + A').C' = (C+A)*C?

Does the dot represnet a multiplication?

Mike

http://communities.ptc.com/servlet/JiveServlet/showImage/2-149416-2532/bar_anim.gif

Mike Armstrong wrote:

Can you confirm that (C' + A').C' = (C+A)*C?

Does the dot represnet a multiplication?

Mike

http://communities.ptc.com/servlet/JiveServlet/showImage/2-149416-2532/bar_anim.gif

The dot represents AND.

So it reads something like (NOT c OR NOT a) AND NOT c.

It is those logic gates expressions.

Sorry, my bad. It does seem as you said above that Mathcad can only evaluate but not simplify a boolean expression at the moment.

Mike

http://communities.ptc.com/servlet/JiveServlet/showImage/2-149416-2532/bar_anim.gif

Announcements

Top Tags