Search code examples
verilog

Selective data transfer


How do I transfer particular bits of data from input to output?

module (a ,b, ...);
   input  [31:0] a;
   output [15:0] b;
endmodule

How I can transfer only the first sixteen bits of input a to output b?


Solution

  • Use a part-select:

    assign b = a[15:0];