Draw the state diagram corresponding to given fsm vhdl model

Assignment Help Other Engineering
Reference no: EM131065530

Problem 1

a)  Draw the synthesized logic resulting from the following VHDL code. Label all the signals on your diagram precisely.

entity unknown is generic (k : natural := 3);

port (x : in std_logic_vector ( 2**k-1 downto 0); f : out std_logic);

end unknown;

architecture struct of unknown is component and2 is

port (a, b : in std_logic; c: out std_logic);

end component;

component or2 is

port (a, b : in std_logic; c: out std_logic);

end component;

type matrix is array (k-1 downto 0, 2**k-1 downto 0) of std_logic;

signal temp : matrix;

begin

outer_loop: for j in k-1 downto 0 generate

inner_loop: for i in 0 to 2**j-1 generate

and_gen: if j = k-1 then generate

and_gate: and2 port map (X(2*i), X(2*i + 1), temp(j,i));

end generate;

or_gen: if j < k-1 then generate

or_gate: or2 port map (temp(j+1, 2*i), temp(j+1, 2*i + 1), temp(j,i));

end generate; end generate;

end generate; f <= temp(0,0); end struct;

What is the critical path delay for this circuit based on your diagram in a general case? State your answer in terms of variables used in the design assuming the delay of AND and OR gates are TAND and TOR respectively.

Problem 2

Write a function that creates a wide AND gate that operates on a vector of any length.

function wide_AND(a: STD_LOGIC_VECTOR) return std_logic is variable retVal: STD_LOGIC;

begin

retVal := '1';

for i in a'range loop

retVal := retVal and a(i); end loop;

return retVal;

end;

Problem 3

retVal := '1';

for i in a'range loop

retVal := retVal and a(i); end loop;

return retVal;

Draw the state diagram corresponding to the following FSM VHDL model:

library IEEE;

use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all;

use IEEE.std_logic_unsigned.all;

entity FSM_MIDTERM is port (

CLOCK: in STD_LOGIC; INPUT: in STD_LOGIC; RESET: in STD_LOGIC;

OUTPUT: out STD_LOGIC_VECTOR (2 downto 0));

end;

architecture FSM_MIDTERM_OPERATION of FSM_MIDTERM is type Sreg0_type is (S1, S2, S3, S4);

signal Sreg0: Sreg0_type;

begin

Sreg0_machine:   process (CLOCK, reset) begin

if RESET='1' then Sreg0 <= S1; OUTPUT <= "000";

elsif CLOCK'event and CLOCK = '1' then case Sreg0 is

when S1=>

OUTPUT <= "000";

if INPUT='1' then

Sreg0 <= S2; elsif INPUT='0' then

Sreg0 <= S1;

end if;

when S2=>

OUTPUT <= "010";

if INPUT='1' then

Sreg0 <= S4; elsif INPUT='0' then

Sreg0 <= S3;

end if;

when S3=>

OUTPUT <= "100";

if INPUT='0' then

Sreg0 <= S1;

elsif INPUT='1' then

Sreg0 <= S4;

end if;

when S4=>

OUTPUT <= "101";

if INPUT='1' then

Sreg0 <= S4; elsif INPUT='0' then

Sreg0 <= S3;

 

end if;

end if; end case;

end process;

Problem 4

In this problem you are asked to design a peak detector circuit. The purpose of this circuit is to alert the user when samples of a signal exceed beyond the threshold level. The circuit consists of a moving average calculation and a peak detector circuit, counters and control signals. A filter calculating the average of the N last samples of a signal is given by:

y(k) = (1/N) · i=nN-1 x (k - t)

Draw the logic block diagram of this circuit including all control signals for N = 4 for the following two cases:

a)       There is only one two-input adder available.

b)      No limitation on number of adders.

Problem 5

a)       What is the synthesis result of the following VHDL code? What function does this VHDL code represent?

entity unknown is

port( a: in unsigned (1 downto 0); d: in stdlogic;

z: out unsigned (3 downto 0));

end entity unknown;

architecture rtl of unknown is begin

process (a, d)

variable temp: integer range 0 to 3;

begin

temp := to_integer (a);

for j in z'range loop

if temp = j then

else end if;

end loop end process;

z(j)<= d; z(j)<= '0';

end architecture rtl;

Problem 6

Assume the following specifications for the logic circuit given below: Tmultiplier = 12 ns

Tadder = 5 ns

Tmux = 3 ns TNegation = 2 ns

FF's: Tc-q = 2 ns Tsu = 1 ns               Thold = 1 ns

68_Logic Circuit.jpg

a.        Minimum clock period for the circuit given in presence of no skew. Highlight the critical path on your design. Also highlight the shortest path in this design.

Tmin = Tc-q+Tneg+Tmult+Tmux+Tadd+Tsu

= 2+2+12+3+5+1=25ns

b.       If you replace the multiplier in part (a) with a two level pipelined multiplier as follows, what would be the speed up for the new design? Calculate the new clock period in presence of no skew.

Tmin = Tc-q+1/3*Tmult+Tmux+Tadd+Tsu

= 2+1/3*12+3+5+1=15ns

1714_Multiplier.jpg

c.        Redraw the complete pipelined circuit with new registers inserted in the paths.

d.       Fill out the following table using the information obtained above.

 

Latency

throughput

Unpipelined

 

 

3-pipelined

 

 

Problem 7

Using shift and add/subtract instructions only, devise efficient routines for the operations by the following constants. Present your answer as a series of add and shift instructions.

a)  Divide by 45

b)  Multiply by 2.5

Problem 8

Consider the following VHDL code segment.

y <= (others => '0'); if (a > b) then

y <= a - b;

end if ;

if (crtl = '1') then

y <= c;

end if ;

(a)   Draw the synthesized logic diagram.

(b)   Rewrite the complete code using one if statement.

if ctrl = 't' then

y<= c;

elsif a> b then

y = <= a - b;

else

y<= (other=> '0';

(c)   Repeat part (a) and (b) for the following VHDL code fragment. if (a > b) then

y <= a - b;

end if ;

if (crtl = '1') then

y <= c;

end if ;

Problem 9

Draw the state diagram corresponding to the following FSM VHDL model. Is this a Mealy or Moore machine? Why? Also complete the timing diagram for the given FSM code for y, g1, g2, g3.

entity arbiter is

port ( clock, resetn               : in          std_logic ;

r                           : in          std_logic_vector(1 to 3) ;

g                           : out        std_logic_vector(1 to 3)) ;

end arbiter ;

architecture behavior of arbiter is

type state_type is (idle, gnt1, gnt2, gnt3) ;

signal y : state_type ;

begin

process (resetn, clock)

begin

if resetn = '0' then y <= idle ;

elsif (clock'event and clock = '1') then case y is

when idle =>

if r(1) = '1' then y <= gnt1 ;

elsif r(2) = '1' then y <= gnt2 ;

elsif r(3) = '1' then y <= gnt3 ;

else y <= idle ;

end if ;

when gnt1 =>

if r(1) = '1' then y <= gnt1 ;

else y <= idle ;

end if ;

when gnt2 =>

if r(2) = '1' then y <= gnt2 ;

else y <= idle ;

end if ;

when gnt3 =>

if r(3) = '1' then y <= gnt3 ;

else y <= idle ;

end if ;

end case ;

end if ;

end process ;

g(1) <= '1' when y = gnt1 else '0' ; g(2) <= '1' when y = gnt2 else '0' ; g(3) <= '1' when y = gnt3 else '0' ;

end behavior;

933_Timing Diagram.jpg

776_Timing Diagram1.jpg

Reference no: EM131065530

Questions Cloud

Write an essay about surgically implanted electronic devices : Write an essay about Surgically Implanted Electronic Devices and Electronic Applications in the Automobile Industry. Present or Contemporary Usage, Advantages and Disadvantages and Future Concerns and Issues.
Which of the pearson correlations shows the strength : which of the folling pearson correlations shows the greatest strength
Derive and graph home import demand schedule : Suppose that Foreign had been a much larger country, with domestic demand D* = 800 - 200P and S* = 400 + 200P. Recalculate the free trade equilibrium and the effects of a 0.5 specific tariff by Home. Relate the difference in results to the discuss..
Determine the standardized test statistic t : determine the standardized test statistic t necessary to test the claim ? = 0 . Round answers to three decimal places
Draw the state diagram corresponding to given fsm vhdl model : Draw the state diagram corresponding to the following FSM VHDL model. Is this a Mealy or Moore machine? Why? Also complete the timing diagram for the given FSM code for y, g1, g2, g3.
Evaluating the definite integral : evaluating the definite integral
What is standard deviation of distribution of sample means : Salesman for the ABC plastics company drive an average of 240 miles per day with a standard deviation of 36 miles. if samples of 25 daily mileages are taken what is the standard deviation of the distribution of sample means?
Which statement is correct : Amy walks from Point A to point B along the segment AB. Fraser walks from point C to D along the segment CD. Which statement is correct
What is the multifactor productivity of the current process : What is the multifactor productivity of the current process?

Reviews

Write a Review

Other Engineering Questions & Answers

  The removal of eschar from burned skin

------------------is the removal of eschar from burned skin.  _____________ investigates the body's structure, whereas __________ investigates the processes or functions of living things.

  Determining capacitive reactance

In the time-constant curve of a resistor and large inductor, the initial part of the curve that represents the start-up of current is blank - Which of the following is a component that opposes any change in current through it?

  Find the maximum value of r

Find the maximum value of R. Using the value of R found in part (a), design a multiplexing system that first multi-plexes s1 (t) and s2 (t) into a new sequence, s5 (t), and then multiplexes s3 (t), s4 (t), and s5 (t).

  The completion of this assignment will entail the design of

the completion of this assignment will entail the design of the structural fire protection for a simple warehouse

  What type of loading arrangements found on a roadheader

Design a suitable ore pass to transport ore a vertical distance of 200m from  the extraction level to the transport level of a block caving mining operation.

  Calculate the reflectivity of the air-glass interface

Crown glass has a refractive index of 1.51 in the visible spectral region. Calculate the reflectivity of the air-glass interface, and determine the transmission of a typical glass window.

  Problems based on digital technology in music recording

Explain how text messaging works.Perform research and discuss how an audio CD and an audio DVD compare.

  Create a flash movie that uses motion animation

Create a Flash movie that uses motion animation to change a figure from a large size to a small size and back as it moves from the top to the bottom of the right side of the stage

  Determine the poles and zeros of the closed-loop system

ELE3SPC - Signal Processing and Control - Determine the poles and zeros of the closed-loop system and calculate the output response y(t) to a unit step input R(s) = 1/s.

  Which elements are in series

Consider the circuit shown in Figure. Which elements are in series? Which elements are in parallel? Apply Ohm s and Kirchhoff s laws to solve for Vx.

  Enmin 5120 tunnelling and mine development a continuous

a continuous miner has the following specifications ltbrgtcutter drum width 3.2m ltbrgtdrum diameter across the picks

  Determine the required airflow for diesel dilution

What is the total development airflow and for a single Stope determine the required airflow for diesel dilution if the requirement is for 0.05 m3/s of air per kW of diesel power?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd