(a) Write a Verilog task that counts the number of 1s in an input bit vector that...

Question:

(a) Write a Verilog task that counts the number of 1s in an input bit vector that is up to N bits long (N ≤ 31). The output should be 5 bits long. The task call should have the following form: (N, A, B) where A is the input and B is the output. You may declare N as a global parameter in the calling module.
(b) Write a Verilog module that will call the task in part (a).

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Digital Systems Design Using Verilog

ISBN: 978-1285051079

1st edition

Authors: Charles Roth, Lizy K. John, Byeong Kil Lee

Question Posted: