Holey_yan

20141009_KUAS_Verilog_Multiplier_3Bit

Oct 17th, 2014
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /************************************/
  2. /** 20141009 3-Bit Multiplier      **/
  3. /** Maker  : Yan                   **/
  4. /** E-Mail : [email protected] **/
  5. /** Date   : 2014/10/09 pm.10:00   **/
  6. /************************************/
  7.  
  8. module Multiplier_3Bit(num_a, num_b, _output);
  9.     input   [2:0]   num_a, num_b;
  10.     output  [5:0]   _output;
  11.     wire    [5:0]   w1, w2, w3;
  12.    
  13.     assign  w1 = num_a & {3{num_b[0]}};
  14.     assign  w2 = (num_a & {3{num_b[1]}}) << 1;
  15.     assign  w3 = (num_a & {3{num_b[2]}}) << 2;
  16.    
  17.     assign  _output = w1 + w2 + w3;
  18. endmodule
Advertisement
Add Comment
Please, Sign In to add comment