T10

.pdf

School

Swinburne University of Technology *

*We aren’t endorsed by this school

Course

EEE20001

Subject

Electrical Engineering

Date

Oct 30, 2023

Type

pdf

Pages

7

Uploaded by bercianoj

Report
Digital Electronics - Tutorial 38 of 46 Tutorial 10 Solution Q1) Vending Machine (Not provided) Q2) 3-bit Up/Down counter with count enable (Updated to use ieee.numeric_std ) -------------------------------------------------------------------------------- -- Tutorial 10 Q2) 3-bit up/down counter module with count enable -------------------------------------------------------------------------------- library IEEE; use ieee.std_logic_1164. all ; use ieee.numeric_std. all ; entity count3 is Port ( reset : in std_logic ; clock : in std_logic ; countEn : in std_logic ; direction : in std_logic ; q : out std_logic_vector ( 2 downto 0 ) ); end entity count3; architecture Behavioral of count3 is signal tq : signed ( 2 downto 0 ); begin q <= std_logic_vector ( count ); -- Convert value to std_logic_vector sync: process ( reset , clock ) begin if ( reset = '1' ) then count <= ( others => '0' ); elsif (rising_edge( clock )) then if ( countEn = '1' ) then if ( direction = '1' ) then count <= count + "1" ; else count <= count - "1" ; end if ; end if ; end if ; end process sync; end architecture Behavioral;
Digital Electronics - Tutorial 39 of 46 3-bit Up/Down counter with count enable (Updated to use ieee.numeric_std ) -------------------------------------------------------------------------------- -- Tutorial 10 Q3) 3-bit ‘automatic’ up/down counter module with count enable -- Also a good example of using enumerated types outside of state machines -------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164. all ; use IEEE.numeric_std. all ; entity count3 is Port ( reset : in std_logic ; clock : in std_logic ; countEn : in std_logic ; q : out std_logic_vector ( 2 downto 0 ) ); end entity count3; architecture Behavioral of count3 is signal count : unsigned ( 2 downto 0 ); -- It is common to use unsigned for counters type DirectionType is ( up , down ); -- Example use of enumerated type signal direction : DirectionType ; -- Easier to 'read' begin q <= std_logic_vector ( count ); -- Convert value to slv for output sync : process ( reset , clock ) begin if ( reset = '1' ) then count <= ( others => '0' ); direction <= up ; elsif (rising_edge( clock )) then -- Note that assignments to direction and count both produce FFs if ( countEn = '1' ) then case direction is when up => count <= count + "1" ; when down => count <= count - "1" ; end case ; -- Change direction 1 clock early to allow for delayed action on following edge if ( count = "001" ) then direction <= up ; elsif ( count = "110" ) then direction <= down ; end if ; end if ; end if ; end process sync; end architecture Behavioral;
Digital Electronics - Tutorial 40 of 46 Q4) Example VHDL P1: process( reset, clock ) begin if (reset = '1') then x <= '0'; elsif (rising_edge(clock)) then x <= w; end if; end process P1; P2: process( clock ) begin if (rising_edge(clock)) then if (clear = '1') then x <= '0'; else x <= w; end if; end if; end process P2; Asynchronous Reset Synchronous Reset (Clear input)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help

Browse Popular Homework Q&A

Q: A) what type of mutation is shown based on the nature of the genetic change (frameshift mutation or…
Q: Find all the critical points of the function and determine whether each critical point is a local…
Q: An ordinary egg can be approximated as a 5.5-cm-diameter sphere whose thermal conductivity of…
Q: A student presses a book between his hands, as the drawing indicates. The forces that he exerts on…
Q: Multiple-Concept Example 10 provides one model for solving this type of problem. Two wheels have the…
Q: Volcanic lava fountains Although the November 1959 Kilauea Iki eruption on the island of Hawaii…
Q: A 20 N crate being pushed at a constant velocity on a horizontal floor using 40 N of force. Be sure…
Q: walk her to the bathroom and notice that she is diaphoretic and dyspneic. She says to you, "I've…
Q: How many grams of oxygen (O) are present in a 6.41 g sample of potassium nitrate (KNO3)? Enter your…
Q: A clinical laboratory has a vacancy for a medical transcriptionist. The job requires candidates to…
Q: A spacecraft is traveling with a velocity of Vox = 5900 m/s along the +x direction. Two engines are…
Q: The coupon interest rate: O Is larger than the stated interest rate Is the same as the market…
Q: brand
Q: Please provide thorough explanation. Thank you
Q: Thomas Hancock has been the administrator of the clinical laboratories of a large urban hospital for…
Q: Salinity in Quebec river is a combination of tides and rain. Rain that diluted the salt occurs about…
Q: Find slope of the line that goes through points (2, 3) and (4,7). 02 -2 O 1/2 none of these answers
Q: 5. Unicorn lily flowers have four different alleles for flower color: purple, magenta, orange, or…
Q: Exactly how many distinct polymorphisms are there? Can you explain the key differences between them
Q: This is the chemical formula for methyl acetate: (CH,),CO,. Calculate the mass percent of carbon in…
Q: worker, and the company decides to eliminate this effect by selecting 12 workers at random and…
Q: Give more detail answer Please. Thank You Your current LIS system will no longer be supported by…