|
Luc Pattyn wrote: There are several conventions about exponent offset, I haven't met yours yet.
Trying to mimic this [^], my exponent is biased with 3 .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
how do simplify this expression: a'b+ab' into one using just AND and OR statements?
|
|
|
|
|
Hi,
that looks like a trick question.
Either your inputs are A, A', B and B' so you already have the solution (2 ANDs, 1 OR)
or your inputs are just A and B, and you are supposed to come up with A' and B' yourself, which is impossible when only having AND and OR gates.
However you could create any combinatorial function you desire from an unlimited number of NAND gates
(that is an AND gate followed by an inverter); same for NOR gates.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
The expression is a XOR function, and it can't be done without at least a NOT operator available to you, unless you assume you have all four inputs at hand. As Luc pointed out, you can implement it using NAND and NOR logic, because you can use either as a NOT operator, but it can't be done with only A and B as inputs, and AND and OR as operators. Your teacher is either an idiot, or a tricksy hobbit.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Hi, please help me with this problem, I have been trying it for hours now and am getting no where.
Imagine a machine with four inputs and one output that functions as follows: the output is on (1) if exactly two of the inputs are on (1) and off (0) otherwise.
ok this is what i get using min terms:
A B C D x
A.B 1
A.C 1
A.D 1
B.C 1
B.D 1
C.D 1
so i get this : (A*B*C'*D') + (A*B'*C*D')+(A*B'*C'*D)+(A'*B*C*D')+(A'*B*C'*D)+(A'*B'*C*D)
now this is confusing me.. am i supposed to draw this out? If i draw it out i will have 16 inputs not 4...
|
|
|
|
|
You've already solved it; your equation is correct. It produces a 1 for the six situations where exactly two inputs are on.
There are four inputs, labeled (not surprisingly) A, B, C, and D. Each has a second branch (going through an inverter if this is a circuit) that gives the complement of the input. The resulting eight signals go into the six AND functions you've identified, and the output of these ANDs goes into an OR with six inputs and one output.
If this equation describes a circuit, the eight signals are drawn going into six AND gates (drawn like a capital 'D' for the word "and"), and the outputs (from the curved part of the Ds) go into an OR gate (which looks like this http://www.eng.cam.ac.uk/DesignOffice/mdp/electric_web/Digital/04108.png[^])
The whole circuit (called a "sum of products") resembles this: http://www.cise.ufl.edu/~mssz/CompOrg/Figure3.8-AdderCkt2.gif[^]
|
|
|
|
|
Could anyone please help me out as I am in need of code to calculate BER and MSE related to audio steganography,in matlab
|
|
|
|
|
hi all,
Can anyone tell me the math behind this MS Excel functions. I am writing software for iPhone and I want to use the functionality like CUMIPMT function of Excel to calculate interest
CUMIPMT(rate,nper,pv,start_period,end_period,type) Returns the cumulative
interest paid on a loan between start_period and end_period.
CUMIPMT(rate,nper,pv,start_period,end_period,type)
Rate is the interest rate.
Nper is the total number of payment periods.
Pv is the present value.
Start_period is the first period in the calculation.
Payment periods are numbered beginning with 1.
End_period is the last period in the calculation.
Type is the timing of the payment.
Type Timing
0 (zero) Payment at the end of the period
1 Payment at the beginning of the period
|
|
|
|
|
|
If you happen to know the amount of the payment (assuming equal payments), there's a shortcut. Multiply the number of payments by the payment amount, then subtract the original balance. This takes a lot fewer calculations than summing all the individual interest amounts, and I suspect that might be important in a handheld device.
If you don't know the payment amount, calculate it from:
Pmt = Amt * (int / ((1 - (1 + int)^(-n)) where
Amt = Initial Principal Balance
Pmt = Payment amount each period
int = Interest rate (in decimal form) for the period
n = number of periods.
The value of int can be calculated by dividing the annual interest rate by the number of payments per year. If you're assuming 10% per year, with monthly payments, int would be .10/12; if payments are made weekly, int = .10/52.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
That's only assuming your payments are going towards principle and interest equally. Most payments go preferentially towards the interest at the beginning of the mortgage. The amount that goes to principle depends on the interest rate.
|
|
|
|
|
No, that's fully amortized, with more interest at the start than the end. The (1 + i) factor is what does the trick, unless I made a typo above - I'll check that and correct it if I screwed up.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Checked it again. Was my mistake - you're right.
|
|
|
|
|
I always have to look it up. You'd think, as often as I need it, I'd remember it. It must have something to with being old...
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Hi.
Do you know any algorithms for detecting a shape in an image ?
thanks in advance.
|
|
|
|
|
hough transform : for curve responses
harris coner and sobel edge detectors : for macro or constellation features
this kind of problem is studied within computer vision.
|
|
|
|
|
Hough transform can help you in simple shape detection like line circle etc.. You better look PDM(Probability density models ), these can detect shapes. PDM need to be initialized with a training set , after that it will calculate PCA . PDM is not that difficult.. have a look.
If u can Dream... U can do it
|
|
|
|
|
|
Great, thanks
Alan Balkany wrote: If you could describe the task you're trying to accomplish, maybe I could make some more specific recommendations.
Actually , I'm going to detect some shapes (likes circle or rectangles or complex shapes ) in an AVI file or a stream video from WebCam with C# .
Do you have any advices ?
|
|
|
|
|
Once you get your image into a bitmap, morphology provides operations you can use to simplify the image, so it's easier to detect the shape you're looking for. For example, to detect circles with diameter d, doing an erosion by a diameter d circle should result in a single point for every circle in the image.
Many systems have morphological operations built in, which is the easiest way to do it. You can also implement your own, but this is harder and requires specialized knowledge. I found a better link for morphology: http://en.wikipedia.org/wiki/Morphological_image_processing[^]. This includes links to free function libraries that do this.
|
|
|
|
|
|
Yes, that looks excellent. It has morphology and much more.
|
|
|
|
|
Thanks a lot Alan Balkany for answers.
|
|
|
|
|
|
Assuming that these are simple geometric shapes on relatively simple backgrounds (as opposed to real objects against cluttered backgrounds), then I'd suggest:
1. Determine which pixels are foreground (shapes) and background (everything else)
2. Identify individual blobs (connected sets of foreground pixels of the same type)
3. For each blob, extract meaningful features
4. Train a classifier, based on the extracted features
5. Test the system on new images
6. Celebrate!
In step 2, try using a flood fill.
In step 3, there are many features one might try, such as perimeter-to-area ratio.
In step 4, the classifier could be any learning algorithm: neural network, linear discriminant, etc.
-Will Dwinnell
Data Mining in MATLAB
|
|
|
|