Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Other Engineering Expert

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

Other Engineering, Engineering

  • Category:- Other Engineering
  • Reference No.:- M91789913

Have any Question?


Related Questions in Other Engineering

Homework - risk and decision management1 you are working

Homework - Risk and Decision Management 1) You are working program X. The total budget allocated to the program is $100 M and it is to be completed in 24 mo. range (R) and passenger capacity (C) are two key performance p ...

Control theory - lab reportsfor experiments 1 to 4 you must

Control Theory - Lab Reports For experiments 1 to 4 you must undertake the following: a) At the start of each section (including the pre-lab activities) there are a number learning outcomes. That is, what students should ...

Operations engineering assignment -please select only one

Operations Engineering Assignment - Please select only one of the following case studies for your assignment: CASE A. Tesla Motors Tesla is an innovative manufacturer that designs, assemble and sells fully electric vehic ...

Projectflow processing of liquor in a mineral refining

Project Flow Processing of Liquor in a Mineral Refining Plant The aim of this project is to design a flow processing system of liquor (slurry) in a mineral (aluminum) refining plant. Aluminum is manufactured in two phase ...

Load fault level analysis amp protection design of a remote

LOAD, FAULT LEVEL ANALYSIS & PROTECTION DESIGN OF A REMOTE AREA MICROGRID Assignment Please undertake the following analyses: 1. Calculate the 3-phase fault levels on Bus 2, Bus 3 and Bus 4 with the main supply connected ...

Mine safety amp environmental engineeringpart 1 questions1

Mine Safety & Environmental Engineering Part 1. Questions 1. Occupational health and safety is the primary factor that needs to be considered in the mining industry. Discuss this statement. 2. Define the following terms ...

Conceptual design of forced-free-mixed convection

Conceptual Design of Forced-Free-Mixed Convection Experiment This assessment is to be completed individually. 1. Learning Outcomes: - Develop a basic ability to conceptually design an experimental apparatus - Use theory ...

Select a risk problem from the list below and prepare a

Select a risk problem from the list below and prepare a risk management plan in accordance with AS/NZS ISO 31000:2009. Please ensure that: - Establish the context clearly, in accordance with the Standard; - Define your s ...

Engineering analysis assignment -for every problem provide

Engineering Analysis Assignment - For every problem, provide The MATLAB script/function files that solve the problems. Problem 1: Plot the function f(t) = (x+5) 2 /(4+3x 2 ) for -3 ≤ x ≤ 5. using plot command. Use the ar ...

Engineering materials term paper assignment -conduct a

ENGINEERING MATERIALS TERM PAPER ASSIGNMENT - Conduct a thorough literature search and write a 15-20 page technical review paper on the evolution of the engineering materials used in the manufacturing of any one of the f ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As