Logic Gates -- What's the real story of how comparison is made?

Status
Not open for further replies.

Thread Starter

rbaulbin

Joined Jan 4, 2011
14
I don't get the part about "flicking 2 switches with one signal". You have mentioned this several times, and I still don't get it. An AND gate requires at least two inputs. Of course, you can use the same signal to control both inputs, in which case your AND gate degenerates to a follower, or buffer (non-inverting).
It has to do with conceptually differentiating between an actual gate that has 2 independent signals to make a comparison, and the ability to compare 2 things with 1 signal. I thought it was possible in a system for comparison to be carried out by 1 signal determining the state of 2 switches, and somehow creating logic from this without the need for 2 independent signals. For example, in a situation where 2 bits are traveling down a wire in series, in order to do a comparison on those 2 bits, each must be mux'd (if that's the term) onto their own individual wires, and then fed through a gate(?) There's no way to compare them outside of a gate(?) I thought perhaps there was some "comparison capacity" aside from each bit having to be "converted" into its own independent signal on its own wire and then sent as 2 inputs into a gate.

RB

P.S. Thank you all for your very helpful replies...
 

thatoneguy

Joined Feb 19, 2009
6,359
I'm not sure if you are referring to a bus, or serial communications.

With a bus, between 8 and 128 lines/wires each carry a signal, and another line carries the "Clock". When the clock goes high, all of the parallel inputs are read and acted upon.

With serial, the clock may be a separate signal, or the clock may be recovered from the data itself. What happens at that point is the string of bits are "Clocked" (w/clock from serial line) to a Serial to parallel shift register, then sent away on a bus as stated above.

Most all complex logic relies on the clock to determine when the data is "valid". There may be more than one clock source for different parts of a circuit as well.

The reason for the clock is to ensure the lines are at the correct level and settled before the logic makes a decision based on the inputs.

The bus lines and serial lines don't have little square waves running down them, per se. The entire wire changes voltage frequently, so that on a scope, it might LOOK like the little squares are going to pile up and run into each other at the end, but that isn't the case. The scope is a visualization, expanding or compressing time into something humans can interpret.
 

kubeek

Joined Sep 20, 2005
5,794
ability to compare 2 things with 1 signal
Lets get the terminology staright first, tell me what does a signal mean in here.

Then, a gate dosen´t "compare", it performs a function with (usually) two inputs and one output. Nothing more, nothing less, and it has nothing to do with HOW it achieves that. You need to see the distinction between actual logic devices made of silicon and the boolean logic that describes them.


I thought it was possible in a system for comparison to be carried out by 1 signal determining the state of 2 switches
What does that mean?

Anyway, here is a schematic of an NAND gate made in CMOS, NMOS and TTL technology. http://en.wikipedia.org/wiki/NAND_gate#Implementations
Each different, yet they do the same function Output = not (A & B)
 
Last edited:

beenthere

Joined Apr 20, 2004
15,819
For example, in a situation where 2 bits are traveling down a wire in series, in order to do a comparison on those 2 bits, each must be mux'd (if that's the term) onto their own individual wires, and then fed through a gate(?) There's no way to compare them outside of a gate(?
As the bits are separated in time and in a properly designed digital system,, there must be a clock present to control data flow. In the case you mention, one bit can be clocked into a flip flop that might be part of a storage register, and the following bit into another register. Comparing the states of the resisters is quite simple.

It has to do with conceptually differentiating between an actual gate that has 2 independent signals to make a comparison, and the ability to compare 2 things with 1 signal.
This is still a misconception. If we use the AND gate again, the inputs are not compared. The state of the inputs determine the state of the output. The results of a comparison are always either;
1. greater than
2. equal
3. less than

That is not a single gate function.

As far as comparing 2 "things" (bits?) with one signal, an illustration of this would help us understand what you mean.
 

Thread Starter

rbaulbin

Joined Jan 4, 2011
14
As the bits are separated in time and in a properly designed digital system,, there must be a clock present to control data flow. In the case you mention, one bit can be clocked into a flip flop that might be part of a storage register, and the following bit into another register. Comparing the states of the resisters is quite simple.

This is still a misconception. If we use the AND gate again, the inputs are not compared. The state of the inputs determine the state of the output. The results of a comparison are always either;
1. greater than
2. equal
3. less than

That is not a single gate function.

As far as comparing 2 "things" (bits?) with one signal, an illustration of this would help us understand what you mean.
According to Wikipedia (whoever wrote this article :)): http://simple.wikipedia.org/wiki/Logic_gate

"Logic gates compare the state at their inputs (source) to decide what the state at their output should be. A logic gate is on or active when its rules are correctly met."


I'm using the term "compare" not in the quantity sense, but in determining "whether or not something is present" sense. I realize the gate has no idea what it's doing, but it's being used to make a logical "comparison" between 2 inputs to determine a new output based on whether or not the inputs are in conformance to its rules, no?

There is some strange semantic overlap between numerical "comparison" and "truth value" comparison.

I always thought it was interesting that "0 OR 1" is written as "0 + 1", because 0 + 1 is 1 but "0 OR 1" is also 1 (comparing truth value here is identical to adding -- comparing "something" OR "nothing" yields "something"). Comparing whether or not something is greater/less than/equal, or comparing "whether or not something is there" overlaps in boolean logic. It's as if adding and comparing are a form of the same thing at a basic level. Comparing numerical quantity and comparing "whether or not something is there" (truth value) seems to overlap.

As far as "comparing 2 things with 1 signal", you can kindly disregard that... I've got that squared away from reading the previous replies.

Thanks..
 
Last edited:

thatoneguy

Joined Feb 19, 2009
6,359
It seems the only part you are missing is the definition of digital logic.

Data is quantized into two states, 0 or 1. These are each a range of voltages, but anything in the range of the definition of "True/1/On" is amplified to the correct value. The same method is used for interpreting "False/0/Off".

All gates are amplifiers of a sort, to keep the logic signal output as the "best case" of the limits described for the logic family/construction.

There is no "in between" so to speak, unless you go to multivalued logic, at which point, there are simply more quantized state ranges representing each digit.

The wiki article should read: "Logic gates evaluate their inputs A and B to control the output".

It's a minor English grammatical issue that makes discussing logic accurately and precisely very difficult to somebody unfamiliar to logic.
 

Thread Starter

rbaulbin

Joined Jan 4, 2011
14
It seems the only part you are missing is the definition of digital logic.

Data is quantized into two states, 0 or 1. These are each a range of voltages, but anything in the range of the definition of "True/1/On" is amplified to the correct value. The same method is used for interpreting "False/0/Off".

All gates are amplifiers of a sort, to keep the logic signal output as the "best case" of the limits described for the logic family/construction.

There is no "in between" so to speak, unless you go to multivalued logic, at which point, there are simply more quantized state ranges representing each digit.

The wiki article should read: "Logic gates evaluate their inputs A and B to control the output".

It's a minor English grammatical issue that makes discussing logic accurately and precisely very difficult to somebody unfamiliar to logic.
I don't understand how that's in conflict with what I said in the previous reply... I understand the basics of digital logic, but I seriously think there is an overlap of the innate human concepts of quantity and truth value. After all, computers are "adding" using boolean logic. "0" represents "nothing" and "1" represents something. It also represents "false" and "true". Through the comparison of binary truth value (0 OR 1 / 0 + 1), computers are able to "add" by "comparing" without "understanding" what real quantity corresponds to. It would seem to me that "compare" can be used due to that conceptual overlap, as did the writers of that article...
 
Last edited:

beenthere

Joined Apr 20, 2004
15,819
Through the comparison of binary truth value (0 OR 1 / 0 + 1), computers are able to "add" by "comparing" without "understanding" what real quantity corresponds to. It would seem to me that "compare" can be used due to that conceptual overlap, as did the writers of that article..
What you have is a small hunk of contaminated silicon. A gate is just about as simple as in the illo of the two input AND gate - http://en.wikipedia.org/wiki/Transistor–transistor_logic It's hard to see how a gate like that can do a comparison (do recall that comparing has greater - equal- less than states). The gate simply does as it has been built to do.

A computer can add (no quotes necessary) thanks to a logical construction call an Arithmetic Logic Unit - http://en.wikipedia.org/wiki/Arithmetic_logic_unit.

0 represents a LOW or FALSE condition; 1 represents TRUE or HIGH. The terms are interchangeable. The TRUE and FALSE terms have nothing to do with quantity or truth in human terms.

A computer is a numeric engine - a machine that runs on numbers.
 

Markd77

Joined Sep 7, 2009
2,806
<ed> Ignore this:
The "+" symbol used for an AND gate confuses things.
It is not the same as addition, it's just a symbol.
1+1 = 1 if you are using the AND gate version
1+1 = 10 (binary) if you are using addition.

(+ isn't the symbol for AND, it's the symbol for OR)
Addition does (kind of) make sense for OR if you ignore the leading 1.

</ed>
 
Last edited:

Thread Starter

rbaulbin

Joined Jan 4, 2011
14
What you have is a small hunk of contaminated silicon. A gate is just about as simple as in the illo of the two input AND gate - http://en.wikipedia.org/wiki/Transistor–transistor_logic It's hard to see how a gate like that can do a comparison (do recall that comparing has greater - equal- less than states). The gate simply does as it has been built to do.

A computer can add (no quotes necessary) thanks to a logical construction call an Arithmetic Logic Unit - http://en.wikipedia.org/wiki/Arithmetic_logic_unit.

0 represents a LOW or FALSE condition; 1 represents TRUE or HIGH. The terms are interchangeable. The TRUE and FALSE terms have nothing to do with quantity or truth in human terms.

A computer is a numeric engine - a machine that runs on numbers.
Right, but doesn't it use Boolean algebra to accomplish it -- and Boolean algebra is not concerned with quantity, but logic. So by definition there must be a bridge between logic and counting, and that bridge must be comparison, because you cannot add truth states. 1 is actually "greater than" 0, and so there's an innate comparison there happening (even though it doesn't know it's doing it). By favoring "something" (presence of signal) over "nothing" (absence of signal), the computer has simultaneously done a "greater than" comparison by default, as well as a truth comparison, because they overlap.
0 represents Low or false, or "absence" or "nothing", and 1 represents high or true, or "something", and a computer runs on comparison of something and nothing to arrive at quantities. It's "adding" because unlike a human's adding, it doesn't know what numbers are, doesn't know it's adding, and doesn't know what it's arrived at because it doesn't know the truth values compared represent quantity.
 

Wendy

Joined Mar 24, 2008
23,415
Uhhh, no. You keep reading more than there is to it.

AND gates are simple. Most gates are.

By combining gates more advanced functions can be created, such as true addition. You can add binary numbers just as you can add decimal number. Humans use decimal numbers. BCD is how computers do it, Binary Coded Decimal.

Computers have an "awareness" in that they can be programmed to do complex task, this being the cumulation of thousands up to millions of gates. A simple calculator has hundreds to thousands of gates.

The awareness is due to a computer can make choices based on input from it surroundings, this is called conditional statements.

But, and this is important, don't confuse programming and logic gates. Logic gates are basic. They are simple.

A simple AND gate can be summed up from it's truth table.

A B Out
0 .0. 0
0 .1 .0
1 .0 .0
1 .1 .1

An OR gate can be summed up simply from this table.

A B Out
0 .0. 0
0 .1 .1
1 .0 .1
1 .1 .1

That is all these gates do, nothing more, nothing less. When you combine them with the inverting function, an inverter, you can build and create something like a computer. You can make a network of gates to do "Greater Than", another network of gates to do "Less Than", and so on. These networks are why integrated circuits are so popular, someone has preplanned the functions and put them in a black box.

Part of the reason you are getting such a heated discussion is semantics is critical, and the terms are very well defined. This is a science, with complete branches of knowledge (computer math can be quite complex), and PHDs issued on the subjects.

Philosophy can be argued with semantics, science can't.
 

Thread Starter

rbaulbin

Joined Jan 4, 2011
14
Uhhh, no. You keep reading more than there is to it.

AND gates are simple. Most gates are.

By combining gates more advanced functions can be created, such as true addition. You can add binary numbers just as you can add decimal number. Humans use decimal numbers. BCD is how computers do it, Binary Coded Decimal.

Computers have an "awareness" in that they can be programmed to do complex task, this being the cumulation of thousands up to millions of gates. A simple calculator has hundreds to thousands of gates.

The awareness is due to a computer can make choices based on input from it surroundings, this is called conditional statements.

But, and this is important, don't confuse programming and logic gates. Logic gates are basic. They are simple.

A simple AND gate can be summed up from it's truth table.

A B Out
0 .0. 0
0 .1 .0
1 .0 .0
1 .1 .1

An OR gate can be summed up simply from this table.

A B Out
0 .0. 0
0 .1 .1
1 .0 .1
1 .1 .1

That is all these gates do, nothing more, nothing less. When you combine them with the inverting function, an inverter, you can build and create something like a computer. You can make a network of gates to do "Greater Than", another network of gates to do "Less Than", and so on. These networks are why integrated circuits are so popular, someone has preplanned the functions and put them in a black box.

Part of the reason you are getting such a heated discussion is semantics is critical, and the terms are very well defined. This is a science, with complete branches of knowledge (computer math can be quite complex), and PHDs issued on the subjects.

Philosophy can be argued with semantics, science can't.

Bill -

Thanks for replying.

I'm not saying computers have awareness. I'm not saying they are volitionally comparing things like humans.


Bear with me as I elaborate:

When George Boole wrote his "Laws of Thought" treatise that is the underpinning of all calculation performed by a computer, he wrote a philosophical piece that shows how logic undergirds calculation. Boolean algebra has nothing to do with quantities other than "something" and "nothing". "Something" happens to be the 1st element of logic. The single TRUTH that you "have" something also happens to be the "1st" number -- 1. "It's TRUE something's there" also happens to be the most fundamental quantity -- and the computer doesn't KNOW it's true it "has" a "1" or voltage on the line -- we've given it "something." We've also told it to allow it through the gate if we also send it "nothing" (0) through the same OR gate. We've forced it to compare 1 is greater than 0. String these automated, forced comparisons of something and nothing together and you have quantities.

A gate is NOT "comparing" anything on purpose, of course -- it is comparing things by "default" because sending no signal and one signal through an OR gate is identical to forcing the computer to "compare" for you. You're forcing it to say "something" (1) is more than "nothing" (0), or "the fact something is there" is greater than "nothing." Boolean addition is quite simply "1 + 0" or "1 OR 0". This is represented through a gate. Hardware designers have set up 1 + 1 = 10 as an AND function so the 1 carries/ripples over into "another column" where a similar calculation (comparison) is performed which is mapped to a greater power of 2. At the end of the day the computer has done nothing but compare whether or not there's voltage in each column, and has a string of 1's and 0's that represents a number, only because the columns represent something meaningful to us.

After all, a machine does not innately know what quantity is because it has no reality, only humans do. We can translate the comparisons we force it to make into innate numbers we intrinsically understand on a core level. We have independent syllables and pictographic awareness of innate quantities that resonate within us emotionally. Of course, a computer only has (1/one) voltage or (0/no) voltage.

Using "something" and "nothing" as both basic numbers and truth comparisons, a computer can count. By definition, there is most certainly an innate correlation between basic logic and the capacity to count. If you have no logic capacity (ability to identify whether or not you have something), you can't work with numbers, therefore logic undergirds counting, which is what Boole clearly defined for us. We've built computers that mimic human reasoning, where having "something" and "nothing" and comparing these facts undergirds all quantification.

By definition, a computer doesn't really "add" numbers -- it doesn't know what numbers are -- it adds "whether or not something is there" which is identical to "comparing whether or not something is there" which is identical to "comparing 1 is greater than 0" which correlates to greater quantities to us when stringed together because we've set it up that way.

The fact is, I'm arguing what Boole said really -- he reduced basic logic to 0's and 1's which can be used to quantify. Let's remember George Boole, the very father of computer science, and whose ideas are at least in the top 5 of the most revolutionary of all time, was a self-educated elementary school graduate. Science is expanded and elucidated all the time. What he has said about human thought and calculation is what I'm simply arguing.

J
 
Last edited:

Thread Starter

rbaulbin

Joined Jan 4, 2011
14
I've thought it through more, and here's what I feel to be an informal proof:

1) A comparison is a yielding of equal, less than, or greater than value between 2 numbers.

2) "Something" (1, or the fundamental quantity) is greater than "nothing" (0).

3) An XOR gate performs a forced comparison of something and nothing and always yields "something" (1) is "greater than" "nothing" (0). The comparison of something being greater than nothing is also identical in result to the most fundamental addition of 2 quantities, 1 and 0.

4) If a computer cannot compare something is greater than nothing, it cannot add. It can add, therefore fundamental logical comparison is the driver of addition/quantification.

Let me know your thoughts...
 

thatoneguy

Joined Feb 19, 2009
6,359
Take a look at This Datasheet Scroll down a bit.

That is an actual magnitude comparator, which specifies if a binary string is numerically larger than another binary string.

If you go to the bottom of the datasheet, you'll notice it is all made out of gates, building blocks. The logic gate is the most basic of digital blocks, with the inverter being the simplest example of a gate, having one input and one output.

When the abstraction is set up, say 5V logic, rules are in place, such as maximum voltage that is read as a 0, and the minimum voltage that will be read as a 1. Within these constraints, the gates can be put together like lego blocks to make other, bigger things.

An individual lego brick doesn't know it is a wall when it's used to build a house, and it doesn't care. That same brick can also be part of an airplane wing, it behaves the same way. Digital Logic is similar, and even as messy if you use wire wrap. :)
 

Thread Starter

rbaulbin

Joined Jan 4, 2011
14
Take a look at This Datasheet Scroll down a bit.

That is an actual magnitude comparator, which specifies if a binary string is numerically larger than another binary string.

If you go to the bottom of the datasheet, you'll notice it is all made out of gates, building blocks. The logic gate is the most basic of digital blocks, with the inverter being the simplest example of a gate, having one input and one output.

When the abstraction is set up, say 5V logic, rules are in place, such as maximum voltage that is read as a 0, and the minimum voltage that will be read as a 1. Within these constraints, the gates can be put together like lego blocks to make other, bigger things.

An individual lego brick doesn't know it is a wall when it's used to build a house, and it doesn't care. That same brick can also be part of an airplane wing, it behaves the same way. Digital Logic is similar, and even as messy if you use wire wrap. :)
Okay, but just because a gate doesn't know it's comparing, and doesn't care, it's still doing it. Something is greater than nothing, and something and nothing must be compared to yield something. :)
 

Ron H

Joined Apr 14, 2005
7,063
A hardware inverter basically compares the input signal (low or high) to an internal threshold. If the input is less than the threshold, the output will be high, and vice versa.
Is this the type of comparison you are talking about?
 

kubeek

Joined Sep 20, 2005
5,794
Okay, but just because a gate doesn't know it's comparing, and doesn't care, it's still doing it. Something is greater than nothing, and something and nothing must be compared to yield something. :)
There is no something and nothing, just two different but "equal" states. The two states can be called red and black and it will still work, and yet red is NOT GREATER than black.
 

Wendy

Joined Mar 24, 2008
23,415
Like I said, you don't argue science with philosophy, and I detest arguing for arguments sake. This thread has devolved very badly, and there are no insights nor understanding to be gained. This is not the first time threads like this come up, probably won't be the last. They muddy the waters for beginners, and accomplish nothing good.
 
Status
Not open for further replies.
Top