Using Verilog behavioral modeling, describe an n-bit circuit that has two n-bit signed inputs A and,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Using Verilog behavioral modeling, describe an n-bit circuit that has two n-bit signed inputs A and, B (represented in 2's complement), and two control inputs C1, and CO. The circuit produces an n-bit signed output Y (again represented in 2's complement), and an over flow indicator flag (1 bit that equals to 1 when there is an overflow and 0 otherwise) according to the following table: [20 marks] C1 C0 Function 00YA-B/4 01 Y ← ABS (A - B), i.e. Y equals the absolute difference between A & B 10 Y 1.5 B, i.e. Y equals 1 and a half of B (integer operations) 1 Y ← AVERAGE (A,B), i.e. Y equals the (integer) average of the 2 inputs 1 Write a test bench and simulate your circuit with the following input values (set n=5). Print the simulation results and comment on the results of each test value: [20 marks] All Values below are in decimal Set A = - 8, B = 12, Then C1,C0=(0,0), (0,1), (1,0), and (1,1) Set A = 12, B = 5, Then C1,C0=(0,0), (0,1), (1,0), and (1,1) Using Verilog behavioral modeling, describe an n-bit circuit that has two n-bit signed inputs A and, B (represented in 2's complement), and two control inputs C1, and CO. The circuit produces an n-bit signed output Y (again represented in 2's complement), and an over flow indicator flag (1 bit that equals to 1 when there is an overflow and 0 otherwise) according to the following table: [20 marks] C1 C0 Function 00YA-B/4 01 Y ← ABS (A - B), i.e. Y equals the absolute difference between A & B 10 Y 1.5 B, i.e. Y equals 1 and a half of B (integer operations) 1 Y ← AVERAGE (A,B), i.e. Y equals the (integer) average of the 2 inputs 1 Write a test bench and simulate your circuit with the following input values (set n=5). Print the simulation results and comment on the results of each test value: [20 marks] All Values below are in decimal Set A = - 8, B = 12, Then C1,C0=(0,0), (0,1), (1,0), and (1,1) Set A = 12, B = 5, Then C1,C0=(0,0), (0,1), (1,0), and (1,1)
Expert Answer:
Answer rating: 100% (QA)
Heres a sample Verilog code for the circuit and a test bench module nbitcircuit input signed 40 A 5b... View the full answer
Related Book For
Digital Systems Design Using Verilog
ISBN: 978-1285051079
1st edition
Authors: Charles Roth, Lizy K. John, Byeong Kil Lee
Posted Date:
Students also viewed these computer network questions
-
You have measured a rectangular surface with sides of length 49.8 plus/minus 0.4cm and width of 48.2 plus/minus 0.8cm. What is the perimeter and area of this surface? Be explicit with your error...
-
It is necessary to design a digital circuit with four inputs C, S, Z, and V and 10 outputs, one for each of the branch conditions listed in Probs. 8-26 and 8-27. (The equal and unequal conditions are...
-
Two signed numbers A and B represented in signed-2's complement form are compared by subtracting A - B. Status bits S, Z, and V are set or cleared depending on the result of the operation. (Note that...
-
You are deciding between two mutually exclusive investment opportunities. Both require the same initial investment of $10 million. Investment A will generate $2 million per year (starting at the end...
-
1. For the expression (xy + z)x, let x = 2 and z = -7. Then multiply and simplify. 2. Explain two ways in which 12y - 722 and your answer to Exercise 42 are related. Use the words multiply and factor...
-
Briefly summarize the GAAP for the financial reporting of operating loss carrybacks and carryforwards.
-
What are the bounds on the autocorrelation function of a stationary random process?
-
Edgerron Company is able to produce two products, G and B, with the same machine in its factory. The following information is available. The company presently operates the machine for a single eight-...
-
Compute the EPS and ROE Equity: Issue 85,000 common shares with a current market price of $15 each. Debt: Take on $1,275,000 of debt with a 4.5% interest and $181,000 principle payments annually...
-
Can you make the journal entries for the transactions below: Dec. 1 - Sold merchandise to Argem Day Care Center for P20,000 and received a 3-month, 12% note. 2 - Purchased merchandise from Stephen...
-
Explain ignition requirement. Also explain the working of battery Ignition system. State its advantages and disadvantages over magneto ignition system.
-
What is computer-mediated communication and how does it compare to other forms of communication media?
-
Use one of the need theories of motivation (Maslows hierarchy, Alderfers ERG, or McClellands need theory) to characterize the state governments current motivational system. What kinds of individuals...
-
Contrast the traditional view of job design with the more recent approach.
-
HOW MUCH DO YOU GET PAID? Joan had been working as a reporter for a large television network for seven years. She was an experienced and hardworking reporter who had won many awards over the years...
-
Refer to the energy level diagram for Ar+ given in Figure 7.6 and find the spinorbit coupling constant A for the ground state 2P and excited state 4D terms. Predict the wavelength of the transition...
-
Note: Treat != (x + 1). X lim x0 x/x! =?
-
Suppose that the laptop of Prob. 2.16 is placed in an insulating briefcase with a fully charged battery, but it does not go into sleep mode, and the battery discharges as if the laptop were in use....
-
(a) Find all the static hazards in the following circuit. State the condition under which each hazard can occur. (b) Redesign the circuit so that it is free of static hazards. Use gates with at most...
-
A block diagram for a 16-bit 2s complement serial subtracter is given here. When St = 1, the registers are loaded and then subtraction occurs. The shift counter, C, produces a signal C15 = 1 after 15...
-
The logic equations for a sequential network with five inputs, two flip-flops, and two outputs are Q 1 + = Q 1 (Q 2 ABC) + Q 1 (Q 2 CDE) Q 2 + = Q 1 Z 1 = Q 1 Q 2 AB + Q 1 Q 2 AB + Q 1 Q 2 AB + Q 1...
-
Several independent situations are described below. 1. The owner of the business included his personal dental expenses in the entitys income statement. 2. The company spent $25 000 on computer...
-
Gas Giant Australia Ltd signed a 20year deal to sell gas to a neighbouring country for \($1.8\) billion. The contract was signed on the last day of Gas Giant Australia Ltds financial year, 30 June....
-
Goode Medical Laboratory Ltd, GMLL, a medical research entity, has discovered a cure for a previously incurable disease. GMLL is protecting the drugs formula by keeping it secure in the company...
Study smarter with the SolutionInn App