a) Write a Verilog function that will create the 2s complement of an N-bit vector. Use a

Question:

a) Write a Verilog function that will create the 2’s complement of an N-bit vector. Use a call of the form comp2(bit_vec, N), where bit_vec is the vector and N is the length of the vector. Do the complement on a bit-by-bit basis using a loop. You may declare N as a global parameter in the calling module.

(b) Write a Verilog module that will call the function 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: