home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / verilog / 503 next >
Encoding:
Text File  |  1993-01-21  |  1.3 KB  |  50 lines

  1. Newsgroups: comp.lang.verilog
  2. Path: sparky!uunet!iphase.com!phan
  3. From: phan@iphase.com (Tai Phan)
  4. Subject: Verilog code for Inverted, Open collector, Output Enable Bus
  5. Message-ID: <C17p8K.7nA@iphase.com>
  6. Followup-To: phan@iphase.com
  7. Summary: Inverted, Open collector, Output Enable Bus
  8. Keywords: Inverted, Open collector, Output Enable Bus
  9. Sender: news@iphase.com
  10. Nntp-Posting-Host: wildcat_ne0
  11. Organization: Interphase Corporation, Dallas Texas
  12. Date: Thu, 21 Jan 1993 16:17:07 GMT
  13. Lines: 35
  14.  
  15. Greetings,
  16.  
  17. If anyone knows a simple way to describe in Verilog an Open collector, Inverted,
  18. with Output enable bus, please help.  The parameters are as follow:
  19.  
  20. // Verilog code
  21.  
  22. input [31:0] inp;               // Input bus
  23. input oen_;                     // Output enable
  24. output [31:0] outp_;            // Output bus
  25.  
  26. // When oen_ is 1, outp_ should be 32'hzzzzzzzz
  27. // when oen_ is 0, outp_ is 0 if inp is 1, and z if inp is 0 (OC inverted)
  28. // For single bit, I have the code that works:
  29.  
  30. wire [31:0] outp_;
  31. assign outp_[31] = (~oen_ && inp[31]) ? 'b0 : 'bz;
  32. assign outp_[30] = (~oen_ && inp[30]) ? 'b0 : 'bz;
  33. .......
  34. and so on
  35. But this takes a lot of space, and typing. I want to use one or two lines
  36. to describe the entire 32 bits bus.
  37.  
  38. Thanks,
  39.  
  40. Tai Phan
  41. --------
  42. Interphase Corp.
  43. (214) 919 9000
  44. phan@iphase.com
  45.  
  46.  
  47. -- 
  48. Tai Phan  X218
  49. phan@iphase.com
  50.