1. Julian Berman
  2. simplehdl

Overview

Quick Primer on Binary in Python

In all calculations, simplehdl assumes that it is processing normal, python ints. You need to pass ints to your module, and you should expect (by default) to receive ints out of their outputs.

However, Python has binary literals, so you can utilize them if they help when inputting.

>>> 0b1010
10

Since binary literals are simply another way of writing ints, you can pass them to your modules.

Also see the inputs_bin and outputs_bin attributes of hardware instances.