Question

In: Electrical Engineering

Using Quartus to design a stopwatch that can display tenths of seconds, minutes, and hours, with...

Using Quartus to design a stopwatch that can display tenths of seconds, minutes, and hours, with the gaps between HEX displays splitting the time units (i.e. minutes on HEX[5..4], hours on HEX[7..6]). Have the stopwatch cycle through 3 states of a state machine with a pushbutton. The 3 states are counter-clear, counter-start, and counter-stop

Solutions

Expert Solution

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

entity real_time_clock is
port (clk1 : in std_logic;
seconds : out std_logic_vector(5 downto 0);
minutes : out std_logic_vector(5 downto 0);
miliseconds: out std_logic_vector(4 downto 0);
hex0,hex1,hex2,hex3,hex5,hex5 (o to 6)
);
end real_time_clock ;

architecture Behavioral of real_time_clock is
signal sec,min,mili : integer range 0 to 60 :=0;
signal count : integer :=1;
signal clk : std_logic :='0';
begin
seconds <= conv_std_logic_vector(sec,6);
minutes <= conv_std_logic_vector(min,6);
miliseconds<= conv_std_logic_vector(mili,5);

--clk generation.For 100 MHz clock this generates 1 Hz clock.
process(clk1)
begin
if(clk1'event and clk1='1') then
count <=count+1;
if(count = 50000000) then
clk <= not clk;
count <=1;
end if;
end if;
end process;

process(clk) --period of clk is 1 second.
begin

if(clk'event and clk='1') then
sec <= sec+ 1;
if(sec = 59) then
sec<=0;
min <= min + 1;
if(min = 59) then
hour <= hour + 1;
min <= 0;
if(hour = 23) then
hour <= 0;
end if;
end if;
end if;
end if;

end process;

end Behavioral;


Related Solutions

Design a clock display to show the time in hours, minutes, and seconds. Assume that we...
Design a clock display to show the time in hours, minutes, and seconds. Assume that we have a clock of exactly 1 KHz (1000 clock pulses per second). It will use 6 seven-segment displays and operate either in military time (hours 00 to 23) or regular time (1 to 12, with AM and PM). An input line, x, differentiates between the two. A seventh display is used to show A or P in the latter case; it is blank otherwise....
Write a program that request a time interval in seconds and display it in hours, minutes,...
Write a program that request a time interval in seconds and display it in hours, minutes, second format. (java)
Write a C++ code that can convert time into hours, minutes, seconds. It can accept (seconds),...
Write a C++ code that can convert time into hours, minutes, seconds. It can accept (seconds), (minutes, seconds), (hours, minutes, seconds) The input can be written in main It should produce the following output: (67.4, 14, 5) is 67 Hours, 38 Minutes, 5 Seconds (127.86) is 0 Hours, 2 Minutes, 8 Seconds (-3, 73, 2) is -1 Hours, -46 Minutes, -58 Seconds
PART A Write a program that converts a total number of seconds to hours, minutes, and...
PART A Write a program that converts a total number of seconds to hours, minutes, and seconds. It should do the following: Prompt the user for input Read an integer from the keyboard Calculate the result Use printf to display the output Your output must be of the format: totalSeconds seconds = numHours hours, numMinutes minutes, and numSeconds seconds For example: If the user entered: 5000 Your program would output: 5000 seconds = 1 hours, 23 minutes, and 20 seconds...
Need to modify the below code to return the time in minutes instead of seconds. (Using...
Need to modify the below code to return the time in minutes instead of seconds. (Using Python 2.7.6 ) def numberPossiblePasswords(numDigits, numPossiblePerDigit):     numPasswords = numPossiblePerDigit**numDigits     return numPasswords def maxSecondsToCrack(numPossiblePasswords, secPerAttempt):     time = numPossiblePasswords*secPerAttempt     return time nd = int(input("How many digits long is the passcode? "))       nc = int(input("How many possible characters are there per digit? ")) secondsPerAttempt = .08 npp = numberPossiblePasswords(nd, nc) totalSeconds = maxSecondsToCrack(npp, secondsPerAttempt) print("It will take you " + str(totalSeconds) + "...
1a. Write your Verilog program to implement the timer counter. HEX0 should show tenths of seconds...
1a. Write your Verilog program to implement the timer counter. HEX0 should show tenths of seconds from 0 to 9. HEX1 and HEX2 should show a count of seconds, from 00 to 59. The ones count is on HEX1 and the tens count is on HEX2. 1b. Count backwards and forwards. Add a button or switch to control counting direction. When counting forwards or backwards, your count should not stop but rollover appropriately at the correct time. When counting forward,...
def DMStoDD(degree, minutes, seconds): dd = abs(degree) + abs(minutes)/60 + abs(seconds)/3600 if degree > 0: return...
def DMStoDD(degree, minutes, seconds): dd = abs(degree) + abs(minutes)/60 + abs(seconds)/3600 if degree > 0: return dd else: return -dd print(DMStoDD(-30, 30, 00)) In this script, add a main program that collects DD or DMS input from the user, then converts it to the other form and reports the converted value. Directions: The main program needs to gather a string from the keyboard using input() and detect whether it is DD or DMS (Hint: use the split function). Then it...
Time Remaining 3 hours 5 minutes 26 seconds 03:05:26 eBook Check my work Check My Work...
Time Remaining 3 hours 5 minutes 26 seconds 03:05:26 eBook Check my work Check My Work button is now disabled Item 3 Item 3 Time Remaining 3 hours 5 minutes 26 seconds 03:05:26 Polaski Company manufactures and sells a single product called a Ret. Operating at capacity, the company can produce and sell 38,000 Rets per year. Costs associated with this level of production and sales are given below: Unit Total Direct materials $ 20 $ 760,000 Direct labor 10...
Time Remaining 2 hours 2 minutes 11 seconds 02:02:11 Item 6 Item 6 Time Remaining 2...
Time Remaining 2 hours 2 minutes 11 seconds 02:02:11 Item 6 Item 6 Time Remaining 2 hours 2 minutes 11 seconds 02:02:11 The Molson Company had budgeted production for the year as follows: Quarter 1 2 3 4 Production in units 11,700 13,700 19,600 15,700 Four pounds of raw materials are required for each unit produced. Raw materials on hand at the start of the year total 5,700 lbs. The raw materials inventory at the end of each quarter should...
Ruben Trout worked the following schedule: Monday, 8 hours, 27 minutes; Tuesday, 7 hours, 38 minutes;...
Ruben Trout worked the following schedule: Monday, 8 hours, 27 minutes; Tuesday, 7 hours, 38 minutes; Wednesday, 9 hours, 19 minutes; Thursday, 8 hours, 3 minutes; Friday, 8 hours, 36 minutes. The employer pays overtime in accordance with FLSA regulations. Required: Determine Ruben's total time worked according to the (a) quarter-hour method and (b) the hundredth-hour method. Which is the more favorable method for Ruben, quarter-hour or hundredth-hour? (Do not round intermediate calculations. Round your final answers to 2 decimal...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT