Using the programing language of Verilog I attempted to make a counter to count from 0 to 9 then loop back to 0 using the internal clock of the FPGA cyclone IV from altera. the code is posted at the bottom
I get the following errors
Error (10663): Verilog HDL Port Connection error at Encryption.v(9): output or inout port "clk" must be connected to a structural net expression
Error (10285): Verilog HDL Module Instantiation error at Encryption.v(9): instance "" specifies 3 actual port connections but module "clockgen" only expects 2
Error (12153): Can't elaborate top-level user hierarchy
Can someone help me debug this code so it can count up to 9
module Encryption(SW, CLOCK_50, OUT, HEX0);
input[1:0]SW;
input CLOCK_50;
output reg[6:0] HEX0;
output [3:0]OUT;
wire S1, S2, S3;
clockgen(CLOCK_50, 25000000,clk);
Tflipflop(SW[0], clk, SW[1], OUT[0]);
and(S1, clk, SW[0], OUT[0]);
Tflipflop(S1, clk, SW[1], OUT[1]);
and(S2, S1, OUT[1]);
Tflipflop(S2, clk, SW[1], OUT[2]);
and (S3, S2, OUT[2]);
Tflipflop(S3, clk, SW[1], OUT[3]);
always
begin
case(OUT)
4'b0000: HEX0 = 7'b1000000;
4'b0001: HEX0 = 7'b1111001;
4'b0010: HEX0 = 7'b0100100;
4'b0011: HEX0 = 7'b0110000;
4'b0100: HEX0 = 7'b0011001;
4'b0101: HEX0 = 7'b0010010;
4'b0110: HEX0 = 7'b0000010;
4'b0111: HEX0 = 7'b1111000;
4'b1000: HEX0 = 7'b0100000;
4'b1001: HEX0 = 7'b0010000;
4'b1010: HEX0 = 7'b0001000;
4'b1011: HEX0 = 7'b0000011;
4'b1100: HEX0 = 7'b1000110;
4'b1101: HEX0 = 7'b0100001;
4'b1110: HEX0 = 7'b0000110;
4'b1111: HEX0 = 7'b1001110;
endcase
end
endmodule
module Tflipflop(En, Clk, Clear, Q);
output Q;
input En, Clk, Clear;
reg Q;
always @(posedge Clk)
if (Clear == 0)
begin
Q = 1'b0;
end
else
begin
Q = En^Q;
end
endmodule
module clockgen(clk_in, clk_out);
input clk_in;
output[3:0] clk_out;// count up to 9 length must be 4 so [3:0]
reg[3:0] counter = 0; //temp variable
always@(posedge clk_in)
begin
if(counter< 9)
counter<=counter+1;//manupulate temp variable
else
counter = 0;
end
assign clk_out = counter;//assigning temp variable value(counter in always block) to the output variable
endmodule
In: Electrical Engineering
Refer Appendix G in the text in order to determine the standard free energy change for each of these reactions. Determine whether or not the reaction is spontaneous under standard conditions (298 K, 1 atm). 2??3 → ?2 + 3?2 ???4 (?) + ?2 (?) → ???2 (?) + 2?2?(?) ?(???????) → ?(????ℎ???)
In: Chemistry
In racket
Assume that the elements of a list are indexed starting with 1. Write a function alts that takes a list of integers xs and returns a pair of lists, the first of which has all the odd-indexed elements (in the same relative order as in xs) and the second of which has all the even-indexed elements (in the same relative order as in xs).
Output should be
(alts (list 7 5 4 6 9 2 8 3)) '((7 4 9 8)5 6 2 3)
(alts (list 5 4 6 9 2 8 3)) '((5 6 2 3) 4 9 8)
Any help would be appreciated, we're not allowed to use cond
In: Computer Science
2. [6 marks] (Induction) Prove that 21 divides 4n+1 + 5 2n−1 whenever n is a positive integer. HINT: 25 ≡ 4(mod 21)
In: Advanced Math
The American Housing Survey reported the following data on the number of times that owner-occupied and renter-occupied units had a water supply stoppage lasting 6 or more hours in the past 3 months.
| Number of Houses (1000s) | ||||
| Number of Times | Owner Occupied | Renter Occupied | ||
| 0 | 549 | 23 | ||
| 1 | 5,012 | 542 | ||
| 2 | 6,100 | 3,734 | ||
| 3 | 2,544 | 8,690 | ||
| 4 times or more | 558 | 3,783 | ||
Do not round intermediate calculations. Round your answers to two decimal places.
a. Define a random variable x = number of times that owner-occupied units had a water supply stoppage lasting 6 or more hours in the past 3 months and develop a probability distribution for the random variable. (Let x = 4 represent 4 or more times.)
| x | f(x) |
| 0 | |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| Total |
b. Compute the expected value and variance for x.
| Total | |
| E(x) | |
| Var(x) |
c. Define a random variable y = number of times that renter-occupied units had a water supply stoppage lasting 6 or more hours in the past 3 months and develop a probability distribution for the random variable. (Let y = 4 represent 4 or more times.)
| y | f(y) |
| 0 | |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| Total |
d. Compute the expected value and variance for y.
| Total | |
| E(y) | |
| Var(y) |
In: Statistics and Probability
Following are the securities and projections for Mogul Corp:
Stock A: REQUIRED RATE OF RETURN = 5%
Constant-growth-growth rate of 3% D0= $3.00
Stock B: REQUIRED RATE OF RETURN = 7%
D0= $4.00, growth at 5% per year for 2 years, followed by 4% forever
Stock C: REQUIRED RATE OF RETURN = 9%
D0= $2.00, growth at 25% for next 4 years, followed by 5% forever
Mogul has a 3.5% Treasury bond, semi-annual interest, with 4 years left to maturity and a quoted
price of $962.81.
PRIMARY POST: Question 3
1) Calculate the bond’s current yield and yield to maturity.
2) Calculate the value per share today for stock A.
3) Calculate the value per share 4 years from today for stock B
4) Calculate the value per share today for stock C.
REPLY POST: Question 3
1) Calculate the bond’s capital gain yield.
2) Calculate the value per share one year from today for stock A.
3) Calculate the value per share today for stock B.
4) 3) Do you agree with the stock valuation in part 4 of the primary post? If the stock was selling for $143.01 on January 1, 2018, would you purchase it? Use the correct stock valuation as the basis for your answer.
In: Finance
Part I: Cost Benefit Analysis:
As the Director of HIM, you have been charged with finding a new vendor to supply the copy machines in your division to be considered in the next capital budget submission. To start the process, you want to form a small committee to assist you in the decision making process.
1. Who should you reach out to for joining the committee? Both within the HIM department and outside your department.
Once the committee is formed, the team determines the most important factors for the machine and assigns those factors a weight on a scale from 1-5 (5 being the most important). As you can see in the table below, Copy Quality was the highest weighted factor with a weight of 5. The four vendors are brought in to display their machines, functionality and services and the committee then rates each vendor based on the factors important to the organization.
After reviewing the below table, answer the following questions:
2. From which vendor should you acquire your machines?
3. What factors did you consider in your decision?
4. What lead you to the final selection of one specific vendor?
Provide a short rationale with specific details to the above questions.
Vendor A Vendor B Vendor C Vendor D
WGT| RTG| SCORE RTG| SCORE RTG| SCORE RTG| SCORE
COPY QUALITY 5| 4| 3 3 2
SPEED 4| 3 1 4 2
MAINTENANCE/ 2| 3 3 5 2
HISTORY
SERVICEABLITIY 3| 5 2 4 3
UPGRADABLE 1| 4 3 3 5
SIZE 2| 5 3 3 1
TOTAL
PURCHASE/LEASE COST (RTG) $18,000 (RTG) $10,000 (RTG) $11,000 (RTG) $2500 Lease/year X 5yrs (operating lease)
The WGT (weight) scale is what you have determined to be the most important factors in selecting a copier. The RTG (rating) is the rating you gave each vendor’s copier for each category.
In: Accounting
5. You are purchasing a car today that costs $25,000. You have been given the following financing options for the car. Option 1 is conventional 4-year financing at an interest rate of 4%, compounded monthly. This option requires monthly payments. Option 2 is a balloon loan which requires monthly payments of $375 for 2 years and then a final balloon payment for the remaining balance. The interest rate on this loan is 2.5%.
a. What is the payment for the conventional loan (option 1)?
b. Prepare an amortization schedule for option 1.
c. What will the balloon payment be for the balloon loan (option 2)?
d. Prepare an amortization schedule for option 2.
e. Which option do you prefer and why? What additional considerations are there with respect to the balloon loan?
In: Finance
Number of hours studying per week for
C or better students:
8, 4, 4, 2, 1, 5, 3, 2, 3
Number of hours studying per week for
D or F students:
6, 2, 1, 0, 3, 2, 1
In: Statistics and Probability
Python pls
1. The function only allow having one return statement. Any other statements are not allowed. You only have to have exactly one return statement.
For example
the answer should be
def hello(thatman):
return thatman * thatman
Create a function search_hobby. This function returns a set of hobby names and people's excitement level.
input
database = {'Dio': {'Lottery': 2, 'Chess': 4, 'Game': 3},'Baily': {'Game': 2, 'Tube': 1, 'Chess': 3}, 'Chico': {'Punch': 2, 'Chess': 5}, 'Aaron': {'Chess': 4, 'Tube': 2, 'Baseball': 1}}
def search_hobby(database, num):
#ONLY ONE STATEMENT IS ALLOWED (RETURN STATEMENT)
search_hobby(database,0) -> {'Chess', 'Punch', 'Baseball', 'Game', 'Tube', 'Lottery'}
search_hobby(databalse,3) - > {'Chess', 'Game'}
In: Computer Science