Special AND-gate

Hi,

I am looking for a way to design a boolean AND-gate (with possibly many inputs) that consists of several standard AND, XOR, NOT, randomness gates and has the following properties:

  1. On input a,b it output a AND b
  2. The encoding to present a AND b has the same probability as NOT(a AND b)

Note that the second property is for instance not satisfied for the standard binary encodiding because the output 1 has only probability 1/4 where 0 has 3/4. What I would like to have is that both outputs have the same probability.

The only way I can think of to solve this problem is to use some kind of dynamic encoding, i.e. sometimes the 1 is used to represent a 0 and sometimes a 0 is used to represent the 1.

Regards, Bernd

Reply to
Bernd Schneider
Loading thread data ...

I'm not quite certain that randomness gates qualify as standard parts.

Absent any other constraints, just alternate between presenting a and !a at the output, since !(a && b) is equivalent to (!a || !b) and that's satisfied by !a.

--
Rich Webb     Norfolk, VA
Reply to
Rich Webb

FPGA PIC AVR PLC PGA Did I miss something?

formatting link
"

Reply to
Jamie

In what way is the output dependent upon the inputs if the output has a 50/50 chance of being either 0 or 1? Maybe you should call it a "WHATEVER" gate, rather than an AND gate.

Reply to
Greg Neill

The "maybe gate", the digital kin of the "inoperational amplifier".

--
Keith
Reply to
krw

Easy,

if (A && B) generate a random 1 or 0 on the output;

Repeat forever;

Reply to
Mook Johnson

Something must be getting lost in the translation because there is nothing you can do about the input combination occurring 1/4 of the time.

You can't do that for a strictly combinatorial circuit, it will have to be made sequential. The only combinatorial function that will produce 1 or 0 with equal probability is the parity function.

Reply to
Fred Bloggs

He can economize even more than that, just say it's 0 all the time, then he can only be wrong 25% of the time...

Reply to
Fred Bloggs

"Bernd Schneider" schreef in bericht news:Xns9A789C09B8ABberndschneider90yaho@194.177.96.78...

The function of an AND-gate is fully specified. Its output depends only on the inputs. So the probability of its output depends on the probability of its inputs. In other words, you do not want an AND-gate but something else. As you reasoning is unclear to me, I can only guess you to want an XNOR-gate. Out of four possible input combinations it makes two times true and two times false. See truth table below.

a b aXNORb

0 0 1 0 1 0 1 0 0 1 1 1

This function is also determined. The probability of the output still depends on the inputs.

petrus bitbyter

Reply to
petrus bitbyter

That's a parity function...

Reply to
Fred Bloggs

Yep, MSP430 for example. Or if Bernd wants the leather-seat deluxe edition maybe an ARM core.

--
Regards, Joerg

http://www.analogconsultants.com/
Reply to
Joerg

Are you sure this is what your homework assignment said? Maybe it said "same probability of 1's and 0's" in which case you can use multiple outputs for the encoding.

As for the big list, add CPLD :-)

Reply to
DJ Delorie

Fred Bloggs wrote:

The George W. Bush flip-flop by Mark Zenier news:cloi2g$tv5$ snipped-for-privacy@eskinews.eskimo.com

formatting link

I kept thinking *fuzzy logic*.

formatting link

Reply to
JeffM

Perhaps trot the two inputs down a pair of shift registers and do majority logic? That should certainly give some "randomness".

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
         America: Land of the Free, Because of the Brave
Reply to
Jim Thompson

Fred Bloggs wrote in news: snipped-for-privacy@nospam.com:

What is a combinatorial circuit? And what is with the XOR function? for two random bit inputs it outputs 1 with probability 1/2

What I acutually try to achieve is an AND gate that flips its output with probability 1/2 for random input. So assume in the first clock cylce you input two random bits to the AND gate. The output will be 1 with probability 1/4 and 0 with probability 3/4. Now, for the next clock cycle, again for random input we have with probability 1/4 an output of 1 and with probability 3/4 an output of 0. The probability that at the output wire we have a flip is 6/16, but what I acutally want to achieve is that the output wire flips with probability 1/2. If I consider for instance an XOR gate than the probability that the output flips is always 1/2. Can I achieve the same probability also for an AND- gate without losing the functionality of the AND-gate?

Cheers, Bernd

Reply to
Bernd Schneider

DJ Delorie wrote in news: snipped-for-privacy@delorie.com:

Yes, multiple outputs are definitly allowed to solve this problem... but I am not so sure how it can help.

Reply to
Bernd Schneider

Probably the secification of my problem was not very well stated.

I hope my second post makes things a bit more clear, although I am still not sure if it is possible at all to achieve something as I mentioned in my post from below.

Cheers, Bernd

Reply to
Bernd Schneider

--
http://en.wikipedia.org/wiki/Combinational_logic
Reply to
John Fields

John Fields wrote in news: snipped-for-privacy@4ax.com:

So, there is no way of designing an AND gate such that the probability of a flip at the output is 1/2?

Reply to
Bernd Schneider

No, because then it wouldn't be an "AND" gate...

Drop the "AND" from your specification and tell us the truth table, or output as a probability FUNCTION OF THE INPUTS and maybe we can help you design this bernd-gate.

Reply to
cs_posting

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.