Dancing with Python by Robert S. Sutor

Dancing with Python by Robert S. Sutor

Author:Robert S. Sutor
Language: eng
Format: epub
Tags: COM051360 - COMPUTERS / Programming Languages / Python, COM051440 - COMPUTERS / Software Development & Engineering / Tools, COM051210 - COMPUTERS / Programming / Object Oriented
Publisher: Packt
Published: 2021-08-30T00:00:00+00:00


Exercise 9.15

Write functions in Python to implement multiplication of 1-bit and 2-bit numbers. Start by thinking about how you multiply integers by hand. Draw circuit diagrams as above. Discuss the role of the carry bit in your functions.

The next circuit has three CNOT gates, though we orient the middle one in the opposite direction to the outer two. It is a reverse CNOT. Since we make the circuit from reversible gates, it is also reversible.

Exercise 9.16

Implement the function bit_reverse_cnot in Python.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.