I received this question from my lecturer and i am stuck.
F=ca+b'a'
implement this function using no more than 3 H.A (half adder) and 3 NOT gates.
i succeed to get a'b' and ac
and still had 1 HA and 1 NOT gate.
I have difficulties creating the OR gate for those two.
Use De Morgan's law and convert the expression in the following form :- ((ca)'(b'a')')'. Assuming that complements of the Literals are available.
The actual implementation of the circuit.
Related
I need to draw a logical circuit from a simplified boolean expression.
Here's the expression:
x = PQ'R' + PQ'R + PQR' + PQR
I got the simplified expression as x = P.
I need to draw the circuit from this simplified expression.
Now, my question is, how to draw the logical circuit when the simplified expression has only one variable?
Any help is appreciated. Thanks.
EDIT: I used AND gate and gave both input as P, so it will give the output P itself. Is it right?
this is circuit of 'x' that include 4 And gate with three input and 1 Or gate with four input
I have learnt that to convert an expression in the form of a Truth Table to a Sum of Product expressions, we use the concept of minterms. After preparing the truth table we find out which products evaluate to 1 and add those products.
While in the case of Product of Sum expression, we take those sums that evaluate to 0 and take the product of those sums.
I could not understand the logic behind this taking of 0 and 1. In an answer I read here, I found that POS is considered as a negative logic. I could not understand the concept behind it. What is the real logic behind this?
This is something I was confused with as well. When we write the truth table and see for which cases the value of F evaluates to 1, we get multiple cases. In SOP, ANY of those minterms can be true and the whole Function would be 1 because 1+X=1 This is the intuition behind SOP being positive logic and hence automatically, its complement, POS being negative logic.
Check out this answer for further clarification.
https://math.stackexchange.com/questions/2794909/boolean-algebra-sum-of-products-and-product-of-sums-why-is-the-procedure-def#
I was solving a RSA problem and facing difficulty to compute d
plz help me with this
given p-971, q-52
Ø(n) - 506340
gcd(Ø(n),e) = 1 1< e < Ø(n)
therefore gcd(506340, 83) = 1
e= 83 .
e * d mod Ø(n) = 1
i want to compute d , i have all the info
can u help me how to computer d from this.
(83 * d) mod 506340 = 1
i am a little wean in maths so i am having difficulties finding d from the above equation.
Your value for q is not prime 52=2^2 * 13. Therefore you cannot find d because the maths for calculating this relies upon the fact the both p and q are prime.
I suggest working your way through the examples given here http://en.wikipedia.org/wiki/RSA_%28cryptosystem%29
Normally, I would hesitate to suggest a wikipedia link such as that, but I found it very useful as a preliminary source when doing a project on RSA as part of my degree.
You will need to be quite competent at modular arithmetic to get to grips with how RSA works. If you want to understand how to find d you will need to learn to find the Modular multiplicative inverse - just google this, I didn't come across anything incorrect when doing so myself.
Good luck.
A worked example
Let's take p=11, q=5. In reality you would use very large primes but we are going to be doing this by hand to we want smaller numbers. Keep both of these private.
Now we need n, which is given as n=pq and so in our case n=55. This needs to be made public.
The next item we need is the totient of n. This is simply phi(n)=(p-1)(q-1) so for our example phi(n)=40. Keep this private.
Now you calculate the encryption exponent, e. Defined such that 1<e<phi(n) and gcd(e,phi(n))=1. There are nearly always many possible different values of e - just pick one (in a real application your choice would be determined by additional factors - different choices of e make the algorithm easier/harder to crack). In this example we will choose e=7. This needs to be made public.
Finally, the last item to be calculated is d, the decryption exponent. To calculate d we must solve the equation ed mod phi(n) = 1. This is most commonly calculated using the Extended Euclidean Algorithm. This algorithm solves the equation phi(n)x+ed=1 subject to 1<d<phi(n), where x is an unknown multiplicative factor - which is identical to writing the previous equation without using mod. In our particular example, solving this leads to d=23. This should be kept private.
Then your public key is: n=55, e=7
and your private key is: n=55, d=23
To see the workthrough of the Extended Euclidean Algorithm check out this youtube video https://www.youtube.com/watch?v=kYasb426Yjk. The values used in that video are the same as the ones used here.
RSA is complicated and the mathematics gets very involved. Try solving a couple of examples with small values of p and q until you are comfortable with the method before attempting a problem with large values.
I am trying to understand with boolean algebra how using 4 NAND Gates can be equivalen to 1 XOR gate.
If we look at this picture from wikipedia http://en.wikipedia.org/wiki/XOR_gate#Alternatives
There is a schematic of the gate.
This is the large expression I came up with to express the schematic. Perhaps it is wrong and that may be my issue? But still I cannot see how to transform the equation into the XOR expression I expect.
I have: !X!Y + X(!X!Y) + Y(!X!Y) + XY(!X!Y)
I know XOR logic looks like this: X!Y + !XY.
Can anyone clear up my confusion?
Your translation of the schematic on Wikipedia is a little bit off. I translated it into
!(!(A!(AB))!(B!(AB)))
Notice that !(XY) and !X!Y are different and that the schematic does not have any or gates (so no + operators). From there we can simplify using various boolean logic:
(!(!(A!(AB))) + !(!(B!(AB))))
(A!(AB) + B!(AB))
(A(!A + !B) + B(!A + !B))
(A!B + B!A)
I have three values X,Y and Z. These values have a range of values between 0 and 1 (0 and 1 included).
When I call a function f(X,Y,Z) it returns a value V (value between 0 and 1). My Goal is to choose X,Y,Z so that the returned value V is as close as possible to 1.
The selection Process should be automated and the right values for X,Y,Z are unknown.
Due to my Use Case it is possible to set Y and Z to 1 (the value 1 hasn't any influence on the output) and search for the best value of X.
After that I can replace X by that value and do the same for Y. Same procedure for Z.
How can I find the "maximum of the function"? Is there somekind of "gradient descend" or hill climbing algorithm or something like that?
The whole modul is written in perl so maybe there is an package for perl that can solve that problem?
You can use Simulated Annealing. Its a multi-variable optimization technique. It is also used to get a partial solution for the Travelling Salesperson problem. Its one of the search algorithms mentioned in Peter Norvig's Intro to AI book as well.
Its a hill climbing algorithm which depends on random variables. Also it won't necessarily give you the 'optimal' answer. You can also vary the iterations required by it as per your computational/time needs.
http://en.wikipedia.org/wiki/Simulated_annealing
http://www1bpt.bridgeport.edu/sed/projects/449/Fall_2000/fangmin/chapter2.htm
I suggest you take a look at Math::Amoeba which implements the Nelder–Mead method for finding stationary points on functions.