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
(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).
Step by Step Solution
3.55 Rating (162 Votes )
There are 3 Steps involved in it
a task countones input 4 ... View full answer
Get step-by-step solutions from verified subject matter experts
