Question

Write VHDL testbench for the next entity Entity dec3to8 is PORT( AA: IN std_logic_vector(2 downto 0);...

Write VHDL testbench for the next entity

Entity dec3to8 is
PORT(
AA: IN std_logic_vector(2 downto 0);
BB: OUT std_logic_vector(7 downto 0);
Enable: IN std_logic );
End entity;

Homework Answers

Answer #1

VHDL Testbench:-


library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity testbench is
end testbench;

architecture Behavioral of testbench is
component dec3to8 is
PORT(
AA: IN std_logic_vector(2 downto 0);
BB: OUT std_logic_vector(7 downto 0);
Enable: IN std_logic );
End component;
signal AA:std_logic_vector(2 downto 0) ;
signal BB:std_logic_vector(7 downto 0);
signal Enable : std_logic;
begin
AA<="000" , "001" after 20 ns , "010" after 40 ns , "011" after 60 ns , "100" after 80 ns , "101" after 100 ns , "110" after 120 ns , "111" after 140 ns;
Enable<='0' , '1' after 10 ns;
uu: dec3to8 port map(AA,BB,Enable);
end Behavioral;

(Note: This testbench is written in software and it is error free.)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Please write the testbench of T-flip flop in VHDL with using assert or wait function. thank...
Please write the testbench of T-flip flop in VHDL with using assert or wait function. thank you. Here my Tff code: module Tff (e,clk,re,q); input e,clk,re; ouput q; always_ff@(posedge clk) begin if (re) q=0; else q<=q+1; end endmodule
Could someone show me how to write VHDL code for the following logical Shifts. Please use...
Could someone show me how to write VHDL code for the following logical Shifts. Please use concatenation. signal x:std_logic_vector(7 downto 0):"01000101"; 1) Logical right shift of 2. 2) Logical right shift of 5. 3) Logical left shift of 2. 3) Logical left shift of 3.
Convert the following code using variables rather than signals. Comment on the differences of a code...
Convert the following code using variables rather than signals. Comment on the differences of a code that uses only signals to a code which makes use of variables. entity converter is port( sign_mag : in std_logic_vector(3 downto 0) ; twos_comp : out std_logic_vector(3 downto 0) ); end converter; architecture converter_arch of converter is signal neg : std_logic_vector(3 downto 0); begin process(sign_mag) begin if (sign_mag <= 1000) then twos_comp<=sign_mag; else neg <=('1' & not sign_mag(2 downto 0))+1; twos_comp<=neg; end if;
entity one is end; architecture a of one is type arr is array(0 to 7) of...
entity one is end; architecture a of one is type arr is array(0 to 7) of bit_vector (2 downto 0); signal a : arr := ("000", "001", "010", "011", "100", "101", "110", "111"); signal x : bit_vector (2 downto 0); signal y : bit; begin y <= x(0) and x(2); process begin for i in 0 to 7 loop x <= a(i); wait for 1 ns; report bit'image(y); end loop; wait; end process; end; The output y is taken from...
Can someone create a test bench for this code in VHDL. (Please type it out) library...
Can someone create a test bench for this code in VHDL. (Please type it out) library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity USR_4Bit is port( LR,SER,clk,clear,OC: in std_logic; Da,Db,Dc,Dd: in std_logic; Qa,Qb,Qc,Qd,QCas: out std_logic); end USR_4Bit; architecture Structural of USR_4Bit is signal NLR,A1,A2,A3,A4,A5,A6,A7,A8: std_logic; signal Nclear,Nclk,Q1,Q2,Q3,Q4:std_logic; signal O1,O2,O3,O4 : std_logic; component andgate port(a,b: in std_logic; z : out std_logic); end component; component orgate port(a,b: in std_logic; z : out std_logic); end component; component notgate port(a: in std_logic; z : out std_logic); end...
Use case statement to implement an 8:1 mutiplexer Verilog HDL module called mux8 with inputs s[2:0],...
Use case statement to implement an 8:1 mutiplexer Verilog HDL module called mux8 with inputs s[2:0], D[7:0] and output Y. write a testbench for the function.
Here's the requirement. Write a client program Subset.java that takes a command-line integer k , reads...
Here's the requirement. Write a client program Subset.java that takes a command-line integer k , reads in a sequence of strings from standard input using StdIn.readString() , and prints out exactly k of them, uniformly at random. Each item from the sequence can be printed out at most once. You may assume that 0 k N , where N is the number of string on standard input. The running time of the program must be linear in the size of...
S = {<3, -2, 1, -4>, <2, 1, -2, -2>, <0, -7, 8, -2>} Determine whether...
S = {<3, -2, 1, -4>, <2, 1, -2, -2>, <0, -7, 8, -2>} Determine whether b = < -4, 12, -12, 8 > is in the span of S. Please write out the vector equation by definition of span. Then convert the vector equation into system of linear equations and matrix equation. No need to solve the equation.
If an investment project is described by the sequence of cash flows: Year Cash flow 0...
If an investment project is described by the sequence of cash flows: Year Cash flow 0 -300 1 -900 2 1100 3 500                 Calculate the MIRR, we will assume a finance rate of 8% and a reinvestment rate of 10%   [5] Find the IRR (using 7%, 10%, 11%) of an investment having initial cash outflow of $3,000. The cash inflows during the first, second, third and fourth years are expected to be $700, $800, $900 and $1,200 respectively            [5]...
For each pseudo-code function below (after the next ==== line), write a useful loop invariant capturing...
For each pseudo-code function below (after the next ==== line), write a useful loop invariant capturing correctness for the main loop in each of the following programs and briefly argue initialization, preservation, and termination. EXAMPLE PROBLEM: //Function to return the max of an array A Maximum(array of integers A) Local integer integer m m=0 for i = 1 to n if A[i] > m then m = A[i] end function Maximum EXAMPLE SOLUTION: The loop invariant is m = max(0,...