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

What is the function implemented by the following Verilog modules:

Module FUNC1 (I0, I1, S, out):

input I0, I1;

input S;

output out;

out = S? I1: I0;

endmodule

module FUNC2 (out, ctl, clk,reset);

output [7:0] out;

input ctl, clk, reset;

reg [7:0] out;

always @(posedge clk)

if (reset) begin

out <= 8’b0;

end

else if (ctl) begin

out <= out+1;

end

else begin

out <= out-1;

end

endmodule

Short Answer

Expert verified

The FUNC1 is the implementation of 2×1multiplexer. The FUNC2 is the implementation of an 8-bit up-down counter.

Step by step solution

01

Analyzing the Verilog module FUNC1

In the module FUNC1, there are two inputs I0 and I1. There is another input S which acts as a selector for the inputs I0 and I1. The output variable is out. The module sets the value of the output using the ternary operator. If the value of S is 1, then the output is equal to I1. Otherwise, the output is I0. So, it is the implementation of 2×1multiplexer which selected selects one value from the two inputs based on the selector.

02

Analyzing the Verilog module FUNC2

In module FUNC2, on the positive rising edge of the clock, the output is changed. If it is a reset, then all the eight bits are set to zero. If the up direction is asserted using ctl, then the output value is incremented by 1. Otherwise, it is decremented by 1. If the total bits used are 8, then the program is a counter 8-bit up-down counter.

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

The Pentium 4 Prescott processor, released in 2004, had a clock rate of 3.6 GHz and voltage of 1.25 V. Assume that, on average, it consumed 10 W of static power and 90 W of dynamic power. The Core i5 Ivy Bridge, released in 2012, had a clock rate of 3.4 GHz and voltage of 0.9 V. Assume that, on average, it consumed 30 W of static power and 40 W of dynamic power.

1.8.1 For each processor find the average capacitive loads.

1.8.2 Find the percentage of the total dissipated power comprised by static power and the ratio of static power to dynamic power for each technology.

1.8.3 If the total dissipated power is to be reduced by 10%, how much should the voltage be reduced to maintain the same leakage current? Note: power is defined as the product of voltage and current

Construct the truth table for a four-input odd-parity function (see page B-65 for a description of parity).

Implement the four functions described in Exercise B.11 using a PLA

Consider three different processors P1, P2, and P3 executing the same instruction set. P1 has a 3 GHz clock rate and a CPI of 1.5.P2 has a 2.5 GHz clock rate and a CPI of 1.0. P3 has a 4.0 GHz clock rate and has a CPI of 2.2.

a. Which processor has the highest performance expressed in instructions per second?

b. f the processors each execute a program in 10 seconds, find the number of cycles and the number of instructions.

c. We are trying to reduce the execution time by 30% but this leads to an increase of 20% in the CPI. What clock rate should we have to get this time reduction?

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

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