boolean logic and or math. Anyone know this stuff?

Stallion

Diamond Member
May 4, 2000
3,657
0
76
I started school a few weeks ago and we got into boolean logic and truth tables and what not. My head is spinning and I feel like a nerd. It has been 18 years since I was in HS so this everyday stuff is killing me. Does anyone use this stuff in their work.. my wife said they use it in her networking group.

anyone else?
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
software development uses both bitwise and logical operators, for example
if (a && b) {do-c; } // logical AND
c = a & 15 ; // bitwise AND

if you don't understand and, or, xor, not in both contexts you'll have a difficult time programming :)
 

Stallion

Diamond Member
May 4, 2000
3,657
0
76
the Prof. said that programers use it everyday but it sure seems screwed up.. I just hope I can pick up on it soon before I loose my mind.

The and gate,or gate SOP,POS, logic gates is a little hard to grasp. Oh well ,need to study more I guess. :(
 

Ameesh

Lifer
Apr 3, 2001
23,686
0
0
Originally posted by: Stallion
the Prof. said that programers use it everyday but it sure seems screwed up.. I just hope I can pick up on it soon before I loose my mind.

The and gate,or gate SOP,POS, logic gates is a little hard to grasp. Oh well ,need to study more I guess. :(

I use it all the time, its not as confusing as your making it to be. just relax, take a deep breath and try reaing the chapter over again. this is a really important thing you learn because every aspect of computer science will use this basic knowledge. think of it like learning to do addition when you first started learning math.
 

Calundronius

Senior member
May 19, 2002
225
0
0
Computer engineers use it a lot for chip design, too...boolean logic and boolean math are basically the fundamental building blocks for digital computers. I took my first classes on them last semester, and its not so bad, once you get the hang of it. But it is important, if you're going to do any low-level programming (or high, for that matter) or any logic network design.
 

MichaelD

Lifer
Jan 16, 2001
31,528
3
76
Originally posted by: DaveSimmons
software development uses both bitwise and logical operators, for example
if (a && b) {do-c; } // logical AND
c = a & 15 ; // bitwise AND

if you don't understand and, or, xor, not in both contexts you'll have a difficult time programming :)

Can someone explain this in English? Seriously. I noticed that the a&&b are surrounded by parenthesis, whereas the do-c is surrounded by brackets. Why? I do not have a very mathematical mind....I think in words. If someone would want to make the attempt, that would be great. :)
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
MichaelD: that's a snippet of C++ code, an "if...then" construct,

if ( test - is - true )
do something

in c++ if the "do something" is more than a single step you group together the steps with curly braces:

example:
if (want-to-reply)
{
press [ reply ] ;
type response ;
press [ reply to thread ] ;
postcount++ ;
}
 

Ameesh

Lifer
Apr 3, 2001
23,686
0
0
Originally posted by: MichaelD
Originally posted by: DaveSimmons
software development uses both bitwise and logical operators, for example
if (a && b) {do-c; } // logical AND
c = a & 15 ; // bitwise AND

if you don't understand and, or, xor, not in both contexts you'll have a difficult time programming :)

Can someone explain this in English? Seriously. I noticed that the a&&b are surrounded by parenthesis, whereas the do-c is surrounded by brackets. Why? I do not have a very mathematical mind....I think in words. If someone would want to make the attempt, that would be great. :)

If A and B both evaulate to true then execute the follwoing statement

the value of c equals the bitwise and of the value of A and the value of B
 

MichaelD

Lifer
Jan 16, 2001
31,528
3
76
Hey, cool explanation guys. Now, I may not be able to write code, DaveSimmons, but I can read that last line of code in your reply! ;) Hehehe.
 

ThreeLeggedGnome

Senior member
Jun 18, 2002
282
0
0
true and false is false, false or true is true, true or false and false can be either true or false depending on where you put the brackets, false and false is false but false or true and false is false no matter where the brackets are :p
 

MichaelD

Lifer
Jan 16, 2001
31,528
3
76
Originally posted by: ThreeLeggedGnome
true and false is false, false or true is true, true or false and false can be either true or false depending on where you put the brackets, false and false is false but false or true and false is false no matter where the brackets are :p

Thank you. Now please come over here and help me pick my splattered brains off the wall and reinsert them into my skull. :p
 

Stallion

Diamond Member
May 4, 2000
3,657
0
76
today we drew up circuits using our boolean equations. we had : y=wxz+wxz'+w'x' So we simplified and came up with y=wx+w'x' then drew up our diagram. And it even made sence. :) Then we started in on Karnaugh maps.

For some reason today it started to get a little easier. Hope I retain some of this new found logic.. ;)
 

Ameesh

Lifer
Apr 3, 2001
23,686
0
0
Originally posted by: Stallion
today we drew up circuits using our boolean equations. we had : y=wxz+wxz'+w'x' So we simplified and came up with y=wx+w'x' then drew up our diagram. And it even made sence. :) Then we started in on Karnaugh maps.

For some reason today it started to get a little easier. Hope I retain some of this new found logic.. ;)

karnaugh maps make the stuff soo easy and and is sooo useful. make sure you understand it, when you actually get into the complicated stuff you are going to love karnaugh!
 

Stallion

Diamond Member
May 4, 2000
3,657
0
76
Originally posted by: Ameesh
Originally posted by: Stallion
today we drew up circuits using our boolean equations. we had : y=wxz+wxz'+w'x' So we simplified and came up with y=wx+w'x' then drew up our diagram. And it even made sence. :) Then we started in on Karnaugh maps.

For some reason today it started to get a little easier. Hope I retain some of this new found logic.. ;)

karnaugh maps make the stuff soo easy and and is sooo useful. make sure you understand it, when you actually get into the complicated stuff you are going to love karnaugh!

It looked easy enough. Bad thing is when I don't look at it for a few days it seems to fade from my memory for a bit.. :)