Dillon Engineering
  • Home
  • Company
    • About Us
    • Contact Us
    • Jobs
  • Services
    • Applications
    • Markets
    • Why Hire DE? >
      • Top Down Meets Bottom Up
    • When to Hire DE?
  • FFT IP
    • Load Unload FFT
    • UltraLong FFT >
      • UltraLong FFT IP Core for Xilinx FPGAs
    • Parallel FFT
    • Dual Parallel FFT
    • Parallel Butterfly FFT
    • Mixed Radix FFT >
      • Mixed Radix FFT IP Core for Xilinx FPGAs
    • Pipelined FFT >
      • FFT_PIPE IP Core for Xilinx FPGAs
    • 2D FFT
    • Other IP Cores >
      • Floating Point IP >
        • FPLIC Riviera Evaluation
        • FPLIC Download
        • FPLIC ParaCore Parameters
      • AES Crypto IP >
        • AES PatraCore Parameters
        • AES Background Information
    • FFT/IFFT ParaCore Parameters
  • Ingenuity
    • ParaCore Architect IP Generation >
      • PCA Flow
      • PCA Example
    • Modeling
    • Verification
    • Fixed vs. Floating Point
    • Fixed Point Math
  • News
    • DE Releases Mixed Radix FFT IP Cores for Xilinx FPGAs
    • DE Release UltraLong FFT IP Cores for Xilinx FPGAs
    • DE Releases FFT_PIPE IP Cores for Xilinx FPGAs
    • Floating Point Modules Evaluation Available
    • Chip Design Magazine Article
    • BCD Math
    • UltraLong FFT IP Success
    • DE Releases FFT IP Cores
  • Docs
    • HowTo >
      • Power Calculation Using XPower
      • Strings in Verilog
      • Inferring Block RAM vs. Distributed RAM in XST and Precision
      • Verilog RTL Coding Style Guidelines, Tips and Template
    • Downloads >
      • gen_ise-sh
      • gen-ise-sh-py
      • deModel
      • deModel_tar_gz
      • deModel_win32_exe
    • HPEC Presentations >
      • HPEC 2003 Presentation
      • HPEC 2004 Presentation
      • HPEC 2007 Abstract
      • HPEC 2007 Posters
    • FFT >
      • Load Unload FFT IP Datasheet
      • FFT_MIXED Candidate Core Datasheet
      • DE FFT IP and Sundance SMT702 Flyer
      • UltraLong FFT IP Core for Xilinx Datasheet
      • PIPE_FFT for Xilinx FPGAs Datasheet
      • FFT Datasheet
      • Floating Point FFT Factsheet
      • FFT Success
    • Sundance DE Partnership Release
    • FPGA Webcast
    • FPGAs Go, Go, Go
    • AES Datasheet
    • FPLIC Specification
    • DE Overview

deModel


Information about Python package usable for modeling fixed point arithmetic algorithms.


Download

  • deModel_tar_gz - Platform-Independent Source
  • deModel_win32_exe - Windows Installer

Documentation

Introduction
The Python package deModel provides a fixed point data type for Python, allowing the development of algorithm models in fixed point arithmetic. The basic data type is represented by the class DeFixedInt, which stores data as an integer and keeps information about the binary point. When performing basic arithmetic operations with this data type, the binary point is adjusted based on some fundamental rules of fixed point arithmetic. For further details about those rules we recommend a paper by Randy Yates titled "Fixed Point Arithmetic: An Introduction", available from the Digital Signal Labs page.

Installation
The installation of the package is fairly simple. When using the platform-independent source you can use the tar command to unpack it.
~> tar -xvf deModel-0.2.tar.gz
Then change into the newly created directory and run the setup.py script (as superuser):
~> cd deModel-0.2/
~> su
Password:
deModel-0.2 # python setup.py install
If you are using the native Windows installation of Python then just use the provided Windows installer. Executing the installer will guide you through the installation process.

Installed  Documentation 

See the code documentation, available through pydoc. Under Windows go to:

  Start -> All Programs -> Python -> Module Docs

Under Linux enter on the command line:
> pydoc -g &
Hit the "open browser" button in the opening window, which in turn will open the browser with the Python module documentation. Search for the deModel package.

Examples
Let's look at a simple addition and multiplication example:

>>> from deModel import DeFixedInt
>>> a = DeFixedInt(8,2, 2.5)
>>> print a
<10 (2.500) A(8,2)>

After importing the class from deModel an instance a is created with the representation A(8,2), meaning 8 bits for the integer width, 2 bits for the fractional width + 1 sign bit. Part of the instantiation is the assignment of the value 2.5.  Displaying the value returns the value in form <raw value (float value) fixed point representation>.

>>> b = DeFixedInt(8,2, 3.75)
>>> print b
<15 (3.750) A(8,2)>
>>> c = a + b
>>> print c
<25 (6.250) A(9,2)>
Now a second instance with the same representation is created and the value 3.75 is assigned. After that the two values are added together. From the result it can be seen that the representation changed. Due to the addition the integer width grew by one bit.

Let's now look at a multiplication example:
>>> d = a * b
>>> print d
<150 (9.375) A(17,4)>
Again the representation changed. Now the integer and fractional width got adjusted, based on the fixed point multiplication rule.

The next example will be again an addition operation, this time of two numpy arrays:
>>> from deModel import arrayFixedInt
>>> a = arrayFixedInt(8,2, [4.5, 1.25, 3.75, 2.0])
>>> print a
[<18 (4.500) A(8,2)> <5 (1.250) A(8,2)> <15 (3.750) A(8,2)> <8 (2.000) A(8,2)
First a new function arrayFixedInt is imported from deModel, which supports the creation of numpy arrays. The first two parameters, like with DeFixedInt, specify the integer and fractional width. The third parameter can either be an integer value, specifying the length of the to be created array, or as in our case, a list with floating point values. The function will now create an array of the same length, using the floating point values of the list to initialize the array with.

>>> b = arrayFixedInt(8,2, [2.25, 3.0, 1.5, 3.75])
>>> print b
[<9 (2.250) A(8,2)> <12 (3.000) A(8,2)> <6 (1.500) A(8,2)> <15 (3.750) A(8,2)>]

>>> c = a + b
>>> print c
[<27 (6.750) A(9,2)> <17 (4.250) A(9,2)> <21 (5.250) A(9,2)> <23 (5.750) A(9,2)>]
After creating a second array the above code shows how a fixed point addition can be performed by adding the two created arrays.

OUR SERVICES

Applications
Markets

OUR IP

FFT
AES
Floating Point

CONTACT US

info@dilloneng.com
952.836.2413
Contact Page
Picture

© 2022 Dillon Logic LLC
All Rights Reserved