Differences

This shows you the differences between two versions of the page.

Link to this comparison view

projects:conste_encoder [2009/01/10 18:53]
guenter fixed headline levels
projects:conste_encoder [2011/03/02 21:37] (current)
guenter download link for source code
Line 27: Line 27:
 The test bench will feed as input data the values from 0 .. 15 and verify the expected output after a delay of 10. The expected output values for the x_o and y_o are hard coded in the lists expXL and expYL. The test bench will feed as input data the values from 0 .. 15 and verify the expected output after a delay of 10. The expected output values for the x_o and y_o are hard coded in the lists expXL and expYL.
  
-<code myhdl>+<code myhdl test_const_encoder.py>
 #!/usr/bin/env python #!/usr/bin/env python
  
Line 85: Line 85:
 Now to the actual implementation of the constellation encoder. With bit indexing the odd and even bits are extracted and concatenated with the concat() function to form the x_o and y_o outputs. Note how the intbv.signed() member function is used in connection with the concat() function. The concat() function would return an intbv() instance with a positive value range. Here in this case it would be 3 bits wide, hence min=0 and max=8. For the constellation encoder function the msb, here bit # 2, is considered the sign bit and the intbv.signed() function does just that. It considers the msb as the sign bit and returns an integer value with the intbv value as two's complement number. Now to the actual implementation of the constellation encoder. With bit indexing the odd and even bits are extracted and concatenated with the concat() function to form the x_o and y_o outputs. Note how the intbv.signed() member function is used in connection with the concat() function. The concat() function would return an intbv() instance with a positive value range. Here in this case it would be 3 bits wide, hence min=0 and max=8. For the constellation encoder function the msb, here bit # 2, is considered the sign bit and the intbv.signed() function does just that. It considers the msb as the sign bit and returns an integer value with the intbv value as two's complement number.
  
-<code myhdl>+<code myhdl const_encoder.py>
 #!/usr/bin/env python #!/usr/bin/env python
 # #
Line 159: Line 159:
 Running the conversion code part of the const_encoder.py file creates the Verilog and VHDL code. Here is the created Verilog code: Running the conversion code part of the const_encoder.py file creates the Verilog and VHDL code. Here is the created Verilog code:
  
-<code verilog>+<code verilog const_encoder.v>
 // File: const_encoder.v // File: const_encoder.v
 // Generated by MyHDL 0.6dev10 // Generated by MyHDL 0.6dev10
Line 192: Line 192:
 With the conversion the following VHDL code is created: With the conversion the following VHDL code is created:
  
-<code vhdl>+<code vhdl const_encoder.vhd>
 -- File: const_encoder.vhd -- File: const_encoder.vhd
 -- Generated by MyHDL 0.6dev10 -- Generated by MyHDL 0.6dev10
projects/conste_encoder.txt ยท Last modified: 2011/03/02 21:37 by guenter
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki