First decide your choice of binary representation.
Then see if there's a standard library that supports that one.
If so, there will probably be type conversion operations between integers and those representations, for whatever width of binary output you choose.
The IEEE.numeric_std
library supports two commonly used representations, with all the operators and conversions you need.
If you chose a different representation (like sign+magnitude for example) you may have to write your own library along the same lines as IEEE.numeric_std
. Most people don't do that.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…