Skip to main content

A powerful tool to build, test, and analyse multiplier designs.

Project description

multiplied

A powerful tool to build, test, and analyse multiplier designs.

Why?

Generating and analysing multiplier designs by hand is labour intensive, even for small datasets, for entire truth tables , this is close to impossible.

multiplied is built to streamline:

  • Custom partial product reduction via templates
  • Generating complete truth tables
  • Analysis, plotting, and managing datasets
  • Fine-grain access to bits, words or stages

Setup

pip install multiplied
import multiplied as mp

Algorithm Execution

A quick demo of a simple 8-bit multiplier executing 42*255:

m = mp.Matrix(8) 
p = mp.Pattern(['a','a','b','b','c','c','d','d'])
alg = mp.Algorithm(m)
alg.push(p)
alg.auto_resolve_stage() 
a=42
b=255
for m in alg.exec(a=a, b=b).values():
    print(m)

# convert result to decimal
print(int("".join(alg.matrix.matrix[0]), 2))
print(a*b)
________00101010
_______00101010_
______00101010__
_____00101010___
____00101010____
___00101010_____
__00101010______
_00101010_______

______0001111110
____0001111110__
__0001111110____
0001111110______
________________
________________
________________
________________

__00011001100110
___0001111110___
0001111110______
________________
________________
________________
________________
________________

0001101000010110
_00011111100____
________________
________________
________________
________________
________________
________________

0010100111010110
________________
________________
________________
________________
________________
________________
________________

10710
10710

Pattern Based Algorithm

Multiplied assists in template generation to create reusable algorithm objects:

  • Patterns are used to build simple templates
  • Pseudo outputs help visualise where bits from a given arithmetic unit will land
  • Automatic grouping/mapping based on empty rows or dadda style mappings
  • Nonessential bits are hidden with underscores for visual clarity

Here's the algorithm from the previous example:

# stage : {
#     "template" : mp.Template, -> template, result
#     "pseudo"   : mp.Matrix,
#     "map"      : mp.Map
# }
print(alg)
0:{

template:{

________AaAaAaAa
_______aAaAaAaA_
______BbBbBbBb__
_____bBbBbBbB___
____CcCcCcCc____
___cCcCcCcC_____
__DdDdDdDd______
_dDdDdDdD_______

______AaAaAaAaAa
________________
____BbBbBbBbBb__
________________
__CcCcCcCcCc____
________________
DdDdDdDdDd______
________________
}

pseudo:{

______AaAaAaAaAa
____BbBbBbBbBb__
__CcCcCcCcCc____
DdDdDdDdDd______
________________
________________
________________
________________
}

map:{

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
FE FE FE FE FE FE FE FE FE FE FE FE FE FE FE FE
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
FD FD FD FD FD FD FD FD FD FD FD FD FD FD FD FD
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
}

1:{

template:{

______AaAaAaAaAa
____AaAaAaAaAa__
__AaAaAaAaAa____
BbBbBbBbBb______
________________
________________
________________
________________

__AaAaAaAaAaAaAa
___AaAaAaAaAa___
________________
BbBbBbBbBb______
________________
________________
________________
________________
}

pseudo:{

__AaAaAaAaAaAaAa
___AaAaAaAaAa___
BbBbBbBbBb______
________________
________________
________________
________________
________________
}

map:{

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
}

2:{

template:{

__AaAaAaAaAaAaAa
___aAaAaAaAaA___
AaAaAaAaAa______
________________
________________
________________
________________
________________

AaAaAaAaAaAaAaAa
_AaAaAaAaAaA____
________________
________________
________________
________________
________________
________________
}

pseudo:{

AaAaAaAaAaAaAaAa
_AaAaAaAaAaA____
________________
________________
________________
________________
________________
________________
}

map:{

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
}

3:{

template:{

AaAaAaAaAaAaAaAa
_aAaAaAaAaAa____
________________
________________
________________
________________
________________
________________

AaAaAaAaAaAaAaAa
________________
________________
________________
________________
________________
________________
________________
}

pseudo:{

AaAaAaAaAaAaAaAa
________________
________________
________________
________________
________________
________________
________________
}

map:{

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
}

Documentation

Resources for usage, general theory and implementations can be found in /docs/. For the API Reference head to Multiplied documentation site

Dependencies

Planned or currently in use.

database visualization
Parquet Matplotlib
Pandas

Full list TBD.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

multiplied-0.7.1.tar.gz (44.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

multiplied-0.7.1-py3-none-any.whl (57.7 kB view details)

Uploaded Python 3

File details

Details for the file multiplied-0.7.1.tar.gz.

File metadata

  • Download URL: multiplied-0.7.1.tar.gz
  • Upload date:
  • Size: 44.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for multiplied-0.7.1.tar.gz
Algorithm Hash digest
SHA256 7f87f29120e425ea254cfea236fc3cac467e6b71553c7b9e028f97a843963f2e
MD5 e502a36b550526882e715cc8a487a684
BLAKE2b-256 aac26ba5000a4b2e5e3faa19497ac9b38b5adff9db09833e518309ea8d14e16d

See more details on using hashes here.

File details

Details for the file multiplied-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: multiplied-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 57.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for multiplied-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b5fc0e294fd7741690b29656c32a7c8235c37b61d7b385d59a90568693874890
MD5 8feea9496ac508b107a2502d2762088b
BLAKE2b-256 578062aa0042baa868ab9ba7212adca6cfd5aa0918deb710adb3845d9275d72e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page