Design a circuit to take twos complement of four-bit number

Assignment Help Other Engineering
Reference no: EM131439802

Lab Assignment

Objectives:

Gain more experience with modular circuit design
Gain experience with arithmetic circuits including: Full Adders, Ripple Carry Adders (RCAs), and Two's Complement

Lab Description:

You will design a ripple-carry adder (RCA) using full adders as components. You will then use this RCA to implement a two's complement conversion circuit and adapt it to add two numbers with two's complement. You will again use modular or structural design techniques to create these larger digital systems.

Lab Tasks:

1. Design a Ripple Carry Adder to add two 4-bit numbers:

a. Create a VHDL design module for a Full Adder; use Boolean expressions to define this circuit. Create a VHDL test bench to test the output for all possible input signal combinations. Simulate your design and verify your output.

b. Create a VHDL design module for this 4-bit Ripple Carry Adder (RCA):

i. You will have two 4-bit inputs (you can call them A and B), one 1-bit carry-in input, one 4-bit sum output, and one 1-bit carry-out output. Use the Full Adder VHDL module you just created. Specifically, use a component declaration and port mapping to create a modular design that uses your pre-existing work.

ii. How will you design this circuit? How many Full Adders and other gates will you need in order to create this 4-bit RCA? Draw a block diagram/schematic of your design including any components or logic gates. Label the components that you do use (e.g. Full Adders). You will include this block diagram/schematic in your report.

c. Create a VHDL test bench to test the output for all possible input signal combinations, wait a minute, how many input combinations will this be?!? Instead, simulate your design using five pairs of input numbers and verify your output. Include the waveforms in your report.

d. Further test your circuit by implementing this on the FPGA board. Connect the input busses of A and B to eight switches, set carry-in to one button, and connect the output bus and carry-out to five LEDs.

2. Design a circuit to take the Two's Complement of a 4-bit number:

a. In the same project, create a new VHDL design module and add the components that you will need to implement the 4-bit Two's Complement circuit:

i. You will have one 4-bit input and one 4-bit output. You will again use component declaration and port mapping to create a modular design.

ii. How will you design this circuit? How many Full Adders and other gates will you need in order to create this 4-bit Two's Complement circuit? Draw a block diagram/schematic of your design including any components or logic gates. Label the components that you do use (e.g. RCA, Full Adders, etc.). You will include this block diagram/schematic in your report.

b. Create a VHDL test bench to test the output for all possible input signal combinations. Simulate your design and verify your output. Include the waveforms in your report.

3. Lastly, design a circuit to add two 4-bit numbers where one number can be expressed in Two's Complement:

a. In the same project, create a VHDL design module for a 4-bit RCA using Two's Complement:

i. This will be a modular design which will use VHDL component declarations and port mapping. This time, you will have two 4-bit inputs (you can call them A and B), one 1- bit select input, and one 4-bit sum output. If the select bit is 1, then the Two's Complement of input number B will be added to A. If the select bit is 0, then the sum is just A + B.

ii. How will you design this circuit? There is a more efficient way than to use your 4-bit RCA from Lab Task 1 and your Two's Complement circuit from Lab Task 2. If you are stumped, think about using every Full Adder input of a RCA, and think about how you will now use the select input.

iii. Draw a block diagram/schematic of your design including any components or logic gates. Label the components that you do use (e.g. Full Adders, RCA, Two's Complement circuit, etc.) and within each component, show the Full Adders and logic gates that are within the component. You will include this block diagram/schematic in your report.

b. Create a VHDL test bench to test the output for five pairs of input numbers (and don't forget to try toggling the select input). Simulate your design and verify your output.

c. Implement this circuit on the FPGA board. Connect the input busses to eight switches, connect the select input to a button, and connect the output bus to four LEDs.

d. Ask the instructor to check your design, simulation waveforms, and FPGA board implementation of your circuit

4. Once you have completed the lab tasks, and after you close this project, remember to copy your project folder to a flash drive, your Dropbox, your Google Drive, or your email in order to keep a copy of your files.

VHDL Code:

Copy-paste your VHDL design module code for:

1. Your full adder and ripple-carry adder (task 1):

2. Your two's complement circuit (task 2):

3. Your ripple-carry adder using two's complement (task 3):

Simulation Screenshots:

Use the "Print Screen" button to capture your screenshot (it should show the entire screen, not just the window of the program).

1. Your ripple-carry adder (task 1):

2. Your two's complement circuit (task 2):

Simulation Screenshot Tips: (you can delete this once you capture your screenshot)

1. Make the "Wave" window large by clicking the "+" button near the upper-right of the window

2. Click the "Zoom Full" button (looks like a blue/green-filled magnifying glass) to enlarge your waveforms

3. In order to not print a lot of black, change the color scheme of the "Wave" window:

3.1. Click Tools→Edit Preferences...

3.2. The "By Window" tab should be selected, then click Wave Windows in the "Window List" to the left

3.3. Scroll to the bottom of the "Wave Windows Color Scheme" list and click waveBackground. Then click white in the color "Palette" at the right of the screen.

3.4. Now color the waveforms and text black:

3.4.1. Click LOGIC_0 in the "Wave Windows Color Scheme." Then click black in the color "Palette" at the right of the screen.

3.4.2. Repeat this for LOGIC_1, timeColor, and cursorColor (if you have a cursor you want to print)

3.5. Once you have captured your screenshot, you can click the Reset Defaults button to restore the "Wave" window to its original color scheme.

Questions: (Please use this cover sheet to type and print your responses)

1. Explain the design process that you used to create the RCA and Two's Complement circuits (lab tasks 1 and 2). Be sure to refer to your schematics/block diagrams and the process to translate these into VHDL.

2. When adding two 4-bit numbers together, an addition overflow may occur and carry-out will be ‘1'. Why is this a problem if we are adding unsigned numbers? Why may this be beneficial if we are adding signed numbers (using two's complement)?

3. Explain the design process that you used to create the 4-bit RCA using Two's Complement (lab task 3). Be sure to refer to your schematics/block diagrams and the process to translate these into VHDL.

As a follow-up question, do you feel that your design is optimal (please explain)? Is there any way you could have better minimized your use of full adders and logic gates (please explain)?

4. Give two reasons why we may not want to create a test bench to simulate a circuit using all possible input signal combinations:

Reference no: EM131439802

Questions Cloud

Describe a leadership style used in the case study : Describe a leadership style used in the case study and why there was a shift in leadership style throughout the case study. Explain the characteristics and decisions of management in the case study that help explain the shift in leadership style
Considering the introduction of new product line : A computer keyboard manufacturing company is considering the introduction of a new product line. The initial investment required for this project is $500.000. and annual maintenance costs are anticipated to be $35,000. Annual operating costs will be ..
What does alexander mean when she calls slavery : What does Alexander mean when (quoting Reva Siegel) she calls slavery, Jim Crow, and mass incarceration "preservation through transformation"? (p. 21) ?Consider Alexander's argument about the origin of the War on Drugs, and tell an analogous story..
Public have different expectations of science : The various groups who make up the US public have different expectations of science. How do these differing expectations of science affect the ways groups place trust in science? Describe one example of a controversial expectation that the author giv..
Design a circuit to take twos complement of four-bit number : EGCP 281- Design a circuit to take the Two's Complement of a 4-bit number: In the same project, create a new VHDL design module and add the components that you will need to implement the 4-bit Two's Complement circuit.
How has technology helped change our views of heredity : How have humans perceived heredity over time and how has that perception changed as major paradigm shifts in the discipline took place. How has technology helped change our views of heredity?
What is monte carlo simulation : Fixed costs are assumed normal with a mean of $5 million and a standard deviation of $20,000. Demands are all assumed to be normally distributed with the following means and standard deviations.
Write essay on effective communication skills in nursing : Assignment is about an essay on Effective Communication skills in nursing practice focusing/concentrating on Errors of miscommunication
What is the role of bureaucratic discretion in new jim crow : What is the role of bureaucratic discretion in the new Jim Crow? Consider both the tremendous discretion of police officers and prosecutors and the relative lack of discretion of judges. Does this suggest anything about what fairer laws might look..

Reviews

Write a Review

Other Engineering Questions & Answers

  Discuss the risks using a critical approach

CSG2344 Principles of Project Management - What risks occur when Traditional Project Management is integrated with the Agile Methodologies of Project Management?

  Write the informations in the given video

I want to watch this video : https://www.youtube.com/watch?v=lyFVxRn7zzQ and do like a project on it. Write the informations in the video and anything you see important like for 2 pages is good. Explain how the bridge is build.

  Determine the reynolds number ratio as a function

Determine the Reynolds number ratio as a function of the length ratios in a distorted model. Assume that fluid and temperature are identical for model and prototype in Prob and determine Rer.

  Determining the condensed per kilogram of fuel

Methanol, CH3OH, is burned with 200% theoretical air in an engine and the products are brought to 100 kPa, 30oC. How much water is condensed per kilogram of fuel?

  Write the vhdl entity declare for a three-input and gate

Write the VHDL entity declare for a three-input AND gate. Write the VHDL architecture for a three-input AND gate. Draw the logic circuit to be implemented by the following VHDL architecture body:

  What flow rate of the ethanol and water feed stream is

What flow rate of the ethanol and water feed stream is needed to provide 83.0 mol/hr of the 0.999 mole fraction ethanol stream? What flow rate of fresh benzene is required? What is the flow rate of the recycle line?

  Devise a detailed description of the structure

Devise a detailed description of the structure and functions of each organelle in a typical neuron. Distinguish the locations and functions of the four neuroglial cells in CNS and the two neuroglial cells in PNS.Categorize the structure of the spinal..

  What is the total impedance of the circuit

In the circuit shown, if the value of the reactive component was increased, how would it change the waveforms - What is the total impedance of the circuit?

  Develop an expression for determining processing rates

Letting the number of vehicles that must actually wait in a queue be x, develop an expression for determining processing rates in terms of x.

  Multipah channel models

A transmitter transmits a signal s(t) with carrier frequency fc. The signal reaches the receiving antennas through three paths. The path gains are a1, a2, and a3.

  The location will be identified in the feasibility

group 5 will be starting up a fictitious military aviation maintenance department. it was identified that a unit was

  Difference between reliability and durability

Explain the difference between reliability and durability and how they can be specified in a product development programme.

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