Answer:
Explanation:
a) Show how two 2-to-1 multiplexers (with no added gates) could be connected to form a 3-to-1 MUX. Input selection should be as follows: If AB = 00, select I0 If AB = 01, select I1 If AB = 1− (B is a don’t-care), select I2
We are to show how Two-2-to -1 multiplexers could be connected to form 3-to-1 MUX
If AB = 00 select [tex]I_o[/tex]
If AB = 01 select [tex]I_1[/tex]
If AB = 1_(B is don't care), select [tex]I_2[/tex]
However, the truth table is attached and shown in the first file below.
Also, the free- body diagram for 2- to - 1 MUX is shown in the second diagram attached below.
b) We are show how two 4-to-1 and one 2-to-1 multiplexers could be connected to form an 8-to-1 MUX with three control inputs.
The perfect illustration showing how they are connected in displayed in the third free-body diagram attached below.
Where ; [tex]I_o , I_1, I_2, I_3, I_4, I_5, I_6, I_7[/tex] are the inputs of the multiplexer and Z is the output.
c) Show how four 2-to-1 and one 4-to-1 multiplexers could be connected to form an 8-to-1 MUX with three control inputs.
For four 2-to-1 and one 4-to-1 multiplexers could be connected to form an 8-to-1 MUX with three control inputs, we have a perfect illustration of the diagram in the last( which is the fourth) diagram attached below.
Where ; [tex]I_o , I_1, I_2, I_3, I_4, I_5, I_6, I_7[/tex] are the inputs of the multiplexer and Z is the output
This question is a multiplexer which is a topic in digital circuit.
Multiplexer is a type of combination circuit that consist of a maximum of [tex]2^n[/tex] data inputs 'n' selection lines and single output line. One of these data inputs will be connected to the output based on the values of selection lines. Another name for multiplexers is MUX.
If we have 'n' selection lines, we will get [tex]2^n[/tex] possible combinations zero and ones. Each combination will select a maximum of only one data input.
a)
Two 2-to-1 multiplexers to form a 3-to-1 MUX.
If AB = 00, select [tex]I_o[/tex]
If AB = 01, select [tex]I_1[/tex]
If AB = 1- (B is don't care) select I
The truth table for the above scenario is in the attached document below.
Figure 1 and 2 represents the solution to this question.
b).
Two 4-to-1 multiplexers and one 2-to-1 multiplexers and one 2-to-1 multiplexers are used to form an 8-to-1 MUX.
In the attached diagram, figure 3 shows a comprehensive detail of how it is structured.
Where [tex]I_o[/tex] to [tex]I_7[/tex] are the inputs of the multiplexer and Z is the output.
c) Four 2-to-1 multiplexers and one 4-to -1 multiplexer are used to form 8-to-1 MUX.
In the attached diagram, figure 4 shows how it is structured.
We would see that [tex]I_o[/tex] to [tex]I_7[/tex] are the inputs of the multiplexer and Z is the output in the system.
Learn more about multiplexers here;
https://brainly.com/question/25953942
Create an abstract class DiscountPolicy. It should have a single abstract method computeDiscount that will return the discount for the purchase of a given number of a single item. The method has two parameters, count and itemCost. 2. Derive a class BulkDiscount from DiscountPolicy, as described in the previous exercise. It should have a constructor that has two parameters, minimum and percent. It should define the method computeDiscount so that if the quantity purchased of an item is more than minimum, the discount is percent percent. 3. Derive a class BuyNItemsGetOneFree from DiscountPolicy, as described in Exercise 1. The class should have a constructor that has a single parameter n. In addition, the class should define the method computeDiscount so that every nth item is free. For example, the following table gives the discount for the purchase of various counts of an item that costs $10, when n is 3: count 1 2 3 4 5 6 7 Discount 0 0 10 10 10 20 20
4. Derive a class CombinedDiscount from DiscountPolicy, as described in Exercise 1. It should have a constructor that has two parameters of type DiscountPolicy. It should define the method computeDiscount to return the maximum value returned by computeDiscount for each of its two private discount policies. The two discount policies are described in Exercises 2 and 3. 5. Define DiscountPolicy as an interface instead of the abstract class described in Exercise 1.
Answer:
Java Code was used to define classes in the abstract discount policy,The bulk discount, The buy items get one free and the combined discount
Explanation:
Solution
Code:
Main.java
public class Main {
public static void main(String[] args) {
BulkDiscount bd=new BulkDiscount(10,5);
BuyNItemsGetOneFree bnd=new BuyNItemsGetOneFree(5);
CombinedDiscount cd=new CombinedDiscount(bd,bnd);
System.out.println("Bulk Discount :"+bd.computeDiscount(20, 20));
System.out.println("Nth item discount :"+bnd.computeDiscount(20, 20));
System.out.println("Combined discount :"+cd.computeDiscount(20, 20));
}
}
discountPolicy.java
public abstract class DiscountPolicy
{
public abstract double computeDiscount(int count, double itemCost);
}
BulkDiscount.java
public class BulkDiscount extends DiscountPolicy
{
private double percent;
private double minimum;
public BulkDiscount(int minimum, double percent)
{
this.minimum = minimum;
this.percent = percent;
}
at Override
public double computeDiscount(int count, double itemCost)
{
if (count >= minimum)
{
return (percent/100)*(count*itemCost); //discount is total price * percentage discount
}
return 0;
}
}
BuyNItemsGetOneFree.java
public class BuyNItemsGetOneFree extends DiscountPolicy
{
private int itemNumberForFree;
public BuyNItemsGetOneFree(int n)
{
itemNumberForFree = n;
}
at Override
public double computeDiscount(int count, double itemCost)
{
if(count > itemNumberForFree)
return (count/itemNumberForFree)*itemCost;
else
return 0;
}
}
CombinedDiscount.java
public class CombinedDiscount extends DiscountPolicy
{
private DiscountPolicy first, second;
public CombinedDiscount(DiscountPolicy firstDiscount, DiscountPolicy secondDiscount)
{
first = firstDiscount;
second = secondDiscount;
}
at Override
public double computeDiscount(int count, double itemCost)
{
double firstDiscount=first.computeDiscount(count, itemCost);
double secondDiscount=second.computeDiscount(count, itemCost);
if(firstDiscount>secondDiscount){
return firstDiscount;
}else{
return secondDiscount;
}
}
}