10 Case Study: A Bit-Vector Arithmetic Package

We now come to our second case study, in which we develop a package of procedures and functions to perform arithmetic operations on bit vectors. The subprograms treat the bit vectors as binary-encoded integers. This case study draws on the facilities of VHDL described in the previous three chapters.

10.1 The Package Interface

VHDL provides certain predefined arithmetic operations, such as addition, subtraction, multiplication and division, on the predefined numeric types. However, while we may represent numbers with bit vectors by using a binary encoding, the language does not provide arithmetic operations for bit vectors. There are several alternative encoding schemes we may use to represent ...

Get The Designer's Guide to VHDL, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.