T9

.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

6

Uploaded by bercianoj

Report
Digital Electronics - Tutorial 32 of 46 Tutorial 9 Solution Q1) P1 : process ( clock ) begin if rising_edge ( clock ) then t <= w or x ; b <= t and y ; end if ; end process P1 ; Note: Two FFs. The assigments to t and b are separated by a clock cycle! P2 : process ( clock , t , y ) begin if rising_edge ( clock ) then t <= w or x ; end if ; b <= t and y ; end process P2 ; Q2) --==================================================== -- Two example shift register architectures -- entity ShiftRegister is Port ( reset : in STD_LOGIC ; clock : in STD_LOGIC ; shiftEn : in STD_LOGIC ; loadEn : in STD_LOGIC ; serialIn : in STD_LOGIC ; d : in STD_LOGIC_VECTOR ( 7 downto 0 ); q : out STD_LOGIC_VECTOR ( 7 downto 0 ) ); end ShiftRegister ;
Digital Electronics - Tutorial 33 of 46 Q2) cont. --================================================= -- 8-bit SR -- Asynchronous reset -- Asynchronous load -- Synchronous shift (obviously) architecture Behavioral of ShiftRegister is signal tq : STD_LOGIC_VECTOR ( 7 downto 0 ); begin q <= tq ; process ( reset , loadEn , d , clock ) begin if ( reset = ' 1 ' ) then -- asynchronous reset tq <= ( others => ' 0 ' ); elsif ( loadEn = ' 1 ' ) then -- asynchronous load tq <= d ; elsif rising_edge ( clock ) then if ( shiftEn = ' 1 ' ) then - synchronous shift left tq <= tq ( 6 downto 0 ) & serialIn ; -- or tq <= tq(tq'left-1 downto tq'right) & serialIn; end if ; end if ; end process ; end Behavioral ; --================================================= -- 8-bit SR -- Asynchronous reset -- Synchronous load -- Synchronous shift (obviously) architecture Behavioral2 of ShiftRegister is signal tq : STD_LOGIC_VECTOR ( 7 downto 0 ); begin q <= tq ; process ( reset , clock ) begin if ( reset = ' 1 ' ) then -- asynchronous reset tq <= ( others => ' 0 ' ); elsif rising_edge ( clock ) then if ( loadEn = ' 1 ' ) then -- synchronous load tq <= d ; elsif ( shiftEn = ' 1 ' ) then -- synchronous shift left tq <= tq ( 6 downto 0 ) & serialIn ; -- or tq <= tq(tq'left-1 downto tq'right) & serialIn; end if ; end if ; end process ; end Behavioral2 ;
Digital Electronics - Tutorial 34 of 46 Q3) --=================================================================== -- dieCounter.vhdl -- -- A counter to produce a roll in the range 1 .. 6 (like a die) -- -- Revision History --=================================================================== -- 6/4/17 - Created - pgo --=================================================================== library ieee ; use ieee . std_logic_1164 . ALL ; use ieee . numeric_std . all ; entity dieCounter is Port ( reset : in std_logic ; clock : in std_logic ; roll : in std_logic ; count : out std_logic_vector ( 2 downto 0 ) ); end dieCounter ; architecture Behavioural of dieCounter is signal dieCount : unsigned ( 2 downto 0 ); begin count <= std_logic_vector ( dieCount ); -- Produce dieCount sequence from 1 ... 6 counter : process ( reset , clock ) begin if ( reset = ' 1 ' ) then dieCount <= "001" ; -- start count from 1 elsif ( clock' event and ( clock = ' 1 ' )) then if ( roll = ' 1 ' ) then -- rolling if ( dieCount >= "110" ) then dieCount <= "001" ; -- wrap count else dieCount <= dieCount + "001" ; end if ; end if ; end if ; end process ; end Behavioural ;
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: Suppose that a distribution of 400 items has mean 130 and standard deviation 5. Find the​ z-score of…
Q: A 22.2-g sample of an alloy at 93.00°C is placed into 50.0 g of water at 22.00°C in an insulated…
Q: Step by step guide. Thank you very much!   Find the derivative of the function. y = x2ex − 2xex +…
Q: A cylindrical hole of radius a is drilled through the center of a solid sphere of radius 2a. Find…
Q: A B C Question 4 Laurie was walking by the pool and dropped her red box of candy! She wants to reach…
Q: Before changes to its management staff, an automobile assembly line operation had a scheduled mean…
Q: Linux:  What is the difference between the . (ie the dot) char meaning for Shell globbing and . (ie…
Q: Commodities exported and imported by each nation constitute the trade; C: gains from trade; D:…
Q: A teacher wants to see if a new unit on factoring is helping students learn. She has five randomly…
Q: Let X be a continuous random variable whose probability density function is given by the formula…
Q: When it comes to security, how can the benefits and drawbacks of the various authentication…
Q: 11). Use the Integral Test to determine whether the sum converges. ∞ n = 1 6n 1 + n4 Evaluate…
Q: 10- For the data in Problem 10-16: 38 A 16 10-A robot has just been installed at a cost of $81,000.…
Q: If a firm is producing a given level of output in a technically-efficient manner, then it must be…
Q: Which of the following describes an object with zero net force acting on it? Choose all The car sped…
Q: 1 Mechanical Wave A string is set up as shown. One end of the string is attached to an oscillator…
Q: A cube of wood having an edge dimension of 19.1 cm and a density of 645 kg/m³ floats on water. (a)…
Q: Which of the two rates would yield the larger amount in 1 year: 9% compounded monthly or 9%…
Q: Compute T₂(x) at x = 0.5 for y = e² and use a calculator to compute the error |eª — T₂(x)| at x =…
Q: Which question would be the BEST to ask to determine if a wave is an EM wave or a mechanical wave?…
Q: The following table gives projections of the population of a country from 2000 to 2100. Answer parts…
Q: Given f''(x) = 3x 5 and f'(0) = 5 and f(0) = 3. Find f'(x) = and find f(2)= =