# How to achieve Or gate

5 messages
Open this post in threaded view
|

## How to achieve Or gate

 Hey! I was re-reading the Canonical representation part and I thought I could use that logic to get the hdl code for the Or Gate. truth table 0 0 0 1 0 1 0 1 1 1 1 1 So I forgot about the first line and 'fixed the values'. So I got And(1,Not(0)) = 1 And(Not(0),1) = 1 And(1,1) = 1 But now I have to 'Or' them together which is bad because this is the gate I am trying to create. How can I achieve the canonical representation of the Or gate without the or gate? I thought I could just negate the result of this but in the case of 0 0 negating will not work. I just really want to know how I can properly use the canonical representation so that I can understand all the this and the other gates. Note: Didn't try to represent the Not and the And gate just because I figured it out really quickly, but I am kind of stuck on this on.
Open this post in threaded view
|

## Re: How to achieve Or gate

 You're close. Let me give you another hint. Note DeMorgan's Law: (a + b)' = a'b' Hence,  a + b = (a'b')' Aha, so OR is equivalent to...
Open this post in threaded view
|

## Re: How to achieve Or gate

 HA!! Ok I read at wikipedia NOT (P OR Q) = (NOT P) AND (NOT Q) So as you said (a'b')' Which basically means NOT(AND(NOT(a),NOT(b)) Thanks for the help. One other question. I wouldn't have been able to get to this by just looking at the truth table and trying to create a canonical representation would I?
Open this post in threaded view
|

## Re: How to achieve Or gate

Sometimes, especially when there are fewer 0's than 1's in the truth table output, it is easier to build the inverted function and then invert the the output to get the true function.

The OR function has only one 0 in its output, so let's find the canonical form of the NOT OR (NOR) function

 a b | NOR 0 0 | 1 0 1 | 0 1 1 | 0 1 1 | 0
NOR is true only when a is not true and b is not true, so the canonical form of NOR is simply
NOR(a, b) = (NOT a) AND (NOT b)
Since NOR is the invert of OR, invert NOR to get
OR(a, b) = NOT((NOT a) AND (NOT b))

--Mark