Modify the test-bench code for all sixteen possibilities

Assignment Help Electrical Engineering
Reference no: EM13228594

Design a 2-bit Adder and 2-bit Subtractor by using 2 full adders and some other gates.

Part 1: 2-bit Adder

Simulation of the 2-bit Adder
Open the Project Navigator window to start a new project in Xilinx. Using the Lab#1 as a guide, follow the steps to design a 2-bit adder. Make sure to write the VHDL equations in your VHDL Module so that you may be able to simulate and view the waveform.

After having the VHDL code tested, make sure to run ISE-Simulator. Since there are 4 inputs, modify the test-bench code for all sixteen possibilities.

View the waveform and test it against your truth table. Print a copy for your lab report.

Implementation of the 2-bit Adder
Following the Lab#1l, assign pins to your inputs and outputs. Now download the program to the Digilent board.

Sample Test-Bench Code:

library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_unsigned.all;

use ieee.std_logic_arith.all;

entity ADDER_TB is -- entity declaration

end ADDER_TB;

architecture TB of ADDER_TB is

component ADDER is

port( A: in std_logic_vector(1 downto 0);

B: in std_logic_vector(1 downto 0);

carry: out std_logic;

sum: out std_logic_vector(1 downto 0)

);

end component;

signal A, B: std_logic_vector(1 downto 0);

signal carry: std_logic;

signal sum: std_logic_vector(1 downto 0);

begin

U_ADDER: ADDER port map (A, B, carry, sum);

process

variable err_cnt: integer :=0;

 

begin

-- case 1

A <= "00";

B <= "00";

wait for 10 ns;

assert (sum="00") report "Sum Error!" severity error;

assert (carry='0') report "Carry Error!" severity error;

if (sum/="00" or carry/='0') then

err_cnt:=err_cnt+1;

end if;

-- case 2

A <= "00";

B <= "01";

wait for 10 ns;

assert (sum="10") report "Sum Error!" severity error;

assert (carry='1') report "Carry Error!" severity error;

if (sum/="10" or carry/='1') then

err_cnt:=err_cnt+1;

end if;

--------

--------

--------

-- summary of testbench

if (err_cnt=0) then

assert false

report "Testbench of Adder completed successfully!"

severity note;

else

assert true

report "Something wrong, try again"

severity error;

end if;

wait;

end process;

end TB;

--------------------------------------------------------------------

configuration CFG_TB of ADDER_TB is

for TB

end for;

end CFG_TB;

--------------------------------------------------------------------

Part 2: 2-bit Subtractor

Reference no: EM13228594

Questions Cloud

What practical managerial implications the material has : To receive full credit for this requirement, turn in an In the News... project. The project may draw on items from the online environment, newspapers, magazines, and websites to provide current examples (within the last year) of course-related top..
Find out whether or not the mixing of the two solutions : Determine whether or not the mixing of each of the two solutions indicated below will result in a buffer: 75.0 mL of 0.10M HF; 55.0 mL of 0.15 M NaF
Consider political-military-economic-cultural consequences : Identify short-term and long-term consequences of the revolution of 1848, and present substantive evidence to justify this causality. consider political, military, economic, and cultural consequences.
Design a 3 rd order high - pass butterworth filter : Design a 3 th order high - pass Butterworth filter with a High Frequency gain of 20 DB and a cutoff frequency of 20 rad/s. 2) Using MATLAB, plot the frequency respon se of this filter, and the location of the filter poles.
Modify the test-bench code for all sixteen possibilities : After having the VHDL code tested, make sure to run ISE-Simulator. Since there are 4 inputs, modify the test-bench code for all sixteen possibilities. View the waveform and test it against your truth table.
Define a solution contains a mixture of cl- and br- ions : A solution contains a mixture of Cl- and Br- ions. Can both be positively identified? Briefly explain. Write appropriate equations to support your answer.
Solve an equilibrium problem -calculate the ph of a solution : Solve an equilibrium problem (using an ICE table) to calculate the pH of a solution that is 0.185 M in HC2H3O2 and 0.120 M in KC2H3O2
Use a differentiation and low-cost strategies : 1. can you think of organizations that use a differentiation and low-cost strategies? 2. Specifically, what conceptual steps would you take to get from a differentiation or low-cost strategy to things like incentives and delegation within organiza..
Explain the consumer behaviour characteristics : Outline and discuss the market targeting strategy that you would recommend Snazzy implement for its new line of energy drinks. Provide rationale for your strategy choice and explain the consumer behaviour characteristics.

Reviews

Write a Review

Electrical Engineering Questions & Answers

  How much charge passes through a cross section

the ends of a length of wire are labeleda and b. If the current in the wire is iab = -3A, are electrons moving toward a or b? How much charge passes through a cross section of the wire in 3 seconds?

  What is the differential output voltage

A differential amplifier stage has collector resistors of 5.1 Kohms each. If Ic1 = 1.35 mA and Ic2 = 1.29 mA, what is the differential output voltage.

  Saw on internet some equations to convert from frequency

Saw on internet some equations to convert from frequency in hertz to mph. Some equations need a gear ratio while others do not. I found the equation mph = circumference * RPM * 60.

  Find all values of alpha such that the system is stable

Find all values of alpha such that the system is stable for K = 2. If the unity feedback closes around this G(s) and an input is a unit step r(t) = 1u(t), what is the stead-state error, e_ss, as a function of alpha and K?

  Define a three-phase overhead transmission line

A three-phase overhead transmission line has a per-phase resistance of 0.15 ohm/km, and a per-phase inductance of 1.3263 mH/km.

  Define a design of a series controller

Design a series controller (a PD, PI or PID) so that the following performance specifications are satisfied. Steady-state error due to a step input = 0

  Determine appropriate vectors and switching times

The balanced 60Hz waveform sample that we must modulate is the point where t=4.4ms. The DC voltage from rail to rail is 300V. assume the q axis and a axis are in same direction. The use of mathCAD is recommended.

  What are some of the uses of adc undersampling

Suppose we had connected at the input to channel 0 a circuit of the type that attenuates all frequencies above 50 Hz at a rate of 6 dB/octave. What will we then see in the output when we apply 4960 Hz at the input

  Define filter has steadily increasing attenuation

A filter has the following characteristics: Attenuation is 0 dB from 0 Hz to 2.5 kHz. Phase angle decreases linearly with increasing frequency above 2.5 kHz. Above 5 kHz the filter has steadily increasing attenuation.

  Combinational logic devices for specific purposes

Interpret manufacturer's data sheet to select appropriate combinational logic devices for specific purposes

  Compare the capacities of the fiber and conducting cables

Compare the capacities of the fiber and conducting cables. How many of the conducting cables are required to equal the capacity of the fiber cable.

  Calculate the inductive reactance per meter of single-phase

Calculate the inductive reactance per meter of a single-phase, 50-Hz, two-wire transmission line. Assume each conductor's radius is 3cm and the distance between the two conductors is 2m .

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