Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Question:B.21 [10] <§§B.3, B.4> Given the following logic diagram for an accumulator, write down the Verilog module implementation of it. Assume a positive edgetriggered register and asynchronous Rst.

Short Answer

Expert verified

Answer

The required Verilog module implementation:

module_verilog_accumulator(QIn, L0, Clock, RESET, L1, Qout);

input[15:0] L0, QIn;

inputClock, RESET, L1;

Qoutput[15:0] Qout t;

reg[15:0] Qout;

always@(posedge RESET or posedge Clock) begin

if(RESET) Qout <=0;

elseif (L1)

Qout<=L0;

else

Qout<= Qout + QIn;

end

End_module_verilog_accumulator

Step by step solution

01

Define the concept of the implementation

It is assumed in the above implementation that there is also a register of positive edge-triggered and Reset of asynchronous are present.

The above implementation is corresponding to the mentioned logic diagram.

Two loads are used in the above implementation- “LO” and “L1”.

Reset is acted like “Rst” and clock is also acted like “clk”. Qin and Qout are acted like “In” and “out” respectively.

02

Determine the implementation with comment. 

module_verilog_accumulator(QIn, L0, Clock, RESET, L1, Qout);

input[15:0] L0, QIn;

inputClock, RESET, L1;

Qoutput[15:0] Qout t;

reg[15:0] Qout;

// initialized the state for the required accumulator

always@(posedge RESET or posedge Clock) begin

// checking for the condition for RESET with “if”

if(RESET) Qout <=0;

// checking for the condition for L1 with “if”

elseif (L1)

Qout<=L0;

// When the condition of “if” statement becomes false

else

Qout<= Qout + QIn;

end

// end of the required module

End_module_verilog_accumulator

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Show that there are 2nentries in a truth table for a function with n inputs.

Assume a program requires the execution of50×106FP instructions, 110×106INT instructions,80×106L/S instructions, and16×106branch instructions. The CPI for each type of instruction is 1, 1, 4, and 2, respectively. Assume that the processor has a 2 GHz clock rate:

1.14.1 By how much must we improve the CPI of FP instructions if we want the program to run two times faster?

1.14.2 By how much must we improve the CPI of L/S instructions if we want the program to run two times faster?

1.14.3 By how much is the execution time of the program improved if the CPI of INT and FP instructions is reduced byand the CPI of L/S and Branch is reduced by?

Question: A Graycode is a sequence of binary numbers with the property that no more than 1 bit changes in going from one element of the sequence to another. For example, here is a 3-bit binary Gray code: 000, 001, 011, 010, 110, 111, 101, and 100. Using three D flip-flops and a PLA, construct a 3-bit Gray code counter that has two inputs: reset, which sets the counter to 000, and inc, which makes the counter go to the next value in the sequence. Note that the code is cyclic, so that the value after 100 in the sequence is 100.

Describe the steps that transform a program written in a high-level language such as C into a representation that is directly executed by a computer processor.

B.31 [10] <§B.6> Instead of thinking of an adder as a device that adds: two numbers and then links the carries together, we can think of the adder as a hardware device that can add three inputs together (ai, bi, ci) and produce two outputs (s, ci + 1). When adding two numbers together, there is little we can do with this observation. When we are adding more than two operands, it is possible to reduce the cost of the carry. The idea is to form two independent sums, called S (sum bits) and C (carry bits). At the end of the process, we need to add C and S together using a normal adder. This technique of delaying carry propagation until the end of a sum of numbers is called carry save addition. The block drawing on the lower right of Figure B.14.1 (see below) shows the organization, with two levels of carry save adders connected by a single normal adder. Calculate the delays to add four 16-bit numbers using full carry-lookahead adders versus carry save with a carry-lookahead adder forming the final sum. (The time unit T in Exercise B.28 is the same)

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free